dccxx-s3-explorer 1.0.25 → 1.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(He,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],l):(He=typeof globalThis<"u"?globalThis:He||self,l(He.S3Explorer={},He.jsxRuntime,He.React,He.ReactDOM))})(this,function(He,l,D,Jr){"use strict";function gi(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const d=gi(D),zn=gi(Jr);function Cd({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"}))}const hi=d.forwardRef(Cd);function Sd({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}))}const Ed=d.forwardRef(Sd);function Nd({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"}))}const Td=d.forwardRef(Nd);function Pd({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 10.5v6m3-3H9m4.06-7.19-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"}))}const Ad=d.forwardRef(Pd);function _d({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"}))}const Zr=d.forwardRef(_d);function Fd({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 21a9.004 9.004 0 0 0 8.716-6.747M12 21a9.004 9.004 0 0 1-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 0 1 7.843 4.582M12 3a8.997 8.997 0 0 0-7.843 4.582m15.686 0A11.953 11.953 0 0 1 12 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0 1 21 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0 1 12 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 0 1 3 12c0-1.605.42-3.113 1.157-4.418"}))}const Od=d.forwardRef(Fd);function Dd({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"}))}const Md=d.forwardRef(Dd);function kd({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 7.5A2.25 2.25 0 0 1 7.5 5.25h9a2.25 2.25 0 0 1 2.25 2.25v9a2.25 2.25 0 0 1-2.25 2.25h-9a2.25 2.25 0 0 1-2.25-2.25v-9Z"}))}const $d=d.forwardRef(kd);function Id({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"}))}const mi=d.forwardRef(Id);/**
1
+ (function(We,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],l):(We=typeof globalThis<"u"?globalThis:We||self,l(We.S3Explorer={},We.jsxRuntime,We.React,We.ReactDOM))})(this,function(We,l,D,to){"use strict";function mi(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const d=mi(D),Hn=mi(to);function Nd({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"}))}const vi=d.forwardRef(Nd);function Td({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}))}const Pd=d.forwardRef(Td);function Ad({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"}))}const _d=d.forwardRef(Ad);function Fd({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 10.5v6m3-3H9m4.06-7.19-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"}))}const Od=d.forwardRef(Fd);function Dd({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"}))}const no=d.forwardRef(Dd);function Md({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 21a9.004 9.004 0 0 0 8.716-6.747M12 21a9.004 9.004 0 0 1-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 0 1 7.843 4.582M12 3a8.997 8.997 0 0 0-7.843 4.582m15.686 0A11.953 11.953 0 0 1 12 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0 1 21 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0 1 12 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 0 1 3 12c0-1.605.42-3.113 1.157-4.418"}))}const kd=d.forwardRef(Md);function $d({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"}))}const Id=d.forwardRef($d);function Ld({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 7.5A2.25 2.25 0 0 1 7.5 5.25h9a2.25 2.25 0 0 1 2.25 2.25v9a2.25 2.25 0 0 1-2.25 2.25h-9a2.25 2.25 0 0 1-2.25-2.25v-9Z"}))}const Rd=d.forwardRef(Ld);function Vd({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"}))}const yi=d.forwardRef(Vd);/**
2
2
  * table-core
3
3
  *
4
4
  * Copyright (c) TanStack
@@ -7,10 +7,10 @@
7
7
  * LICENSE.md file in the root directory of this source tree.
8
8
  *
9
9
  * @license MIT
10
- */function wt(e,t){return typeof e=="function"?e(t):e}function Me(e,t){return n=>{t.setState(r=>({...r,[e]:wt(n,r[e])}))}}function Hn(e){return e instanceof Function}function Rd(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Ld(e,t){const n=[],r=o=>{o.forEach(s=>{n.push(s);const i=t(s);i!=null&&i.length&&r(i)})};return r(e),n}function Y(e,t,n){let r=[],o;return s=>{let i;n.key&&n.debug&&(i=Date.now());const a=e(s);if(!(a.length!==r.length||a.some((f,g)=>r[g]!==f)))return o;r=a;let c;if(n.key&&n.debug&&(c=Date.now()),o=t(...a),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const f=Math.round((Date.now()-i)*100)/100,g=Math.round((Date.now()-c)*100)/100,m=g/16,p=(v,h)=>{for(v=String(v);v.length<h;)v=" "+v;return v};console.info(`%c⏱ ${p(g,5)} /${p(f,5)} ms`,`
10
+ */function xt(e,t){return typeof e=="function"?e(t):e}function $e(e,t){return n=>{t.setState(r=>({...r,[e]:xt(n,r[e])}))}}function Un(e){return e instanceof Function}function Bd(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function zd(e,t){const n=[],r=o=>{o.forEach(s=>{n.push(s);const i=t(s);i!=null&&i.length&&r(i)})};return r(e),n}function Y(e,t,n){let r=[],o;return s=>{let i;n.key&&n.debug&&(i=Date.now());const a=e(s);if(!(a.length!==r.length||a.some((f,g)=>r[g]!==f)))return o;r=a;let c;if(n.key&&n.debug&&(c=Date.now()),o=t(...a),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const f=Math.round((Date.now()-i)*100)/100,g=Math.round((Date.now()-c)*100)/100,m=g/16,p=(v,h)=>{for(v=String(v);v.length<h;)v=" "+v;return v};console.info(`%c⏱ ${p(g,5)} /${p(f,5)} ms`,`
11
11
  font-size: .6rem;
12
12
  font-weight: bold;
13
- color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function J(e,t,n,r){return{debug:()=>{var o;return(o=e==null?void 0:e.debugAll)!=null?o:e[t]},key:process.env.NODE_ENV==="development"&&n,onChange:r}}function Vd(e,t,n,r){const o=()=>{var i;return(i=s.getValue())!=null?i:e.options.renderFallbackValue},s={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:Y(()=>[e,n,t,s],(i,a,u,c)=>({table:i,column:a,row:u,cell:c,getValue:c.getValue,renderValue:c.renderValue}),J(e.options,"debugCells","cell.getContext"))};return e._features.forEach(i=>{i.createCell==null||i.createCell(s,n,t,e)},{}),s}function Bd(e,t,n,r){var o,s;const a={...e._getDefaultColumnDef(),...t},u=a.accessorKey;let c=(o=(s=a.id)!=null?s:u?typeof String.prototype.replaceAll=="function"?u.replaceAll(".","_"):u.replace(/\./g,"_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,f;if(a.accessorFn?f=a.accessorFn:u&&(u.includes(".")?f=m=>{let p=m;for(const h of u.split(".")){var v;p=(v=p)==null?void 0:v[h],process.env.NODE_ENV!=="production"&&p===void 0&&console.warn(`"${h}" in deeply nested key "${u}" returned undefined.`)}return p}:f=m=>m[a.accessorKey]),!c)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let g={id:`${String(c)}`,accessorFn:f,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:Y(()=>[!0],()=>{var m;return[g,...(m=g.columns)==null?void 0:m.flatMap(p=>p.getFlatColumns())]},J(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:Y(()=>[e._getOrderColumnsFn()],m=>{var p;if((p=g.columns)!=null&&p.length){let v=g.columns.flatMap(h=>h.getLeafColumns());return m(v)}return[g]},J(e.options,"debugColumns","column.getLeafColumns"))};for(const m of e._features)m.createColumn==null||m.createColumn(g,e);return g}const Ce="debugHeaders";function vi(e,t,n){var r;let s={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const i=[],a=u=>{u.subHeaders&&u.subHeaders.length&&u.subHeaders.map(a),i.push(u)};return a(s),i},getContext:()=>({table:e,header:s,column:t})};return e._features.forEach(i=>{i.createHeader==null||i.createHeader(s,e)}),s}const zd={createTable:e=>{e.getHeaderGroups=Y(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var s,i;const a=(s=r==null?void 0:r.map(g=>n.find(m=>m.id===g)).filter(Boolean))!=null?s:[],u=(i=o==null?void 0:o.map(g=>n.find(m=>m.id===g)).filter(Boolean))!=null?i:[],c=n.filter(g=>!(r!=null&&r.includes(g.id))&&!(o!=null&&o.includes(g.id)));return Un(t,[...a,...c,...u],e)},J(e.options,Ce,"getHeaderGroups")),e.getCenterHeaderGroups=Y(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(s=>!(r!=null&&r.includes(s.id))&&!(o!=null&&o.includes(s.id))),Un(t,n,e,"center")),J(e.options,Ce,"getCenterHeaderGroups")),e.getLeftHeaderGroups=Y(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const s=(o=r==null?void 0:r.map(i=>n.find(a=>a.id===i)).filter(Boolean))!=null?o:[];return Un(t,s,e,"left")},J(e.options,Ce,"getLeftHeaderGroups")),e.getRightHeaderGroups=Y(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const s=(o=r==null?void 0:r.map(i=>n.find(a=>a.id===i)).filter(Boolean))!=null?o:[];return Un(t,s,e,"right")},J(e.options,Ce,"getRightHeaderGroups")),e.getFooterGroups=Y(()=>[e.getHeaderGroups()],t=>[...t].reverse(),J(e.options,Ce,"getFooterGroups")),e.getLeftFooterGroups=Y(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),J(e.options,Ce,"getLeftFooterGroups")),e.getCenterFooterGroups=Y(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),J(e.options,Ce,"getCenterFooterGroups")),e.getRightFooterGroups=Y(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),J(e.options,Ce,"getRightFooterGroups")),e.getFlatHeaders=Y(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),J(e.options,Ce,"getFlatHeaders")),e.getLeftFlatHeaders=Y(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),J(e.options,Ce,"getLeftFlatHeaders")),e.getCenterFlatHeaders=Y(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),J(e.options,Ce,"getCenterFlatHeaders")),e.getRightFlatHeaders=Y(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),J(e.options,Ce,"getRightFlatHeaders")),e.getCenterLeafHeaders=Y(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),J(e.options,Ce,"getCenterLeafHeaders")),e.getLeftLeafHeaders=Y(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),J(e.options,Ce,"getLeftLeafHeaders")),e.getRightLeafHeaders=Y(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),J(e.options,Ce,"getRightLeafHeaders")),e.getLeafHeaders=Y(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,s,i,a,u,c;return[...(o=(s=t[0])==null?void 0:s.headers)!=null?o:[],...(i=(a=n[0])==null?void 0:a.headers)!=null?i:[],...(u=(c=r[0])==null?void 0:c.headers)!=null?u:[]].map(f=>f.getLeafHeaders()).flat()},J(e.options,Ce,"getLeafHeaders"))}};function Un(e,t,n,r){var o,s;let i=0;const a=function(m,p){p===void 0&&(p=1),i=Math.max(i,p),m.filter(v=>v.getIsVisible()).forEach(v=>{var h;(h=v.columns)!=null&&h.length&&a(v.columns,p+1)},0)};a(e);let u=[];const c=(m,p)=>{const v={depth:p,id:[r,`${p}`].filter(Boolean).join("_"),headers:[]},h=[];m.forEach(y=>{const w=[...h].reverse()[0],x=y.column.depth===v.depth;let S,E=!1;if(x&&y.column.parent?S=y.column.parent:(S=y.column,E=!0),w&&(w==null?void 0:w.column)===S)w.subHeaders.push(y);else{const C=vi(n,S,{id:[r,p,S.id,y==null?void 0:y.id].filter(Boolean).join("_"),isPlaceholder:E,placeholderId:E?`${h.filter(P=>P.column===S).length}`:void 0,depth:p,index:h.length});C.subHeaders.push(y),h.push(C)}v.headers.push(y),y.headerGroup=v}),u.push(v),p>0&&c(h,p-1)},f=t.map((m,p)=>vi(n,m,{depth:i,index:p}));c(f,i-1),u.reverse();const g=m=>m.filter(v=>v.column.getIsVisible()).map(v=>{let h=0,y=0,w=[0];v.subHeaders&&v.subHeaders.length?(w=[],g(v.subHeaders).forEach(S=>{let{colSpan:E,rowSpan:C}=S;h+=E,w.push(C)})):h=1;const x=Math.min(...w);return y=y+x,v.colSpan=h,v.rowSpan=y,{colSpan:h,rowSpan:y}});return g((o=(s=u[0])==null?void 0:s.headers)!=null?o:[]),u}const Qr=(e,t,n,r,o,s,i)=>{let a={id:t,index:r,original:n,depth:o,parentId:i,_valuesCache:{},_uniqueValuesCache:{},getValue:u=>{if(a._valuesCache.hasOwnProperty(u))return a._valuesCache[u];const c=e.getColumn(u);if(c!=null&&c.accessorFn)return a._valuesCache[u]=c.accessorFn(a.original,r),a._valuesCache[u]},getUniqueValues:u=>{if(a._uniqueValuesCache.hasOwnProperty(u))return a._uniqueValuesCache[u];const c=e.getColumn(u);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[u]=c.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[u]):(a._uniqueValuesCache[u]=[a.getValue(u)],a._uniqueValuesCache[u])},renderValue:u=>{var c;return(c=a.getValue(u))!=null?c:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>Ld(a.subRows,u=>u.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let u=[],c=a;for(;;){const f=c.getParentRow();if(!f)break;u.push(f),c=f}return u.reverse()},getAllCells:Y(()=>[e.getAllLeafColumns()],u=>u.map(c=>Vd(e,a,c,c.id)),J(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:Y(()=>[a.getAllCells()],u=>u.reduce((c,f)=>(c[f.column.id]=f,c),{}),J(e.options,"debugRows","getAllCellsByColumnId"))};for(let u=0;u<e._features.length;u++){const c=e._features[u];c==null||c.createRow==null||c.createRow(a,e)}return a},Hd={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},yi=(e,t,n)=>{var r,o;const s=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(s))};yi.autoRemove=e=>Ue(e);const wi=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};wi.autoRemove=e=>Ue(e);const bi=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};bi.autoRemove=e=>Ue(e);const xi=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};xi.autoRemove=e=>Ue(e)||!(e!=null&&e.length);const Ci=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});Ci.autoRemove=e=>Ue(e)||!(e!=null&&e.length);const Si=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});Si.autoRemove=e=>Ue(e)||!(e!=null&&e.length);const Ei=(e,t,n)=>e.getValue(t)===n;Ei.autoRemove=e=>Ue(e);const Ni=(e,t,n)=>e.getValue(t)==n;Ni.autoRemove=e=>Ue(e);const eo=(e,t,n)=>{let[r,o]=n;const s=e.getValue(t);return s>=r&&s<=o};eo.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,s=t===null||Number.isNaN(r)?-1/0:r,i=n===null||Number.isNaN(o)?1/0:o;if(s>i){const a=s;s=i,i=a}return[s,i]},eo.autoRemove=e=>Ue(e)||Ue(e[0])&&Ue(e[1]);const at={includesString:yi,includesStringSensitive:wi,equalsString:bi,arrIncludes:xi,arrIncludesAll:Ci,arrIncludesSome:Si,equals:Ei,weakEquals:Ni,inNumberRange:eo};function Ue(e){return e==null||e===""}const Ud={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Me("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?at.includesString:typeof r=="number"?at.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?at.equals:Array.isArray(r)?at.arrIncludes:at.weakEquals},e.getFilterFn=()=>{var n,r;return Hn(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:at[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),s=r==null?void 0:r.find(f=>f.id===e.id),i=wt(n,s?s.value:void 0);if(Ti(o,i,e)){var a;return(a=r==null?void 0:r.filter(f=>f.id!==e.id))!=null?a:[]}const u={id:e.id,value:i};if(s){var c;return(c=r==null?void 0:r.map(f=>f.id===e.id?u:f))!=null?c:[]}return r!=null&&r.length?[...r,u]:[u]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var s;return(s=wt(t,o))==null?void 0:s.filter(i=>{const a=n.find(u=>u.id===i.id);if(a){const u=a.getFilterFn();if(Ti(u,i.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function Ti(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const to={sum:(e,t,n)=>n.reduce((r,o)=>{const s=o.getValue(e);return r+(typeof s=="number"?s:0)},0),min:(e,t,n)=>{let r;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r>s||r===void 0&&s>=s)&&(r=s)}),r},max:(e,t,n)=>{let r;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r<s||r===void 0&&s>=s)&&(r=s)}),r},extent:(e,t,n)=>{let r,o;return n.forEach(s=>{const i=s.getValue(e);i!=null&&(r===void 0?i>=i&&(r=o=i):(r>i&&(r=i),o<i&&(o=i)))}),[r,o]},mean:(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let s=o.getValue(e);s!=null&&(s=+s)>=s&&(++n,r+=s)}),n)return r/n},median:(e,t)=>{if(!t.length)return;const n=t.map(s=>s.getValue(e));if(!Rd(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((s,i)=>s-i);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},unique:(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(n=>n.getValue(e))).size,count:(e,t)=>t.length},jd={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Me("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return to.sum;if(Object.prototype.toString.call(r)==="[object Date]")return to.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Hn(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:to[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function Wd(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(s=>!t.includes(s.id));return n==="remove"?r:[...t.map(s=>e.find(i=>i.id===s)).filter(Boolean),...r]}const Gd={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Me("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Y(n=>[vn(t,n)],n=>n.findIndex(r=>r.id===e.id),J(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return((r=vn(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=vn(t,n);return((r=o[o.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=Y(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let s=[];if(!(t!=null&&t.length))s=o;else{const i=[...t],a=[...o];for(;a.length&&i.length;){const u=i.shift(),c=a.findIndex(f=>f.id===u);c>-1&&s.push(a.splice(c,1)[0])}s=[...s,...a]}return Wd(s,n,r)},J(e.options,"debugTable","_getOrderColumnsFn"))}},no=()=>({left:[],right:[]}),qd={getInitialState:e=>({columnPinning:no(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Me("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var s,i;if(n==="right"){var a,u;return{left:((a=o==null?void 0:o.left)!=null?a:[]).filter(g=>!(r!=null&&r.includes(g))),right:[...((u=o==null?void 0:o.right)!=null?u:[]).filter(g=>!(r!=null&&r.includes(g))),...r]}}if(n==="left"){var c,f;return{left:[...((c=o==null?void 0:o.left)!=null?c:[]).filter(g=>!(r!=null&&r.includes(g))),...r],right:((f=o==null?void 0:o.right)!=null?f:[]).filter(g=>!(r!=null&&r.includes(g)))}}return{left:((s=o==null?void 0:o.left)!=null?s:[]).filter(g=>!(r!=null&&r.includes(g))),right:((i=o==null?void 0:o.right)!=null?i:[]).filter(g=>!(r!=null&&r.includes(g)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,s,i;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((s=(i=t.options.enableColumnPinning)!=null?i:t.options.enablePinning)!=null?s:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,s=n.some(a=>r==null?void 0:r.includes(a)),i=n.some(a=>o==null?void 0:o.includes(a));return s?"left":i?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=Y(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const s=[...r??[],...o??[]];return n.filter(i=>!s.includes(i.column.id))},J(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=Y(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(s=>n.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"left"})),J(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=Y(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(s=>n.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"right"})),J(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?no():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:no())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,s;return!!((o=r.left)!=null&&o.length||(s=r.right)!=null&&s.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=Y(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),J(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=Y(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),J(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=Y(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(s=>!o.includes(s.id))},J(e.options,"debugColumns","getCenterLeafColumns"))}},jn={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},ro=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Kd={getDefaultColumnDef:()=>jn,getInitialState:e=>({columnSizing:{},columnSizingInfo:ro(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Me("columnSizing",e),onColumnSizingInfoChange:Me("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const s=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:jn.minSize,(r=s??e.columnDef.size)!=null?r:jn.size),(o=e.columnDef.maxSize)!=null?o:jn.maxSize)},e.getStart=Y(n=>[n,vn(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,s)=>o+s.getSize(),0),J(t.options,"debugColumns","getStart")),e.getAfter=Y(n=>[n,vn(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,s)=>o+s.getSize(),0),J(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var s;n+=(s=o.column.getSize())!=null?s:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r==null?void 0:r.getCanResize();return s=>{if(!r||!o||(s.persist==null||s.persist(),oo(s)&&s.touches&&s.touches.length>1))return;const i=e.getSize(),a=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[r.id,r.getSize()]],u=oo(s)?Math.round(s.touches[0].clientX):s.clientX,c={},f=(w,x)=>{typeof x=="number"&&(t.setColumnSizingInfo(S=>{var E,C;const P=t.options.columnResizeDirection==="rtl"?-1:1,_=(x-((E=S==null?void 0:S.startOffset)!=null?E:0))*P,O=Math.max(_/((C=S==null?void 0:S.startSize)!=null?C:0),-.999999);return S.columnSizingStart.forEach(k=>{let[F,G]=k;c[F]=Math.round(Math.max(G+G*O,0)*100)/100}),{...S,deltaOffset:_,deltaPercentage:O}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(S=>({...S,...c})))},g=w=>f("move",w),m=w=>{f("end",w),t.setColumnSizingInfo(x=>({...x,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},p=n||typeof document<"u"?document:null,v={moveHandler:w=>g(w.clientX),upHandler:w=>{p==null||p.removeEventListener("mousemove",v.moveHandler),p==null||p.removeEventListener("mouseup",v.upHandler),m(w.clientX)}},h={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),g(w.touches[0].clientX),!1),upHandler:w=>{var x;p==null||p.removeEventListener("touchmove",h.moveHandler),p==null||p.removeEventListener("touchend",h.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),m((x=w.touches[0])==null?void 0:x.clientX)}},y=Xd()?{passive:!1}:!1;oo(s)?(p==null||p.addEventListener("touchmove",h.moveHandler,y),p==null||p.addEventListener("touchend",h.upHandler,y)):(p==null||p.addEventListener("mousemove",v.moveHandler,y),p==null||p.addEventListener("mouseup",v.upHandler,y)),t.setColumnSizingInfo(w=>({...w,startOffset:u,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?ro():(n=e.initialState.columnSizingInfo)!=null?n:ro())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let Wn=null;function Xd(){if(typeof Wn=="boolean")return Wn;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Wn=e,Wn}function oo(e){return e.type==="touchstart"}const Yd={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Me("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return(n=o.length?o.some(s=>s.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=Y(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),J(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=Y(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],J(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,r)=>Y(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),J(e.options,"debugColumns",n));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,s)=>({...o,[s.id]:n||!(s.getCanHide!=null&&s.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function vn(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const Jd={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},Zd={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Me("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,o,s;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((s=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?s:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>at.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Hn(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:at[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},Qd={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Me("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,s;e.setExpanded(r?{}:(o=(s=e.initialState)==null?void 0:s.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(s=>{const i=s.split(".");r=Math.max(r,i.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const s=r===!0?!0:!!(r!=null&&r[e.id]);let i={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{i[a]=!0}):i=r,n=(o=n)!=null?o:!s,!s&&n)return{...i,[e.id]:!0};if(s&&!n){const{[e.id]:a,...u}=i;return u}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},so=0,io=10,ao=()=>({pageIndex:so,pageSize:io}),ef={getInitialState:e=>({...e,pagination:{...ao(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Me("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=s=>wt(r,s);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?ao():(o=e.initialState.pagination)!=null?o:ao())},e.setPageIndex=r=>{e.setPagination(o=>{let s=wt(r,o.pageIndex);const i=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return s=Math.max(0,Math.min(s,i)),{...o,pageIndex:s}})},e.resetPageIndex=r=>{var o,s;e.setPageIndex(r?so:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?o:so)},e.resetPageSize=r=>{var o,s;e.setPageSize(r?io:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?o:io)},e.setPageSize=r=>{e.setPagination(o=>{const s=Math.max(1,wt(r,o.pageSize)),i=o.pageSize*o.pageIndex,a=Math.floor(i/s);return{...o,pageIndex:a,pageSize:s}})},e.setPageCount=r=>e.setPagination(o=>{var s;let i=wt(r,(s=e.options.pageCount)!=null?s:-1);return typeof i=="number"&&(i=Math.max(-1,i)),{...o,pageCount:i}}),e.getPageOptions=Y(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((s,i)=>i)),o},J(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},lo=()=>({top:[],bottom:[]}),tf={getInitialState:e=>({rowPinning:lo(),...e}),getDefaultOptions:e=>({onRowPinningChange:Me("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const s=r?e.getLeafRows().map(u=>{let{id:c}=u;return c}):[],i=o?e.getParentRows().map(u=>{let{id:c}=u;return c}):[],a=new Set([...i,e.id,...s]);t.setRowPinning(u=>{var c,f;if(n==="bottom"){var g,m;return{top:((g=u==null?void 0:u.top)!=null?g:[]).filter(h=>!(a!=null&&a.has(h))),bottom:[...((m=u==null?void 0:u.bottom)!=null?m:[]).filter(h=>!(a!=null&&a.has(h))),...Array.from(a)]}}if(n==="top"){var p,v;return{top:[...((p=u==null?void 0:u.top)!=null?p:[]).filter(h=>!(a!=null&&a.has(h))),...Array.from(a)],bottom:((v=u==null?void 0:u.bottom)!=null?v:[]).filter(h=>!(a!=null&&a.has(h)))}}return{top:((c=u==null?void 0:u.top)!=null?c:[]).filter(h=>!(a!=null&&a.has(h))),bottom:((f=u==null?void 0:u.bottom)!=null?f:[]).filter(h=>!(a!=null&&a.has(h)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,s=n.some(a=>r==null?void 0:r.includes(a)),i=n.some(a=>o==null?void 0:o.includes(a));return s?"top":i?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const s=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(i=>{let{id:a}=i;return a});return(r=s==null?void 0:s.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?lo():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:lo())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,s;return!!((o=r.top)!=null&&o.length||(s=r.bottom)!=null&&s.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(i=>{const a=e.getRow(i,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(i=>t.find(a=>a.id===i))).filter(Boolean).map(i=>({...i,position:r}))},e.getTopRows=Y(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),J(e.options,"debugRows","getTopRows")),e.getBottomRows=Y(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),J(e.options,"debugRows","getBottomRows")),e.getCenterRows=Y(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(s=>!o.has(s.id))},J(e.options,"debugRows","getCenterRows"))}},nf={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Me("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(s=>{s.getCanSelect()&&(r[s.id]=!0)}):o.forEach(s=>{delete r[s.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(s=>{co(o,s.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Y(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?uo(e,n):{rows:[],flatRows:[],rowsById:{}},J(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=Y(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?uo(e,n):{rows:[],flatRows:[],rowsById:{}},J(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=Y(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?uo(e,n):{rows:[],flatRows:[],rowsById:{}},J(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(s=>{var i;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return s;const a={...s};return co(a,e.id,n,(i=r==null?void 0:r.selectChildren)!=null?i:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return fo(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return po(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return po(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},co=(e,t,n,r,o)=>{var s;const i=o.getRow(t,!0);n?(i.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),i.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(s=i.subRows)!=null&&s.length&&i.getCanSelectSubRows()&&i.subRows.forEach(a=>co(e,a.id,n,r,o))};function uo(e,t){const n=e.getState().rowSelection,r=[],o={},s=function(i,a){return i.map(u=>{var c;const f=fo(u,n);if(f&&(r.push(u),o[u.id]=u),(c=u.subRows)!=null&&c.length&&(u={...u,subRows:s(u.subRows)}),f)return u}).filter(Boolean)};return{rows:s(t.rows),flatRows:r,rowsById:o}}function fo(e,t){var n;return(n=t[e.id])!=null?n:!1}function po(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,s=!1;return e.subRows.forEach(i=>{if(!(s&&!o)&&(i.getCanSelect()&&(fo(i,t)?s=!0:o=!1),i.subRows&&i.subRows.length)){const a=po(i,t);a==="all"?s=!0:(a==="some"&&(s=!0),o=!1)}}),o?"all":s?"some":!1}const go=/([0-9]+)/gm,rf=(e,t,n)=>Pi(bt(e.getValue(n)).toLowerCase(),bt(t.getValue(n)).toLowerCase()),of=(e,t,n)=>Pi(bt(e.getValue(n)),bt(t.getValue(n))),sf=(e,t,n)=>ho(bt(e.getValue(n)).toLowerCase(),bt(t.getValue(n)).toLowerCase()),af=(e,t,n)=>ho(bt(e.getValue(n)),bt(t.getValue(n))),lf=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},cf=(e,t,n)=>ho(e.getValue(n),t.getValue(n));function ho(e,t){return e===t?0:e>t?1:-1}function bt(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Pi(e,t){const n=e.split(go).filter(Boolean),r=t.split(go).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),s=r.shift(),i=parseInt(o,10),a=parseInt(s,10),u=[i,a].sort();if(isNaN(u[0])){if(o>s)return 1;if(s>o)return-1;continue}if(isNaN(u[1]))return isNaN(i)?-1:1;if(i>a)return 1;if(a>i)return-1}return n.length-r.length}const yn={alphanumeric:rf,alphanumericCaseSensitive:of,text:sf,textCaseSensitive:af,datetime:lf,basic:cf},uf=[zd,Yd,Gd,qd,Hd,Ud,Jd,Zd,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Me("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const s=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(s)==="[object Date]")return yn.datetime;if(typeof s=="string"&&(r=!0,s.split(go).length>1))return yn.alphanumeric}return r?yn.text:yn.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return Hn(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:yn[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),s=typeof n<"u"&&n!==null;t.setSorting(i=>{const a=i==null?void 0:i.find(p=>p.id===e.id),u=i==null?void 0:i.findIndex(p=>p.id===e.id);let c=[],f,g=s?n:o==="desc";if(i!=null&&i.length&&e.getCanMultiSort()&&r?a?f="toggle":f="add":i!=null&&i.length&&u!==i.length-1?f="replace":a?f="toggle":f="replace",f==="toggle"&&(s||o||(f="remove")),f==="add"){var m;c=[...i,{id:e.id,desc:g}],c.splice(0,c.length-((m=t.options.maxMultiSortColCount)!=null?m:Number.MAX_SAFE_INTEGER))}else f==="toggle"?c=i.map(p=>p.id===e.id?{...p,desc:g}:p):f==="remove"?c=i.filter(p=>p.id!==e.id):c=[{id:e.id,desc:g}];return c})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const s=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==s&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:i==="desc"?"asc":"desc":s},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},jd,Qd,ef,tf,nf,Kd];function df(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const r=[...uf,...(t=e._features)!=null?t:[]];let o={_features:r};const s=o._features.reduce((m,p)=>Object.assign(m,p.getDefaultOptions==null?void 0:p.getDefaultOptions(o)),{}),i=m=>o.options.mergeOptions?o.options.mergeOptions(s,m):{...s,...m};let u={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(m=>{var p;u=(p=m.getInitialState==null?void 0:m.getInitialState(u))!=null?p:u});const c=[];let f=!1;const g={_features:r,options:{...s,...e},initialState:u,_queue:m=>{c.push(m),f||(f=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();f=!1}).catch(p=>setTimeout(()=>{throw p})))},reset:()=>{o.setState(o.initialState)},setOptions:m=>{const p=wt(m,o.options);o.options=i(p)},getState:()=>o.options.state,setState:m=>{o.options.onStateChange==null||o.options.onStateChange(m)},_getRowId:(m,p,v)=>{var h;return(h=o.options.getRowId==null?void 0:o.options.getRowId(m,p,v))!=null?h:`${v?[v.id,p].join("."):p}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(m,p)=>{let v=(p?o.getPrePaginationRowModel():o.getRowModel()).rowsById[m];if(!v&&(v=o.getCoreRowModel().rowsById[m],!v))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${m}`):new Error;return v},_getDefaultColumnDef:Y(()=>[o.options.defaultColumn],m=>{var p;return m=(p=m)!=null?p:{},{header:v=>{const h=v.header.column.columnDef;return h.accessorKey?h.accessorKey:h.accessorFn?h.id:null},cell:v=>{var h,y;return(h=(y=v.renderValue())==null||y.toString==null?void 0:y.toString())!=null?h:null},...o._features.reduce((v,h)=>Object.assign(v,h.getDefaultColumnDef==null?void 0:h.getDefaultColumnDef()),{}),...m}},J(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>o.options.columns,getAllColumns:Y(()=>[o._getColumnDefs()],m=>{const p=function(v,h,y){return y===void 0&&(y=0),v.map(w=>{const x=Bd(o,w,y,h),S=w;return x.columns=S.columns?p(S.columns,x,y+1):[],x})};return p(m)},J(e,"debugColumns","getAllColumns")),getAllFlatColumns:Y(()=>[o.getAllColumns()],m=>m.flatMap(p=>p.getFlatColumns()),J(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:Y(()=>[o.getAllFlatColumns()],m=>m.reduce((p,v)=>(p[v.id]=v,p),{}),J(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:Y(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(m,p)=>{let v=m.flatMap(h=>h.getLeafColumns());return p(v)},J(e,"debugColumns","getAllLeafColumns")),getColumn:m=>{const p=o._getAllFlatColumnsById()[m];return process.env.NODE_ENV!=="production"&&!p&&console.error(`[Table] Column with id '${m}' does not exist.`),p}};Object.assign(o,g);for(let m=0;m<o._features.length;m++){const p=o._features[m];p==null||p.createTable==null||p.createTable(o)}return o}function Ai(){return e=>Y(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,s,i){s===void 0&&(s=0);const a=[];for(let c=0;c<o.length;c++){const f=Qr(e,e._getRowId(o[c],c,i),o[c],c,s,void 0,i==null?void 0:i.id);if(n.flatRows.push(f),n.rowsById[f.id]=f,a.push(f),e.options.getSubRows){var u;f.originalSubRows=e.options.getSubRows(o[c],c),(u=f.originalSubRows)!=null&&u.length&&(f.subRows=r(f.originalSubRows,s+1,f))}}return a};return n.rows=r(t),n},J(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function ff(e,t,n){return n.options.filterFromLeafRows?pf(e,t,n):gf(e,t,n)}function pf(e,t,n){var r;const o=[],s={},i=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(u,c){c===void 0&&(c=0);const f=[];for(let m=0;m<u.length;m++){var g;let p=u[m];const v=Qr(n,p.id,p.original,p.index,p.depth,void 0,p.parentId);if(v.columnFilters=p.columnFilters,(g=p.subRows)!=null&&g.length&&c<i){if(v.subRows=a(p.subRows,c+1),p=v,t(p)&&!v.subRows.length){f.push(p),s[p.id]=p,o.push(p);continue}if(t(p)||v.subRows.length){f.push(p),s[p.id]=p,o.push(p);continue}}else p=v,t(p)&&(f.push(p),s[p.id]=p,o.push(p))}return f};return{rows:a(e),flatRows:o,rowsById:s}}function gf(e,t,n){var r;const o=[],s={},i=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(u,c){c===void 0&&(c=0);const f=[];for(let m=0;m<u.length;m++){let p=u[m];if(t(p)){var g;if((g=p.subRows)!=null&&g.length&&c<i){const h=Qr(n,p.id,p.original,p.index,p.depth,void 0,p.parentId);h.subRows=a(p.subRows,c+1),p=h}f.push(p),o.push(p),s[p.id]=p}}return f};return{rows:a(e),flatRows:o,rowsById:s}}function hf(){return e=>Y(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let m=0;m<t.flatRows.length;m++)t.flatRows[m].columnFilters={},t.flatRows[m].columnFiltersMeta={};return t}const o=[],s=[];(n??[]).forEach(m=>{var p;const v=e.getColumn(m.id);if(!v)return;const h=v.getFilterFn();if(!h){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${v.id}.`);return}o.push({id:m.id,filterFn:h,resolvedValue:(p=h.resolveFilterValue==null?void 0:h.resolveFilterValue(m.value))!=null?p:m.value})});const i=(n??[]).map(m=>m.id),a=e.getGlobalFilterFn(),u=e.getAllLeafColumns().filter(m=>m.getCanGlobalFilter());r&&a&&u.length&&(i.push("__global__"),u.forEach(m=>{var p;s.push({id:m.id,filterFn:a,resolvedValue:(p=a.resolveFilterValue==null?void 0:a.resolveFilterValue(r))!=null?p:r})}));let c,f;for(let m=0;m<t.flatRows.length;m++){const p=t.flatRows[m];if(p.columnFilters={},o.length)for(let v=0;v<o.length;v++){c=o[v];const h=c.id;p.columnFilters[h]=c.filterFn(p,h,c.resolvedValue,y=>{p.columnFiltersMeta[h]=y})}if(s.length){for(let v=0;v<s.length;v++){f=s[v];const h=f.id;if(f.filterFn(p,h,f.resolvedValue,y=>{p.columnFiltersMeta[h]=y})){p.columnFilters.__global__=!0;break}}p.columnFilters.__global__!==!0&&(p.columnFilters.__global__=!1)}}const g=m=>{for(let p=0;p<i.length;p++)if(m.columnFilters[i[p]]===!1)return!1;return!0};return ff(t.rows,g,e)},J(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}/**
13
+ color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function J(e,t,n,r){return{debug:()=>{var o;return(o=e==null?void 0:e.debugAll)!=null?o:e[t]},key:process.env.NODE_ENV==="development"&&n,onChange:r}}function Hd(e,t,n,r){const o=()=>{var i;return(i=s.getValue())!=null?i:e.options.renderFallbackValue},s={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:Y(()=>[e,n,t,s],(i,a,u,c)=>({table:i,column:a,row:u,cell:c,getValue:c.getValue,renderValue:c.renderValue}),J(e.options,"debugCells","cell.getContext"))};return e._features.forEach(i=>{i.createCell==null||i.createCell(s,n,t,e)},{}),s}function Ud(e,t,n,r){var o,s;const a={...e._getDefaultColumnDef(),...t},u=a.accessorKey;let c=(o=(s=a.id)!=null?s:u?typeof String.prototype.replaceAll=="function"?u.replaceAll(".","_"):u.replace(/\./g,"_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,f;if(a.accessorFn?f=a.accessorFn:u&&(u.includes(".")?f=m=>{let p=m;for(const h of u.split(".")){var v;p=(v=p)==null?void 0:v[h],process.env.NODE_ENV!=="production"&&p===void 0&&console.warn(`"${h}" in deeply nested key "${u}" returned undefined.`)}return p}:f=m=>m[a.accessorKey]),!c)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let g={id:`${String(c)}`,accessorFn:f,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:Y(()=>[!0],()=>{var m;return[g,...(m=g.columns)==null?void 0:m.flatMap(p=>p.getFlatColumns())]},J(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:Y(()=>[e._getOrderColumnsFn()],m=>{var p;if((p=g.columns)!=null&&p.length){let v=g.columns.flatMap(h=>h.getLeafColumns());return m(v)}return[g]},J(e.options,"debugColumns","column.getLeafColumns"))};for(const m of e._features)m.createColumn==null||m.createColumn(g,e);return g}const Ee="debugHeaders";function wi(e,t,n){var r;let s={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const i=[],a=u=>{u.subHeaders&&u.subHeaders.length&&u.subHeaders.map(a),i.push(u)};return a(s),i},getContext:()=>({table:e,header:s,column:t})};return e._features.forEach(i=>{i.createHeader==null||i.createHeader(s,e)}),s}const jd={createTable:e=>{e.getHeaderGroups=Y(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var s,i;const a=(s=r==null?void 0:r.map(g=>n.find(m=>m.id===g)).filter(Boolean))!=null?s:[],u=(i=o==null?void 0:o.map(g=>n.find(m=>m.id===g)).filter(Boolean))!=null?i:[],c=n.filter(g=>!(r!=null&&r.includes(g.id))&&!(o!=null&&o.includes(g.id)));return jn(t,[...a,...c,...u],e)},J(e.options,Ee,"getHeaderGroups")),e.getCenterHeaderGroups=Y(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(s=>!(r!=null&&r.includes(s.id))&&!(o!=null&&o.includes(s.id))),jn(t,n,e,"center")),J(e.options,Ee,"getCenterHeaderGroups")),e.getLeftHeaderGroups=Y(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const s=(o=r==null?void 0:r.map(i=>n.find(a=>a.id===i)).filter(Boolean))!=null?o:[];return jn(t,s,e,"left")},J(e.options,Ee,"getLeftHeaderGroups")),e.getRightHeaderGroups=Y(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const s=(o=r==null?void 0:r.map(i=>n.find(a=>a.id===i)).filter(Boolean))!=null?o:[];return jn(t,s,e,"right")},J(e.options,Ee,"getRightHeaderGroups")),e.getFooterGroups=Y(()=>[e.getHeaderGroups()],t=>[...t].reverse(),J(e.options,Ee,"getFooterGroups")),e.getLeftFooterGroups=Y(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),J(e.options,Ee,"getLeftFooterGroups")),e.getCenterFooterGroups=Y(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),J(e.options,Ee,"getCenterFooterGroups")),e.getRightFooterGroups=Y(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),J(e.options,Ee,"getRightFooterGroups")),e.getFlatHeaders=Y(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),J(e.options,Ee,"getFlatHeaders")),e.getLeftFlatHeaders=Y(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),J(e.options,Ee,"getLeftFlatHeaders")),e.getCenterFlatHeaders=Y(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),J(e.options,Ee,"getCenterFlatHeaders")),e.getRightFlatHeaders=Y(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),J(e.options,Ee,"getRightFlatHeaders")),e.getCenterLeafHeaders=Y(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),J(e.options,Ee,"getCenterLeafHeaders")),e.getLeftLeafHeaders=Y(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),J(e.options,Ee,"getLeftLeafHeaders")),e.getRightLeafHeaders=Y(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),J(e.options,Ee,"getRightLeafHeaders")),e.getLeafHeaders=Y(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,s,i,a,u,c;return[...(o=(s=t[0])==null?void 0:s.headers)!=null?o:[],...(i=(a=n[0])==null?void 0:a.headers)!=null?i:[],...(u=(c=r[0])==null?void 0:c.headers)!=null?u:[]].map(f=>f.getLeafHeaders()).flat()},J(e.options,Ee,"getLeafHeaders"))}};function jn(e,t,n,r){var o,s;let i=0;const a=function(m,p){p===void 0&&(p=1),i=Math.max(i,p),m.filter(v=>v.getIsVisible()).forEach(v=>{var h;(h=v.columns)!=null&&h.length&&a(v.columns,p+1)},0)};a(e);let u=[];const c=(m,p)=>{const v={depth:p,id:[r,`${p}`].filter(Boolean).join("_"),headers:[]},h=[];m.forEach(y=>{const w=[...h].reverse()[0],b=y.column.depth===v.depth;let S,E=!1;if(b&&y.column.parent?S=y.column.parent:(S=y.column,E=!0),w&&(w==null?void 0:w.column)===S)w.subHeaders.push(y);else{const x=wi(n,S,{id:[r,p,S.id,y==null?void 0:y.id].filter(Boolean).join("_"),isPlaceholder:E,placeholderId:E?`${h.filter(P=>P.column===S).length}`:void 0,depth:p,index:h.length});x.subHeaders.push(y),h.push(x)}v.headers.push(y),y.headerGroup=v}),u.push(v),p>0&&c(h,p-1)},f=t.map((m,p)=>wi(n,m,{depth:i,index:p}));c(f,i-1),u.reverse();const g=m=>m.filter(v=>v.column.getIsVisible()).map(v=>{let h=0,y=0,w=[0];v.subHeaders&&v.subHeaders.length?(w=[],g(v.subHeaders).forEach(S=>{let{colSpan:E,rowSpan:x}=S;h+=E,w.push(x)})):h=1;const b=Math.min(...w);return y=y+b,v.colSpan=h,v.rowSpan=y,{colSpan:h,rowSpan:y}});return g((o=(s=u[0])==null?void 0:s.headers)!=null?o:[]),u}const ro=(e,t,n,r,o,s,i)=>{let a={id:t,index:r,original:n,depth:o,parentId:i,_valuesCache:{},_uniqueValuesCache:{},getValue:u=>{if(a._valuesCache.hasOwnProperty(u))return a._valuesCache[u];const c=e.getColumn(u);if(c!=null&&c.accessorFn)return a._valuesCache[u]=c.accessorFn(a.original,r),a._valuesCache[u]},getUniqueValues:u=>{if(a._uniqueValuesCache.hasOwnProperty(u))return a._uniqueValuesCache[u];const c=e.getColumn(u);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[u]=c.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[u]):(a._uniqueValuesCache[u]=[a.getValue(u)],a._uniqueValuesCache[u])},renderValue:u=>{var c;return(c=a.getValue(u))!=null?c:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>zd(a.subRows,u=>u.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let u=[],c=a;for(;;){const f=c.getParentRow();if(!f)break;u.push(f),c=f}return u.reverse()},getAllCells:Y(()=>[e.getAllLeafColumns()],u=>u.map(c=>Hd(e,a,c,c.id)),J(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:Y(()=>[a.getAllCells()],u=>u.reduce((c,f)=>(c[f.column.id]=f,c),{}),J(e.options,"debugRows","getAllCellsByColumnId"))};for(let u=0;u<e._features.length;u++){const c=e._features[u];c==null||c.createRow==null||c.createRow(a,e)}return a},Wd={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},bi=(e,t,n)=>{var r,o;const s=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(s))};bi.autoRemove=e=>Ge(e);const xi=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};xi.autoRemove=e=>Ge(e);const Ci=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};Ci.autoRemove=e=>Ge(e);const Si=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};Si.autoRemove=e=>Ge(e)||!(e!=null&&e.length);const Ei=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});Ei.autoRemove=e=>Ge(e)||!(e!=null&&e.length);const Ni=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});Ni.autoRemove=e=>Ge(e)||!(e!=null&&e.length);const Ti=(e,t,n)=>e.getValue(t)===n;Ti.autoRemove=e=>Ge(e);const Pi=(e,t,n)=>e.getValue(t)==n;Pi.autoRemove=e=>Ge(e);const oo=(e,t,n)=>{let[r,o]=n;const s=e.getValue(t);return s>=r&&s<=o};oo.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,s=t===null||Number.isNaN(r)?-1/0:r,i=n===null||Number.isNaN(o)?1/0:o;if(s>i){const a=s;s=i,i=a}return[s,i]},oo.autoRemove=e=>Ge(e)||Ge(e[0])&&Ge(e[1]);const ut={includesString:bi,includesStringSensitive:xi,equalsString:Ci,arrIncludes:Si,arrIncludesAll:Ei,arrIncludesSome:Ni,equals:Ti,weakEquals:Pi,inNumberRange:oo};function Ge(e){return e==null||e===""}const Gd={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:$e("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?ut.includesString:typeof r=="number"?ut.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?ut.equals:Array.isArray(r)?ut.arrIncludes:ut.weakEquals},e.getFilterFn=()=>{var n,r;return Un(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:ut[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),s=r==null?void 0:r.find(f=>f.id===e.id),i=xt(n,s?s.value:void 0);if(Ai(o,i,e)){var a;return(a=r==null?void 0:r.filter(f=>f.id!==e.id))!=null?a:[]}const u={id:e.id,value:i};if(s){var c;return(c=r==null?void 0:r.map(f=>f.id===e.id?u:f))!=null?c:[]}return r!=null&&r.length?[...r,u]:[u]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var s;return(s=xt(t,o))==null?void 0:s.filter(i=>{const a=n.find(u=>u.id===i.id);if(a){const u=a.getFilterFn();if(Ai(u,i.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function Ai(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const so={sum:(e,t,n)=>n.reduce((r,o)=>{const s=o.getValue(e);return r+(typeof s=="number"?s:0)},0),min:(e,t,n)=>{let r;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r>s||r===void 0&&s>=s)&&(r=s)}),r},max:(e,t,n)=>{let r;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r<s||r===void 0&&s>=s)&&(r=s)}),r},extent:(e,t,n)=>{let r,o;return n.forEach(s=>{const i=s.getValue(e);i!=null&&(r===void 0?i>=i&&(r=o=i):(r>i&&(r=i),o<i&&(o=i)))}),[r,o]},mean:(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let s=o.getValue(e);s!=null&&(s=+s)>=s&&(++n,r+=s)}),n)return r/n},median:(e,t)=>{if(!t.length)return;const n=t.map(s=>s.getValue(e));if(!Bd(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((s,i)=>s-i);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},unique:(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(n=>n.getValue(e))).size,count:(e,t)=>t.length},qd={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:$e("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return so.sum;if(Object.prototype.toString.call(r)==="[object Date]")return so.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Un(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:so[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function Kd(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(s=>!t.includes(s.id));return n==="remove"?r:[...t.map(s=>e.find(i=>i.id===s)).filter(Boolean),...r]}const Xd={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:$e("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Y(n=>[vn(t,n)],n=>n.findIndex(r=>r.id===e.id),J(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return((r=vn(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=vn(t,n);return((r=o[o.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=Y(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let s=[];if(!(t!=null&&t.length))s=o;else{const i=[...t],a=[...o];for(;a.length&&i.length;){const u=i.shift(),c=a.findIndex(f=>f.id===u);c>-1&&s.push(a.splice(c,1)[0])}s=[...s,...a]}return Kd(s,n,r)},J(e.options,"debugTable","_getOrderColumnsFn"))}},io=()=>({left:[],right:[]}),Yd={getInitialState:e=>({columnPinning:io(),...e}),getDefaultOptions:e=>({onColumnPinningChange:$e("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var s,i;if(n==="right"){var a,u;return{left:((a=o==null?void 0:o.left)!=null?a:[]).filter(g=>!(r!=null&&r.includes(g))),right:[...((u=o==null?void 0:o.right)!=null?u:[]).filter(g=>!(r!=null&&r.includes(g))),...r]}}if(n==="left"){var c,f;return{left:[...((c=o==null?void 0:o.left)!=null?c:[]).filter(g=>!(r!=null&&r.includes(g))),...r],right:((f=o==null?void 0:o.right)!=null?f:[]).filter(g=>!(r!=null&&r.includes(g)))}}return{left:((s=o==null?void 0:o.left)!=null?s:[]).filter(g=>!(r!=null&&r.includes(g))),right:((i=o==null?void 0:o.right)!=null?i:[]).filter(g=>!(r!=null&&r.includes(g)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,s,i;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((s=(i=t.options.enableColumnPinning)!=null?i:t.options.enablePinning)!=null?s:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,s=n.some(a=>r==null?void 0:r.includes(a)),i=n.some(a=>o==null?void 0:o.includes(a));return s?"left":i?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=Y(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const s=[...r??[],...o??[]];return n.filter(i=>!s.includes(i.column.id))},J(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=Y(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(s=>n.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"left"})),J(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=Y(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(s=>n.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"right"})),J(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?io():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:io())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,s;return!!((o=r.left)!=null&&o.length||(s=r.right)!=null&&s.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=Y(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),J(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=Y(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),J(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=Y(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(s=>!o.includes(s.id))},J(e.options,"debugColumns","getCenterLeafColumns"))}},Wn={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},ao=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Jd={getDefaultColumnDef:()=>Wn,getInitialState:e=>({columnSizing:{},columnSizingInfo:ao(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:$e("columnSizing",e),onColumnSizingInfoChange:$e("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const s=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Wn.minSize,(r=s??e.columnDef.size)!=null?r:Wn.size),(o=e.columnDef.maxSize)!=null?o:Wn.maxSize)},e.getStart=Y(n=>[n,vn(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,s)=>o+s.getSize(),0),J(t.options,"debugColumns","getStart")),e.getAfter=Y(n=>[n,vn(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,s)=>o+s.getSize(),0),J(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var s;n+=(s=o.column.getSize())!=null?s:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r==null?void 0:r.getCanResize();return s=>{if(!r||!o||(s.persist==null||s.persist(),lo(s)&&s.touches&&s.touches.length>1))return;const i=e.getSize(),a=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[r.id,r.getSize()]],u=lo(s)?Math.round(s.touches[0].clientX):s.clientX,c={},f=(w,b)=>{typeof b=="number"&&(t.setColumnSizingInfo(S=>{var E,x;const P=t.options.columnResizeDirection==="rtl"?-1:1,_=(b-((E=S==null?void 0:S.startOffset)!=null?E:0))*P,O=Math.max(_/((x=S==null?void 0:S.startSize)!=null?x:0),-.999999);return S.columnSizingStart.forEach(k=>{let[F,G]=k;c[F]=Math.round(Math.max(G+G*O,0)*100)/100}),{...S,deltaOffset:_,deltaPercentage:O}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(S=>({...S,...c})))},g=w=>f("move",w),m=w=>{f("end",w),t.setColumnSizingInfo(b=>({...b,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},p=n||typeof document<"u"?document:null,v={moveHandler:w=>g(w.clientX),upHandler:w=>{p==null||p.removeEventListener("mousemove",v.moveHandler),p==null||p.removeEventListener("mouseup",v.upHandler),m(w.clientX)}},h={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),g(w.touches[0].clientX),!1),upHandler:w=>{var b;p==null||p.removeEventListener("touchmove",h.moveHandler),p==null||p.removeEventListener("touchend",h.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),m((b=w.touches[0])==null?void 0:b.clientX)}},y=Zd()?{passive:!1}:!1;lo(s)?(p==null||p.addEventListener("touchmove",h.moveHandler,y),p==null||p.addEventListener("touchend",h.upHandler,y)):(p==null||p.addEventListener("mousemove",v.moveHandler,y),p==null||p.addEventListener("mouseup",v.upHandler,y)),t.setColumnSizingInfo(w=>({...w,startOffset:u,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?ao():(n=e.initialState.columnSizingInfo)!=null?n:ao())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let Gn=null;function Zd(){if(typeof Gn=="boolean")return Gn;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Gn=e,Gn}function lo(e){return e.type==="touchstart"}const Qd={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:$e("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return(n=o.length?o.some(s=>s.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=Y(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),J(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=Y(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],J(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,r)=>Y(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),J(e.options,"debugColumns",n));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,s)=>({...o,[s.id]:n||!(s.getCanHide!=null&&s.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function vn(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const ef={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},tf={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:$e("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,o,s;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((s=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?s:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>ut.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Un(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:ut[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},nf={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:$e("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,s;e.setExpanded(r?{}:(o=(s=e.initialState)==null?void 0:s.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(s=>{const i=s.split(".");r=Math.max(r,i.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const s=r===!0?!0:!!(r!=null&&r[e.id]);let i={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{i[a]=!0}):i=r,n=(o=n)!=null?o:!s,!s&&n)return{...i,[e.id]:!0};if(s&&!n){const{[e.id]:a,...u}=i;return u}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},co=0,uo=10,fo=()=>({pageIndex:co,pageSize:uo}),rf={getInitialState:e=>({...e,pagination:{...fo(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:$e("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=s=>xt(r,s);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?fo():(o=e.initialState.pagination)!=null?o:fo())},e.setPageIndex=r=>{e.setPagination(o=>{let s=xt(r,o.pageIndex);const i=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return s=Math.max(0,Math.min(s,i)),{...o,pageIndex:s}})},e.resetPageIndex=r=>{var o,s;e.setPageIndex(r?co:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?o:co)},e.resetPageSize=r=>{var o,s;e.setPageSize(r?uo:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?o:uo)},e.setPageSize=r=>{e.setPagination(o=>{const s=Math.max(1,xt(r,o.pageSize)),i=o.pageSize*o.pageIndex,a=Math.floor(i/s);return{...o,pageIndex:a,pageSize:s}})},e.setPageCount=r=>e.setPagination(o=>{var s;let i=xt(r,(s=e.options.pageCount)!=null?s:-1);return typeof i=="number"&&(i=Math.max(-1,i)),{...o,pageCount:i}}),e.getPageOptions=Y(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((s,i)=>i)),o},J(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},po=()=>({top:[],bottom:[]}),of={getInitialState:e=>({rowPinning:po(),...e}),getDefaultOptions:e=>({onRowPinningChange:$e("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const s=r?e.getLeafRows().map(u=>{let{id:c}=u;return c}):[],i=o?e.getParentRows().map(u=>{let{id:c}=u;return c}):[],a=new Set([...i,e.id,...s]);t.setRowPinning(u=>{var c,f;if(n==="bottom"){var g,m;return{top:((g=u==null?void 0:u.top)!=null?g:[]).filter(h=>!(a!=null&&a.has(h))),bottom:[...((m=u==null?void 0:u.bottom)!=null?m:[]).filter(h=>!(a!=null&&a.has(h))),...Array.from(a)]}}if(n==="top"){var p,v;return{top:[...((p=u==null?void 0:u.top)!=null?p:[]).filter(h=>!(a!=null&&a.has(h))),...Array.from(a)],bottom:((v=u==null?void 0:u.bottom)!=null?v:[]).filter(h=>!(a!=null&&a.has(h)))}}return{top:((c=u==null?void 0:u.top)!=null?c:[]).filter(h=>!(a!=null&&a.has(h))),bottom:((f=u==null?void 0:u.bottom)!=null?f:[]).filter(h=>!(a!=null&&a.has(h)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,s=n.some(a=>r==null?void 0:r.includes(a)),i=n.some(a=>o==null?void 0:o.includes(a));return s?"top":i?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const s=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(i=>{let{id:a}=i;return a});return(r=s==null?void 0:s.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?po():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:po())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,s;return!!((o=r.top)!=null&&o.length||(s=r.bottom)!=null&&s.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(i=>{const a=e.getRow(i,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(i=>t.find(a=>a.id===i))).filter(Boolean).map(i=>({...i,position:r}))},e.getTopRows=Y(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),J(e.options,"debugRows","getTopRows")),e.getBottomRows=Y(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),J(e.options,"debugRows","getBottomRows")),e.getCenterRows=Y(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(s=>!o.has(s.id))},J(e.options,"debugRows","getCenterRows"))}},sf={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:$e("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(s=>{s.getCanSelect()&&(r[s.id]=!0)}):o.forEach(s=>{delete r[s.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(s=>{go(o,s.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Y(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?ho(e,n):{rows:[],flatRows:[],rowsById:{}},J(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=Y(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?ho(e,n):{rows:[],flatRows:[],rowsById:{}},J(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=Y(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?ho(e,n):{rows:[],flatRows:[],rowsById:{}},J(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(s=>{var i;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return s;const a={...s};return go(a,e.id,n,(i=r==null?void 0:r.selectChildren)!=null?i:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return mo(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return vo(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return vo(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},go=(e,t,n,r,o)=>{var s;const i=o.getRow(t,!0);n?(i.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),i.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(s=i.subRows)!=null&&s.length&&i.getCanSelectSubRows()&&i.subRows.forEach(a=>go(e,a.id,n,r,o))};function ho(e,t){const n=e.getState().rowSelection,r=[],o={},s=function(i,a){return i.map(u=>{var c;const f=mo(u,n);if(f&&(r.push(u),o[u.id]=u),(c=u.subRows)!=null&&c.length&&(u={...u,subRows:s(u.subRows)}),f)return u}).filter(Boolean)};return{rows:s(t.rows),flatRows:r,rowsById:o}}function mo(e,t){var n;return(n=t[e.id])!=null?n:!1}function vo(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,s=!1;return e.subRows.forEach(i=>{if(!(s&&!o)&&(i.getCanSelect()&&(mo(i,t)?s=!0:o=!1),i.subRows&&i.subRows.length)){const a=vo(i,t);a==="all"?s=!0:(a==="some"&&(s=!0),o=!1)}}),o?"all":s?"some":!1}const yo=/([0-9]+)/gm,af=(e,t,n)=>_i(Ct(e.getValue(n)).toLowerCase(),Ct(t.getValue(n)).toLowerCase()),lf=(e,t,n)=>_i(Ct(e.getValue(n)),Ct(t.getValue(n))),cf=(e,t,n)=>wo(Ct(e.getValue(n)).toLowerCase(),Ct(t.getValue(n)).toLowerCase()),uf=(e,t,n)=>wo(Ct(e.getValue(n)),Ct(t.getValue(n))),df=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},ff=(e,t,n)=>wo(e.getValue(n),t.getValue(n));function wo(e,t){return e===t?0:e>t?1:-1}function Ct(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function _i(e,t){const n=e.split(yo).filter(Boolean),r=t.split(yo).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),s=r.shift(),i=parseInt(o,10),a=parseInt(s,10),u=[i,a].sort();if(isNaN(u[0])){if(o>s)return 1;if(s>o)return-1;continue}if(isNaN(u[1]))return isNaN(i)?-1:1;if(i>a)return 1;if(a>i)return-1}return n.length-r.length}const yn={alphanumeric:af,alphanumericCaseSensitive:lf,text:cf,textCaseSensitive:uf,datetime:df,basic:ff},pf=[jd,Qd,Xd,Yd,Wd,Gd,ef,tf,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:$e("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const s=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(s)==="[object Date]")return yn.datetime;if(typeof s=="string"&&(r=!0,s.split(yo).length>1))return yn.alphanumeric}return r?yn.text:yn.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return Un(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:yn[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),s=typeof n<"u"&&n!==null;t.setSorting(i=>{const a=i==null?void 0:i.find(p=>p.id===e.id),u=i==null?void 0:i.findIndex(p=>p.id===e.id);let c=[],f,g=s?n:o==="desc";if(i!=null&&i.length&&e.getCanMultiSort()&&r?a?f="toggle":f="add":i!=null&&i.length&&u!==i.length-1?f="replace":a?f="toggle":f="replace",f==="toggle"&&(s||o||(f="remove")),f==="add"){var m;c=[...i,{id:e.id,desc:g}],c.splice(0,c.length-((m=t.options.maxMultiSortColCount)!=null?m:Number.MAX_SAFE_INTEGER))}else f==="toggle"?c=i.map(p=>p.id===e.id?{...p,desc:g}:p):f==="remove"?c=i.filter(p=>p.id!==e.id):c=[{id:e.id,desc:g}];return c})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const s=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==s&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:i==="desc"?"asc":"desc":s},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},qd,nf,rf,of,sf,Jd];function gf(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const r=[...pf,...(t=e._features)!=null?t:[]];let o={_features:r};const s=o._features.reduce((m,p)=>Object.assign(m,p.getDefaultOptions==null?void 0:p.getDefaultOptions(o)),{}),i=m=>o.options.mergeOptions?o.options.mergeOptions(s,m):{...s,...m};let u={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(m=>{var p;u=(p=m.getInitialState==null?void 0:m.getInitialState(u))!=null?p:u});const c=[];let f=!1;const g={_features:r,options:{...s,...e},initialState:u,_queue:m=>{c.push(m),f||(f=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();f=!1}).catch(p=>setTimeout(()=>{throw p})))},reset:()=>{o.setState(o.initialState)},setOptions:m=>{const p=xt(m,o.options);o.options=i(p)},getState:()=>o.options.state,setState:m=>{o.options.onStateChange==null||o.options.onStateChange(m)},_getRowId:(m,p,v)=>{var h;return(h=o.options.getRowId==null?void 0:o.options.getRowId(m,p,v))!=null?h:`${v?[v.id,p].join("."):p}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(m,p)=>{let v=(p?o.getPrePaginationRowModel():o.getRowModel()).rowsById[m];if(!v&&(v=o.getCoreRowModel().rowsById[m],!v))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${m}`):new Error;return v},_getDefaultColumnDef:Y(()=>[o.options.defaultColumn],m=>{var p;return m=(p=m)!=null?p:{},{header:v=>{const h=v.header.column.columnDef;return h.accessorKey?h.accessorKey:h.accessorFn?h.id:null},cell:v=>{var h,y;return(h=(y=v.renderValue())==null||y.toString==null?void 0:y.toString())!=null?h:null},...o._features.reduce((v,h)=>Object.assign(v,h.getDefaultColumnDef==null?void 0:h.getDefaultColumnDef()),{}),...m}},J(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>o.options.columns,getAllColumns:Y(()=>[o._getColumnDefs()],m=>{const p=function(v,h,y){return y===void 0&&(y=0),v.map(w=>{const b=Ud(o,w,y,h),S=w;return b.columns=S.columns?p(S.columns,b,y+1):[],b})};return p(m)},J(e,"debugColumns","getAllColumns")),getAllFlatColumns:Y(()=>[o.getAllColumns()],m=>m.flatMap(p=>p.getFlatColumns()),J(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:Y(()=>[o.getAllFlatColumns()],m=>m.reduce((p,v)=>(p[v.id]=v,p),{}),J(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:Y(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(m,p)=>{let v=m.flatMap(h=>h.getLeafColumns());return p(v)},J(e,"debugColumns","getAllLeafColumns")),getColumn:m=>{const p=o._getAllFlatColumnsById()[m];return process.env.NODE_ENV!=="production"&&!p&&console.error(`[Table] Column with id '${m}' does not exist.`),p}};Object.assign(o,g);for(let m=0;m<o._features.length;m++){const p=o._features[m];p==null||p.createTable==null||p.createTable(o)}return o}function Fi(){return e=>Y(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,s,i){s===void 0&&(s=0);const a=[];for(let c=0;c<o.length;c++){const f=ro(e,e._getRowId(o[c],c,i),o[c],c,s,void 0,i==null?void 0:i.id);if(n.flatRows.push(f),n.rowsById[f.id]=f,a.push(f),e.options.getSubRows){var u;f.originalSubRows=e.options.getSubRows(o[c],c),(u=f.originalSubRows)!=null&&u.length&&(f.subRows=r(f.originalSubRows,s+1,f))}}return a};return n.rows=r(t),n},J(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function hf(e,t,n){return n.options.filterFromLeafRows?mf(e,t,n):vf(e,t,n)}function mf(e,t,n){var r;const o=[],s={},i=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(u,c){c===void 0&&(c=0);const f=[];for(let m=0;m<u.length;m++){var g;let p=u[m];const v=ro(n,p.id,p.original,p.index,p.depth,void 0,p.parentId);if(v.columnFilters=p.columnFilters,(g=p.subRows)!=null&&g.length&&c<i){if(v.subRows=a(p.subRows,c+1),p=v,t(p)&&!v.subRows.length){f.push(p),s[p.id]=p,o.push(p);continue}if(t(p)||v.subRows.length){f.push(p),s[p.id]=p,o.push(p);continue}}else p=v,t(p)&&(f.push(p),s[p.id]=p,o.push(p))}return f};return{rows:a(e),flatRows:o,rowsById:s}}function vf(e,t,n){var r;const o=[],s={},i=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(u,c){c===void 0&&(c=0);const f=[];for(let m=0;m<u.length;m++){let p=u[m];if(t(p)){var g;if((g=p.subRows)!=null&&g.length&&c<i){const h=ro(n,p.id,p.original,p.index,p.depth,void 0,p.parentId);h.subRows=a(p.subRows,c+1),p=h}f.push(p),o.push(p),s[p.id]=p}}return f};return{rows:a(e),flatRows:o,rowsById:s}}function yf(){return e=>Y(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let m=0;m<t.flatRows.length;m++)t.flatRows[m].columnFilters={},t.flatRows[m].columnFiltersMeta={};return t}const o=[],s=[];(n??[]).forEach(m=>{var p;const v=e.getColumn(m.id);if(!v)return;const h=v.getFilterFn();if(!h){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${v.id}.`);return}o.push({id:m.id,filterFn:h,resolvedValue:(p=h.resolveFilterValue==null?void 0:h.resolveFilterValue(m.value))!=null?p:m.value})});const i=(n??[]).map(m=>m.id),a=e.getGlobalFilterFn(),u=e.getAllLeafColumns().filter(m=>m.getCanGlobalFilter());r&&a&&u.length&&(i.push("__global__"),u.forEach(m=>{var p;s.push({id:m.id,filterFn:a,resolvedValue:(p=a.resolveFilterValue==null?void 0:a.resolveFilterValue(r))!=null?p:r})}));let c,f;for(let m=0;m<t.flatRows.length;m++){const p=t.flatRows[m];if(p.columnFilters={},o.length)for(let v=0;v<o.length;v++){c=o[v];const h=c.id;p.columnFilters[h]=c.filterFn(p,h,c.resolvedValue,y=>{p.columnFiltersMeta[h]=y})}if(s.length){for(let v=0;v<s.length;v++){f=s[v];const h=f.id;if(f.filterFn(p,h,f.resolvedValue,y=>{p.columnFiltersMeta[h]=y})){p.columnFilters.__global__=!0;break}}p.columnFilters.__global__!==!0&&(p.columnFilters.__global__=!1)}}const g=m=>{for(let p=0;p<i.length;p++)if(m.columnFilters[i[p]]===!1)return!1;return!0};return hf(t.rows,g,e)},J(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}/**
14
14
  * react-table
15
15
  *
16
16
  * Copyright (c) TanStack
@@ -19,82 +19,82 @@
19
19
  * LICENSE.md file in the root directory of this source tree.
20
20
  *
21
21
  * @license MIT
22
- */function Gn(e,t){return e?mf(e)?d.createElement(e,t):e:null}function mf(e){return vf(e)||typeof e=="function"||yf(e)}function vf(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function yf(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function _i(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=d.useState(()=>({current:df(t)})),[r,o]=d.useState(()=>n.current.initialState);return n.current.setOptions(s=>({...s,...e,state:{...r,...e.state},onStateChange:i=>{o(i),e.onStateChange==null||e.onStateChange(i)}})),n.current}function Fi(e,t){return function(){return e.apply(t,arguments)}}const{toString:wf}=Object.prototype,{getPrototypeOf:mo}=Object,qn=(e=>t=>{const n=wf.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),je=e=>(e=e.toLowerCase(),t=>qn(t)===e),Kn=e=>t=>typeof t===e,{isArray:Gt}=Array,wn=Kn("undefined");function bf(e){return e!==null&&!wn(e)&&e.constructor!==null&&!wn(e.constructor)&&ke(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Oi=je("ArrayBuffer");function xf(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Oi(e.buffer),t}const Cf=Kn("string"),ke=Kn("function"),Di=Kn("number"),Xn=e=>e!==null&&typeof e=="object",Sf=e=>e===!0||e===!1,Yn=e=>{if(qn(e)!=="object")return!1;const t=mo(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Ef=je("Date"),Nf=je("File"),Tf=je("Blob"),Pf=je("FileList"),Af=e=>Xn(e)&&ke(e.pipe),_f=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||ke(e.append)&&((t=qn(e))==="formdata"||t==="object"&&ke(e.toString)&&e.toString()==="[object FormData]"))},Ff=je("URLSearchParams"),[Of,Df,Mf,kf]=["ReadableStream","Request","Response","Headers"].map(je),$f=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function bn(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),Gt(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const s=n?Object.getOwnPropertyNames(e):Object.keys(e),i=s.length;let a;for(r=0;r<i;r++)a=s[r],t.call(null,e[a],a,e)}}function Mi(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,o;for(;r-- >0;)if(o=n[r],t===o.toLowerCase())return o;return null}const Rt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ki=e=>!wn(e)&&e!==Rt;function vo(){const{caseless:e}=ki(this)&&this||{},t={},n=(r,o)=>{const s=e&&Mi(t,o)||o;Yn(t[s])&&Yn(r)?t[s]=vo(t[s],r):Yn(r)?t[s]=vo({},r):Gt(r)?t[s]=r.slice():t[s]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&bn(arguments[r],n);return t}const If=(e,t,n,{allOwnKeys:r}={})=>(bn(t,(o,s)=>{n&&ke(o)?e[s]=Fi(o,n):e[s]=o},{allOwnKeys:r}),e),Rf=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Lf=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Vf=(e,t,n,r)=>{let o,s,i;const a={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],(!r||r(i,e,t))&&!a[i]&&(t[i]=e[i],a[i]=!0);e=n!==!1&&mo(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Bf=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},zf=e=>{if(!e)return null;if(Gt(e))return e;let t=e.length;if(!Di(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Hf=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&mo(Uint8Array)),Uf=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=r.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},jf=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Wf=je("HTMLFormElement"),Gf=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),$i=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),qf=je("RegExp"),Ii=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};bn(n,(o,s)=>{let i;(i=t(o,s,e))!==!1&&(r[s]=i||o)}),Object.defineProperties(e,r)},Kf=e=>{Ii(e,(t,n)=>{if(ke(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(ke(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Xf=(e,t)=>{const n={},r=o=>{o.forEach(s=>{n[s]=!0})};return Gt(e)?r(e):r(String(e).split(t)),n},Yf=()=>{},Jf=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,yo="abcdefghijklmnopqrstuvwxyz",Ri="0123456789",Li={DIGIT:Ri,ALPHA:yo,ALPHA_DIGIT:yo+yo.toUpperCase()+Ri},Zf=(e=16,t=Li.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function Qf(e){return!!(e&&ke(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const ep=e=>{const t=new Array(10),n=(r,o)=>{if(Xn(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[o]=r;const s=Gt(r)?[]:{};return bn(r,(i,a)=>{const u=n(i,o+1);!wn(u)&&(s[a]=u)}),t[o]=void 0,s}}return r};return n(e,0)},tp=je("AsyncFunction"),np=e=>e&&(Xn(e)||ke(e))&&ke(e.then)&&ke(e.catch),Vi=((e,t)=>e?setImmediate:t?((n,r)=>(Rt.addEventListener("message",({source:o,data:s})=>{o===Rt&&s===n&&r.length&&r.shift()()},!1),o=>{r.push(o),Rt.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",ke(Rt.postMessage)),rp=typeof queueMicrotask<"u"?queueMicrotask.bind(Rt):typeof process<"u"&&process.nextTick||Vi,T={isArray:Gt,isArrayBuffer:Oi,isBuffer:bf,isFormData:_f,isArrayBufferView:xf,isString:Cf,isNumber:Di,isBoolean:Sf,isObject:Xn,isPlainObject:Yn,isReadableStream:Of,isRequest:Df,isResponse:Mf,isHeaders:kf,isUndefined:wn,isDate:Ef,isFile:Nf,isBlob:Tf,isRegExp:qf,isFunction:ke,isStream:Af,isURLSearchParams:Ff,isTypedArray:Hf,isFileList:Pf,forEach:bn,merge:vo,extend:If,trim:$f,stripBOM:Rf,inherits:Lf,toFlatObject:Vf,kindOf:qn,kindOfTest:je,endsWith:Bf,toArray:zf,forEachEntry:Uf,matchAll:jf,isHTMLForm:Wf,hasOwnProperty:$i,hasOwnProp:$i,reduceDescriptors:Ii,freezeMethods:Kf,toObjectSet:Xf,toCamelCase:Gf,noop:Yf,toFiniteNumber:Jf,findKey:Mi,global:Rt,isContextDefined:ki,ALPHABET:Li,generateString:Zf,isSpecCompliantForm:Qf,toJSONObject:ep,isAsyncFn:tp,isThenable:np,setImmediate:Vi,asap:rp};function Q(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}T.inherits(Q,Error,{toJSON:function(){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:T.toJSONObject(this.config),code:this.code,status:this.status}}});const Bi=Q.prototype,zi={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{zi[e]={value:e}}),Object.defineProperties(Q,zi),Object.defineProperty(Bi,"isAxiosError",{value:!0}),Q.from=(e,t,n,r,o,s)=>{const i=Object.create(Bi);return T.toFlatObject(e,i,function(u){return u!==Error.prototype},a=>a!=="isAxiosError"),Q.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const op=null;function wo(e){return T.isPlainObject(e)||T.isArray(e)}function Hi(e){return T.endsWith(e,"[]")?e.slice(0,-2):e}function Ui(e,t,n){return e?e.concat(t).map(function(o,s){return o=Hi(o),!n&&s?"["+o+"]":o}).join(n?".":""):t}function sp(e){return T.isArray(e)&&!e.some(wo)}const ip=T.toFlatObject(T,{},null,function(t){return/^is[A-Z]/.test(t)});function Jn(e,t,n){if(!T.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=T.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,y){return!T.isUndefined(y[h])});const r=n.metaTokens,o=n.visitor||f,s=n.dots,i=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&T.isSpecCompliantForm(t);if(!T.isFunction(o))throw new TypeError("visitor must be a function");function c(v){if(v===null)return"";if(T.isDate(v))return v.toISOString();if(!u&&T.isBlob(v))throw new Q("Blob is not supported. Use a Buffer instead.");return T.isArrayBuffer(v)||T.isTypedArray(v)?u&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function f(v,h,y){let w=v;if(v&&!y&&typeof v=="object"){if(T.endsWith(h,"{}"))h=r?h:h.slice(0,-2),v=JSON.stringify(v);else if(T.isArray(v)&&sp(v)||(T.isFileList(v)||T.endsWith(h,"[]"))&&(w=T.toArray(v)))return h=Hi(h),w.forEach(function(S,E){!(T.isUndefined(S)||S===null)&&t.append(i===!0?Ui([h],E,s):i===null?h:h+"[]",c(S))}),!1}return wo(v)?!0:(t.append(Ui(y,h,s),c(v)),!1)}const g=[],m=Object.assign(ip,{defaultVisitor:f,convertValue:c,isVisitable:wo});function p(v,h){if(!T.isUndefined(v)){if(g.indexOf(v)!==-1)throw Error("Circular reference detected in "+h.join("."));g.push(v),T.forEach(v,function(w,x){(!(T.isUndefined(w)||w===null)&&o.call(t,w,T.isString(x)?x.trim():x,h,m))===!0&&p(w,h?h.concat(x):[x])}),g.pop()}}if(!T.isObject(e))throw new TypeError("data must be an object");return p(e),t}function ji(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function bo(e,t){this._pairs=[],e&&Jn(e,this,t)}const Wi=bo.prototype;Wi.append=function(t,n){this._pairs.push([t,n])},Wi.toString=function(t){const n=t?function(r){return t.call(this,r,ji)}:ji;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function ap(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Gi(e,t,n){if(!t)return e;const r=n&&n.encode||ap;T.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(o?s=o(t,n):s=T.isURLSearchParams(t)?t.toString():new bo(t,n).toString(r),s){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class qi{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){T.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Ki={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},lp={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:bo,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},xo=typeof window<"u"&&typeof document<"u",Co=typeof navigator=="object"&&navigator||void 0,cp=xo&&(!Co||["ReactNative","NativeScript","NS"].indexOf(Co.product)<0),up=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",dp=xo&&window.location.href||"http://localhost",Se={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:xo,hasStandardBrowserEnv:cp,hasStandardBrowserWebWorkerEnv:up,navigator:Co,origin:dp},Symbol.toStringTag,{value:"Module"})),...lp};function fp(e,t){return Jn(e,new Se.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,s){return Se.isNode&&T.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function pp(e){return T.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function gp(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}function Xi(e){function t(n,r,o,s){let i=n[s++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),u=s>=n.length;return i=!i&&T.isArray(o)?o.length:i,u?(T.hasOwnProp(o,i)?o[i]=[o[i],r]:o[i]=r,!a):((!o[i]||!T.isObject(o[i]))&&(o[i]=[]),t(n,r,o[i],s)&&T.isArray(o[i])&&(o[i]=gp(o[i])),!a)}if(T.isFormData(e)&&T.isFunction(e.entries)){const n={};return T.forEachEntry(e,(r,o)=>{t(pp(r),o,n,0)}),n}return null}function hp(e,t,n){if(T.isString(e))try{return(t||JSON.parse)(e),T.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const xn={transitional:Ki,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,s=T.isObject(t);if(s&&T.isHTMLForm(t)&&(t=new FormData(t)),T.isFormData(t))return o?JSON.stringify(Xi(t)):t;if(T.isArrayBuffer(t)||T.isBuffer(t)||T.isStream(t)||T.isFile(t)||T.isBlob(t)||T.isReadableStream(t))return t;if(T.isArrayBufferView(t))return t.buffer;if(T.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return fp(t,this.formSerializer).toString();if((a=T.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return Jn(a?{"files[]":t}:t,u&&new u,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),hp(t)):t}],transformResponse:[function(t){const n=this.transitional||xn.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(T.isResponse(t)||T.isReadableStream(t))return t;if(t&&T.isString(t)&&(r&&!this.responseType||o)){const i=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(a){if(i)throw a.name==="SyntaxError"?Q.from(a,Q.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Se.classes.FormData,Blob:Se.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};T.forEach(["delete","get","head","post","put","patch"],e=>{xn.headers[e]={}});const mp=T.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"]),vp=e=>{const t={};let n,r,o;return e&&e.split(`
23
- `).forEach(function(i){o=i.indexOf(":"),n=i.substring(0,o).trim().toLowerCase(),r=i.substring(o+1).trim(),!(!n||t[n]&&mp[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Yi=Symbol("internals");function Cn(e){return e&&String(e).trim().toLowerCase()}function Zn(e){return e===!1||e==null?e:T.isArray(e)?e.map(Zn):String(e)}function yp(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const wp=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function So(e,t,n,r,o){if(T.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!T.isString(t)){if(T.isString(r))return t.indexOf(r)!==-1;if(T.isRegExp(r))return r.test(t)}}function bp(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function xp(e,t){const n=T.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(o,s,i){return this[r].call(this,t,o,s,i)},configurable:!0})})}class Ae{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function s(a,u,c){const f=Cn(u);if(!f)throw new Error("header name must be a non-empty string");const g=T.findKey(o,f);(!g||o[g]===void 0||c===!0||c===void 0&&o[g]!==!1)&&(o[g||u]=Zn(a))}const i=(a,u)=>T.forEach(a,(c,f)=>s(c,f,u));if(T.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(T.isString(t)&&(t=t.trim())&&!wp(t))i(vp(t),n);else if(T.isHeaders(t))for(const[a,u]of t.entries())s(u,a,r);else t!=null&&s(n,t,r);return this}get(t,n){if(t=Cn(t),t){const r=T.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return yp(o);if(T.isFunction(n))return n.call(this,o,r);if(T.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Cn(t),t){const r=T.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||So(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function s(i){if(i=Cn(i),i){const a=T.findKey(r,i);a&&(!n||So(r,r[a],a,n))&&(delete r[a],o=!0)}}return T.isArray(t)?t.forEach(s):s(t),o}clear(t){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const s=n[r];(!t||So(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){const n=this,r={};return T.forEach(this,(o,s)=>{const i=T.findKey(r,s);if(i){n[i]=Zn(o),delete n[s];return}const a=t?bp(s):String(s).trim();a!==s&&delete n[s],n[a]=Zn(o),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return T.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&T.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
24
- `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[Yi]=this[Yi]={accessors:{}}).accessors,o=this.prototype;function s(i){const a=Cn(i);r[a]||(xp(o,i),r[a]=!0)}return T.isArray(t)?t.forEach(s):s(t),this}}Ae.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),T.reduceDescriptors(Ae.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),T.freezeMethods(Ae);function Eo(e,t){const n=this||xn,r=t||n,o=Ae.from(r.headers);let s=r.data;return T.forEach(e,function(a){s=a.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function Ji(e){return!!(e&&e.__CANCEL__)}function qt(e,t,n){Q.call(this,e??"canceled",Q.ERR_CANCELED,t,n),this.name="CanceledError"}T.inherits(qt,Q,{__CANCEL__:!0});function Zi(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Q("Request failed with status code "+n.status,[Q.ERR_BAD_REQUEST,Q.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Cp(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Sp(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,s=0,i;return t=t!==void 0?t:1e3,function(u){const c=Date.now(),f=r[s];i||(i=c),n[o]=u,r[o]=c;let g=s,m=0;for(;g!==o;)m+=n[g++],g=g%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),c-i<t)return;const p=f&&c-f;return p?Math.round(m*1e3/p):void 0}}function Ep(e,t){let n=0,r=1e3/t,o,s;const i=(c,f=Date.now())=>{n=f,o=null,s&&(clearTimeout(s),s=null),e.apply(null,c)};return[(...c)=>{const f=Date.now(),g=f-n;g>=r?i(c,f):(o=c,s||(s=setTimeout(()=>{s=null,i(o)},r-g)))},()=>o&&i(o)]}const Qn=(e,t,n=3)=>{let r=0;const o=Sp(50,250);return Ep(s=>{const i=s.loaded,a=s.lengthComputable?s.total:void 0,u=i-r,c=o(u),f=i<=a;r=i;const g={loaded:i,total:a,progress:a?i/a:void 0,bytes:u,rate:c||void 0,estimated:c&&a&&f?(a-i)/c:void 0,event:s,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(g)},n)},Qi=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ea=e=>(...t)=>T.asap(()=>e(...t)),Np=Se.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Se.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Se.origin),Se.navigator&&/(msie|trident)/i.test(Se.navigator.userAgent)):()=>!0,Tp=Se.hasStandardBrowserEnv?{write(e,t,n,r,o,s){const i=[e+"="+encodeURIComponent(t)];T.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),T.isString(r)&&i.push("path="+r),T.isString(o)&&i.push("domain="+o),s===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Pp(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Ap(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ta(e,t){return e&&!Pp(t)?Ap(e,t):t}const na=e=>e instanceof Ae?{...e}:e;function Lt(e,t){t=t||{};const n={};function r(c,f,g,m){return T.isPlainObject(c)&&T.isPlainObject(f)?T.merge.call({caseless:m},c,f):T.isPlainObject(f)?T.merge({},f):T.isArray(f)?f.slice():f}function o(c,f,g,m){if(T.isUndefined(f)){if(!T.isUndefined(c))return r(void 0,c,g,m)}else return r(c,f,g,m)}function s(c,f){if(!T.isUndefined(f))return r(void 0,f)}function i(c,f){if(T.isUndefined(f)){if(!T.isUndefined(c))return r(void 0,c)}else return r(void 0,f)}function a(c,f,g){if(g in t)return r(c,f);if(g in e)return r(void 0,c)}const u={url:s,method:s,data:s,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,responseEncoding:i,validateStatus:a,headers:(c,f,g)=>o(na(c),na(f),g,!0)};return T.forEach(Object.keys(Object.assign({},e,t)),function(f){const g=u[f]||o,m=g(e[f],t[f],f);T.isUndefined(m)&&g!==a||(n[f]=m)}),n}const ra=e=>{const t=Lt({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=t;t.headers=i=Ae.from(i),t.url=Gi(ta(t.baseURL,t.url),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let u;if(T.isFormData(n)){if(Se.hasStandardBrowserEnv||Se.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((u=i.getContentType())!==!1){const[c,...f]=u?u.split(";").map(g=>g.trim()).filter(Boolean):[];i.setContentType([c||"multipart/form-data",...f].join("; "))}}if(Se.hasStandardBrowserEnv&&(r&&T.isFunction(r)&&(r=r(t)),r||r!==!1&&Np(t.url))){const c=o&&s&&Tp.read(s);c&&i.set(o,c)}return t},_p=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const o=ra(e);let s=o.data;const i=Ae.from(o.headers).normalize();let{responseType:a,onUploadProgress:u,onDownloadProgress:c}=o,f,g,m,p,v;function h(){p&&p(),v&&v(),o.cancelToken&&o.cancelToken.unsubscribe(f),o.signal&&o.signal.removeEventListener("abort",f)}let y=new XMLHttpRequest;y.open(o.method.toUpperCase(),o.url,!0),y.timeout=o.timeout;function w(){if(!y)return;const S=Ae.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),C={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:S,config:e,request:y};Zi(function(_){n(_),h()},function(_){r(_),h()},C),y=null}"onloadend"in y?y.onloadend=w:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(w)},y.onabort=function(){y&&(r(new Q("Request aborted",Q.ECONNABORTED,e,y)),y=null)},y.onerror=function(){r(new Q("Network Error",Q.ERR_NETWORK,e,y)),y=null},y.ontimeout=function(){let E=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const C=o.transitional||Ki;o.timeoutErrorMessage&&(E=o.timeoutErrorMessage),r(new Q(E,C.clarifyTimeoutError?Q.ETIMEDOUT:Q.ECONNABORTED,e,y)),y=null},s===void 0&&i.setContentType(null),"setRequestHeader"in y&&T.forEach(i.toJSON(),function(E,C){y.setRequestHeader(C,E)}),T.isUndefined(o.withCredentials)||(y.withCredentials=!!o.withCredentials),a&&a!=="json"&&(y.responseType=o.responseType),c&&([m,v]=Qn(c,!0),y.addEventListener("progress",m)),u&&y.upload&&([g,p]=Qn(u),y.upload.addEventListener("progress",g),y.upload.addEventListener("loadend",p)),(o.cancelToken||o.signal)&&(f=S=>{y&&(r(!S||S.type?new qt(null,e,y):S),y.abort(),y=null)},o.cancelToken&&o.cancelToken.subscribe(f),o.signal&&(o.signal.aborted?f():o.signal.addEventListener("abort",f)));const x=Cp(o.url);if(x&&Se.protocols.indexOf(x)===-1){r(new Q("Unsupported protocol "+x+":",Q.ERR_BAD_REQUEST,e));return}y.send(s||null)})},Fp=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,o;const s=function(c){if(!o){o=!0,a();const f=c instanceof Error?c:this.reason;r.abort(f instanceof Q?f:new qt(f instanceof Error?f.message:f))}};let i=t&&setTimeout(()=>{i=null,s(new Q(`timeout ${t} of ms exceeded`,Q.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),e=null)};e.forEach(c=>c.addEventListener("abort",s));const{signal:u}=r;return u.unsubscribe=()=>T.asap(a),u}},Op=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,o;for(;r<n;)o=r+t,yield e.slice(r,o),r=o},Dp=async function*(e,t){for await(const n of Mp(e))yield*Op(n,t)},Mp=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},oa=(e,t,n,r)=>{const o=Dp(e,t);let s=0,i,a=u=>{i||(i=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:c,value:f}=await o.next();if(c){a(),u.close();return}let g=f.byteLength;if(n){let m=s+=g;n(m)}u.enqueue(new Uint8Array(f))}catch(c){throw a(c),c}},cancel(u){return a(u),o.return()}},{highWaterMark:2})},er=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",sa=er&&typeof ReadableStream=="function",kp=er&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),ia=(e,...t)=>{try{return!!e(...t)}catch{return!1}},$p=sa&&ia(()=>{let e=!1;const t=new Request(Se.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),aa=64*1024,No=sa&&ia(()=>T.isReadableStream(new Response("").body)),tr={stream:No&&(e=>e.body)};er&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!tr[t]&&(tr[t]=T.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new Q(`Response type '${t}' is not supported`,Q.ERR_NOT_SUPPORT,r)})})})(new Response);const Ip=async e=>{if(e==null)return 0;if(T.isBlob(e))return e.size;if(T.isSpecCompliantForm(e))return(await new Request(Se.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(T.isArrayBufferView(e)||T.isArrayBuffer(e))return e.byteLength;if(T.isURLSearchParams(e)&&(e=e+""),T.isString(e))return(await kp(e)).byteLength},Rp=async(e,t)=>{const n=T.toFiniteNumber(e.getContentLength());return n??Ip(t)},To={http:op,xhr:_p,fetch:er&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:s,timeout:i,onDownloadProgress:a,onUploadProgress:u,responseType:c,headers:f,withCredentials:g="same-origin",fetchOptions:m}=ra(e);c=c?(c+"").toLowerCase():"text";let p=Fp([o,s&&s.toAbortSignal()],i),v;const h=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let y;try{if(u&&$p&&n!=="get"&&n!=="head"&&(y=await Rp(f,r))!==0){let C=new Request(t,{method:"POST",body:r,duplex:"half"}),P;if(T.isFormData(r)&&(P=C.headers.get("content-type"))&&f.setContentType(P),C.body){const[_,O]=Qi(y,Qn(ea(u)));r=oa(C.body,aa,_,O)}}T.isString(g)||(g=g?"include":"omit");const w="credentials"in Request.prototype;v=new Request(t,{...m,signal:p,method:n.toUpperCase(),headers:f.normalize().toJSON(),body:r,duplex:"half",credentials:w?g:void 0});let x=await fetch(v);const S=No&&(c==="stream"||c==="response");if(No&&(a||S&&h)){const C={};["status","statusText","headers"].forEach(k=>{C[k]=x[k]});const P=T.toFiniteNumber(x.headers.get("content-length")),[_,O]=a&&Qi(P,Qn(ea(a),!0))||[];x=new Response(oa(x.body,aa,_,()=>{O&&O(),h&&h()}),C)}c=c||"text";let E=await tr[T.findKey(tr,c)||"text"](x,e);return!S&&h&&h(),await new Promise((C,P)=>{Zi(C,P,{data:E,headers:Ae.from(x.headers),status:x.status,statusText:x.statusText,config:e,request:v})})}catch(w){throw h&&h(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new Q("Network Error",Q.ERR_NETWORK,e,v),{cause:w.cause||w}):Q.from(w,w&&w.code,e,v)}})};T.forEach(To,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const la=e=>`- ${e}`,Lp=e=>T.isFunction(e)||e===null||e===!1,ca={getAdapter:e=>{e=T.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let s=0;s<t;s++){n=e[s];let i;if(r=n,!Lp(n)&&(r=To[(i=String(n)).toLowerCase()],r===void 0))throw new Q(`Unknown adapter '${i}'`);if(r)break;o[i||"#"+s]=r}if(!r){const s=Object.entries(o).map(([a,u])=>`adapter ${a} `+(u===!1?"is not supported by the environment":"is not available in the build"));let i=t?s.length>1?`since :
25
- `+s.map(la).join(`
26
- `):" "+la(s[0]):"as no adapter specified";throw new Q("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:To};function Po(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new qt(null,e)}function ua(e){return Po(e),e.headers=Ae.from(e.headers),e.data=Eo.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ca.getAdapter(e.adapter||xn.adapter)(e).then(function(r){return Po(e),r.data=Eo.call(e,e.transformResponse,r),r.headers=Ae.from(r.headers),r},function(r){return Ji(r)||(Po(e),r&&r.response&&(r.response.data=Eo.call(e,e.transformResponse,r.response),r.response.headers=Ae.from(r.response.headers))),Promise.reject(r)})}const da="1.7.9",nr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{nr[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const fa={};nr.transitional=function(t,n,r){function o(s,i){return"[Axios v"+da+"] Transitional option '"+s+"'"+i+(r?". "+r:"")}return(s,i,a)=>{if(t===!1)throw new Q(o(i," has been removed"+(n?" in "+n:"")),Q.ERR_DEPRECATED);return n&&!fa[i]&&(fa[i]=!0,console.warn(o(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,i,a):!0}},nr.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Vp(e,t,n){if(typeof e!="object")throw new Q("options must be an object",Q.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const a=e[s],u=a===void 0||i(a,s,e);if(u!==!0)throw new Q("option "+s+" must be "+u,Q.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Q("Unknown option "+s,Q.ERR_BAD_OPTION)}}const rr={assertOptions:Vp,validators:nr},Ze=rr.validators;class Vt{constructor(t){this.defaults=t,this.interceptors={request:new qi,response:new qi}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const s=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
27
- `+s):r.stack=s}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Lt(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&rr.assertOptions(r,{silentJSONParsing:Ze.transitional(Ze.boolean),forcedJSONParsing:Ze.transitional(Ze.boolean),clarifyTimeoutError:Ze.transitional(Ze.boolean)},!1),o!=null&&(T.isFunction(o)?n.paramsSerializer={serialize:o}:rr.assertOptions(o,{encode:Ze.function,serialize:Ze.function},!0)),rr.assertOptions(n,{baseUrl:Ze.spelling("baseURL"),withXsrfToken:Ze.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=s&&T.merge(s.common,s[n.method]);s&&T.forEach(["delete","get","head","post","put","patch","common"],v=>{delete s[v]}),n.headers=Ae.concat(i,s);const a=[];let u=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(u=u&&h.synchronous,a.unshift(h.fulfilled,h.rejected))});const c=[];this.interceptors.response.forEach(function(h){c.push(h.fulfilled,h.rejected)});let f,g=0,m;if(!u){const v=[ua.bind(this),void 0];for(v.unshift.apply(v,a),v.push.apply(v,c),m=v.length,f=Promise.resolve(n);g<m;)f=f.then(v[g++],v[g++]);return f}m=a.length;let p=n;for(g=0;g<m;){const v=a[g++],h=a[g++];try{p=v(p)}catch(y){h.call(this,y);break}}try{f=ua.call(this,p)}catch(v){return Promise.reject(v)}for(g=0,m=c.length;g<m;)f=f.then(c[g++],c[g++]);return f}getUri(t){t=Lt(this.defaults,t);const n=ta(t.baseURL,t.url);return Gi(n,t.params,t.paramsSerializer)}}T.forEach(["delete","get","head","options"],function(t){Vt.prototype[t]=function(n,r){return this.request(Lt(r||{},{method:t,url:n,data:(r||{}).data}))}}),T.forEach(["post","put","patch"],function(t){function n(r){return function(s,i,a){return this.request(Lt(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}Vt.prototype[t]=n(),Vt.prototype[t+"Form"]=n(!0)});class Ao{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(a=>{r.subscribe(a),s=a}).then(o);return i.cancel=function(){r.unsubscribe(s)},i},t(function(s,i,a){r.reason||(r.reason=new qt(s,i,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Ao(function(o){t=o}),cancel:t}}}function Bp(e){return function(n){return e.apply(null,n)}}function zp(e){return T.isObject(e)&&e.isAxiosError===!0}const _o={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};Object.entries(_o).forEach(([e,t])=>{_o[t]=e});function pa(e){const t=new Vt(e),n=Fi(Vt.prototype.request,t);return T.extend(n,Vt.prototype,t,{allOwnKeys:!0}),T.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return pa(Lt(e,o))},n}const oe=pa(xn);oe.Axios=Vt,oe.CanceledError=qt,oe.CancelToken=Ao,oe.isCancel=Ji,oe.VERSION=da,oe.toFormData=Jn,oe.AxiosError=Q,oe.Cancel=oe.CanceledError,oe.all=function(t){return Promise.all(t)},oe.spread=Bp,oe.isAxiosError=zp,oe.mergeConfig=Lt,oe.AxiosHeaders=Ae,oe.formToJSON=e=>Xi(T.isHTMLForm(e)?new FormData(e):e),oe.getAdapter=ca.getAdapter,oe.HttpStatusCode=_o,oe.default=oe;/**
22
+ */function qn(e,t){return e?wf(e)?d.createElement(e,t):e:null}function wf(e){return bf(e)||typeof e=="function"||xf(e)}function bf(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function xf(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Oi(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=d.useState(()=>({current:gf(t)})),[r,o]=d.useState(()=>n.current.initialState);return n.current.setOptions(s=>({...s,...e,state:{...r,...e.state},onStateChange:i=>{o(i),e.onStateChange==null||e.onStateChange(i)}})),n.current}function Di(e,t){return function(){return e.apply(t,arguments)}}const{toString:Cf}=Object.prototype,{getPrototypeOf:bo}=Object,Kn=(e=>t=>{const n=Cf.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),qe=e=>(e=e.toLowerCase(),t=>Kn(t)===e),Xn=e=>t=>typeof t===e,{isArray:Kt}=Array,wn=Xn("undefined");function Sf(e){return e!==null&&!wn(e)&&e.constructor!==null&&!wn(e.constructor)&&Ie(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Mi=qe("ArrayBuffer");function Ef(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Mi(e.buffer),t}const Nf=Xn("string"),Ie=Xn("function"),ki=Xn("number"),Yn=e=>e!==null&&typeof e=="object",Tf=e=>e===!0||e===!1,Jn=e=>{if(Kn(e)!=="object")return!1;const t=bo(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Pf=qe("Date"),Af=qe("File"),_f=qe("Blob"),Ff=qe("FileList"),Of=e=>Yn(e)&&Ie(e.pipe),Df=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ie(e.append)&&((t=Kn(e))==="formdata"||t==="object"&&Ie(e.toString)&&e.toString()==="[object FormData]"))},Mf=qe("URLSearchParams"),[kf,$f,If,Lf]=["ReadableStream","Request","Response","Headers"].map(qe),Rf=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function bn(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),Kt(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const s=n?Object.getOwnPropertyNames(e):Object.keys(e),i=s.length;let a;for(r=0;r<i;r++)a=s[r],t.call(null,e[a],a,e)}}function $i(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,o;for(;r-- >0;)if(o=n[r],t===o.toLowerCase())return o;return null}const Vt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ii=e=>!wn(e)&&e!==Vt;function xo(){const{caseless:e}=Ii(this)&&this||{},t={},n=(r,o)=>{const s=e&&$i(t,o)||o;Jn(t[s])&&Jn(r)?t[s]=xo(t[s],r):Jn(r)?t[s]=xo({},r):Kt(r)?t[s]=r.slice():t[s]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&bn(arguments[r],n);return t}const Vf=(e,t,n,{allOwnKeys:r}={})=>(bn(t,(o,s)=>{n&&Ie(o)?e[s]=Di(o,n):e[s]=o},{allOwnKeys:r}),e),Bf=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),zf=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Hf=(e,t,n,r)=>{let o,s,i;const a={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],(!r||r(i,e,t))&&!a[i]&&(t[i]=e[i],a[i]=!0);e=n!==!1&&bo(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Uf=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},jf=e=>{if(!e)return null;if(Kt(e))return e;let t=e.length;if(!ki(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Wf=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&bo(Uint8Array)),Gf=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=r.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},qf=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Kf=qe("HTMLFormElement"),Xf=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),Li=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Yf=qe("RegExp"),Ri=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};bn(n,(o,s)=>{let i;(i=t(o,s,e))!==!1&&(r[s]=i||o)}),Object.defineProperties(e,r)},Jf=e=>{Ri(e,(t,n)=>{if(Ie(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Ie(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Zf=(e,t)=>{const n={},r=o=>{o.forEach(s=>{n[s]=!0})};return Kt(e)?r(e):r(String(e).split(t)),n},Qf=()=>{},ep=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Co="abcdefghijklmnopqrstuvwxyz",Vi="0123456789",Bi={DIGIT:Vi,ALPHA:Co,ALPHA_DIGIT:Co+Co.toUpperCase()+Vi},tp=(e=16,t=Bi.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function np(e){return!!(e&&Ie(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const rp=e=>{const t=new Array(10),n=(r,o)=>{if(Yn(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[o]=r;const s=Kt(r)?[]:{};return bn(r,(i,a)=>{const u=n(i,o+1);!wn(u)&&(s[a]=u)}),t[o]=void 0,s}}return r};return n(e,0)},op=qe("AsyncFunction"),sp=e=>e&&(Yn(e)||Ie(e))&&Ie(e.then)&&Ie(e.catch),zi=((e,t)=>e?setImmediate:t?((n,r)=>(Vt.addEventListener("message",({source:o,data:s})=>{o===Vt&&s===n&&r.length&&r.shift()()},!1),o=>{r.push(o),Vt.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ie(Vt.postMessage)),ip=typeof queueMicrotask<"u"?queueMicrotask.bind(Vt):typeof process<"u"&&process.nextTick||zi,T={isArray:Kt,isArrayBuffer:Mi,isBuffer:Sf,isFormData:Df,isArrayBufferView:Ef,isString:Nf,isNumber:ki,isBoolean:Tf,isObject:Yn,isPlainObject:Jn,isReadableStream:kf,isRequest:$f,isResponse:If,isHeaders:Lf,isUndefined:wn,isDate:Pf,isFile:Af,isBlob:_f,isRegExp:Yf,isFunction:Ie,isStream:Of,isURLSearchParams:Mf,isTypedArray:Wf,isFileList:Ff,forEach:bn,merge:xo,extend:Vf,trim:Rf,stripBOM:Bf,inherits:zf,toFlatObject:Hf,kindOf:Kn,kindOfTest:qe,endsWith:Uf,toArray:jf,forEachEntry:Gf,matchAll:qf,isHTMLForm:Kf,hasOwnProperty:Li,hasOwnProp:Li,reduceDescriptors:Ri,freezeMethods:Jf,toObjectSet:Zf,toCamelCase:Xf,noop:Qf,toFiniteNumber:ep,findKey:$i,global:Vt,isContextDefined:Ii,ALPHABET:Bi,generateString:tp,isSpecCompliantForm:np,toJSONObject:rp,isAsyncFn:op,isThenable:sp,setImmediate:zi,asap:ip};function te(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}T.inherits(te,Error,{toJSON:function(){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:T.toJSONObject(this.config),code:this.code,status:this.status}}});const Hi=te.prototype,Ui={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Ui[e]={value:e}}),Object.defineProperties(te,Ui),Object.defineProperty(Hi,"isAxiosError",{value:!0}),te.from=(e,t,n,r,o,s)=>{const i=Object.create(Hi);return T.toFlatObject(e,i,function(u){return u!==Error.prototype},a=>a!=="isAxiosError"),te.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const ap=null;function So(e){return T.isPlainObject(e)||T.isArray(e)}function ji(e){return T.endsWith(e,"[]")?e.slice(0,-2):e}function Wi(e,t,n){return e?e.concat(t).map(function(o,s){return o=ji(o),!n&&s?"["+o+"]":o}).join(n?".":""):t}function lp(e){return T.isArray(e)&&!e.some(So)}const cp=T.toFlatObject(T,{},null,function(t){return/^is[A-Z]/.test(t)});function Zn(e,t,n){if(!T.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=T.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,y){return!T.isUndefined(y[h])});const r=n.metaTokens,o=n.visitor||f,s=n.dots,i=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&T.isSpecCompliantForm(t);if(!T.isFunction(o))throw new TypeError("visitor must be a function");function c(v){if(v===null)return"";if(T.isDate(v))return v.toISOString();if(!u&&T.isBlob(v))throw new te("Blob is not supported. Use a Buffer instead.");return T.isArrayBuffer(v)||T.isTypedArray(v)?u&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function f(v,h,y){let w=v;if(v&&!y&&typeof v=="object"){if(T.endsWith(h,"{}"))h=r?h:h.slice(0,-2),v=JSON.stringify(v);else if(T.isArray(v)&&lp(v)||(T.isFileList(v)||T.endsWith(h,"[]"))&&(w=T.toArray(v)))return h=ji(h),w.forEach(function(S,E){!(T.isUndefined(S)||S===null)&&t.append(i===!0?Wi([h],E,s):i===null?h:h+"[]",c(S))}),!1}return So(v)?!0:(t.append(Wi(y,h,s),c(v)),!1)}const g=[],m=Object.assign(cp,{defaultVisitor:f,convertValue:c,isVisitable:So});function p(v,h){if(!T.isUndefined(v)){if(g.indexOf(v)!==-1)throw Error("Circular reference detected in "+h.join("."));g.push(v),T.forEach(v,function(w,b){(!(T.isUndefined(w)||w===null)&&o.call(t,w,T.isString(b)?b.trim():b,h,m))===!0&&p(w,h?h.concat(b):[b])}),g.pop()}}if(!T.isObject(e))throw new TypeError("data must be an object");return p(e),t}function Gi(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Eo(e,t){this._pairs=[],e&&Zn(e,this,t)}const qi=Eo.prototype;qi.append=function(t,n){this._pairs.push([t,n])},qi.toString=function(t){const n=t?function(r){return t.call(this,r,Gi)}:Gi;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function up(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ki(e,t,n){if(!t)return e;const r=n&&n.encode||up;T.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(o?s=o(t,n):s=T.isURLSearchParams(t)?t.toString():new Eo(t,n).toString(r),s){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class Xi{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){T.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Yi={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},dp={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Eo,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},No=typeof window<"u"&&typeof document<"u",To=typeof navigator=="object"&&navigator||void 0,fp=No&&(!To||["ReactNative","NativeScript","NS"].indexOf(To.product)<0),pp=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",gp=No&&window.location.href||"http://localhost",Ne={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:No,hasStandardBrowserEnv:fp,hasStandardBrowserWebWorkerEnv:pp,navigator:To,origin:gp},Symbol.toStringTag,{value:"Module"})),...dp};function hp(e,t){return Zn(e,new Ne.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,s){return Ne.isNode&&T.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function mp(e){return T.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function vp(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}function Ji(e){function t(n,r,o,s){let i=n[s++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),u=s>=n.length;return i=!i&&T.isArray(o)?o.length:i,u?(T.hasOwnProp(o,i)?o[i]=[o[i],r]:o[i]=r,!a):((!o[i]||!T.isObject(o[i]))&&(o[i]=[]),t(n,r,o[i],s)&&T.isArray(o[i])&&(o[i]=vp(o[i])),!a)}if(T.isFormData(e)&&T.isFunction(e.entries)){const n={};return T.forEachEntry(e,(r,o)=>{t(mp(r),o,n,0)}),n}return null}function yp(e,t,n){if(T.isString(e))try{return(t||JSON.parse)(e),T.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const xn={transitional:Yi,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,s=T.isObject(t);if(s&&T.isHTMLForm(t)&&(t=new FormData(t)),T.isFormData(t))return o?JSON.stringify(Ji(t)):t;if(T.isArrayBuffer(t)||T.isBuffer(t)||T.isStream(t)||T.isFile(t)||T.isBlob(t)||T.isReadableStream(t))return t;if(T.isArrayBufferView(t))return t.buffer;if(T.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return hp(t,this.formSerializer).toString();if((a=T.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return Zn(a?{"files[]":t}:t,u&&new u,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),yp(t)):t}],transformResponse:[function(t){const n=this.transitional||xn.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(T.isResponse(t)||T.isReadableStream(t))return t;if(t&&T.isString(t)&&(r&&!this.responseType||o)){const i=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(a){if(i)throw a.name==="SyntaxError"?te.from(a,te.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ne.classes.FormData,Blob:Ne.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};T.forEach(["delete","get","head","post","put","patch"],e=>{xn.headers[e]={}});const wp=T.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"]),bp=e=>{const t={};let n,r,o;return e&&e.split(`
23
+ `).forEach(function(i){o=i.indexOf(":"),n=i.substring(0,o).trim().toLowerCase(),r=i.substring(o+1).trim(),!(!n||t[n]&&wp[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Zi=Symbol("internals");function Cn(e){return e&&String(e).trim().toLowerCase()}function Qn(e){return e===!1||e==null?e:T.isArray(e)?e.map(Qn):String(e)}function xp(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Cp=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Po(e,t,n,r,o){if(T.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!T.isString(t)){if(T.isString(r))return t.indexOf(r)!==-1;if(T.isRegExp(r))return r.test(t)}}function Sp(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Ep(e,t){const n=T.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(o,s,i){return this[r].call(this,t,o,s,i)},configurable:!0})})}class _e{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function s(a,u,c){const f=Cn(u);if(!f)throw new Error("header name must be a non-empty string");const g=T.findKey(o,f);(!g||o[g]===void 0||c===!0||c===void 0&&o[g]!==!1)&&(o[g||u]=Qn(a))}const i=(a,u)=>T.forEach(a,(c,f)=>s(c,f,u));if(T.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(T.isString(t)&&(t=t.trim())&&!Cp(t))i(bp(t),n);else if(T.isHeaders(t))for(const[a,u]of t.entries())s(u,a,r);else t!=null&&s(n,t,r);return this}get(t,n){if(t=Cn(t),t){const r=T.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return xp(o);if(T.isFunction(n))return n.call(this,o,r);if(T.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Cn(t),t){const r=T.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Po(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function s(i){if(i=Cn(i),i){const a=T.findKey(r,i);a&&(!n||Po(r,r[a],a,n))&&(delete r[a],o=!0)}}return T.isArray(t)?t.forEach(s):s(t),o}clear(t){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const s=n[r];(!t||Po(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){const n=this,r={};return T.forEach(this,(o,s)=>{const i=T.findKey(r,s);if(i){n[i]=Qn(o),delete n[s];return}const a=t?Sp(s):String(s).trim();a!==s&&delete n[s],n[a]=Qn(o),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return T.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&T.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
24
+ `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[Zi]=this[Zi]={accessors:{}}).accessors,o=this.prototype;function s(i){const a=Cn(i);r[a]||(Ep(o,i),r[a]=!0)}return T.isArray(t)?t.forEach(s):s(t),this}}_e.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),T.reduceDescriptors(_e.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),T.freezeMethods(_e);function Ao(e,t){const n=this||xn,r=t||n,o=_e.from(r.headers);let s=r.data;return T.forEach(e,function(a){s=a.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function Qi(e){return!!(e&&e.__CANCEL__)}function Xt(e,t,n){te.call(this,e??"canceled",te.ERR_CANCELED,t,n),this.name="CanceledError"}T.inherits(Xt,te,{__CANCEL__:!0});function ea(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new te("Request failed with status code "+n.status,[te.ERR_BAD_REQUEST,te.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Np(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Tp(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,s=0,i;return t=t!==void 0?t:1e3,function(u){const c=Date.now(),f=r[s];i||(i=c),n[o]=u,r[o]=c;let g=s,m=0;for(;g!==o;)m+=n[g++],g=g%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),c-i<t)return;const p=f&&c-f;return p?Math.round(m*1e3/p):void 0}}function Pp(e,t){let n=0,r=1e3/t,o,s;const i=(c,f=Date.now())=>{n=f,o=null,s&&(clearTimeout(s),s=null),e.apply(null,c)};return[(...c)=>{const f=Date.now(),g=f-n;g>=r?i(c,f):(o=c,s||(s=setTimeout(()=>{s=null,i(o)},r-g)))},()=>o&&i(o)]}const er=(e,t,n=3)=>{let r=0;const o=Tp(50,250);return Pp(s=>{const i=s.loaded,a=s.lengthComputable?s.total:void 0,u=i-r,c=o(u),f=i<=a;r=i;const g={loaded:i,total:a,progress:a?i/a:void 0,bytes:u,rate:c||void 0,estimated:c&&a&&f?(a-i)/c:void 0,event:s,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(g)},n)},ta=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},na=e=>(...t)=>T.asap(()=>e(...t)),Ap=Ne.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Ne.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Ne.origin),Ne.navigator&&/(msie|trident)/i.test(Ne.navigator.userAgent)):()=>!0,_p=Ne.hasStandardBrowserEnv?{write(e,t,n,r,o,s){const i=[e+"="+encodeURIComponent(t)];T.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),T.isString(r)&&i.push("path="+r),T.isString(o)&&i.push("domain="+o),s===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Fp(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Op(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ra(e,t){return e&&!Fp(t)?Op(e,t):t}const oa=e=>e instanceof _e?{...e}:e;function Bt(e,t){t=t||{};const n={};function r(c,f,g,m){return T.isPlainObject(c)&&T.isPlainObject(f)?T.merge.call({caseless:m},c,f):T.isPlainObject(f)?T.merge({},f):T.isArray(f)?f.slice():f}function o(c,f,g,m){if(T.isUndefined(f)){if(!T.isUndefined(c))return r(void 0,c,g,m)}else return r(c,f,g,m)}function s(c,f){if(!T.isUndefined(f))return r(void 0,f)}function i(c,f){if(T.isUndefined(f)){if(!T.isUndefined(c))return r(void 0,c)}else return r(void 0,f)}function a(c,f,g){if(g in t)return r(c,f);if(g in e)return r(void 0,c)}const u={url:s,method:s,data:s,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,responseEncoding:i,validateStatus:a,headers:(c,f,g)=>o(oa(c),oa(f),g,!0)};return T.forEach(Object.keys(Object.assign({},e,t)),function(f){const g=u[f]||o,m=g(e[f],t[f],f);T.isUndefined(m)&&g!==a||(n[f]=m)}),n}const sa=e=>{const t=Bt({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=t;t.headers=i=_e.from(i),t.url=Ki(ra(t.baseURL,t.url),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let u;if(T.isFormData(n)){if(Ne.hasStandardBrowserEnv||Ne.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((u=i.getContentType())!==!1){const[c,...f]=u?u.split(";").map(g=>g.trim()).filter(Boolean):[];i.setContentType([c||"multipart/form-data",...f].join("; "))}}if(Ne.hasStandardBrowserEnv&&(r&&T.isFunction(r)&&(r=r(t)),r||r!==!1&&Ap(t.url))){const c=o&&s&&_p.read(s);c&&i.set(o,c)}return t},Dp=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const o=sa(e);let s=o.data;const i=_e.from(o.headers).normalize();let{responseType:a,onUploadProgress:u,onDownloadProgress:c}=o,f,g,m,p,v;function h(){p&&p(),v&&v(),o.cancelToken&&o.cancelToken.unsubscribe(f),o.signal&&o.signal.removeEventListener("abort",f)}let y=new XMLHttpRequest;y.open(o.method.toUpperCase(),o.url,!0),y.timeout=o.timeout;function w(){if(!y)return;const S=_e.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),x={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:S,config:e,request:y};ea(function(_){n(_),h()},function(_){r(_),h()},x),y=null}"onloadend"in y?y.onloadend=w:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(w)},y.onabort=function(){y&&(r(new te("Request aborted",te.ECONNABORTED,e,y)),y=null)},y.onerror=function(){r(new te("Network Error",te.ERR_NETWORK,e,y)),y=null},y.ontimeout=function(){let E=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const x=o.transitional||Yi;o.timeoutErrorMessage&&(E=o.timeoutErrorMessage),r(new te(E,x.clarifyTimeoutError?te.ETIMEDOUT:te.ECONNABORTED,e,y)),y=null},s===void 0&&i.setContentType(null),"setRequestHeader"in y&&T.forEach(i.toJSON(),function(E,x){y.setRequestHeader(x,E)}),T.isUndefined(o.withCredentials)||(y.withCredentials=!!o.withCredentials),a&&a!=="json"&&(y.responseType=o.responseType),c&&([m,v]=er(c,!0),y.addEventListener("progress",m)),u&&y.upload&&([g,p]=er(u),y.upload.addEventListener("progress",g),y.upload.addEventListener("loadend",p)),(o.cancelToken||o.signal)&&(f=S=>{y&&(r(!S||S.type?new Xt(null,e,y):S),y.abort(),y=null)},o.cancelToken&&o.cancelToken.subscribe(f),o.signal&&(o.signal.aborted?f():o.signal.addEventListener("abort",f)));const b=Np(o.url);if(b&&Ne.protocols.indexOf(b)===-1){r(new te("Unsupported protocol "+b+":",te.ERR_BAD_REQUEST,e));return}y.send(s||null)})},Mp=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,o;const s=function(c){if(!o){o=!0,a();const f=c instanceof Error?c:this.reason;r.abort(f instanceof te?f:new Xt(f instanceof Error?f.message:f))}};let i=t&&setTimeout(()=>{i=null,s(new te(`timeout ${t} of ms exceeded`,te.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),e=null)};e.forEach(c=>c.addEventListener("abort",s));const{signal:u}=r;return u.unsubscribe=()=>T.asap(a),u}},kp=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,o;for(;r<n;)o=r+t,yield e.slice(r,o),r=o},$p=async function*(e,t){for await(const n of Ip(e))yield*kp(n,t)},Ip=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},ia=(e,t,n,r)=>{const o=$p(e,t);let s=0,i,a=u=>{i||(i=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:c,value:f}=await o.next();if(c){a(),u.close();return}let g=f.byteLength;if(n){let m=s+=g;n(m)}u.enqueue(new Uint8Array(f))}catch(c){throw a(c),c}},cancel(u){return a(u),o.return()}},{highWaterMark:2})},tr=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",aa=tr&&typeof ReadableStream=="function",Lp=tr&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),la=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Rp=aa&&la(()=>{let e=!1;const t=new Request(Ne.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),ca=64*1024,_o=aa&&la(()=>T.isReadableStream(new Response("").body)),nr={stream:_o&&(e=>e.body)};tr&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!nr[t]&&(nr[t]=T.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new te(`Response type '${t}' is not supported`,te.ERR_NOT_SUPPORT,r)})})})(new Response);const Vp=async e=>{if(e==null)return 0;if(T.isBlob(e))return e.size;if(T.isSpecCompliantForm(e))return(await new Request(Ne.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(T.isArrayBufferView(e)||T.isArrayBuffer(e))return e.byteLength;if(T.isURLSearchParams(e)&&(e=e+""),T.isString(e))return(await Lp(e)).byteLength},Bp=async(e,t)=>{const n=T.toFiniteNumber(e.getContentLength());return n??Vp(t)},Fo={http:ap,xhr:Dp,fetch:tr&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:s,timeout:i,onDownloadProgress:a,onUploadProgress:u,responseType:c,headers:f,withCredentials:g="same-origin",fetchOptions:m}=sa(e);c=c?(c+"").toLowerCase():"text";let p=Mp([o,s&&s.toAbortSignal()],i),v;const h=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let y;try{if(u&&Rp&&n!=="get"&&n!=="head"&&(y=await Bp(f,r))!==0){let x=new Request(t,{method:"POST",body:r,duplex:"half"}),P;if(T.isFormData(r)&&(P=x.headers.get("content-type"))&&f.setContentType(P),x.body){const[_,O]=ta(y,er(na(u)));r=ia(x.body,ca,_,O)}}T.isString(g)||(g=g?"include":"omit");const w="credentials"in Request.prototype;v=new Request(t,{...m,signal:p,method:n.toUpperCase(),headers:f.normalize().toJSON(),body:r,duplex:"half",credentials:w?g:void 0});let b=await fetch(v);const S=_o&&(c==="stream"||c==="response");if(_o&&(a||S&&h)){const x={};["status","statusText","headers"].forEach(k=>{x[k]=b[k]});const P=T.toFiniteNumber(b.headers.get("content-length")),[_,O]=a&&ta(P,er(na(a),!0))||[];b=new Response(ia(b.body,ca,_,()=>{O&&O(),h&&h()}),x)}c=c||"text";let E=await nr[T.findKey(nr,c)||"text"](b,e);return!S&&h&&h(),await new Promise((x,P)=>{ea(x,P,{data:E,headers:_e.from(b.headers),status:b.status,statusText:b.statusText,config:e,request:v})})}catch(w){throw h&&h(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new te("Network Error",te.ERR_NETWORK,e,v),{cause:w.cause||w}):te.from(w,w&&w.code,e,v)}})};T.forEach(Fo,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const ua=e=>`- ${e}`,zp=e=>T.isFunction(e)||e===null||e===!1,da={getAdapter:e=>{e=T.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let s=0;s<t;s++){n=e[s];let i;if(r=n,!zp(n)&&(r=Fo[(i=String(n)).toLowerCase()],r===void 0))throw new te(`Unknown adapter '${i}'`);if(r)break;o[i||"#"+s]=r}if(!r){const s=Object.entries(o).map(([a,u])=>`adapter ${a} `+(u===!1?"is not supported by the environment":"is not available in the build"));let i=t?s.length>1?`since :
25
+ `+s.map(ua).join(`
26
+ `):" "+ua(s[0]):"as no adapter specified";throw new te("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:Fo};function Oo(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Xt(null,e)}function fa(e){return Oo(e),e.headers=_e.from(e.headers),e.data=Ao.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),da.getAdapter(e.adapter||xn.adapter)(e).then(function(r){return Oo(e),r.data=Ao.call(e,e.transformResponse,r),r.headers=_e.from(r.headers),r},function(r){return Qi(r)||(Oo(e),r&&r.response&&(r.response.data=Ao.call(e,e.transformResponse,r.response),r.response.headers=_e.from(r.response.headers))),Promise.reject(r)})}const pa="1.7.9",rr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{rr[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const ga={};rr.transitional=function(t,n,r){function o(s,i){return"[Axios v"+pa+"] Transitional option '"+s+"'"+i+(r?". "+r:"")}return(s,i,a)=>{if(t===!1)throw new te(o(i," has been removed"+(n?" in "+n:"")),te.ERR_DEPRECATED);return n&&!ga[i]&&(ga[i]=!0,console.warn(o(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,i,a):!0}},rr.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Hp(e,t,n){if(typeof e!="object")throw new te("options must be an object",te.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const a=e[s],u=a===void 0||i(a,s,e);if(u!==!0)throw new te("option "+s+" must be "+u,te.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new te("Unknown option "+s,te.ERR_BAD_OPTION)}}const or={assertOptions:Hp,validators:rr},et=or.validators;class zt{constructor(t){this.defaults=t,this.interceptors={request:new Xi,response:new Xi}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const s=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
27
+ `+s):r.stack=s}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Bt(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&or.assertOptions(r,{silentJSONParsing:et.transitional(et.boolean),forcedJSONParsing:et.transitional(et.boolean),clarifyTimeoutError:et.transitional(et.boolean)},!1),o!=null&&(T.isFunction(o)?n.paramsSerializer={serialize:o}:or.assertOptions(o,{encode:et.function,serialize:et.function},!0)),or.assertOptions(n,{baseUrl:et.spelling("baseURL"),withXsrfToken:et.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=s&&T.merge(s.common,s[n.method]);s&&T.forEach(["delete","get","head","post","put","patch","common"],v=>{delete s[v]}),n.headers=_e.concat(i,s);const a=[];let u=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(u=u&&h.synchronous,a.unshift(h.fulfilled,h.rejected))});const c=[];this.interceptors.response.forEach(function(h){c.push(h.fulfilled,h.rejected)});let f,g=0,m;if(!u){const v=[fa.bind(this),void 0];for(v.unshift.apply(v,a),v.push.apply(v,c),m=v.length,f=Promise.resolve(n);g<m;)f=f.then(v[g++],v[g++]);return f}m=a.length;let p=n;for(g=0;g<m;){const v=a[g++],h=a[g++];try{p=v(p)}catch(y){h.call(this,y);break}}try{f=fa.call(this,p)}catch(v){return Promise.reject(v)}for(g=0,m=c.length;g<m;)f=f.then(c[g++],c[g++]);return f}getUri(t){t=Bt(this.defaults,t);const n=ra(t.baseURL,t.url);return Ki(n,t.params,t.paramsSerializer)}}T.forEach(["delete","get","head","options"],function(t){zt.prototype[t]=function(n,r){return this.request(Bt(r||{},{method:t,url:n,data:(r||{}).data}))}}),T.forEach(["post","put","patch"],function(t){function n(r){return function(s,i,a){return this.request(Bt(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}zt.prototype[t]=n(),zt.prototype[t+"Form"]=n(!0)});class Do{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(a=>{r.subscribe(a),s=a}).then(o);return i.cancel=function(){r.unsubscribe(s)},i},t(function(s,i,a){r.reason||(r.reason=new Xt(s,i,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Do(function(o){t=o}),cancel:t}}}function Up(e){return function(n){return e.apply(null,n)}}function jp(e){return T.isObject(e)&&e.isAxiosError===!0}const Mo={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};Object.entries(Mo).forEach(([e,t])=>{Mo[t]=e});function ha(e){const t=new zt(e),n=Di(zt.prototype.request,t);return T.extend(n,zt.prototype,t,{allOwnKeys:!0}),T.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return ha(Bt(e,o))},n}const oe=ha(xn);oe.Axios=zt,oe.CanceledError=Xt,oe.CancelToken=Do,oe.isCancel=Qi,oe.VERSION=pa,oe.toFormData=Zn,oe.AxiosError=te,oe.Cancel=oe.CanceledError,oe.all=function(t){return Promise.all(t)},oe.spread=Up,oe.isAxiosError=jp,oe.mergeConfig=Bt,oe.AxiosHeaders=_e,oe.formToJSON=e=>Ji(T.isHTMLForm(e)?new FormData(e):e),oe.getAdapter=da.getAdapter,oe.HttpStatusCode=Mo,oe.default=oe;/**
28
28
  * @license lucide-react v0.468.0 - ISC
29
29
  *
30
30
  * This source code is licensed under the ISC license.
31
31
  * See the LICENSE file in the root directory of this source tree.
32
- */const Hp=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ga=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
32
+ */const Wp=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ma=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
33
33
  * @license lucide-react v0.468.0 - ISC
34
34
  *
35
35
  * This source code is licensed under the ISC license.
36
36
  * See the LICENSE file in the root directory of this source tree.
37
- */var Up={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"};/**
37
+ */var Gp={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"};/**
38
38
  * @license lucide-react v0.468.0 - ISC
39
39
  *
40
40
  * This source code is licensed under the ISC license.
41
41
  * See the LICENSE file in the root directory of this source tree.
42
- */const jp=D.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},u)=>D.createElement("svg",{ref:u,...Up,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:ga("lucide",o),...a},[...i.map(([c,f])=>D.createElement(c,f)),...Array.isArray(s)?s:[s]]));/**
42
+ */const qp=D.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},u)=>D.createElement("svg",{ref:u,...Gp,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:ma("lucide",o),...a},[...i.map(([c,f])=>D.createElement(c,f)),...Array.isArray(s)?s:[s]]));/**
43
43
  * @license lucide-react v0.468.0 - ISC
44
44
  *
45
45
  * This source code is licensed under the ISC license.
46
46
  * See the LICENSE file in the root directory of this source tree.
47
- */const lt=(e,t)=>{const n=D.forwardRef(({className:r,...o},s)=>D.createElement(jp,{ref:s,iconNode:t,className:ga(`lucide-${Hp(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
47
+ */const dt=(e,t)=>{const n=D.forwardRef(({className:r,...o},s)=>D.createElement(qp,{ref:s,iconNode:t,className:ma(`lucide-${Wp(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
48
48
  * @license lucide-react v0.468.0 - ISC
49
49
  *
50
50
  * This source code is licensed under the ISC license.
51
51
  * See the LICENSE file in the root directory of this source tree.
52
- */const Wp=lt("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/**
52
+ */const Kp=dt("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/**
53
53
  * @license lucide-react v0.468.0 - ISC
54
54
  *
55
55
  * This source code is licensed under the ISC license.
56
56
  * See the LICENSE file in the root directory of this source tree.
57
- */const Gp=lt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
57
+ */const Xp=dt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
58
58
  * @license lucide-react v0.468.0 - ISC
59
59
  *
60
60
  * This source code is licensed under the ISC license.
61
61
  * See the LICENSE file in the root directory of this source tree.
62
- */const qp=lt("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
62
+ */const Yp=dt("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
63
63
  * @license lucide-react v0.468.0 - ISC
64
64
  *
65
65
  * This source code is licensed under the ISC license.
66
66
  * See the LICENSE file in the root directory of this source tree.
67
- */const ha=lt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
67
+ */const va=dt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
68
68
  * @license lucide-react v0.468.0 - ISC
69
69
  *
70
70
  * This source code is licensed under the ISC license.
71
71
  * See the LICENSE file in the root directory of this source tree.
72
- */const Kp=lt("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
72
+ */const Jp=dt("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
73
73
  * @license lucide-react v0.468.0 - ISC
74
74
  *
75
75
  * This source code is licensed under the ISC license.
76
76
  * See the LICENSE file in the root directory of this source tree.
77
- */const Xp=lt("Eye",[["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"}]]);/**
77
+ */const Zp=dt("Eye",[["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"}]]);/**
78
78
  * @license lucide-react v0.468.0 - ISC
79
79
  *
80
80
  * This source code is licensed under the ISC license.
81
81
  * See the LICENSE file in the root directory of this source tree.
82
- */const be=lt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
82
+ */const Ce=dt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
83
83
  * @license lucide-react v0.468.0 - ISC
84
84
  *
85
85
  * This source code is licensed under the ISC license.
86
86
  * See the LICENSE file in the root directory of this source tree.
87
- */const Yp=lt("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
87
+ */const Qp=dt("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
88
88
  * @license lucide-react v0.468.0 - ISC
89
89
  *
90
90
  * This source code is licensed under the ISC license.
91
91
  * See the LICENSE file in the root directory of this source tree.
92
- */const Fo=lt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function ma(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Jp(...e){return t=>{let n=!1;const r=e.map(o=>{const s=ma(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():ma(e[o],null)}}}}var Kt=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Zp);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(Oo,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Oo,{...r,ref:t,children:n})});Kt.displayName="Slot";var Oo=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=eg(n);return d.cloneElement(n,{...Qp(r,n.props),ref:t?Jp(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Oo.displayName="SlotClone";var va=({children:e})=>l.jsx(l.Fragment,{children:e});function Zp(e){return d.isValidElement(e)&&e.type===va}function Qp(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function eg(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ya(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=ya(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function wa(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=ya(e))&&(r&&(r+=" "),r+=t);return r}const Do="-",tg=e=>{const t=rg(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(Do);return a[0]===""&&a.length!==1&&a.shift(),ba(a,t)||ng(i)},getConflictingClassGroupIds:(i,a)=>{const u=n[i]||[];return a&&r[i]?[...u,...r[i]]:u}}},ba=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?ba(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Do);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},xa=/^\[(.+)\]$/,ng=e=>{if(xa.test(e)){const t=xa.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},rg=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return sg(Object.entries(e.classGroups),n).forEach(([s,i])=>{Mo(i,r,s,t)}),r},Mo=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:Ca(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(og(o)){Mo(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{Mo(i,Ca(t,s),n,r)})})},Ca=(e,t)=>{let n=e;return t.split(Do).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},og=e=>e.isThemeGetter,sg=(e,t)=>t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,a])=>[t+i,a])):s);return[n,o]}):e,ig=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},Sa="!",ag=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length,i=a=>{const u=[];let c=0,f=0,g;for(let y=0;y<a.length;y++){let w=a[y];if(c===0){if(w===o&&(r||a.slice(y,y+s)===t)){u.push(a.slice(f,y)),f=y+s;continue}if(w==="/"){g=y;continue}}w==="["?c++:w==="]"&&c--}const m=u.length===0?a:a.substring(f),p=m.startsWith(Sa),v=p?m.substring(1):m,h=g&&g>f?g-f:void 0;return{modifiers:u,hasImportantModifier:p,baseClassName:v,maybePostfixModifierPosition:h}};return n?a=>n({className:a,parseClassName:i}):i},lg=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},cg=e=>({cache:ig(e.cacheSize),parseClassName:ag(e),...tg(e)}),ug=/\s+/,dg=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(ug);let a="";for(let u=i.length-1;u>=0;u-=1){const c=i[u],{modifiers:f,hasImportantModifier:g,baseClassName:m,maybePostfixModifierPosition:p}=n(c);let v=!!p,h=r(v?m.substring(0,p):m);if(!h){if(!v){a=c+(a.length>0?" "+a:a);continue}if(h=r(m),!h){a=c+(a.length>0?" "+a:a);continue}v=!1}const y=lg(f).join(":"),w=g?y+Sa:y,x=w+h;if(s.includes(x))continue;s.push(x);const S=o(h,v);for(let E=0;E<S.length;++E){const C=S[E];s.push(w+C)}a=c+(a.length>0?" "+a:a)}return a};function fg(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Ea(t))&&(r&&(r+=" "),r+=n);return r}const Ea=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Ea(e[r]))&&(n&&(n+=" "),n+=t);return n};function pg(e,...t){let n,r,o,s=i;function i(u){const c=t.reduce((f,g)=>g(f),e());return n=cg(c),r=n.cache.get,o=n.cache.set,s=a,a(u)}function a(u){const c=r(u);if(c)return c;const f=dg(u,n);return o(u,f),f}return function(){return s(fg.apply(null,arguments))}}const ue=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Na=/^\[(?:([a-z-]+):)?(.+)\]$/i,gg=/^\d+\/\d+$/,hg=new Set(["px","full","screen"]),mg=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,vg=/\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$/,yg=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,wg=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,bg=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ct=e=>Xt(e)||hg.has(e)||gg.test(e),xt=e=>Yt(e,"length",Ag),Xt=e=>!!e&&!Number.isNaN(Number(e)),ko=e=>Yt(e,"number",Xt),Sn=e=>!!e&&Number.isInteger(Number(e)),xg=e=>e.endsWith("%")&&Xt(e.slice(0,-1)),ne=e=>Na.test(e),Ct=e=>mg.test(e),Cg=new Set(["length","size","percentage"]),Sg=e=>Yt(e,Cg,Ta),Eg=e=>Yt(e,"position",Ta),Ng=new Set(["image","url"]),Tg=e=>Yt(e,Ng,Fg),Pg=e=>Yt(e,"",_g),En=()=>!0,Yt=(e,t,n)=>{const r=Na.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Ag=e=>vg.test(e)&&!yg.test(e),Ta=()=>!1,_g=e=>wg.test(e),Fg=e=>bg.test(e),Og=pg(()=>{const e=ue("colors"),t=ue("spacing"),n=ue("blur"),r=ue("brightness"),o=ue("borderColor"),s=ue("borderRadius"),i=ue("borderSpacing"),a=ue("borderWidth"),u=ue("contrast"),c=ue("grayscale"),f=ue("hueRotate"),g=ue("invert"),m=ue("gap"),p=ue("gradientColorStops"),v=ue("gradientColorStopPositions"),h=ue("inset"),y=ue("margin"),w=ue("opacity"),x=ue("padding"),S=ue("saturate"),E=ue("scale"),C=ue("sepia"),P=ue("skew"),_=ue("space"),O=ue("translate"),k=()=>["auto","contain","none"],F=()=>["auto","hidden","clip","visible","scroll"],G=()=>["auto",ne,t],$=()=>[ne,t],R=()=>["",ct,xt],M=()=>["auto",Xt,ne],q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],U=()=>["solid","dashed","dotted","double","none"],X=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>["start","end","center","between","around","evenly","stretch"],ee=()=>["","0",ne],ie=()=>["auto","avoid","all","avoid-page","page","left","right","column"],fe=()=>[Xt,ne];return{cacheSize:500,separator:":",theme:{colors:[En],spacing:[ct,xt],blur:["none","",Ct,ne],brightness:fe(),borderColor:[e],borderRadius:["none","","full",Ct,ne],borderSpacing:$(),borderWidth:R(),contrast:fe(),grayscale:ee(),hueRotate:fe(),invert:ee(),gap:$(),gradientColorStops:[e],gradientColorStopPositions:[xg,xt],inset:G(),margin:G(),opacity:fe(),padding:$(),saturate:fe(),scale:fe(),sepia:ee(),skew:fe(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",ne]}],container:["container"],columns:[{columns:[Ct]}],"break-after":[{"break-after":ie()}],"break-before":[{"break-before":ie()}],"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"],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:[...q(),ne]}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Sn,ne]}],basis:[{basis:G()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ne]}],grow:[{grow:ee()}],shrink:[{shrink:ee()}],order:[{order:["first","last","none",Sn,ne]}],"grid-cols":[{"grid-cols":[En]}],"col-start-end":[{col:["auto",{span:["full",Sn,ne]},ne]}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":[En]}],"row-start-end":[{row:["auto",{span:[Sn,ne]},ne]}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ne]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ne]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...K()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...K(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...K(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ne,t]}],"min-w":[{"min-w":[ne,t,"min","max","fit"]}],"max-w":[{"max-w":[ne,t,"none","full","min","max","fit","prose",{screen:[Ct]},Ct]}],h:[{h:[ne,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ne,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ne,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ne,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ct,xt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ko]}],"font-family":[{font:[En]}],"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:["tighter","tight","normal","wide","wider","widest",ne]}],"line-clamp":[{"line-clamp":["none",Xt,ko]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ct,ne]}],"list-image":[{"list-image":["none",ne]}],"list-style-type":[{list:["none","disc","decimal",ne]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ct,xt]}],"underline-offset":[{"underline-offset":["auto",ct,ne]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ne]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...q(),Eg]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Sg]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Tg]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...U(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:U()}],"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-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()]}],"outline-offset":[{"outline-offset":[ct,ne]}],"outline-w":[{outline:[ct,xt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:R()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[ct,xt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ct,Pg]}],"shadow-color":[{shadow:[En]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...X(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":X()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",Ct,ne]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[g]}],saturate:[{saturate:[S]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ne]}],duration:[{duration:fe()}],ease:[{ease:["linear","in","out","in-out",ne]}],delay:[{delay:fe()}],animate:[{animate:["none","spin","ping","pulse","bounce",ne]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[Sn,ne]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ne]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",ne]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"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",ne]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ct,xt,ko]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-s","border-w-e","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-s","border-color-e","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"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","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-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"]}}});function Z(...e){return Og(wa(e))}const Dg=e=>{if(e===0)return"0 Bytes";const t=1024,n=["Bytes","KB","MB","GB","TB"],r=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/Math.pow(t,r)).toFixed(2))} ${n[r]}`},Pa=d.forwardRef(({className:e,...t},n)=>l.jsx("nav",{ref:n,"aria-label":"breadcrumb",className:Z("s3-explr-ui-breadcrumb",e),...t}));Pa.displayName="Breadcrumb";const Aa=d.forwardRef(({className:e,...t},n)=>l.jsx("ol",{ref:n,className:Z("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5","s3-explr-ui-breadcrumb-list",e),...t}));Aa.displayName="BreadcrumbList";const $o=d.forwardRef(({className:e,...t},n)=>l.jsx("li",{ref:n,className:Z("inline-flex items-center gap-1.5","s3-explr-ui-breadcrumb-item",e),...t}));$o.displayName="BreadcrumbItem";const Io=d.forwardRef(({asChild:e,className:t,...n},r)=>{const o=e?Kt:"a";return l.jsx(o,{ref:r,className:Z("transition-colors hover:text-foreground","s3-explr-ui-breadcrumb-link",t),...n})});Io.displayName="BreadcrumbLink";const Mg=d.forwardRef(({className:e,...t},n)=>l.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:Z("font-normal text-foreground","s3-explr-ui-breadcrumb-page",e),...t}));Mg.displayName="BreadcrumbPage";const _a=({children:e,className:t,...n})=>l.jsx("li",{role:"presentation","aria-hidden":"true",className:Z("[&>svg]:w-3.5 [&>svg]:h-3.5","s3-explr-ui-breadcrumb-separator",t),...n,children:e??l.jsx(ha,{})});_a.displayName="BreadcrumbSeparator";const Fa=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Oa=wa,Ro=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Oa(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(c=>{const f=n==null?void 0:n[c],g=s==null?void 0:s[c];if(f===null)return null;const m=Fa(f)||Fa(g);return o[c][m]}),a=n&&Object.entries(n).reduce((c,f)=>{let[g,m]=f;return m===void 0||(c[g]=m),c},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,f)=>{let{class:g,className:m,...p}=f;return Object.entries(p).every(v=>{let[h,y]=v;return Array.isArray(y)?y.includes({...s,...a}[h]):{...s,...a}[h]===y})?[...c,g,m]:c},[]);return Oa(e,i,u,n==null?void 0:n.class,n==null?void 0:n.className)},Da=Ro("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 s3-explr-ui-button",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90 s3-explr-ui-button-default",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90 s3-explr-ui-button-destructive",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground s3-explr-ui-button-outline",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80 s3-explr-ui-button-secondary",ghost:"hover:bg-accent hover:text-accent-foreground s3-explr-ui-button-ghost",link:"text-primary underline-offset-4 hover:underline s3-explr-ui-button-link"},size:{default:"h-9 px-4 py-2 s3-explr-ui-button-size-default",sm:"h-8 rounded-md px-3 text-xs s3-explr-ui-button-size-sm",lg:"h-10 rounded-md px-8 s3-explr-ui-button-size-lg",icon:"h-9 w-9 s3-explr-ui-button-size-icon"}},defaultVariants:{variant:"default",size:"default"}}),se=d.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},s)=>{const i=r?Kt:"button";return l.jsx(i,{className:Z(Da({variant:t,size:n,className:e})),ref:s,...o})});se.displayName="Button";function kg(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function or(...e){return t=>e.forEach(n=>kg(n,t))}function Le(...e){return d.useCallback(or(...e),e)}function $g(e,t){const n=d.createContext(t),r=s=>{const{children:i,...a}=s,u=d.useMemo(()=>a,Object.values(a));return l.jsx(n.Provider,{value:u,children:i})};r.displayName=e+"Provider";function o(s){const i=d.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function St(e,t=[]){let n=[];function r(s,i){const a=d.createContext(i),u=n.length;n=[...n,i];const c=g=>{var w;const{scope:m,children:p,...v}=g,h=((w=m==null?void 0:m[e])==null?void 0:w[u])||a,y=d.useMemo(()=>v,Object.values(v));return l.jsx(h.Provider,{value:y,children:p})};c.displayName=s+"Provider";function f(g,m){var h;const p=((h=m==null?void 0:m[e])==null?void 0:h[u])||a,v=d.useContext(p);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${g}\` must be used within \`${s}\``)}return[c,f]}const o=()=>{const s=n.map(i=>d.createContext(i));return function(a){const u=(a==null?void 0:a[e])||s;return d.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return o.scopeName=e,[r,Ig(o,...t)]}function Ig(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:u,scopeName:c})=>{const g=u(s)[`__scope${c}`];return{...a,...g}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function me(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Te(e){const t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Jt({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Rg({defaultProp:t,onChange:n}),s=e!==void 0,i=s?e:r,a=Te(n),u=d.useCallback(c=>{if(s){const g=typeof c=="function"?c(e):c;g!==e&&a(g)}else o(c)},[s,e,o,a]);return[i,u]}function Rg({defaultProp:e,onChange:t}){const n=d.useState(e),[r]=n,o=d.useRef(r),s=Te(t);return d.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}function Lg(e){const t=d.useRef({value:e,previous:e});return d.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var $e=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{};function Ma(e){const[t,n]=d.useState(void 0);return $e(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const u=s.borderBoxSize,c=Array.isArray(u)?u[0]:u;i=c.inlineSize,a=c.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}function Vg(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var Zt=e=>{const{present:t,children:n}=e,r=Bg(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=Le(r.ref,zg(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};Zt.displayName="Presence";function Bg(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=Vg(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=sr(r.current);s.current=a==="mounted"?c:"none"},[a]),$e(()=>{const c=r.current,f=o.current;if(f!==e){const m=s.current,p=sr(c);e?u("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&m!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),$e(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,g=p=>{const h=sr(r.current).includes(p.animationName);if(p.target===t&&h&&(u("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},m=p=>{p.target===t&&(s.current=sr(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:d.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function sr(e){return(e==null?void 0:e.animationName)||"none"}function zg(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ka=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Ug);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(Lo,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Lo,{...r,ref:t,children:n})});ka.displayName="Slot";var Lo=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Wg(n);return d.cloneElement(n,{...jg(r,n.props),ref:t?or(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Lo.displayName="SlotClone";var Hg=({children:e})=>l.jsx(l.Fragment,{children:e});function Ug(e){return d.isValidElement(e)&&e.type===Hg}function jg(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Wg(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Gg=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ve=Gg.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?ka:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function $a(e,t){e&&zn.flushSync(()=>e.dispatchEvent(t))}var Vo="Checkbox",[qg,Hx]=St(Vo),[Kg,Xg]=qg(Vo),Ia=d.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:u="on",onCheckedChange:c,form:f,...g}=e,[m,p]=d.useState(null),v=Le(t,E=>p(E)),h=d.useRef(!1),y=m?f||!!m.closest("form"):!0,[w=!1,x]=Jt({prop:o,defaultProp:s,onChange:c}),S=d.useRef(w);return d.useEffect(()=>{const E=m==null?void 0:m.form;if(E){const C=()=>x(S.current);return E.addEventListener("reset",C),()=>E.removeEventListener("reset",C)}},[m,x]),l.jsxs(Kg,{scope:n,state:w,disabled:a,children:[l.jsx(ve.button,{type:"button",role:"checkbox","aria-checked":Et(w)?"mixed":w,"aria-required":i,"data-state":Va(w),"data-disabled":a?"":void 0,disabled:a,value:u,...g,ref:v,onKeyDown:me(e.onKeyDown,E=>{E.key==="Enter"&&E.preventDefault()}),onClick:me(e.onClick,E=>{x(C=>Et(C)?!0:!C),y&&(h.current=E.isPropagationStopped(),h.current||E.stopPropagation())})}),y&&l.jsx(Yg,{control:m,bubbles:!h.current,name:r,value:u,checked:w,required:i,disabled:a,form:f,style:{transform:"translateX(-100%)"},defaultChecked:Et(s)?!1:s})]})});Ia.displayName=Vo;var Ra="CheckboxIndicator",La=d.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=Xg(Ra,n);return l.jsx(Zt,{present:r||Et(s.state)||s.state===!0,children:l.jsx(ve.span,{"data-state":Va(s.state),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});La.displayName=Ra;var Yg=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:o,...s}=e,i=d.useRef(null),a=Lg(n),u=Ma(t);d.useEffect(()=>{const f=i.current,g=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(g,"checked").set;if(a!==n&&p){const v=new Event("click",{bubbles:r});f.indeterminate=Et(n),p.call(f,Et(n)?!1:n),f.dispatchEvent(v)}},[a,n,r]);const c=d.useRef(Et(n)?!1:n);return l.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o??c.current,...s,tabIndex:-1,ref:i,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Et(e){return e==="indeterminate"}function Va(e){return Et(e)?"indeterminate":e?"checked":"unchecked"}var Ba=Ia,Jg=La;const Bo=d.forwardRef(({className:e,...t},n)=>l.jsx(Ba,{ref:n,className:Z("s3-explr-ui-checkbox peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:l.jsx(Jg,{className:Z("s3-explr-ui-checkbox-indicator flex items-center justify-center text-current"),children:l.jsx(Gp,{className:"s3-explr-ui-checkbox-check h-4 w-4"})})}));Bo.displayName=Ba.displayName;var Zg=d.useId||(()=>{}),Qg=0;function Qt(e){const[t,n]=d.useState(Zg());return $e(()=>{e||n(r=>r??String(Qg++))},[e]),e||(t?`radix-${t}`:"")}function za(e,t=globalThis==null?void 0:globalThis.document){const n=Te(e);d.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var eh="DismissableLayer",zo="dismissableLayer.update",th="dismissableLayer.pointerDownOutside",nh="dismissableLayer.focusOutside",Ha,Ua=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ho=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...u}=e,c=d.useContext(Ua),[f,g]=d.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=d.useState({}),v=Le(t,_=>g(_)),h=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=h.indexOf(y),x=f?h.indexOf(f):-1,S=c.layersWithOutsidePointerEventsDisabled.size>0,E=x>=w,C=oh(_=>{const O=_.target,k=[...c.branches].some(F=>F.contains(O));!E||k||(o==null||o(_),i==null||i(_),_.defaultPrevented||a==null||a())},m),P=sh(_=>{const O=_.target;[...c.branches].some(F=>F.contains(O))||(s==null||s(_),i==null||i(_),_.defaultPrevented||a==null||a())},m);return za(_=>{x===c.layers.size-1&&(r==null||r(_),!_.defaultPrevented&&a&&(_.preventDefault(),a()))},m),d.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Ha=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),Wa(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Ha)}},[f,m,n,c]),d.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),Wa())},[f,c]),d.useEffect(()=>{const _=()=>p({});return document.addEventListener(zo,_),()=>document.removeEventListener(zo,_)},[]),l.jsx(ve.div,{...u,ref:v,style:{pointerEvents:S?E?"auto":"none":void 0,...e.style},onFocusCapture:me(e.onFocusCapture,P.onFocusCapture),onBlurCapture:me(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:me(e.onPointerDownCapture,C.onPointerDownCapture)})});Ho.displayName=eh;var rh="DismissableLayerBranch",ja=d.forwardRef((e,t)=>{const n=d.useContext(Ua),r=d.useRef(null),o=Le(t,r);return d.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(ve.div,{...e,ref:o})});ja.displayName=rh;function oh(e,t=globalThis==null?void 0:globalThis.document){const n=Te(e),r=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let u=function(){Ga(th,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function sh(e,t=globalThis==null?void 0:globalThis.document){const n=Te(e),r=d.useRef(!1);return d.useEffect(()=>{const o=s=>{s.target&&!r.current&&Ga(nh,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Wa(){const e=new CustomEvent(zo);document.dispatchEvent(e)}function Ga(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?$a(o,s):o.dispatchEvent(s)}var ih=Ho,ah=ja,Uo="focusScope.autoFocusOnMount",jo="focusScope.autoFocusOnUnmount",qa={bubbles:!1,cancelable:!0},lh="FocusScope",Ka=d.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,u]=d.useState(null),c=Te(o),f=Te(s),g=d.useRef(null),m=Le(t,h=>u(h)),p=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(r){let h=function(S){if(p.paused||!a)return;const E=S.target;a.contains(E)?g.current=E:Nt(g.current,{select:!0})},y=function(S){if(p.paused||!a)return;const E=S.relatedTarget;E!==null&&(a.contains(E)||Nt(g.current,{select:!0}))},w=function(S){if(document.activeElement===document.body)for(const C of S)C.removedNodes.length>0&&Nt(a)};document.addEventListener("focusin",h),document.addEventListener("focusout",y);const x=new MutationObserver(w);return a&&x.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",y),x.disconnect()}}},[r,a,p.paused]),d.useEffect(()=>{if(a){Ja.add(p);const h=document.activeElement;if(!a.contains(h)){const w=new CustomEvent(Uo,qa);a.addEventListener(Uo,c),a.dispatchEvent(w),w.defaultPrevented||(ch(gh(Xa(a)),{select:!0}),document.activeElement===h&&Nt(a))}return()=>{a.removeEventListener(Uo,c),setTimeout(()=>{const w=new CustomEvent(jo,qa);a.addEventListener(jo,f),a.dispatchEvent(w),w.defaultPrevented||Nt(h??document.body,{select:!0}),a.removeEventListener(jo,f),Ja.remove(p)},0)}}},[a,c,f,p]);const v=d.useCallback(h=>{if(!n&&!r||p.paused)return;const y=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,w=document.activeElement;if(y&&w){const x=h.currentTarget,[S,E]=uh(x);S&&E?!h.shiftKey&&w===E?(h.preventDefault(),n&&Nt(S,{select:!0})):h.shiftKey&&w===S&&(h.preventDefault(),n&&Nt(E,{select:!0})):w===x&&h.preventDefault()}},[n,r,p.paused]);return l.jsx(ve.div,{tabIndex:-1,...i,ref:m,onKeyDown:v})});Ka.displayName=lh;function ch(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Nt(r,{select:t}),document.activeElement!==n)return}function uh(e){const t=Xa(e),n=Ya(t,e),r=Ya(t.reverse(),e);return[n,r]}function Xa(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ya(e,t){for(const n of e)if(!dh(n,{upTo:t}))return n}function dh(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function fh(e){return e instanceof HTMLInputElement&&"select"in e}function Nt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&fh(e)&&t&&e.select()}}var Ja=ph();function ph(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Za(e,t),e.unshift(t)},remove(t){var n;e=Za(e,t),(n=e[0])==null||n.resume()}}}function Za(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function gh(e){return e.filter(t=>t.tagName!=="A")}var hh="Portal",Wo=d.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=d.useState(!1);$e(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?Jr.createPortal(l.jsx(ve.div,{...r,ref:t}),i):null});Wo.displayName=hh;var Go=0;function mh(){d.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Qa()),document.body.insertAdjacentElement("beforeend",e[1]??Qa()),Go++,()=>{Go===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Go--}},[])}function Qa(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Qe=function(){return Qe=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Qe.apply(this,arguments)};function el(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function tl(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,s=[],i;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(a){i={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return s}function nl(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var ir="right-scroll-bar-position",ar="width-before-scroll-bar",vh="with-scroll-bars-hidden",yh="--removed-body-scroll-bar-size";function qo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function wh(e,t){var n=D.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var bh=typeof window<"u"?d.useLayoutEffect:d.useEffect,rl=new WeakMap;function xh(e,t){var n=wh(null,function(r){return e.forEach(function(o){return qo(o,r)})});return bh(function(){var r=rl.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||qo(a,null)}),s.forEach(function(a){o.has(a)||qo(a,i)})}rl.set(n,e)},[e]),n}function Ch(e){return e}function Sh(e,t){t===void 0&&(t=Ch);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var u=function(){var f=i;i=[],f.forEach(s)},c=function(){return Promise.resolve().then(u)};c(),n={push:function(f){i.push(f),c()},filter:function(f){return i=i.filter(f),n}}}};return o}function Eh(e){e===void 0&&(e={});var t=Sh(null);return t.options=Qe({async:!0,ssr:!1},e),t}var ol=function(e){var t=e.sideCar,n=el(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return d.createElement(r,Qe({},n))};ol.isSideCarExport=!0;function Nh(e,t){return e.useMedium(t),ol}var sl=Eh(),Ko=function(){},lr=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:Ko,onWheelCapture:Ko,onTouchMoveCapture:Ko}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,u=e.className,c=e.removeScrollBar,f=e.enabled,g=e.shards,m=e.sideCar,p=e.noIsolation,v=e.inert,h=e.allowPinchZoom,y=e.as,w=y===void 0?"div":y,x=e.gapMode,S=el(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=m,C=xh([n,t]),P=Qe(Qe({},S),o);return d.createElement(d.Fragment,null,f&&d.createElement(E,{sideCar:sl,removeScrollBar:c,shards:g,noIsolation:p,inert:v,setCallbacks:s,allowPinchZoom:!!h,lockRef:n,gapMode:x}),i?d.cloneElement(d.Children.only(a),Qe(Qe({},P),{ref:C})):d.createElement(w,Qe({},P,{className:u,ref:C}),a))});lr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},lr.classNames={fullWidth:ar,zeroRight:ir};var Th=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ph(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Th();return t&&e.setAttribute("nonce",t),e}function Ah(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function _h(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Fh=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ph())&&(Ah(t,n),_h(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Oh=function(){var e=Fh();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},il=function(){var e=Oh(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Dh={left:0,top:0,right:0,gap:0},Xo=function(e){return parseInt(e||"",10)||0},Mh=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Xo(n),Xo(r),Xo(o)]},kh=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Dh;var t=Mh(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},$h=il(),en="data-scroll-locked",Ih=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
93
- .`.concat(vh,` {
92
+ */const ko=dt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function ya(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function eg(...e){return t=>{let n=!1;const r=e.map(o=>{const s=ya(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():ya(e[o],null)}}}}var Yt=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(tg);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx($o,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx($o,{...r,ref:t,children:n})});Yt.displayName="Slot";var $o=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=rg(n);return d.cloneElement(n,{...ng(r,n.props),ref:t?eg(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});$o.displayName="SlotClone";var wa=({children:e})=>l.jsx(l.Fragment,{children:e});function tg(e){return d.isValidElement(e)&&e.type===wa}function ng(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function rg(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ba(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=ba(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function xa(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=ba(e))&&(r&&(r+=" "),r+=t);return r}const Io="-",og=e=>{const t=ig(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(Io);return a[0]===""&&a.length!==1&&a.shift(),Ca(a,t)||sg(i)},getConflictingClassGroupIds:(i,a)=>{const u=n[i]||[];return a&&r[i]?[...u,...r[i]]:u}}},Ca=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Ca(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Io);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},Sa=/^\[(.+)\]$/,sg=e=>{if(Sa.test(e)){const t=Sa.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},ig=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return lg(Object.entries(e.classGroups),n).forEach(([s,i])=>{Lo(i,r,s,t)}),r},Lo=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:Ea(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(ag(o)){Lo(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{Lo(i,Ea(t,s),n,r)})})},Ea=(e,t)=>{let n=e;return t.split(Io).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},ag=e=>e.isThemeGetter,lg=(e,t)=>t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,a])=>[t+i,a])):s);return[n,o]}):e,cg=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},Na="!",ug=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length,i=a=>{const u=[];let c=0,f=0,g;for(let y=0;y<a.length;y++){let w=a[y];if(c===0){if(w===o&&(r||a.slice(y,y+s)===t)){u.push(a.slice(f,y)),f=y+s;continue}if(w==="/"){g=y;continue}}w==="["?c++:w==="]"&&c--}const m=u.length===0?a:a.substring(f),p=m.startsWith(Na),v=p?m.substring(1):m,h=g&&g>f?g-f:void 0;return{modifiers:u,hasImportantModifier:p,baseClassName:v,maybePostfixModifierPosition:h}};return n?a=>n({className:a,parseClassName:i}):i},dg=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},fg=e=>({cache:cg(e.cacheSize),parseClassName:ug(e),...og(e)}),pg=/\s+/,gg=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(pg);let a="";for(let u=i.length-1;u>=0;u-=1){const c=i[u],{modifiers:f,hasImportantModifier:g,baseClassName:m,maybePostfixModifierPosition:p}=n(c);let v=!!p,h=r(v?m.substring(0,p):m);if(!h){if(!v){a=c+(a.length>0?" "+a:a);continue}if(h=r(m),!h){a=c+(a.length>0?" "+a:a);continue}v=!1}const y=dg(f).join(":"),w=g?y+Na:y,b=w+h;if(s.includes(b))continue;s.push(b);const S=o(h,v);for(let E=0;E<S.length;++E){const x=S[E];s.push(w+x)}a=c+(a.length>0?" "+a:a)}return a};function hg(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Ta(t))&&(r&&(r+=" "),r+=n);return r}const Ta=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Ta(e[r]))&&(n&&(n+=" "),n+=t);return n};function mg(e,...t){let n,r,o,s=i;function i(u){const c=t.reduce((f,g)=>g(f),e());return n=fg(c),r=n.cache.get,o=n.cache.set,s=a,a(u)}function a(u){const c=r(u);if(c)return c;const f=gg(u,n);return o(u,f),f}return function(){return s(hg.apply(null,arguments))}}const ce=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Pa=/^\[(?:([a-z-]+):)?(.+)\]$/i,vg=/^\d+\/\d+$/,yg=new Set(["px","full","screen"]),wg=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bg=/\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$/,xg=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Cg=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Sg=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ft=e=>Jt(e)||yg.has(e)||vg.test(e),St=e=>Zt(e,"length",Og),Jt=e=>!!e&&!Number.isNaN(Number(e)),Ro=e=>Zt(e,"number",Jt),Sn=e=>!!e&&Number.isInteger(Number(e)),Eg=e=>e.endsWith("%")&&Jt(e.slice(0,-1)),re=e=>Pa.test(e),Et=e=>wg.test(e),Ng=new Set(["length","size","percentage"]),Tg=e=>Zt(e,Ng,Aa),Pg=e=>Zt(e,"position",Aa),Ag=new Set(["image","url"]),_g=e=>Zt(e,Ag,Mg),Fg=e=>Zt(e,"",Dg),En=()=>!0,Zt=(e,t,n)=>{const r=Pa.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Og=e=>bg.test(e)&&!xg.test(e),Aa=()=>!1,Dg=e=>Cg.test(e),Mg=e=>Sg.test(e),kg=mg(()=>{const e=ce("colors"),t=ce("spacing"),n=ce("blur"),r=ce("brightness"),o=ce("borderColor"),s=ce("borderRadius"),i=ce("borderSpacing"),a=ce("borderWidth"),u=ce("contrast"),c=ce("grayscale"),f=ce("hueRotate"),g=ce("invert"),m=ce("gap"),p=ce("gradientColorStops"),v=ce("gradientColorStopPositions"),h=ce("inset"),y=ce("margin"),w=ce("opacity"),b=ce("padding"),S=ce("saturate"),E=ce("scale"),x=ce("sepia"),P=ce("skew"),_=ce("space"),O=ce("translate"),k=()=>["auto","contain","none"],F=()=>["auto","hidden","clip","visible","scroll"],G=()=>["auto",re,t],$=()=>[re,t],L=()=>["",ft,St],M=()=>["auto",Jt,re],q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],W=()=>["solid","dashed","dotted","double","none"],X=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>["start","end","center","between","around","evenly","stretch"],ne=()=>["","0",re],ae=()=>["auto","avoid","all","avoid-page","page","left","right","column"],de=()=>[Jt,re];return{cacheSize:500,separator:":",theme:{colors:[En],spacing:[ft,St],blur:["none","",Et,re],brightness:de(),borderColor:[e],borderRadius:["none","","full",Et,re],borderSpacing:$(),borderWidth:L(),contrast:de(),grayscale:ne(),hueRotate:de(),invert:ne(),gap:$(),gradientColorStops:[e],gradientColorStopPositions:[Eg,St],inset:G(),margin:G(),opacity:de(),padding:$(),saturate:de(),scale:de(),sepia:ne(),skew:de(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",re]}],container:["container"],columns:[{columns:[Et]}],"break-after":[{"break-after":ae()}],"break-before":[{"break-before":ae()}],"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"],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:[...q(),re]}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Sn,re]}],basis:[{basis:G()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",re]}],grow:[{grow:ne()}],shrink:[{shrink:ne()}],order:[{order:["first","last","none",Sn,re]}],"grid-cols":[{"grid-cols":[En]}],"col-start-end":[{col:["auto",{span:["full",Sn,re]},re]}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":[En]}],"row-start-end":[{row:["auto",{span:[Sn,re]},re]}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",re]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",re]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...K()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...K(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...K(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",re,t]}],"min-w":[{"min-w":[re,t,"min","max","fit"]}],"max-w":[{"max-w":[re,t,"none","full","min","max","fit","prose",{screen:[Et]},Et]}],h:[{h:[re,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[re,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[re,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[re,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Et,St]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ro]}],"font-family":[{font:[En]}],"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:["tighter","tight","normal","wide","wider","widest",re]}],"line-clamp":[{"line-clamp":["none",Jt,Ro]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ft,re]}],"list-image":[{"list-image":["none",re]}],"list-style-type":[{list:["none","disc","decimal",re]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ft,St]}],"underline-offset":[{"underline-offset":["auto",ft,re]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",re]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",re]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...q(),Pg]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Tg]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},_g]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...W(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:W()}],"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-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:["",...W()]}],"outline-offset":[{"outline-offset":[ft,re]}],"outline-w":[{outline:[ft,St]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[ft,St]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Et,Fg]}],"shadow-color":[{shadow:[En]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...X(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":X()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",Et,re]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[g]}],saturate:[{saturate:[S]}],sepia:[{sepia:[x]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[x]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",re]}],duration:[{duration:de()}],ease:[{ease:["linear","in","out","in-out",re]}],delay:[{delay:de()}],animate:[{animate:["none","spin","ping","pulse","bounce",re]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[Sn,re]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",re]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",re]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"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",re]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ft,St,Ro]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-s","border-w-e","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-s","border-color-e","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"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","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-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"]}}});function Z(...e){return kg(xa(e))}const $g=e=>{if(e===0)return"0 Bytes";const t=1024,n=["Bytes","KB","MB","GB","TB"],r=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/Math.pow(t,r)).toFixed(2))} ${n[r]}`},_a=d.forwardRef(({className:e,...t},n)=>l.jsx("nav",{ref:n,"aria-label":"breadcrumb",className:Z("s3-explr-ui-breadcrumb",e),...t}));_a.displayName="Breadcrumb";const Fa=d.forwardRef(({className:e,...t},n)=>l.jsx("ol",{ref:n,className:Z("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5","s3-explr-ui-breadcrumb-list",e),...t}));Fa.displayName="BreadcrumbList";const Vo=d.forwardRef(({className:e,...t},n)=>l.jsx("li",{ref:n,className:Z("inline-flex items-center gap-1.5","s3-explr-ui-breadcrumb-item",e),...t}));Vo.displayName="BreadcrumbItem";const Bo=d.forwardRef(({asChild:e,className:t,...n},r)=>{const o=e?Yt:"a";return l.jsx(o,{ref:r,className:Z("transition-colors hover:text-foreground","s3-explr-ui-breadcrumb-link",t),...n})});Bo.displayName="BreadcrumbLink";const Ig=d.forwardRef(({className:e,...t},n)=>l.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:Z("font-normal text-foreground","s3-explr-ui-breadcrumb-page",e),...t}));Ig.displayName="BreadcrumbPage";const Oa=({children:e,className:t,...n})=>l.jsx("li",{role:"presentation","aria-hidden":"true",className:Z("[&>svg]:w-3.5 [&>svg]:h-3.5","s3-explr-ui-breadcrumb-separator",t),...n,children:e??l.jsx(va,{})});Oa.displayName="BreadcrumbSeparator";const Da=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ma=xa,zo=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Ma(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(c=>{const f=n==null?void 0:n[c],g=s==null?void 0:s[c];if(f===null)return null;const m=Da(f)||Da(g);return o[c][m]}),a=n&&Object.entries(n).reduce((c,f)=>{let[g,m]=f;return m===void 0||(c[g]=m),c},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,f)=>{let{class:g,className:m,...p}=f;return Object.entries(p).every(v=>{let[h,y]=v;return Array.isArray(y)?y.includes({...s,...a}[h]):{...s,...a}[h]===y})?[...c,g,m]:c},[]);return Ma(e,i,u,n==null?void 0:n.class,n==null?void 0:n.className)},ka=zo("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 s3-explr-ui-button",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90 s3-explr-ui-button-default",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90 s3-explr-ui-button-destructive",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground s3-explr-ui-button-outline",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80 s3-explr-ui-button-secondary",ghost:"hover:bg-accent hover:text-accent-foreground s3-explr-ui-button-ghost",link:"text-primary underline-offset-4 hover:underline s3-explr-ui-button-link"},size:{default:"h-9 px-4 py-2 s3-explr-ui-button-size-default",sm:"h-8 rounded-md px-3 text-xs s3-explr-ui-button-size-sm",lg:"h-10 rounded-md px-8 s3-explr-ui-button-size-lg",icon:"h-9 w-9 s3-explr-ui-button-size-icon"}},defaultVariants:{variant:"default",size:"default"}}),ie=d.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},s)=>{const i=r?Yt:"button";return l.jsx(i,{className:Z(ka({variant:t,size:n,className:e})),ref:s,...o})});ie.displayName="Button";function Lg(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function sr(...e){return t=>e.forEach(n=>Lg(n,t))}function ze(...e){return d.useCallback(sr(...e),e)}function Rg(e,t){const n=d.createContext(t),r=s=>{const{children:i,...a}=s,u=d.useMemo(()=>a,Object.values(a));return l.jsx(n.Provider,{value:u,children:i})};r.displayName=e+"Provider";function o(s){const i=d.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function Nt(e,t=[]){let n=[];function r(s,i){const a=d.createContext(i),u=n.length;n=[...n,i];const c=g=>{var w;const{scope:m,children:p,...v}=g,h=((w=m==null?void 0:m[e])==null?void 0:w[u])||a,y=d.useMemo(()=>v,Object.values(v));return l.jsx(h.Provider,{value:y,children:p})};c.displayName=s+"Provider";function f(g,m){var h;const p=((h=m==null?void 0:m[e])==null?void 0:h[u])||a,v=d.useContext(p);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${g}\` must be used within \`${s}\``)}return[c,f]}const o=()=>{const s=n.map(i=>d.createContext(i));return function(a){const u=(a==null?void 0:a[e])||s;return d.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return o.scopeName=e,[r,Vg(o,...t)]}function Vg(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:u,scopeName:c})=>{const g=u(s)[`__scope${c}`];return{...a,...g}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function he(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Pe(e){const t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Qt({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Bg({defaultProp:t,onChange:n}),s=e!==void 0,i=s?e:r,a=Pe(n),u=d.useCallback(c=>{if(s){const g=typeof c=="function"?c(e):c;g!==e&&a(g)}else o(c)},[s,e,o,a]);return[i,u]}function Bg({defaultProp:e,onChange:t}){const n=d.useState(e),[r]=n,o=d.useRef(r),s=Pe(t);return d.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}function zg(e){const t=d.useRef({value:e,previous:e});return d.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Le=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{};function $a(e){const[t,n]=d.useState(void 0);return Le(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const u=s.borderBoxSize,c=Array.isArray(u)?u[0]:u;i=c.inlineSize,a=c.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}function Hg(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var en=e=>{const{present:t,children:n}=e,r=Ug(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=ze(r.ref,jg(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};en.displayName="Presence";function Ug(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=Hg(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=ir(r.current);s.current=a==="mounted"?c:"none"},[a]),Le(()=>{const c=r.current,f=o.current;if(f!==e){const m=s.current,p=ir(c);e?u("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&m!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),Le(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,g=p=>{const h=ir(r.current).includes(p.animationName);if(p.target===t&&h&&(u("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},m=p=>{p.target===t&&(s.current=ir(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:d.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function ir(e){return(e==null?void 0:e.animationName)||"none"}function jg(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ia=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Gg);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(Ho,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Ho,{...r,ref:t,children:n})});Ia.displayName="Slot";var Ho=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Kg(n);return d.cloneElement(n,{...qg(r,n.props),ref:t?sr(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Ho.displayName="SlotClone";var Wg=({children:e})=>l.jsx(l.Fragment,{children:e});function Gg(e){return d.isValidElement(e)&&e.type===Wg}function qg(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Kg(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Xg=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ve=Xg.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Ia:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function La(e,t){e&&Hn.flushSync(()=>e.dispatchEvent(t))}var Uo="Checkbox",[Yg,Xx]=Nt(Uo),[Jg,Zg]=Yg(Uo),Ra=d.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:u="on",onCheckedChange:c,form:f,...g}=e,[m,p]=d.useState(null),v=ze(t,E=>p(E)),h=d.useRef(!1),y=m?f||!!m.closest("form"):!0,[w=!1,b]=Qt({prop:o,defaultProp:s,onChange:c}),S=d.useRef(w);return d.useEffect(()=>{const E=m==null?void 0:m.form;if(E){const x=()=>b(S.current);return E.addEventListener("reset",x),()=>E.removeEventListener("reset",x)}},[m,b]),l.jsxs(Jg,{scope:n,state:w,disabled:a,children:[l.jsx(ve.button,{type:"button",role:"checkbox","aria-checked":Tt(w)?"mixed":w,"aria-required":i,"data-state":za(w),"data-disabled":a?"":void 0,disabled:a,value:u,...g,ref:v,onKeyDown:he(e.onKeyDown,E=>{E.key==="Enter"&&E.preventDefault()}),onClick:he(e.onClick,E=>{b(x=>Tt(x)?!0:!x),y&&(h.current=E.isPropagationStopped(),h.current||E.stopPropagation())})}),y&&l.jsx(Qg,{control:m,bubbles:!h.current,name:r,value:u,checked:w,required:i,disabled:a,form:f,style:{transform:"translateX(-100%)"},defaultChecked:Tt(s)?!1:s})]})});Ra.displayName=Uo;var Va="CheckboxIndicator",Ba=d.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=Zg(Va,n);return l.jsx(en,{present:r||Tt(s.state)||s.state===!0,children:l.jsx(ve.span,{"data-state":za(s.state),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});Ba.displayName=Va;var Qg=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:o,...s}=e,i=d.useRef(null),a=zg(n),u=$a(t);d.useEffect(()=>{const f=i.current,g=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(g,"checked").set;if(a!==n&&p){const v=new Event("click",{bubbles:r});f.indeterminate=Tt(n),p.call(f,Tt(n)?!1:n),f.dispatchEvent(v)}},[a,n,r]);const c=d.useRef(Tt(n)?!1:n);return l.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o??c.current,...s,tabIndex:-1,ref:i,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Tt(e){return e==="indeterminate"}function za(e){return Tt(e)?"indeterminate":e?"checked":"unchecked"}var Ha=Ra,eh=Ba;const jo=d.forwardRef(({className:e,...t},n)=>l.jsx(Ha,{ref:n,className:Z("s3-explr-ui-checkbox peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:l.jsx(eh,{className:Z("s3-explr-ui-checkbox-indicator flex items-center justify-center text-current"),children:l.jsx(Xp,{className:"s3-explr-ui-checkbox-check h-4 w-4"})})}));jo.displayName=Ha.displayName;var th=d.useId||(()=>{}),nh=0;function tn(e){const[t,n]=d.useState(th());return Le(()=>{e||n(r=>r??String(nh++))},[e]),e||(t?`radix-${t}`:"")}function Ua(e,t=globalThis==null?void 0:globalThis.document){const n=Pe(e);d.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var rh="DismissableLayer",Wo="dismissableLayer.update",oh="dismissableLayer.pointerDownOutside",sh="dismissableLayer.focusOutside",ja,Wa=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Go=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...u}=e,c=d.useContext(Wa),[f,g]=d.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=d.useState({}),v=ze(t,_=>g(_)),h=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=h.indexOf(y),b=f?h.indexOf(f):-1,S=c.layersWithOutsidePointerEventsDisabled.size>0,E=b>=w,x=ah(_=>{const O=_.target,k=[...c.branches].some(F=>F.contains(O));!E||k||(o==null||o(_),i==null||i(_),_.defaultPrevented||a==null||a())},m),P=lh(_=>{const O=_.target;[...c.branches].some(F=>F.contains(O))||(s==null||s(_),i==null||i(_),_.defaultPrevented||a==null||a())},m);return Ua(_=>{b===c.layers.size-1&&(r==null||r(_),!_.defaultPrevented&&a&&(_.preventDefault(),a()))},m),d.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(ja=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),qa(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=ja)}},[f,m,n,c]),d.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),qa())},[f,c]),d.useEffect(()=>{const _=()=>p({});return document.addEventListener(Wo,_),()=>document.removeEventListener(Wo,_)},[]),l.jsx(ve.div,{...u,ref:v,style:{pointerEvents:S?E?"auto":"none":void 0,...e.style},onFocusCapture:he(e.onFocusCapture,P.onFocusCapture),onBlurCapture:he(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:he(e.onPointerDownCapture,x.onPointerDownCapture)})});Go.displayName=rh;var ih="DismissableLayerBranch",Ga=d.forwardRef((e,t)=>{const n=d.useContext(Wa),r=d.useRef(null),o=ze(t,r);return d.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(ve.div,{...e,ref:o})});Ga.displayName=ih;function ah(e,t=globalThis==null?void 0:globalThis.document){const n=Pe(e),r=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let u=function(){Ka(oh,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function lh(e,t=globalThis==null?void 0:globalThis.document){const n=Pe(e),r=d.useRef(!1);return d.useEffect(()=>{const o=s=>{s.target&&!r.current&&Ka(sh,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function qa(){const e=new CustomEvent(Wo);document.dispatchEvent(e)}function Ka(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?La(o,s):o.dispatchEvent(s)}var ch=Go,uh=Ga,qo="focusScope.autoFocusOnMount",Ko="focusScope.autoFocusOnUnmount",Xa={bubbles:!1,cancelable:!0},dh="FocusScope",Ya=d.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,u]=d.useState(null),c=Pe(o),f=Pe(s),g=d.useRef(null),m=ze(t,h=>u(h)),p=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(r){let h=function(S){if(p.paused||!a)return;const E=S.target;a.contains(E)?g.current=E:Pt(g.current,{select:!0})},y=function(S){if(p.paused||!a)return;const E=S.relatedTarget;E!==null&&(a.contains(E)||Pt(g.current,{select:!0}))},w=function(S){if(document.activeElement===document.body)for(const x of S)x.removedNodes.length>0&&Pt(a)};document.addEventListener("focusin",h),document.addEventListener("focusout",y);const b=new MutationObserver(w);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",y),b.disconnect()}}},[r,a,p.paused]),d.useEffect(()=>{if(a){Qa.add(p);const h=document.activeElement;if(!a.contains(h)){const w=new CustomEvent(qo,Xa);a.addEventListener(qo,c),a.dispatchEvent(w),w.defaultPrevented||(fh(vh(Ja(a)),{select:!0}),document.activeElement===h&&Pt(a))}return()=>{a.removeEventListener(qo,c),setTimeout(()=>{const w=new CustomEvent(Ko,Xa);a.addEventListener(Ko,f),a.dispatchEvent(w),w.defaultPrevented||Pt(h??document.body,{select:!0}),a.removeEventListener(Ko,f),Qa.remove(p)},0)}}},[a,c,f,p]);const v=d.useCallback(h=>{if(!n&&!r||p.paused)return;const y=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,w=document.activeElement;if(y&&w){const b=h.currentTarget,[S,E]=ph(b);S&&E?!h.shiftKey&&w===E?(h.preventDefault(),n&&Pt(S,{select:!0})):h.shiftKey&&w===S&&(h.preventDefault(),n&&Pt(E,{select:!0})):w===b&&h.preventDefault()}},[n,r,p.paused]);return l.jsx(ve.div,{tabIndex:-1,...i,ref:m,onKeyDown:v})});Ya.displayName=dh;function fh(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Pt(r,{select:t}),document.activeElement!==n)return}function ph(e){const t=Ja(e),n=Za(t,e),r=Za(t.reverse(),e);return[n,r]}function Ja(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Za(e,t){for(const n of e)if(!gh(n,{upTo:t}))return n}function gh(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function hh(e){return e instanceof HTMLInputElement&&"select"in e}function Pt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&hh(e)&&t&&e.select()}}var Qa=mh();function mh(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=el(e,t),e.unshift(t)},remove(t){var n;e=el(e,t),(n=e[0])==null||n.resume()}}}function el(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function vh(e){return e.filter(t=>t.tagName!=="A")}var yh="Portal",Xo=d.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=d.useState(!1);Le(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?to.createPortal(l.jsx(ve.div,{...r,ref:t}),i):null});Xo.displayName=yh;var Yo=0;function wh(){d.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??tl()),document.body.insertAdjacentElement("beforeend",e[1]??tl()),Yo++,()=>{Yo===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Yo--}},[])}function tl(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var tt=function(){return tt=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},tt.apply(this,arguments)};function nl(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function rl(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,s=[],i;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(a){i={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return s}function ol(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var ar="right-scroll-bar-position",lr="width-before-scroll-bar",bh="with-scroll-bars-hidden",xh="--removed-body-scroll-bar-size";function Jo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Ch(e,t){var n=D.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Sh=typeof window<"u"?d.useLayoutEffect:d.useEffect,sl=new WeakMap;function Eh(e,t){var n=Ch(null,function(r){return e.forEach(function(o){return Jo(o,r)})});return Sh(function(){var r=sl.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Jo(a,null)}),s.forEach(function(a){o.has(a)||Jo(a,i)})}sl.set(n,e)},[e]),n}function Nh(e){return e}function Th(e,t){t===void 0&&(t=Nh);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var u=function(){var f=i;i=[],f.forEach(s)},c=function(){return Promise.resolve().then(u)};c(),n={push:function(f){i.push(f),c()},filter:function(f){return i=i.filter(f),n}}}};return o}function Ph(e){e===void 0&&(e={});var t=Th(null);return t.options=tt({async:!0,ssr:!1},e),t}var il=function(e){var t=e.sideCar,n=nl(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return d.createElement(r,tt({},n))};il.isSideCarExport=!0;function Ah(e,t){return e.useMedium(t),il}var al=Ph(),Zo=function(){},cr=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:Zo,onWheelCapture:Zo,onTouchMoveCapture:Zo}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,u=e.className,c=e.removeScrollBar,f=e.enabled,g=e.shards,m=e.sideCar,p=e.noIsolation,v=e.inert,h=e.allowPinchZoom,y=e.as,w=y===void 0?"div":y,b=e.gapMode,S=nl(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=m,x=Eh([n,t]),P=tt(tt({},S),o);return d.createElement(d.Fragment,null,f&&d.createElement(E,{sideCar:al,removeScrollBar:c,shards:g,noIsolation:p,inert:v,setCallbacks:s,allowPinchZoom:!!h,lockRef:n,gapMode:b}),i?d.cloneElement(d.Children.only(a),tt(tt({},P),{ref:x})):d.createElement(w,tt({},P,{className:u,ref:x}),a))});cr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},cr.classNames={fullWidth:lr,zeroRight:ar};var _h=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Fh(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=_h();return t&&e.setAttribute("nonce",t),e}function Oh(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Dh(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Mh=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Fh())&&(Oh(t,n),Dh(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},kh=function(){var e=Mh();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ll=function(){var e=kh(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},$h={left:0,top:0,right:0,gap:0},Qo=function(e){return parseInt(e||"",10)||0},Ih=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Qo(n),Qo(r),Qo(o)]},Lh=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return $h;var t=Ih(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Rh=ll(),nn="data-scroll-locked",Vh=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
93
+ .`.concat(bh,` {
94
94
  overflow: hidden `).concat(r,`;
95
95
  padding-right: `).concat(a,"px ").concat(r,`;
96
96
  }
97
- body[`).concat(en,`] {
97
+ body[`).concat(nn,`] {
98
98
  overflow: hidden `).concat(r,`;
99
99
  overscroll-behavior: contain;
100
100
  `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
@@ -107,32 +107,32 @@
107
107
  `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
108
108
  }
109
109
 
110
- .`).concat(ir,` {
110
+ .`).concat(ar,` {
111
111
  right: `).concat(a,"px ").concat(r,`;
112
112
  }
113
113
 
114
- .`).concat(ar,` {
114
+ .`).concat(lr,` {
115
115
  margin-right: `).concat(a,"px ").concat(r,`;
116
116
  }
117
117
 
118
- .`).concat(ir," .").concat(ir,` {
118
+ .`).concat(ar," .").concat(ar,` {
119
119
  right: 0 `).concat(r,`;
120
120
  }
121
121
 
122
- .`).concat(ar," .").concat(ar,` {
122
+ .`).concat(lr," .").concat(lr,` {
123
123
  margin-right: 0 `).concat(r,`;
124
124
  }
125
125
 
126
- body[`).concat(en,`] {
127
- `).concat(yh,": ").concat(a,`px;
126
+ body[`).concat(nn,`] {
127
+ `).concat(xh,": ").concat(a,`px;
128
128
  }
129
- `)},al=function(){var e=parseInt(document.body.getAttribute(en)||"0",10);return isFinite(e)?e:0},Rh=function(){d.useEffect(function(){return document.body.setAttribute(en,(al()+1).toString()),function(){var e=al()-1;e<=0?document.body.removeAttribute(en):document.body.setAttribute(en,e.toString())}},[])},Lh=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Rh();var s=d.useMemo(function(){return kh(o)},[o]);return d.createElement($h,{styles:Ih(s,!t,o,n?"":"!important")})},Yo=!1;if(typeof window<"u")try{var cr=Object.defineProperty({},"passive",{get:function(){return Yo=!0,!0}});window.addEventListener("test",cr,cr),window.removeEventListener("test",cr,cr)}catch{Yo=!1}var tn=Yo?{passive:!1}:!1,Vh=function(e){return e.tagName==="TEXTAREA"},ll=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Vh(e)&&n[t]==="visible")},Bh=function(e){return ll(e,"overflowY")},zh=function(e){return ll(e,"overflowX")},cl=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=ul(e,r);if(o){var s=dl(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Hh=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Uh=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},ul=function(e,t){return e==="v"?Bh(t):zh(t)},dl=function(e,t){return e==="v"?Hh(t):Uh(t)},jh=function(e,t){return e==="h"&&t==="rtl"?-1:1},Wh=function(e,t,n,r,o){var s=jh(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,u=t.contains(a),c=!1,f=i>0,g=0,m=0;do{var p=dl(e,a),v=p[0],h=p[1],y=p[2],w=h-y-s*v;(v||w)&&ul(e,a)&&(g+=w,m+=v),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!u&&a!==document.body||u&&(t.contains(a)||t===a));return(f&&(Math.abs(g)<1||!o)||!f&&(Math.abs(m)<1||!o))&&(c=!0),c},ur=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},fl=function(e){return[e.deltaX,e.deltaY]},pl=function(e){return e&&"current"in e?e.current:e},Gh=function(e,t){return e[0]===t[0]&&e[1]===t[1]},qh=function(e){return`
129
+ `)},cl=function(){var e=parseInt(document.body.getAttribute(nn)||"0",10);return isFinite(e)?e:0},Bh=function(){d.useEffect(function(){return document.body.setAttribute(nn,(cl()+1).toString()),function(){var e=cl()-1;e<=0?document.body.removeAttribute(nn):document.body.setAttribute(nn,e.toString())}},[])},zh=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Bh();var s=d.useMemo(function(){return Lh(o)},[o]);return d.createElement(Rh,{styles:Vh(s,!t,o,n?"":"!important")})},es=!1;if(typeof window<"u")try{var ur=Object.defineProperty({},"passive",{get:function(){return es=!0,!0}});window.addEventListener("test",ur,ur),window.removeEventListener("test",ur,ur)}catch{es=!1}var rn=es?{passive:!1}:!1,Hh=function(e){return e.tagName==="TEXTAREA"},ul=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Hh(e)&&n[t]==="visible")},Uh=function(e){return ul(e,"overflowY")},jh=function(e){return ul(e,"overflowX")},dl=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=fl(e,r);if(o){var s=pl(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Wh=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Gh=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},fl=function(e,t){return e==="v"?Uh(t):jh(t)},pl=function(e,t){return e==="v"?Wh(t):Gh(t)},qh=function(e,t){return e==="h"&&t==="rtl"?-1:1},Kh=function(e,t,n,r,o){var s=qh(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,u=t.contains(a),c=!1,f=i>0,g=0,m=0;do{var p=pl(e,a),v=p[0],h=p[1],y=p[2],w=h-y-s*v;(v||w)&&fl(e,a)&&(g+=w,m+=v),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!u&&a!==document.body||u&&(t.contains(a)||t===a));return(f&&(Math.abs(g)<1||!o)||!f&&(Math.abs(m)<1||!o))&&(c=!0),c},dr=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},gl=function(e){return[e.deltaX,e.deltaY]},hl=function(e){return e&&"current"in e?e.current:e},Xh=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Yh=function(e){return`
130
130
  .block-interactivity-`.concat(e,` {pointer-events: none;}
131
131
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
132
- `)},Kh=0,nn=[];function Xh(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),o=d.useState(Kh++)[0],s=d.useState(il)[0],i=d.useRef(e);d.useEffect(function(){i.current=e},[e]),d.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var h=nl([e.lockRef.current],(e.shards||[]).map(pl),!0).filter(Boolean);return h.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),h.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=d.useCallback(function(h,y){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!i.current.allowPinchZoom;var w=ur(h),x=n.current,S="deltaX"in h?h.deltaX:x[0]-w[0],E="deltaY"in h?h.deltaY:x[1]-w[1],C,P=h.target,_=Math.abs(S)>Math.abs(E)?"h":"v";if("touches"in h&&_==="h"&&P.type==="range")return!1;var O=cl(_,P);if(!O)return!0;if(O?C=_:(C=_==="v"?"h":"v",O=cl(_,P)),!O)return!1;if(!r.current&&"changedTouches"in h&&(S||E)&&(r.current=C),!C)return!0;var k=r.current||C;return Wh(k,y,h,k==="h"?S:E,!0)},[]),u=d.useCallback(function(h){var y=h;if(!(!nn.length||nn[nn.length-1]!==s)){var w="deltaY"in y?fl(y):ur(y),x=t.current.filter(function(C){return C.name===y.type&&(C.target===y.target||y.target===C.shadowParent)&&Gh(C.delta,w)})[0];if(x&&x.should){y.cancelable&&y.preventDefault();return}if(!x){var S=(i.current.shards||[]).map(pl).filter(Boolean).filter(function(C){return C.contains(y.target)}),E=S.length>0?a(y,S[0]):!i.current.noIsolation;E&&y.cancelable&&y.preventDefault()}}},[]),c=d.useCallback(function(h,y,w,x){var S={name:h,delta:y,target:w,should:x,shadowParent:Yh(w)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(E){return E!==S})},1)},[]),f=d.useCallback(function(h){n.current=ur(h),r.current=void 0},[]),g=d.useCallback(function(h){c(h.type,fl(h),h.target,a(h,e.lockRef.current))},[]),m=d.useCallback(function(h){c(h.type,ur(h),h.target,a(h,e.lockRef.current))},[]);d.useEffect(function(){return nn.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:m}),document.addEventListener("wheel",u,tn),document.addEventListener("touchmove",u,tn),document.addEventListener("touchstart",f,tn),function(){nn=nn.filter(function(h){return h!==s}),document.removeEventListener("wheel",u,tn),document.removeEventListener("touchmove",u,tn),document.removeEventListener("touchstart",f,tn)}},[]);var p=e.removeScrollBar,v=e.inert;return d.createElement(d.Fragment,null,v?d.createElement(s,{styles:qh(o)}):null,p?d.createElement(Lh,{gapMode:e.gapMode}):null)}function Yh(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Jh=Nh(sl,Xh);var gl=d.forwardRef(function(e,t){return d.createElement(lr,Qe({},e,{ref:t,sideCar:Jh}))});gl.classNames=lr.classNames;var Zh=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},rn=new WeakMap,dr=new WeakMap,fr={},Jo=0,hl=function(e){return e&&(e.host||hl(e.parentNode))},Qh=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=hl(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},em=function(e,t,n,r){var o=Qh(t,Array.isArray(e)?e:[e]);fr[n]||(fr[n]=new WeakMap);var s=fr[n],i=[],a=new Set,u=new Set(o),c=function(g){!g||a.has(g)||(a.add(g),c(g.parentNode))};o.forEach(c);var f=function(g){!g||u.has(g)||Array.prototype.forEach.call(g.children,function(m){if(a.has(m))f(m);else try{var p=m.getAttribute(r),v=p!==null&&p!=="false",h=(rn.get(m)||0)+1,y=(s.get(m)||0)+1;rn.set(m,h),s.set(m,y),i.push(m),h===1&&v&&dr.set(m,!0),y===1&&m.setAttribute(n,"true"),v||m.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",m,w)}})};return f(t),a.clear(),Jo++,function(){i.forEach(function(g){var m=rn.get(g)-1,p=s.get(g)-1;rn.set(g,m),s.set(g,p),m||(dr.has(g)||g.removeAttribute(r),dr.delete(g)),p||g.removeAttribute(n)}),Jo--,Jo||(rn=new WeakMap,rn=new WeakMap,dr=new WeakMap,fr={})}},tm=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Zh(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),em(r,o,n,"aria-hidden")):function(){return null}},ml=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(rm);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(Zo,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Zo,{...r,ref:t,children:n})});ml.displayName="Slot";var Zo=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=sm(n);return d.cloneElement(n,{...om(r,n.props),ref:t?or(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Zo.displayName="SlotClone";var nm=({children:e})=>l.jsx(l.Fragment,{children:e});function rm(e){return d.isValidElement(e)&&e.type===nm}function om(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function sm(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Qo="Dialog",[vl,Ux]=St(Qo),[im,We]=vl(Qo),yl=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,a=d.useRef(null),u=d.useRef(null),[c=!1,f]=Jt({prop:r,defaultProp:o,onChange:s});return l.jsx(im,{scope:t,triggerRef:a,contentRef:u,contentId:Qt(),titleId:Qt(),descriptionId:Qt(),open:c,onOpenChange:f,onOpenToggle:d.useCallback(()=>f(g=>!g),[f]),modal:i,children:n})};yl.displayName=Qo;var wl="DialogTrigger",bl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=We(wl,n),s=Le(t,o.triggerRef);return l.jsx(ve.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ns(o.open),...r,ref:s,onClick:me(e.onClick,o.onOpenToggle)})});bl.displayName=wl;var es="DialogPortal",[am,xl]=vl(es,{forceMount:void 0}),Cl=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=We(es,t);return l.jsx(am,{scope:t,forceMount:n,children:d.Children.map(r,i=>l.jsx(Zt,{present:n||s.open,children:l.jsx(Wo,{asChild:!0,container:o,children:i})}))})};Cl.displayName=es;var pr="DialogOverlay",Sl=d.forwardRef((e,t)=>{const n=xl(pr,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=We(pr,e.__scopeDialog);return s.modal?l.jsx(Zt,{present:r||s.open,children:l.jsx(lm,{...o,ref:t})}):null});Sl.displayName=pr;var lm=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=We(pr,n);return l.jsx(gl,{as:ml,allowPinchZoom:!0,shards:[o.contentRef],children:l.jsx(ve.div,{"data-state":ns(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Bt="DialogContent",El=d.forwardRef((e,t)=>{const n=xl(Bt,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=We(Bt,e.__scopeDialog);return l.jsx(Zt,{present:r||s.open,children:s.modal?l.jsx(cm,{...o,ref:t}):l.jsx(um,{...o,ref:t})})});El.displayName=Bt;var cm=d.forwardRef((e,t)=>{const n=We(Bt,e.__scopeDialog),r=d.useRef(null),o=Le(t,n.contentRef,r);return d.useEffect(()=>{const s=r.current;if(s)return tm(s)},[]),l.jsx(Nl,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:me(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:me(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:me(e.onFocusOutside,s=>s.preventDefault())})}),um=d.forwardRef((e,t)=>{const n=We(Bt,e.__scopeDialog),r=d.useRef(!1),o=d.useRef(!1);return l.jsx(Nl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var u,c;(u=e.onInteractOutside)==null||u.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((c=n.triggerRef.current)==null?void 0:c.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Nl=d.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=We(Bt,n),u=d.useRef(null),c=Le(t,u);return mh(),l.jsxs(l.Fragment,{children:[l.jsx(Ka,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:l.jsx(Ho,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":ns(a.open),...i,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(dm,{titleId:a.titleId}),l.jsx(pm,{contentRef:u,descriptionId:a.descriptionId})]})]})}),ts="DialogTitle",Tl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=We(ts,n);return l.jsx(ve.h2,{id:o.titleId,...r,ref:t})});Tl.displayName=ts;var Pl="DialogDescription",Al=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=We(Pl,n);return l.jsx(ve.p,{id:o.descriptionId,...r,ref:t})});Al.displayName=Pl;var _l="DialogClose",Fl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=We(_l,n);return l.jsx(ve.button,{type:"button",...r,ref:t,onClick:me(e.onClick,()=>o.onOpenChange(!1))})});Fl.displayName=_l;function ns(e){return e?"open":"closed"}var Ol="DialogTitleWarning",[jx,Dl]=$g(Ol,{contentName:Bt,titleName:ts,docsSlug:"dialog"}),dm=({titleId:e})=>{const t=Dl(Ol),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
132
+ `)},Jh=0,on=[];function Zh(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),o=d.useState(Jh++)[0],s=d.useState(ll)[0],i=d.useRef(e);d.useEffect(function(){i.current=e},[e]),d.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var h=ol([e.lockRef.current],(e.shards||[]).map(hl),!0).filter(Boolean);return h.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),h.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=d.useCallback(function(h,y){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!i.current.allowPinchZoom;var w=dr(h),b=n.current,S="deltaX"in h?h.deltaX:b[0]-w[0],E="deltaY"in h?h.deltaY:b[1]-w[1],x,P=h.target,_=Math.abs(S)>Math.abs(E)?"h":"v";if("touches"in h&&_==="h"&&P.type==="range")return!1;var O=dl(_,P);if(!O)return!0;if(O?x=_:(x=_==="v"?"h":"v",O=dl(_,P)),!O)return!1;if(!r.current&&"changedTouches"in h&&(S||E)&&(r.current=x),!x)return!0;var k=r.current||x;return Kh(k,y,h,k==="h"?S:E,!0)},[]),u=d.useCallback(function(h){var y=h;if(!(!on.length||on[on.length-1]!==s)){var w="deltaY"in y?gl(y):dr(y),b=t.current.filter(function(x){return x.name===y.type&&(x.target===y.target||y.target===x.shadowParent)&&Xh(x.delta,w)})[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}if(!b){var S=(i.current.shards||[]).map(hl).filter(Boolean).filter(function(x){return x.contains(y.target)}),E=S.length>0?a(y,S[0]):!i.current.noIsolation;E&&y.cancelable&&y.preventDefault()}}},[]),c=d.useCallback(function(h,y,w,b){var S={name:h,delta:y,target:w,should:b,shadowParent:Qh(w)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(E){return E!==S})},1)},[]),f=d.useCallback(function(h){n.current=dr(h),r.current=void 0},[]),g=d.useCallback(function(h){c(h.type,gl(h),h.target,a(h,e.lockRef.current))},[]),m=d.useCallback(function(h){c(h.type,dr(h),h.target,a(h,e.lockRef.current))},[]);d.useEffect(function(){return on.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:m}),document.addEventListener("wheel",u,rn),document.addEventListener("touchmove",u,rn),document.addEventListener("touchstart",f,rn),function(){on=on.filter(function(h){return h!==s}),document.removeEventListener("wheel",u,rn),document.removeEventListener("touchmove",u,rn),document.removeEventListener("touchstart",f,rn)}},[]);var p=e.removeScrollBar,v=e.inert;return d.createElement(d.Fragment,null,v?d.createElement(s,{styles:Yh(o)}):null,p?d.createElement(zh,{gapMode:e.gapMode}):null)}function Qh(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const em=Ah(al,Zh);var ml=d.forwardRef(function(e,t){return d.createElement(cr,tt({},e,{ref:t,sideCar:em}))});ml.classNames=cr.classNames;var tm=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},sn=new WeakMap,fr=new WeakMap,pr={},ts=0,vl=function(e){return e&&(e.host||vl(e.parentNode))},nm=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=vl(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},rm=function(e,t,n,r){var o=nm(t,Array.isArray(e)?e:[e]);pr[n]||(pr[n]=new WeakMap);var s=pr[n],i=[],a=new Set,u=new Set(o),c=function(g){!g||a.has(g)||(a.add(g),c(g.parentNode))};o.forEach(c);var f=function(g){!g||u.has(g)||Array.prototype.forEach.call(g.children,function(m){if(a.has(m))f(m);else try{var p=m.getAttribute(r),v=p!==null&&p!=="false",h=(sn.get(m)||0)+1,y=(s.get(m)||0)+1;sn.set(m,h),s.set(m,y),i.push(m),h===1&&v&&fr.set(m,!0),y===1&&m.setAttribute(n,"true"),v||m.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",m,w)}})};return f(t),a.clear(),ts++,function(){i.forEach(function(g){var m=sn.get(g)-1,p=s.get(g)-1;sn.set(g,m),s.set(g,p),m||(fr.has(g)||g.removeAttribute(r),fr.delete(g)),p||g.removeAttribute(n)}),ts--,ts||(sn=new WeakMap,sn=new WeakMap,fr=new WeakMap,pr={})}},om=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=tm(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),rm(r,o,n,"aria-hidden")):function(){return null}},yl=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(im);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(ns,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(ns,{...r,ref:t,children:n})});yl.displayName="Slot";var ns=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=lm(n);return d.cloneElement(n,{...am(r,n.props),ref:t?sr(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});ns.displayName="SlotClone";var sm=({children:e})=>l.jsx(l.Fragment,{children:e});function im(e){return d.isValidElement(e)&&e.type===sm}function am(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function lm(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var rs="Dialog",[wl,Yx]=Nt(rs),[cm,Ke]=wl(rs),bl=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,a=d.useRef(null),u=d.useRef(null),[c=!1,f]=Qt({prop:r,defaultProp:o,onChange:s});return l.jsx(cm,{scope:t,triggerRef:a,contentRef:u,contentId:tn(),titleId:tn(),descriptionId:tn(),open:c,onOpenChange:f,onOpenToggle:d.useCallback(()=>f(g=>!g),[f]),modal:i,children:n})};bl.displayName=rs;var xl="DialogTrigger",Cl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ke(xl,n),s=ze(t,o.triggerRef);return l.jsx(ve.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":is(o.open),...r,ref:s,onClick:he(e.onClick,o.onOpenToggle)})});Cl.displayName=xl;var os="DialogPortal",[um,Sl]=wl(os,{forceMount:void 0}),El=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=Ke(os,t);return l.jsx(um,{scope:t,forceMount:n,children:d.Children.map(r,i=>l.jsx(en,{present:n||s.open,children:l.jsx(Xo,{asChild:!0,container:o,children:i})}))})};El.displayName=os;var gr="DialogOverlay",Nl=d.forwardRef((e,t)=>{const n=Sl(gr,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Ke(gr,e.__scopeDialog);return s.modal?l.jsx(en,{present:r||s.open,children:l.jsx(dm,{...o,ref:t})}):null});Nl.displayName=gr;var dm=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ke(gr,n);return l.jsx(ml,{as:yl,allowPinchZoom:!0,shards:[o.contentRef],children:l.jsx(ve.div,{"data-state":is(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ht="DialogContent",Tl=d.forwardRef((e,t)=>{const n=Sl(Ht,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Ke(Ht,e.__scopeDialog);return l.jsx(en,{present:r||s.open,children:s.modal?l.jsx(fm,{...o,ref:t}):l.jsx(pm,{...o,ref:t})})});Tl.displayName=Ht;var fm=d.forwardRef((e,t)=>{const n=Ke(Ht,e.__scopeDialog),r=d.useRef(null),o=ze(t,n.contentRef,r);return d.useEffect(()=>{const s=r.current;if(s)return om(s)},[]),l.jsx(Pl,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:he(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:he(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:he(e.onFocusOutside,s=>s.preventDefault())})}),pm=d.forwardRef((e,t)=>{const n=Ke(Ht,e.__scopeDialog),r=d.useRef(!1),o=d.useRef(!1);return l.jsx(Pl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var u,c;(u=e.onInteractOutside)==null||u.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((c=n.triggerRef.current)==null?void 0:c.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Pl=d.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=Ke(Ht,n),u=d.useRef(null),c=ze(t,u);return wh(),l.jsxs(l.Fragment,{children:[l.jsx(Ya,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:l.jsx(Go,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":is(a.open),...i,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(gm,{titleId:a.titleId}),l.jsx(mm,{contentRef:u,descriptionId:a.descriptionId})]})]})}),ss="DialogTitle",Al=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ke(ss,n);return l.jsx(ve.h2,{id:o.titleId,...r,ref:t})});Al.displayName=ss;var _l="DialogDescription",Fl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ke(_l,n);return l.jsx(ve.p,{id:o.descriptionId,...r,ref:t})});Fl.displayName=_l;var Ol="DialogClose",Dl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ke(Ol,n);return l.jsx(ve.button,{type:"button",...r,ref:t,onClick:he(e.onClick,()=>o.onOpenChange(!1))})});Dl.displayName=Ol;function is(e){return e?"open":"closed"}var Ml="DialogTitleWarning",[Jx,kl]=Rg(Ml,{contentName:Ht,titleName:ss,docsSlug:"dialog"}),gm=({titleId:e})=>{const t=kl(Ml),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
133
133
 
134
134
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
135
135
 
136
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return d.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},fm="DialogDescriptionWarning",pm=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Dl(fm).contentName}}.`;return d.useEffect(()=>{var s;const o=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},gm=yl,hm=bl,mm=Cl,Ml=Sl,kl=El,$l=Tl,Il=Al,vm=Fl;const zt=gm,gr=hm,ym=mm,Rl=d.forwardRef(({className:e,...t},n)=>l.jsx(Ml,{ref:n,className:Z("s3-explr-ui-dialog-overlay fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Rl.displayName=Ml.displayName;const Tt=d.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(ym,{children:[l.jsx(Rl,{}),l.jsxs(kl,{ref:r,className:Z("s3-explr-ui-dialog-content fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,l.jsxs(vm,{className:Z("s3-explr-ui-dialog-close absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"),children:[l.jsx(Fo,{className:"s3-explr-ui-dialog-close-icon h-4 w-4"}),l.jsx("span",{className:"s3-explr-ui-dialog-close-text sr-only",children:"Close"})]})]})]}));Tt.displayName=kl.displayName;const Pt=({className:e,...t})=>l.jsx("div",{className:Z("s3-explr-ui-dialog-header flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Pt.displayName="DialogHeader";const Nn=({className:e,...t})=>l.jsx("div",{className:Z("s3-explr-ui-dialog-footer flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Nn.displayName="DialogFooter";const At=d.forwardRef(({className:e,...t},n)=>l.jsx($l,{ref:n,className:Z("s3-explr-ui-dialog-title text-lg font-semibold leading-none tracking-tight",e),...t}));At.displayName=$l.displayName;const hr=d.forwardRef(({className:e,...t},n)=>l.jsx(Il,{ref:n,className:Z("s3-explr-ui-dialog-description text-sm text-muted-foreground",e),...t}));hr.displayName=Il.displayName;const _t=d.forwardRef(({className:e,type:t,...n},r)=>l.jsx("input",{type:t,className:Z("s3-explr-ui-input","flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));_t.displayName="Input";var wm="Label",Ll=d.forwardRef((e,t)=>l.jsx(ve.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Ll.displayName=wm;var Vl=Ll;const bm=Ro("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 s3-explr-ui-label",{variants:{variant:{default:"s3-explr-ui-label-default",required:"s3-explr-ui-label-required",disabled:"s3-explr-ui-label-disabled"},size:{default:"s3-explr-ui-label-size-default",sm:"s3-explr-ui-label-size-sm",lg:"s3-explr-ui-label-size-lg"}},defaultVariants:{variant:"default",size:"default"}}),Ht=d.forwardRef(({className:e,variant:t,size:n,...r},o)=>l.jsx(Vl,{ref:o,className:Z(bm({variant:t,size:n}),e),...r}));Ht.displayName=Vl.displayName;const mr=d.forwardRef(({className:e,...t},n)=>l.jsx("div",{className:Z("relative w-full overflow-auto","s3-explr-ui-table-container"),children:l.jsx("table",{ref:n,className:Z("w-full caption-bottom text-sm","s3-explr-ui-table",e),...t})}));mr.displayName="Table";const vr=d.forwardRef(({className:e,...t},n)=>l.jsx("thead",{ref:n,className:Z("[&_tr]:border-b","s3-explr-ui-table-header",e),...t}));vr.displayName="TableHeader";const yr=d.forwardRef(({className:e,...t},n)=>l.jsx("tbody",{ref:n,className:Z("[&_tr:last-child]:border-0","s3-explr-ui-table-body",e),...t}));yr.displayName="TableBody";const xm=d.forwardRef(({className:e,...t},n)=>l.jsx("tfoot",{ref:n,className:Z("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0","s3-explr-ui-table-footer",e),...t}));xm.displayName="TableFooter";const Ge=d.forwardRef(({className:e,...t},n)=>l.jsx("tr",{ref:n,className:Z("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted","s3-explr-ui-table-row",e),...t}));Ge.displayName="TableRow";const et=d.forwardRef(({className:e,...t},n)=>l.jsx("th",{ref:n,className:Z("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]","s3-explr-ui-table-head",e),...t}));et.displayName="TableHead";const _e=d.forwardRef(({className:e,...t},n)=>l.jsx("td",{ref:n,className:Z("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]","s3-explr-ui-table-cell",e),...t}));_e.displayName="TableCell";const Cm=d.forwardRef(({className:e,...t},n)=>l.jsx("caption",{ref:n,className:Z("mt-4 text-sm text-muted-foreground","s3-explr-ui-table-caption",e),...t}));Cm.displayName="TableCaption";function rs(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function on(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Bl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function os(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Bl(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Bl(e[o],null)}}}}function ss(...e){return d.useCallback(os(...e),e)}var is=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Em);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(as,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(as,{...r,ref:t,children:n})});is.displayName="Slot";var as=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Tm(n);return d.cloneElement(n,{...Nm(r,n.props),ref:t?os(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});as.displayName="SlotClone";var Sm=({children:e})=>l.jsx(l.Fragment,{children:e});function Em(e){return d.isValidElement(e)&&e.type===Sm}function Nm(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Tm(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Pm(e){const t=e+"CollectionProvider",[n,r]=St(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:v,children:h}=p,y=D.useRef(null),w=D.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:w,collectionRef:y,children:h})};i.displayName=t;const a=e+"CollectionSlot",u=D.forwardRef((p,v)=>{const{scope:h,children:y}=p,w=s(a,h),x=ss(v,w.collectionRef);return l.jsx(is,{ref:x,children:y})});u.displayName=a;const c=e+"CollectionItemSlot",f="data-radix-collection-item",g=D.forwardRef((p,v)=>{const{scope:h,children:y,...w}=p,x=D.useRef(null),S=ss(v,x),E=s(c,h);return D.useEffect(()=>(E.itemMap.set(x,{ref:x,...w}),()=>void E.itemMap.delete(x))),l.jsx(is,{[f]:"",ref:S,children:y})});g.displayName=c;function m(p){const v=s(e+"CollectionConsumer",p);return D.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((E,C)=>w.indexOf(E.ref.current)-w.indexOf(C.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:u,ItemSlot:g},m,r]}var zl=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(_m);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(ls,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(ls,{...r,ref:t,children:n})});zl.displayName="Slot";var ls=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Om(n);return d.cloneElement(n,{...Fm(r,n.props),ref:t?os(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});ls.displayName="SlotClone";var Am=({children:e})=>l.jsx(l.Fragment,{children:e});function _m(e){return d.isValidElement(e)&&e.type===Am}function Fm(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Om(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Dm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Hl=Dm.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?zl:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Mm=d.createContext(void 0);function Ul(e){const t=d.useContext(Mm);return e||t||"ltr"}var cs="rovingFocusGroup.onEntryFocus",km={bubbles:!1,cancelable:!0},wr="RovingFocusGroup",[us,jl,$m]=Pm(wr),[Im,Wl]=St(wr,[$m]),[Rm,Lm]=Im(wr),Gl=d.forwardRef((e,t)=>l.jsx(us.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(us.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Vm,{...e,ref:t})})}));Gl.displayName=wr;var Vm=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:u,onEntryFocus:c,preventScrollOnEntryFocus:f=!1,...g}=e,m=d.useRef(null),p=ss(t,m),v=Ul(s),[h=null,y]=Jt({prop:i,defaultProp:a,onChange:u}),[w,x]=d.useState(!1),S=Te(c),E=jl(n),C=d.useRef(!1),[P,_]=d.useState(0);return d.useEffect(()=>{const O=m.current;if(O)return O.addEventListener(cs,S),()=>O.removeEventListener(cs,S)},[S]),l.jsx(Rm,{scope:n,orientation:r,dir:v,loop:o,currentTabStopId:h,onItemFocus:d.useCallback(O=>y(O),[y]),onItemShiftTab:d.useCallback(()=>x(!0),[]),onFocusableItemAdd:d.useCallback(()=>_(O=>O+1),[]),onFocusableItemRemove:d.useCallback(()=>_(O=>O-1),[]),children:l.jsx(Hl.div,{tabIndex:w||P===0?-1:0,"data-orientation":r,...g,ref:p,style:{outline:"none",...e.style},onMouseDown:on(e.onMouseDown,()=>{C.current=!0}),onFocus:on(e.onFocus,O=>{const k=!C.current;if(O.target===O.currentTarget&&k&&!w){const F=new CustomEvent(cs,km);if(O.currentTarget.dispatchEvent(F),!F.defaultPrevented){const G=E().filter(U=>U.focusable),$=G.find(U=>U.active),R=G.find(U=>U.id===h),q=[$,R,...G].filter(Boolean).map(U=>U.ref.current);Xl(q,f)}}C.current=!1}),onBlur:on(e.onBlur,()=>x(!1))})})}),ql="RovingFocusGroupItem",Kl=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,...i}=e,a=Qt(),u=s||a,c=Lm(ql,n),f=c.currentTabStopId===u,g=jl(n),{onFocusableItemAdd:m,onFocusableItemRemove:p}=c;return d.useEffect(()=>{if(r)return m(),()=>p()},[r,m,p]),l.jsx(us.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:l.jsx(Hl.span,{tabIndex:f?0:-1,"data-orientation":c.orientation,...i,ref:t,onMouseDown:on(e.onMouseDown,v=>{r?c.onItemFocus(u):v.preventDefault()}),onFocus:on(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:on(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const h=Hm(v,c.orientation,c.dir);if(h!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let w=g().filter(x=>x.focusable).map(x=>x.ref.current);if(h==="last")w.reverse();else if(h==="prev"||h==="next"){h==="prev"&&w.reverse();const x=w.indexOf(v.currentTarget);w=c.loop?Um(w,x+1):w.slice(x+1)}setTimeout(()=>Xl(w))}})})})});Kl.displayName=ql;var Bm={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function zm(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Hm(e,t,n){const r=zm(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Bm[r]}function Xl(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Um(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var jm=Gl,Wm=Kl;function Yl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Gm(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Yl(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Yl(e[o],null)}}}}function qm(...e){return d.useCallback(Gm(...e),e)}function Km(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var Jl=e=>{const{present:t,children:n}=e,r=Xm(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=qm(r.ref,Ym(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};Jl.displayName="Presence";function Xm(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=Km(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=br(r.current);s.current=a==="mounted"?c:"none"},[a]),$e(()=>{const c=r.current,f=o.current;if(f!==e){const m=s.current,p=br(c);e?u("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&m!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),$e(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,g=p=>{const h=br(r.current).includes(p.animationName);if(p.target===t&&h&&(u("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},m=p=>{p.target===t&&(s.current=br(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:d.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function br(e){return(e==null?void 0:e.animationName)||"none"}function Ym(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Zl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Jm(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Zl(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Zl(e[o],null)}}}}var Ql=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Qm);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(ds,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(ds,{...r,ref:t,children:n})});Ql.displayName="Slot";var ds=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=tv(n);return d.cloneElement(n,{...ev(r,n.props),ref:t?Jm(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});ds.displayName="SlotClone";var Zm=({children:e})=>l.jsx(l.Fragment,{children:e});function Qm(e){return d.isValidElement(e)&&e.type===Zm}function ev(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function tv(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var nv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],xr=nv.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Ql:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),fs="Tabs",[rv,Wx]=St(fs,[Wl]),ec=Wl(),[ov,ps]=rv(fs),tc=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:a,activationMode:u="automatic",...c}=e,f=Ul(a),[g,m]=Jt({prop:r,onChange:o,defaultProp:s});return l.jsx(ov,{scope:n,baseId:Qt(),value:g,onValueChange:m,orientation:i,dir:f,activationMode:u,children:l.jsx(xr.div,{dir:f,"data-orientation":i,...c,ref:t})})});tc.displayName=fs;var nc="TabsList",rc=d.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,s=ps(nc,n),i=ec(n);return l.jsx(jm,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:r,children:l.jsx(xr.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});rc.displayName=nc;var oc="TabsTrigger",sc=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...s}=e,i=ps(oc,n),a=ec(n),u=lc(i.baseId,r),c=cc(i.baseId,r),f=r===i.value;return l.jsx(Wm,{asChild:!0,...a,focusable:!o,active:f,children:l.jsx(xr.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":c,"data-state":f?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:u,...s,ref:t,onMouseDown:rs(e.onMouseDown,g=>{!o&&g.button===0&&g.ctrlKey===!1?i.onValueChange(r):g.preventDefault()}),onKeyDown:rs(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&i.onValueChange(r)}),onFocus:rs(e.onFocus,()=>{const g=i.activationMode!=="manual";!f&&!o&&g&&i.onValueChange(r)})})})});sc.displayName=oc;var ic="TabsContent",ac=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:s,...i}=e,a=ps(ic,n),u=lc(a.baseId,r),c=cc(a.baseId,r),f=r===a.value,g=d.useRef(f);return d.useEffect(()=>{const m=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(m)},[]),l.jsx(Jl,{present:o||f,children:({present:m})=>l.jsx(xr.div,{"data-state":f?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":u,hidden:!m,id:c,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:g.current?"0s":void 0},children:m&&s})})});ac.displayName=ic;function lc(e,t){return`${e}-trigger-${t}`}function cc(e,t){return`${e}-content-${t}`}var sv=tc,uc=rc,dc=sc,fc=ac;const iv=sv,pc=d.forwardRef(({className:e,...t},n)=>l.jsx(uc,{ref:n,className:Z("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));pc.displayName=uc.displayName;const gs=d.forwardRef(({className:e,...t},n)=>l.jsx(dc,{ref:n,className:Z("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));gs.displayName=dc.displayName;const hs=d.forwardRef(({className:e,...t},n)=>l.jsx(fc,{ref:n,className:Z("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));hs.displayName=fc.displayName;const Cr=d.forwardRef(({className:e,...t},n)=>l.jsx("textarea",{className:Z("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...t}));Cr.displayName="Textarea";function av(e,t=[]){let n=[];function r(s,i){const a=d.createContext(i),u=n.length;n=[...n,i];function c(g){const{scope:m,children:p,...v}=g,h=(m==null?void 0:m[e][u])||a,y=d.useMemo(()=>v,Object.values(v));return l.jsx(h.Provider,{value:y,children:p})}function f(g,m){const p=(m==null?void 0:m[e][u])||a,v=d.useContext(p);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${g}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,f]}const o=()=>{const s=n.map(i=>d.createContext(i));return function(a){const u=(a==null?void 0:a[e])||s;return d.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return o.scopeName=e,[r,lv(o,...t)]}function lv(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:u,scopeName:c})=>{const g=u(s)[`__scope${c}`];return{...a,...g}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var ms=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(uv);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(vs,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(vs,{...r,ref:t,children:n})});ms.displayName="Slot";var vs=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=fv(n);return d.cloneElement(n,{...dv(r,n.props),ref:t?or(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});vs.displayName="SlotClone";var cv=({children:e})=>l.jsx(l.Fragment,{children:e});function uv(e){return d.isValidElement(e)&&e.type===cv}function dv(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function fv(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function pv(e){const t=e+"CollectionProvider",[n,r]=av(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:v,children:h}=p,y=D.useRef(null),w=D.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:w,collectionRef:y,children:h})};i.displayName=t;const a=e+"CollectionSlot",u=D.forwardRef((p,v)=>{const{scope:h,children:y}=p,w=s(a,h),x=Le(v,w.collectionRef);return l.jsx(ms,{ref:x,children:y})});u.displayName=a;const c=e+"CollectionItemSlot",f="data-radix-collection-item",g=D.forwardRef((p,v)=>{const{scope:h,children:y,...w}=p,x=D.useRef(null),S=Le(v,x),E=s(c,h);return D.useEffect(()=>(E.itemMap.set(x,{ref:x,...w}),()=>void E.itemMap.delete(x))),l.jsx(ms,{[f]:"",ref:S,children:y})});g.displayName=c;function m(p){const v=s(e+"CollectionConsumer",p);return D.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((E,C)=>w.indexOf(E.ref.current)-w.indexOf(C.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:u,ItemSlot:g},m,r]}var gv="VisuallyHidden",ys=d.forwardRef((e,t)=>l.jsx(ve.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));ys.displayName=gv;var ws="ToastProvider",[bs,hv,mv]=pv("Toast"),[gc,Gx]=St("Toast",[mv]),[vv,Sr]=gc(ws),hc=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:s=50,children:i}=e,[a,u]=d.useState(null),[c,f]=d.useState(0),g=d.useRef(!1),m=d.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${ws}\`. Expected non-empty \`string\`.`),l.jsx(bs.Provider,{scope:t,children:l.jsx(vv,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:s,toastCount:c,viewport:a,onViewportChange:u,onToastAdd:d.useCallback(()=>f(p=>p+1),[]),onToastRemove:d.useCallback(()=>f(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:g,isClosePausedRef:m,children:i})})};hc.displayName=ws;var mc="ToastViewport",yv=["F8"],xs="toast.viewportPause",Cs="toast.viewportResume",vc=d.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=yv,label:o="Notifications ({hotkey})",...s}=e,i=Sr(mc,n),a=hv(n),u=d.useRef(null),c=d.useRef(null),f=d.useRef(null),g=d.useRef(null),m=Le(t,g,i.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),v=i.toastCount>0;d.useEffect(()=>{const y=w=>{var S;r.length!==0&&r.every(E=>w[E]||w.code===E)&&((S=g.current)==null||S.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),d.useEffect(()=>{const y=u.current,w=g.current;if(v&&y&&w){const x=()=>{if(!i.isClosePausedRef.current){const P=new CustomEvent(xs);w.dispatchEvent(P),i.isClosePausedRef.current=!0}},S=()=>{if(i.isClosePausedRef.current){const P=new CustomEvent(Cs);w.dispatchEvent(P),i.isClosePausedRef.current=!1}},E=P=>{!y.contains(P.relatedTarget)&&S()},C=()=>{y.contains(document.activeElement)||S()};return y.addEventListener("focusin",x),y.addEventListener("focusout",E),y.addEventListener("pointermove",x),y.addEventListener("pointerleave",C),window.addEventListener("blur",x),window.addEventListener("focus",S),()=>{y.removeEventListener("focusin",x),y.removeEventListener("focusout",E),y.removeEventListener("pointermove",x),y.removeEventListener("pointerleave",C),window.removeEventListener("blur",x),window.removeEventListener("focus",S)}}},[v,i.isClosePausedRef]);const h=d.useCallback(({tabbingDirection:y})=>{const x=a().map(S=>{const E=S.ref.current,C=[E,...Ov(E)];return y==="forwards"?C:C.reverse()});return(y==="forwards"?x.reverse():x).flat()},[a]);return d.useEffect(()=>{const y=g.current;if(y){const w=x=>{var C,P,_;const S=x.altKey||x.ctrlKey||x.metaKey;if(x.key==="Tab"&&!S){const O=document.activeElement,k=x.shiftKey;if(x.target===y&&k){(C=c.current)==null||C.focus();return}const $=h({tabbingDirection:k?"backwards":"forwards"}),R=$.findIndex(M=>M===O);Ns($.slice(R+1))?x.preventDefault():k?(P=c.current)==null||P.focus():(_=f.current)==null||_.focus()}};return y.addEventListener("keydown",w),()=>y.removeEventListener("keydown",w)}},[a,h]),l.jsxs(ah,{ref:u,role:"region","aria-label":o.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&l.jsx(Ss,{ref:c,onFocusFromOutsideViewport:()=>{const y=h({tabbingDirection:"forwards"});Ns(y)}}),l.jsx(bs.Slot,{scope:n,children:l.jsx(ve.ol,{tabIndex:-1,...s,ref:m})}),v&&l.jsx(Ss,{ref:f,onFocusFromOutsideViewport:()=>{const y=h({tabbingDirection:"backwards"});Ns(y)}})]})});vc.displayName=mc;var yc="ToastFocusProxy",Ss=d.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,s=Sr(yc,n);return l.jsx(ys,{"aria-hidden":!0,tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:i=>{var c;const a=i.relatedTarget;!((c=s.viewport)!=null&&c.contains(a))&&r()}})});Ss.displayName=yc;var Er="Toast",wv="toast.swipeStart",bv="toast.swipeMove",xv="toast.swipeCancel",Cv="toast.swipeEnd",wc=d.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:s,...i}=e,[a=!0,u]=Jt({prop:r,defaultProp:o,onChange:s});return l.jsx(Zt,{present:n||a,children:l.jsx(Nv,{open:a,...i,ref:t,onClose:()=>u(!1),onPause:Te(e.onPause),onResume:Te(e.onResume),onSwipeStart:me(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:me(e.onSwipeMove,c=>{const{x:f,y:g}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${g}px`)}),onSwipeCancel:me(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:me(e.onSwipeEnd,c=>{const{x:f,y:g}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${g}px`),u(!1)})})})});wc.displayName=Er;var[Sv,Ev]=gc(Er,{onClose(){}}),Nv=d.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:s,onClose:i,onEscapeKeyDown:a,onPause:u,onResume:c,onSwipeStart:f,onSwipeMove:g,onSwipeCancel:m,onSwipeEnd:p,...v}=e,h=Sr(Er,n),[y,w]=d.useState(null),x=Le(t,M=>w(M)),S=d.useRef(null),E=d.useRef(null),C=o||h.duration,P=d.useRef(0),_=d.useRef(C),O=d.useRef(0),{onToastAdd:k,onToastRemove:F}=h,G=Te(()=>{var q;(y==null?void 0:y.contains(document.activeElement))&&((q=h.viewport)==null||q.focus()),i()}),$=d.useCallback(M=>{!M||M===1/0||(window.clearTimeout(O.current),P.current=new Date().getTime(),O.current=window.setTimeout(G,M))},[G]);d.useEffect(()=>{const M=h.viewport;if(M){const q=()=>{$(_.current),c==null||c()},U=()=>{const X=new Date().getTime()-P.current;_.current=_.current-X,window.clearTimeout(O.current),u==null||u()};return M.addEventListener(xs,U),M.addEventListener(Cs,q),()=>{M.removeEventListener(xs,U),M.removeEventListener(Cs,q)}}},[h.viewport,C,u,c,$]),d.useEffect(()=>{s&&!h.isClosePausedRef.current&&$(C)},[s,C,h.isClosePausedRef,$]),d.useEffect(()=>(k(),()=>F()),[k,F]);const R=d.useMemo(()=>y?Tc(y):null,[y]);return h.viewport?l.jsxs(l.Fragment,{children:[R&&l.jsx(Tv,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:R}),l.jsx(Sv,{scope:n,onClose:G,children:zn.createPortal(l.jsx(bs.ItemSlot,{scope:n,children:l.jsx(ih,{asChild:!0,onEscapeKeyDown:me(a,()=>{h.isFocusedToastEscapeKeyDownRef.current||G(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:l.jsx(ve.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":h.swipeDirection,...v,ref:x,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:me(e.onKeyDown,M=>{M.key==="Escape"&&(a==null||a(M.nativeEvent),M.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,G()))}),onPointerDown:me(e.onPointerDown,M=>{M.button===0&&(S.current={x:M.clientX,y:M.clientY})}),onPointerMove:me(e.onPointerMove,M=>{if(!S.current)return;const q=M.clientX-S.current.x,U=M.clientY-S.current.y,X=!!E.current,K=["left","right"].includes(h.swipeDirection),ee=["left","up"].includes(h.swipeDirection)?Math.min:Math.max,ie=K?ee(0,q):0,fe=K?0:ee(0,U),Oe=M.pointerType==="touch"?10:2,xe={x:ie,y:fe},Be={originalEvent:M,delta:xe};X?(E.current=xe,Nr(bv,g,Be,{discrete:!1})):Pc(xe,h.swipeDirection,Oe)?(E.current=xe,Nr(wv,f,Be,{discrete:!1}),M.target.setPointerCapture(M.pointerId)):(Math.abs(q)>Oe||Math.abs(U)>Oe)&&(S.current=null)}),onPointerUp:me(e.onPointerUp,M=>{const q=E.current,U=M.target;if(U.hasPointerCapture(M.pointerId)&&U.releasePointerCapture(M.pointerId),E.current=null,S.current=null,q){const X=M.currentTarget,K={originalEvent:M,delta:q};Pc(q,h.swipeDirection,h.swipeThreshold)?Nr(Cv,p,K,{discrete:!0}):Nr(xv,m,K,{discrete:!0}),X.addEventListener("click",ee=>ee.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),Tv=e=>{const{__scopeToast:t,children:n,...r}=e,o=Sr(Er,t),[s,i]=d.useState(!1),[a,u]=d.useState(!1);return _v(()=>i(!0)),d.useEffect(()=>{const c=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:l.jsx(Wo,{asChild:!0,children:l.jsx(ys,{...r,children:s&&l.jsxs(l.Fragment,{children:[o.label," ",n]})})})},Pv="ToastTitle",bc=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(ve.div,{...r,ref:t})});bc.displayName=Pv;var Av="ToastDescription",xc=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(ve.div,{...r,ref:t})});xc.displayName=Av;var Cc="ToastAction",Sc=d.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?l.jsx(Nc,{altText:n,asChild:!0,children:l.jsx(Es,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Cc}\`. Expected non-empty \`string\`.`),null)});Sc.displayName=Cc;var Ec="ToastClose",Es=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=Ev(Ec,n);return l.jsx(Nc,{asChild:!0,children:l.jsx(ve.button,{type:"button",...r,ref:t,onClick:me(e.onClick,o.onClose)})})});Es.displayName=Ec;var Nc=d.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return l.jsx(ve.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function Tc(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),Fv(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!o)if(s){const i=r.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...Tc(r))}}),t}function Nr(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?$a(o,s):o.dispatchEvent(s)}var Pc=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),s=r>o;return t==="left"||t==="right"?s&&r>n:!s&&o>n};function _v(e=()=>{}){const t=Te(e);$e(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function Fv(e){return e.nodeType===e.ELEMENT_NODE}function Ov(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ns(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var Dv=hc,Ac=vc,_c=wc,Fc=bc,Oc=xc,Dc=Sc,Mc=Es;const Mv=Dv,kc=d.forwardRef(({className:e,...t},n)=>l.jsx(Ac,{ref:n,className:Z("s3-explr-ui-toast-viewport fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));kc.displayName=Ac.displayName;const kv=Ro("s3-explr-ui-toast group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"s3-explr-ui-toast-default border bg-background text-foreground",destructive:"s3-explr-ui-toast-destructive destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),$c=d.forwardRef(({className:e,variant:t,...n},r)=>l.jsx(_c,{ref:r,className:Z(kv({variant:t}),e),...n}));$c.displayName=_c.displayName;const $v=d.forwardRef(({className:e,...t},n)=>l.jsx(Dc,{ref:n,className:Z("s3-explr-ui-toast-action inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));$v.displayName=Dc.displayName;const Ic=d.forwardRef(({className:e,...t},n)=>l.jsx(Mc,{ref:n,className:Z("s3-explr-ui-toast-close absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:l.jsx(Fo,{className:"s3-explr-ui-toast-close-icon h-4 w-4"})}));Ic.displayName=Mc.displayName;const Rc=d.forwardRef(({className:e,...t},n)=>l.jsx(Fc,{ref:n,className:Z("s3-explr-ui-toast-title text-sm font-semibold [&+div]:text-xs",e),...t}));Rc.displayName=Fc.displayName;const Lc=d.forwardRef(({className:e,...t},n)=>l.jsx(Oc,{ref:n,className:Z("s3-explr-ui-toast-description text-sm opacity-90",e),...t}));Lc.displayName=Oc.displayName;const Iv=1,Rv=1e6;let Ts=0;function Lv(){return Ts=(Ts+1)%Number.MAX_SAFE_INTEGER,Ts.toString()}const Ps=new Map,Vc=e=>{if(Ps.has(e))return;const t=setTimeout(()=>{Ps.delete(e),Tn({type:"REMOVE_TOAST",toastId:e})},Rv);Ps.set(e,t)},Vv=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Iv)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?Vc(n):e.toasts.forEach(r=>{Vc(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Tr=[];let Pr={toasts:[]};function Tn(e){Pr=Vv(Pr,e),Tr.forEach(t=>{t(Pr)})}function Bv({...e}){const t=Lv(),n=o=>Tn({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>Tn({type:"DISMISS_TOAST",toastId:t});return Tn({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function As(){const[e,t]=d.useState(Pr);return d.useEffect(()=>(Tr.push(t),()=>{const n=Tr.indexOf(t);n>-1&&Tr.splice(n,1)}),[e]),{...e,toast:Bv,dismiss:n=>Tn({type:"DISMISS_TOAST",toastId:n})}}function Bc(){const{toasts:e}=As();return l.jsxs(Mv,{children:[e.map(function({id:t,title:n,description:r,action:o,...s}){return l.jsxs($c,{...s,className:`s3-explr-ui-toast ${s.className||""}`,children:[l.jsxs("div",{className:"s3-explr-ui-toast-content grid gap-1",children:[n&&l.jsx(Rc,{className:"s3-explr-ui-toast-title",children:n}),r&&l.jsx(Lc,{className:"s3-explr-ui-toast-description",children:r})]}),o&&l.jsx("div",{className:"s3-explr-ui-toast-action",children:o}),l.jsx(Ic,{className:"s3-explr-ui-toast-close"})]},t)}),l.jsx(kc,{className:"s3-explr-ui-toast-viewport"})]})}function ut(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function zc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function zv(...e){return t=>{let n=!1;const r=e.map(o=>{const s=zc(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():zc(e[o],null)}}}}function Pn(...e){return d.useCallback(zv(...e),e)}var Hv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],An=Hv.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Kt:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Uv(e,t){e&&zn.flushSync(()=>e.dispatchEvent(t))}var jv="DismissableLayer",_s="dismissableLayer.update",Wv="dismissableLayer.pointerDownOutside",Gv="dismissableLayer.focusOutside",Hc,Uc=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),jc=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...u}=e,c=d.useContext(Uc),[f,g]=d.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=d.useState({}),v=Pn(t,_=>g(_)),h=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=h.indexOf(y),x=f?h.indexOf(f):-1,S=c.layersWithOutsidePointerEventsDisabled.size>0,E=x>=w,C=Xv(_=>{const O=_.target,k=[...c.branches].some(F=>F.contains(O));!E||k||(o==null||o(_),i==null||i(_),_.defaultPrevented||a==null||a())},m),P=Yv(_=>{const O=_.target;[...c.branches].some(F=>F.contains(O))||(s==null||s(_),i==null||i(_),_.defaultPrevented||a==null||a())},m);return za(_=>{x===c.layers.size-1&&(r==null||r(_),!_.defaultPrevented&&a&&(_.preventDefault(),a()))},m),d.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Hc=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),Wc(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Hc)}},[f,m,n,c]),d.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),Wc())},[f,c]),d.useEffect(()=>{const _=()=>p({});return document.addEventListener(_s,_),()=>document.removeEventListener(_s,_)},[]),l.jsx(An.div,{...u,ref:v,style:{pointerEvents:S?E?"auto":"none":void 0,...e.style},onFocusCapture:ut(e.onFocusCapture,P.onFocusCapture),onBlurCapture:ut(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:ut(e.onPointerDownCapture,C.onPointerDownCapture)})});jc.displayName=jv;var qv="DismissableLayerBranch",Kv=d.forwardRef((e,t)=>{const n=d.useContext(Uc),r=d.useRef(null),o=Pn(t,r);return d.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(An.div,{...e,ref:o})});Kv.displayName=qv;function Xv(e,t=globalThis==null?void 0:globalThis.document){const n=Te(e),r=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let u=function(){Gc(Wv,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Yv(e,t=globalThis==null?void 0:globalThis.document){const n=Te(e),r=d.useRef(!1);return d.useEffect(()=>{const o=s=>{s.target&&!r.current&&Gc(Gv,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Wc(){const e=new CustomEvent(_s);document.dispatchEvent(e)}function Gc(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Uv(o,s):o.dispatchEvent(s)}const Jv=["top","right","bottom","left"],Ft=Math.min,Ie=Math.max,Ar=Math.round,_r=Math.floor,tt=e=>({x:e,y:e}),Zv={left:"right",right:"left",bottom:"top",top:"bottom"},Qv={start:"end",end:"start"};function Fs(e,t,n){return Ie(e,Ft(t,n))}function dt(e,t){return typeof e=="function"?e(t):e}function ft(e){return e.split("-")[0]}function sn(e){return e.split("-")[1]}function Os(e){return e==="x"?"y":"x"}function Ds(e){return e==="y"?"height":"width"}function Ot(e){return["top","bottom"].includes(ft(e))?"y":"x"}function Ms(e){return Os(Ot(e))}function ey(e,t,n){n===void 0&&(n=!1);const r=sn(e),o=Ms(e),s=Ds(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Fr(i)),[i,Fr(i)]}function ty(e){const t=Fr(e);return[ks(e),t,ks(t)]}function ks(e){return e.replace(/start|end/g,t=>Qv[t])}function ny(e,t,n){const r=["left","right"],o=["right","left"],s=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?s:i;default:return[]}}function ry(e,t,n,r){const o=sn(e);let s=ny(ft(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(ks)))),s}function Fr(e){return e.replace(/left|right|bottom|top/g,t=>Zv[t])}function oy(e){return{top:0,right:0,bottom:0,left:0,...e}}function qc(e){return typeof e!="number"?oy(e):{top:e,right:e,bottom:e,left:e}}function Or(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Kc(e,t,n){let{reference:r,floating:o}=e;const s=Ot(t),i=Ms(t),a=Ds(i),u=ft(t),c=s==="y",f=r.x+r.width/2-o.width/2,g=r.y+r.height/2-o.height/2,m=r[a]/2-o[a]/2;let p;switch(u){case"top":p={x:f,y:r.y-o.height};break;case"bottom":p={x:f,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:g};break;case"left":p={x:r.x-o.width,y:g};break;default:p={x:r.x,y:r.y}}switch(sn(t)){case"start":p[i]-=m*(n&&c?-1:1);break;case"end":p[i]+=m*(n&&c?-1:1);break}return p}const sy=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),u=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:g}=Kc(c,r,u),m=r,p={},v=0;for(let h=0;h<a.length;h++){const{name:y,fn:w}=a[h],{x,y:S,data:E,reset:C}=await w({x:f,y:g,initialPlacement:r,placement:m,strategy:o,middlewareData:p,rects:c,platform:i,elements:{reference:e,floating:t}});f=x??f,g=S??g,p={...p,[y]:{...p[y],...E}},C&&v<=50&&(v++,typeof C=="object"&&(C.placement&&(m=C.placement),C.rects&&(c=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:f,y:g}=Kc(c,m,u)),h=-1)}return{x:f,y:g,placement:m,strategy:o,middlewareData:p}};async function _n(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:g="floating",altBoundary:m=!1,padding:p=0}=dt(t,e),v=qc(p),y=a[m?g==="floating"?"reference":"floating":g],w=Or(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:f,strategy:u})),x=g==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),E=await(s.isElement==null?void 0:s.isElement(S))?await(s.getScale==null?void 0:s.getScale(S))||{x:1,y:1}:{x:1,y:1},C=Or(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:S,strategy:u}):x);return{top:(w.top-C.top+v.top)/E.y,bottom:(C.bottom-w.bottom+v.bottom)/E.y,left:(w.left-C.left+v.left)/E.x,right:(C.right-w.right+v.right)/E.x}}const iy=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:u}=t,{element:c,padding:f=0}=dt(e,t)||{};if(c==null)return{};const g=qc(f),m={x:n,y:r},p=Ms(o),v=Ds(p),h=await i.getDimensions(c),y=p==="y",w=y?"top":"left",x=y?"bottom":"right",S=y?"clientHeight":"clientWidth",E=s.reference[v]+s.reference[p]-m[p]-s.floating[v],C=m[p]-s.reference[p],P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let _=P?P[S]:0;(!_||!await(i.isElement==null?void 0:i.isElement(P)))&&(_=a.floating[S]||s.floating[v]);const O=E/2-C/2,k=_/2-h[v]/2-1,F=Ft(g[w],k),G=Ft(g[x],k),$=F,R=_-h[v]-G,M=_/2-h[v]/2+O,q=Fs($,M,R),U=!u.arrow&&sn(o)!=null&&M!==q&&s.reference[v]/2-(M<$?F:G)-h[v]/2<0,X=U?M<$?M-$:M-R:0;return{[p]:m[p]+X,data:{[p]:q,centerOffset:M-q-X,...U&&{alignmentOffset:X}},reset:U}}}),ay=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:u,elements:c}=t,{mainAxis:f=!0,crossAxis:g=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:h=!0,...y}=dt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=ft(o),x=Ot(a),S=ft(a)===a,E=await(u.isRTL==null?void 0:u.isRTL(c.floating)),C=m||(S||!h?[Fr(a)]:ty(a)),P=v!=="none";!m&&P&&C.push(...ry(a,h,v,E));const _=[a,...C],O=await _n(t,y),k=[];let F=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&k.push(O[w]),g){const M=ey(o,i,E);k.push(O[M[0]],O[M[1]])}if(F=[...F,{placement:o,overflows:k}],!k.every(M=>M<=0)){var G,$;const M=(((G=s.flip)==null?void 0:G.index)||0)+1,q=_[M];if(q)return{data:{index:M,overflows:F},reset:{placement:q}};let U=($=F.filter(X=>X.overflows[0]<=0).sort((X,K)=>X.overflows[1]-K.overflows[1])[0])==null?void 0:$.placement;if(!U)switch(p){case"bestFit":{var R;const X=(R=F.filter(K=>{if(P){const ee=Ot(K.placement);return ee===x||ee==="y"}return!0}).map(K=>[K.placement,K.overflows.filter(ee=>ee>0).reduce((ee,ie)=>ee+ie,0)]).sort((K,ee)=>K[1]-ee[1])[0])==null?void 0:R[0];X&&(U=X);break}case"initialPlacement":U=a;break}if(o!==U)return{reset:{placement:U}}}return{}}}};function Xc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Yc(e){return Jv.some(t=>e[t]>=0)}const ly=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=dt(e,t);switch(r){case"referenceHidden":{const s=await _n(t,{...o,elementContext:"reference"}),i=Xc(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Yc(i)}}}case"escaped":{const s=await _n(t,{...o,altBoundary:!0}),i=Xc(s,n.floating);return{data:{escapedOffsets:i,escaped:Yc(i)}}}default:return{}}}}};async function cy(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=ft(n),a=sn(n),u=Ot(n)==="y",c=["left","top"].includes(i)?-1:1,f=s&&u?-1:1,g=dt(t,e);let{mainAxis:m,crossAxis:p,alignmentAxis:v}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return a&&typeof v=="number"&&(p=a==="end"?v*-1:v),u?{x:p*f,y:m*c}:{x:m*c,y:p*f}}const uy=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,u=await cy(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:s+u.y,data:{...u,placement:i}}}}},dy=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:y=>{let{x:w,y:x}=y;return{x:w,y:x}}},...u}=dt(e,t),c={x:n,y:r},f=await _n(t,u),g=Ot(ft(o)),m=Os(g);let p=c[m],v=c[g];if(s){const y=m==="y"?"top":"left",w=m==="y"?"bottom":"right",x=p+f[y],S=p-f[w];p=Fs(x,p,S)}if(i){const y=g==="y"?"top":"left",w=g==="y"?"bottom":"right",x=v+f[y],S=v-f[w];v=Fs(x,v,S)}const h=a.fn({...t,[m]:p,[g]:v});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[m]:s,[g]:i}}}}}},fy=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:u=!0,crossAxis:c=!0}=dt(e,t),f={x:n,y:r},g=Ot(o),m=Os(g);let p=f[m],v=f[g];const h=dt(a,t),y=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(u){const S=m==="y"?"height":"width",E=s.reference[m]-s.floating[S]+y.mainAxis,C=s.reference[m]+s.reference[S]-y.mainAxis;p<E?p=E:p>C&&(p=C)}if(c){var w,x;const S=m==="y"?"width":"height",E=["top","left"].includes(ft(o)),C=s.reference[g]-s.floating[S]+(E&&((w=i.offset)==null?void 0:w[g])||0)+(E?0:y.crossAxis),P=s.reference[g]+s.reference[S]+(E?0:((x=i.offset)==null?void 0:x[g])||0)-(E?y.crossAxis:0);v<C?v=C:v>P&&(v=P)}return{[m]:p,[g]:v}}}},py=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:u=()=>{},...c}=dt(e,t),f=await _n(t,c),g=ft(o),m=sn(o),p=Ot(o)==="y",{width:v,height:h}=s.floating;let y,w;g==="top"||g==="bottom"?(y=g,w=m===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(w=g,y=m==="end"?"top":"bottom");const x=h-f.top-f.bottom,S=v-f.left-f.right,E=Ft(h-f[y],x),C=Ft(v-f[w],S),P=!t.middlewareData.shift;let _=E,O=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(_=x),P&&!m){const F=Ie(f.left,0),G=Ie(f.right,0),$=Ie(f.top,0),R=Ie(f.bottom,0);p?O=v-2*(F!==0||G!==0?F+G:Ie(f.left,f.right)):_=h-2*($!==0||R!==0?$+R:Ie(f.top,f.bottom))}await u({...t,availableWidth:O,availableHeight:_});const k=await i.getDimensions(a.floating);return v!==k.width||h!==k.height?{reset:{rects:!0}}:{}}}};function Dr(){return typeof window<"u"}function an(e){return Jc(e)?(e.nodeName||"").toLowerCase():"#document"}function Re(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function nt(e){var t;return(t=(Jc(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Jc(e){return Dr()?e instanceof Node||e instanceof Re(e).Node:!1}function qe(e){return Dr()?e instanceof Element||e instanceof Re(e).Element:!1}function rt(e){return Dr()?e instanceof HTMLElement||e instanceof Re(e).HTMLElement:!1}function Zc(e){return!Dr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Re(e).ShadowRoot}function Fn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ke(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function gy(e){return["table","td","th"].includes(an(e))}function Mr(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function $s(e){const t=Is(),n=qe(e)?Ke(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function hy(e){let t=Dt(e);for(;rt(t)&&!ln(t);){if($s(t))return t;if(Mr(t))return null;t=Dt(t)}return null}function Is(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ln(e){return["html","body","#document"].includes(an(e))}function Ke(e){return Re(e).getComputedStyle(e)}function kr(e){return qe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Dt(e){if(an(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Zc(e)&&e.host||nt(e);return Zc(t)?t.host:t}function Qc(e){const t=Dt(e);return ln(t)?e.ownerDocument?e.ownerDocument.body:e.body:rt(t)&&Fn(t)?t:Qc(t)}function On(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Qc(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Re(o);if(s){const a=Rs(i);return t.concat(i,i.visualViewport||[],Fn(o)?o:[],a&&n?On(a):[])}return t.concat(o,On(o,[],n))}function Rs(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function eu(e){const t=Ke(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=rt(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Ar(n)!==s||Ar(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Ls(e){return qe(e)?e:e.contextElement}function cn(e){const t=Ls(e);if(!rt(t))return tt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=eu(t);let i=(s?Ar(n.width):n.width)/r,a=(s?Ar(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const my=tt(0);function tu(e){const t=Re(e);return!Is()||!t.visualViewport?my:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function vy(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Re(e)?!1:t}function Ut(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Ls(e);let i=tt(1);t&&(r?qe(r)&&(i=cn(r)):i=cn(e));const a=vy(s,n,r)?tu(s):tt(0);let u=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,f=o.width/i.x,g=o.height/i.y;if(s){const m=Re(s),p=r&&qe(r)?Re(r):r;let v=m,h=Rs(v);for(;h&&r&&p!==v;){const y=cn(h),w=h.getBoundingClientRect(),x=Ke(h),S=w.left+(h.clientLeft+parseFloat(x.paddingLeft))*y.x,E=w.top+(h.clientTop+parseFloat(x.paddingTop))*y.y;u*=y.x,c*=y.y,f*=y.x,g*=y.y,u+=S,c+=E,v=Re(h),h=Rs(v)}}return Or({width:f,height:g,x:u,y:c})}function Vs(e,t){const n=kr(e).scrollLeft;return t?t.left+n:Ut(nt(e)).left+n}function nu(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Vs(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function yy(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=nt(r),a=t?Mr(t.floating):!1;if(r===i||a&&s)return n;let u={scrollLeft:0,scrollTop:0},c=tt(1);const f=tt(0),g=rt(r);if((g||!g&&!s)&&((an(r)!=="body"||Fn(i))&&(u=kr(r)),rt(r))){const p=Ut(r);c=cn(r),f.x=p.x+r.clientLeft,f.y=p.y+r.clientTop}const m=i&&!g&&!s?nu(i,u,!0):tt(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+f.x+m.x,y:n.y*c.y-u.scrollTop*c.y+f.y+m.y}}function wy(e){return Array.from(e.getClientRects())}function by(e){const t=nt(e),n=kr(e),r=e.ownerDocument.body,o=Ie(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Ie(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Vs(e);const a=-n.scrollTop;return Ke(r).direction==="rtl"&&(i+=Ie(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function xy(e,t){const n=Re(e),r=nt(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,u=0;if(o){s=o.width,i=o.height;const c=Is();(!c||c&&t==="fixed")&&(a=o.offsetLeft,u=o.offsetTop)}return{width:s,height:i,x:a,y:u}}function Cy(e,t){const n=Ut(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=rt(e)?cn(e):tt(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,u=o*s.x,c=r*s.y;return{width:i,height:a,x:u,y:c}}function ru(e,t,n){let r;if(t==="viewport")r=xy(e,n);else if(t==="document")r=by(nt(e));else if(qe(t))r=Cy(t,n);else{const o=tu(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Or(r)}function ou(e,t){const n=Dt(e);return n===t||!qe(n)||ln(n)?!1:Ke(n).position==="fixed"||ou(n,t)}function Sy(e,t){const n=t.get(e);if(n)return n;let r=On(e,[],!1).filter(a=>qe(a)&&an(a)!=="body"),o=null;const s=Ke(e).position==="fixed";let i=s?Dt(e):e;for(;qe(i)&&!ln(i);){const a=Ke(i),u=$s(i);!u&&a.position==="fixed"&&(o=null),(s?!u&&!o:!u&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Fn(i)&&!u&&ou(e,i))?r=r.filter(f=>f!==i):o=a,i=Dt(i)}return t.set(e,r),r}function Ey(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Mr(t)?[]:Sy(t,this._c):[].concat(n),r],a=i[0],u=i.reduce((c,f)=>{const g=ru(t,f,o);return c.top=Ie(g.top,c.top),c.right=Ft(g.right,c.right),c.bottom=Ft(g.bottom,c.bottom),c.left=Ie(g.left,c.left),c},ru(t,a,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Ny(e){const{width:t,height:n}=eu(e);return{width:t,height:n}}function Ty(e,t,n){const r=rt(t),o=nt(t),s=n==="fixed",i=Ut(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const u=tt(0);if(r||!r&&!s)if((an(t)!=="body"||Fn(o))&&(a=kr(t)),r){const m=Ut(t,!0,s,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}else o&&(u.x=Vs(o));const c=o&&!r&&!s?nu(o,a):tt(0),f=i.left+a.scrollLeft-u.x-c.x,g=i.top+a.scrollTop-u.y-c.y;return{x:f,y:g,width:i.width,height:i.height}}function Bs(e){return Ke(e).position==="static"}function su(e,t){if(!rt(e)||Ke(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return nt(e)===n&&(n=n.ownerDocument.body),n}function iu(e,t){const n=Re(e);if(Mr(e))return n;if(!rt(e)){let o=Dt(e);for(;o&&!ln(o);){if(qe(o)&&!Bs(o))return o;o=Dt(o)}return n}let r=su(e,t);for(;r&&gy(r)&&Bs(r);)r=su(r,t);return r&&ln(r)&&Bs(r)&&!$s(r)?n:r||hy(e)||n}const Py=async function(e){const t=this.getOffsetParent||iu,n=this.getDimensions,r=await n(e.floating);return{reference:Ty(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ay(e){return Ke(e).direction==="rtl"}const _y={convertOffsetParentRelativeRectToViewportRelativeRect:yy,getDocumentElement:nt,getClippingRect:Ey,getOffsetParent:iu,getElementRects:Py,getClientRects:wy,getDimensions:Ny,getScale:cn,isElement:qe,isRTL:Ay};function Fy(e,t){let n=null,r;const o=nt(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,u){a===void 0&&(a=!1),u===void 0&&(u=1),s();const{left:c,top:f,width:g,height:m}=e.getBoundingClientRect();if(a||t(),!g||!m)return;const p=_r(f),v=_r(o.clientWidth-(c+g)),h=_r(o.clientHeight-(f+m)),y=_r(c),x={rootMargin:-p+"px "+-v+"px "+-h+"px "+-y+"px",threshold:Ie(0,Ft(1,u))||1};let S=!0;function E(C){const P=C[0].intersectionRatio;if(P!==u){if(!S)return i();P?i(!1,P):r=setTimeout(()=>{i(!1,1e-7)},1e3)}S=!1}try{n=new IntersectionObserver(E,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(E,x)}n.observe(e)}return i(!0),s}function Oy(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,c=Ls(e),f=o||s?[...c?On(c):[],...On(t)]:[];f.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const g=c&&a?Fy(c,n):null;let m=-1,p=null;i&&(p=new ResizeObserver(w=>{let[x]=w;x&&x.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var S;(S=p)==null||S.observe(t)})),n()}),c&&!u&&p.observe(c),p.observe(t));let v,h=u?Ut(e):null;u&&y();function y(){const w=Ut(e);h&&(w.x!==h.x||w.y!==h.y||w.width!==h.width||w.height!==h.height)&&n(),h=w,v=requestAnimationFrame(y)}return n(),()=>{var w;f.forEach(x=>{o&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),g==null||g(),(w=p)==null||w.disconnect(),p=null,u&&cancelAnimationFrame(v)}}const Dy=uy,My=dy,ky=ay,$y=py,Iy=ly,au=iy,Ry=fy,Ly=(e,t,n)=>{const r=new Map,o={platform:_y,...n},s={...o.platform,_c:r};return sy(e,t,{...o,platform:s})};var $r=typeof document<"u"?D.useLayoutEffect:D.useEffect;function Ir(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ir(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Ir(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function lu(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function cu(e,t){const n=lu(e);return Math.round(t*n)/n}function zs(e){const t=d.useRef(e);return $r(()=>{t.current=e}),t}function Vy(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:u,open:c}=e,[f,g]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=d.useState(r);Ir(m,r)||p(r);const[v,h]=d.useState(null),[y,w]=d.useState(null),x=d.useCallback(K=>{K!==P.current&&(P.current=K,h(K))},[]),S=d.useCallback(K=>{K!==_.current&&(_.current=K,w(K))},[]),E=s||v,C=i||y,P=d.useRef(null),_=d.useRef(null),O=d.useRef(f),k=u!=null,F=zs(u),G=zs(o),$=zs(c),R=d.useCallback(()=>{if(!P.current||!_.current)return;const K={placement:t,strategy:n,middleware:m};G.current&&(K.platform=G.current),Ly(P.current,_.current,K).then(ee=>{const ie={...ee,isPositioned:$.current!==!1};M.current&&!Ir(O.current,ie)&&(O.current=ie,zn.flushSync(()=>{g(ie)}))})},[m,t,n,G,$]);$r(()=>{c===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,g(K=>({...K,isPositioned:!1})))},[c]);const M=d.useRef(!1);$r(()=>(M.current=!0,()=>{M.current=!1}),[]),$r(()=>{if(E&&(P.current=E),C&&(_.current=C),E&&C){if(F.current)return F.current(E,C,R);R()}},[E,C,R,F,k]);const q=d.useMemo(()=>({reference:P,floating:_,setReference:x,setFloating:S}),[x,S]),U=d.useMemo(()=>({reference:E,floating:C}),[E,C]),X=d.useMemo(()=>{const K={position:n,left:0,top:0};if(!U.floating)return K;const ee=cu(U.floating,f.x),ie=cu(U.floating,f.y);return a?{...K,transform:"translate("+ee+"px, "+ie+"px)",...lu(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ee,top:ie}},[n,a,U.floating,f.x,f.y]);return d.useMemo(()=>({...f,update:R,refs:q,elements:U,floatingStyles:X}),[f,R,q,U,X])}const By=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?au({element:r.current,padding:o}).fn(n):{}:r?au({element:r,padding:o}).fn(n):{}}}},zy=(e,t)=>({...Dy(e),options:[e,t]}),Hy=(e,t)=>({...My(e),options:[e,t]}),Uy=(e,t)=>({...Ry(e),options:[e,t]}),jy=(e,t)=>({...ky(e),options:[e,t]}),Wy=(e,t)=>({...$y(e),options:[e,t]}),Gy=(e,t)=>({...Iy(e),options:[e,t]}),qy=(e,t)=>({...By(e),options:[e,t]});var Ky=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Xy=Ky.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Kt:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Yy="Arrow",uu=d.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return l.jsx(Xy.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});uu.displayName=Yy;var Jy=uu;function du(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Zy(...e){return t=>{let n=!1;const r=e.map(o=>{const s=du(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():du(e[o],null)}}}}function fu(...e){return d.useCallback(Zy(...e),e)}var Qy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],pu=Qy.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Kt:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Hs="Popper",[gu,hu]=St(Hs),[ew,mu]=gu(Hs),vu=e=>{const{__scopePopper:t,children:n}=e,[r,o]=d.useState(null);return l.jsx(ew,{scope:t,anchor:r,onAnchorChange:o,children:n})};vu.displayName=Hs;var yu="PopperAnchor",wu=d.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=mu(yu,n),i=d.useRef(null),a=fu(t,i);return d.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:l.jsx(pu.div,{...o,ref:a})});wu.displayName=yu;var Us="PopperContent",[tw,nw]=gu(Us),bu=d.forwardRef((e,t)=>{var Ee,Je,De,pn,ht,mt;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:u=!0,collisionBoundary:c=[],collisionPadding:f=0,sticky:g="partial",hideWhenDetached:m=!1,updatePositionStrategy:p="optimized",onPlaced:v,...h}=e,y=mu(Us,n),[w,x]=d.useState(null),S=fu(t,ze=>x(ze)),[E,C]=d.useState(null),P=Ma(E),_=(P==null?void 0:P.width)??0,O=(P==null?void 0:P.height)??0,k=r+(s!=="center"?"-"+s:""),F=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},G=Array.isArray(c)?c:[c],$=G.length>0,R={padding:F,boundary:G.filter(ow),altBoundary:$},{refs:M,floatingStyles:q,placement:U,isPositioned:X,middlewareData:K}=Vy({strategy:"fixed",placement:k,whileElementsMounted:(...ze)=>Oy(...ze,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[zy({mainAxis:o+O,alignmentAxis:i}),u&&Hy({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?Uy():void 0,...R}),u&&jy({...R}),Wy({...R,apply:({elements:ze,rects:$t,availableWidth:gn,availableHeight:It})=>{const{width:Vn,height:b}=$t.reference,N=ze.floating.style;N.setProperty("--radix-popper-available-width",`${gn}px`),N.setProperty("--radix-popper-available-height",`${It}px`),N.setProperty("--radix-popper-anchor-width",`${Vn}px`),N.setProperty("--radix-popper-anchor-height",`${b}px`)}}),E&&qy({element:E,padding:a}),sw({arrowWidth:_,arrowHeight:O}),m&&Gy({strategy:"referenceHidden",...R})]}),[ee,ie]=Su(U),fe=Te(v);$e(()=>{X&&(fe==null||fe())},[X,fe]);const Oe=(Ee=K.arrow)==null?void 0:Ee.x,xe=(Je=K.arrow)==null?void 0:Je.y,Be=((De=K.arrow)==null?void 0:De.centerOffset)!==0,[kt,we]=d.useState();return $e(()=>{w&&we(window.getComputedStyle(w).zIndex)},[w]),l.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:X?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:kt,"--radix-popper-transform-origin":[(pn=K.transformOrigin)==null?void 0:pn.x,(ht=K.transformOrigin)==null?void 0:ht.y].join(" "),...((mt=K.hide)==null?void 0:mt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(tw,{scope:n,placedSide:ee,onArrowChange:C,arrowX:Oe,arrowY:xe,shouldHideArrow:Be,children:l.jsx(pu.div,{"data-side":ee,"data-align":ie,...h,ref:S,style:{...h.style,animation:X?void 0:"none"}})})})});bu.displayName=Us;var xu="PopperArrow",rw={top:"bottom",right:"left",bottom:"top",left:"right"},Cu=d.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=nw(xu,r),i=rw[s.placedSide];return l.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:l.jsx(Jy,{...o,ref:n,style:{...o.style,display:"block"}})})});Cu.displayName=xu;function ow(e){return e!==null}var sw=e=>({name:"transformOrigin",options:e,fn(t){var y,w,x;const{placement:n,rects:r,middlewareData:o}=t,i=((y=o.arrow)==null?void 0:y.centerOffset)!==0,a=i?0:e.arrowWidth,u=i?0:e.arrowHeight,[c,f]=Su(n),g={start:"0%",center:"50%",end:"100%"}[f],m=(((w=o.arrow)==null?void 0:w.x)??0)+a/2,p=(((x=o.arrow)==null?void 0:x.y)??0)+u/2;let v="",h="";return c==="bottom"?(v=i?g:`${m}px`,h=`${-u}px`):c==="top"?(v=i?g:`${m}px`,h=`${r.floating.height+u}px`):c==="right"?(v=`${-u}px`,h=i?g:`${p}px`):c==="left"&&(v=`${r.floating.width+u}px`,h=i?g:`${p}px`),{data:{x:v,y:h}}}});function Su(e){const[t,n="center"]=e.split("-");return[t,n]}var iw=vu,aw=wu,lw=bu,cw=Cu,uw="Portal",Eu=d.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=d.useState(!1);$e(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?Jr.createPortal(l.jsx(An.div,{...r,ref:t}),i):null});Eu.displayName=uw;function dw(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var js=e=>{const{present:t,children:n}=e,r=fw(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=Pn(r.ref,pw(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};js.displayName="Presence";function fw(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=dw(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=Rr(r.current);s.current=a==="mounted"?c:"none"},[a]),$e(()=>{const c=r.current,f=o.current;if(f!==e){const m=s.current,p=Rr(c);e?u("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&m!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),$e(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,g=p=>{const h=Rr(r.current).includes(p.animationName);if(p.target===t&&h&&(u("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},m=p=>{p.target===t&&(s.current=Rr(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:d.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Rr(e){return(e==null?void 0:e.animationName)||"none"}function pw(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var gw="VisuallyHidden",Nu=d.forwardRef((e,t)=>l.jsx(An.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Nu.displayName=gw;var hw=Nu,[Lr,qx]=St("Tooltip",[hu]),Vr=hu(),Tu="TooltipProvider",mw=700,Ws="tooltip.open",[vw,Gs]=Lr(Tu),Pu=e=>{const{__scopeTooltip:t,delayDuration:n=mw,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,[i,a]=d.useState(!0),u=d.useRef(!1),c=d.useRef(0);return d.useEffect(()=>{const f=c.current;return()=>window.clearTimeout(f)},[]),l.jsx(vw,{scope:t,isOpenDelayed:i,delayDuration:n,onOpen:d.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:d.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:d.useCallback(f=>{u.current=f},[]),disableHoverableContent:o,children:s})};Pu.displayName=Tu;var Br="Tooltip",[yw,Dn]=Lr(Br),Au=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,u=Gs(Br,e.__scopeTooltip),c=Vr(t),[f,g]=d.useState(null),m=Qt(),p=d.useRef(0),v=i??u.disableHoverableContent,h=a??u.delayDuration,y=d.useRef(!1),[w=!1,x]=Jt({prop:r,defaultProp:o,onChange:_=>{_?(u.onOpen(),document.dispatchEvent(new CustomEvent(Ws))):u.onClose(),s==null||s(_)}}),S=d.useMemo(()=>w?y.current?"delayed-open":"instant-open":"closed",[w]),E=d.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y.current=!1,x(!0)},[x]),C=d.useCallback(()=>{window.clearTimeout(p.current),p.current=0,x(!1)},[x]),P=d.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{y.current=!0,x(!0),p.current=0},h)},[h,x]);return d.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),l.jsx(iw,{...c,children:l.jsx(yw,{scope:t,contentId:m,open:w,stateAttribute:S,trigger:f,onTriggerChange:g,onTriggerEnter:d.useCallback(()=>{u.isOpenDelayed?P():E()},[u.isOpenDelayed,P,E]),onTriggerLeave:d.useCallback(()=>{v?C():(window.clearTimeout(p.current),p.current=0)},[C,v]),onOpen:E,onClose:C,disableHoverableContent:v,children:n})})};Au.displayName=Br;var qs="TooltipTrigger",_u=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Dn(qs,n),s=Gs(qs,n),i=Vr(n),a=d.useRef(null),u=Pn(t,a,o.onTriggerChange),c=d.useRef(!1),f=d.useRef(!1),g=d.useCallback(()=>c.current=!1,[]);return d.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),l.jsx(aw,{asChild:!0,...i,children:l.jsx(An.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:ut(e.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:ut(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:ut(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:ut(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:ut(e.onBlur,o.onClose),onClick:ut(e.onClick,o.onClose)})})});_u.displayName=qs;var Ks="TooltipPortal",[ww,bw]=Lr(Ks,{forceMount:void 0}),Fu=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=Dn(Ks,t);return l.jsx(ww,{scope:t,forceMount:n,children:l.jsx(js,{present:n||s.open,children:l.jsx(Eu,{asChild:!0,container:o,children:r})})})};Fu.displayName=Ks;var un="TooltipContent",Ou=d.forwardRef((e,t)=>{const n=bw(un,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=Dn(un,e.__scopeTooltip);return l.jsx(js,{present:r||i.open,children:i.disableHoverableContent?l.jsx(Du,{side:o,...s,ref:t}):l.jsx(xw,{side:o,...s,ref:t})})}),xw=d.forwardRef((e,t)=>{const n=Dn(un,e.__scopeTooltip),r=Gs(un,e.__scopeTooltip),o=d.useRef(null),s=Pn(t,o),[i,a]=d.useState(null),{trigger:u,onClose:c}=n,f=o.current,{onPointerInTransitChange:g}=r,m=d.useCallback(()=>{a(null),g(!1)},[g]),p=d.useCallback((v,h)=>{const y=v.currentTarget,w={x:v.clientX,y:v.clientY},x=Nw(w,y.getBoundingClientRect()),S=Tw(w,x),E=Pw(h.getBoundingClientRect()),C=_w([...S,...E]);a(C),g(!0)},[g]);return d.useEffect(()=>()=>m(),[m]),d.useEffect(()=>{if(u&&f){const v=y=>p(y,f),h=y=>p(y,u);return u.addEventListener("pointerleave",v),f.addEventListener("pointerleave",h),()=>{u.removeEventListener("pointerleave",v),f.removeEventListener("pointerleave",h)}}},[u,f,p,m]),d.useEffect(()=>{if(i){const v=h=>{const y=h.target,w={x:h.clientX,y:h.clientY},x=(u==null?void 0:u.contains(y))||(f==null?void 0:f.contains(y)),S=!Aw(w,i);x?m():S&&(m(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[u,f,i,c,m]),l.jsx(Du,{...e,ref:s})}),[Cw,Sw]=Lr(Br,{isInside:!1}),Du=d.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,u=Dn(un,n),c=Vr(n),{onClose:f}=u;return d.useEffect(()=>(document.addEventListener(Ws,f),()=>document.removeEventListener(Ws,f)),[f]),d.useEffect(()=>{if(u.trigger){const g=m=>{const p=m.target;p!=null&&p.contains(u.trigger)&&f()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[u.trigger,f]),l.jsx(jc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:g=>g.preventDefault(),onDismiss:f,children:l.jsxs(lw,{"data-state":u.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(va,{children:r}),l.jsx(Cw,{scope:n,isInside:!0,children:l.jsx(hw,{id:u.contentId,role:"tooltip",children:o||r})})]})})});Ou.displayName=un;var Mu="TooltipArrow",Ew=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Vr(n);return Sw(Mu,n).isInside?null:l.jsx(cw,{...o,...r,ref:t})});Ew.displayName=Mu;function Nw(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Tw(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Pw(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Aw(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s].x,u=t[s].y,c=t[i].x,f=t[i].y;u>r!=f>r&&n<(c-a)*(r-u)/(f-u)+a&&(o=!o)}return o}function _w(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Fw(t)}function Fw(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Ow=Pu,Dw=Au,Mw=_u,kw=Fu,ku=Ou;const $u=Ow,Iu=Dw,Ru=Mw,Xs=d.forwardRef(({className:e,sideOffset:t=4,...n},r)=>l.jsx(kw,{children:l.jsx(ku,{ref:r,sideOffset:t,className:Z("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Xs.displayName=ku.displayName;function $w({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const Iw=d.forwardRef($w);var Rw=function(e){return function(t,n){var r=D.useRef(!1);e(function(){return function(){r.current=!1}},[]),e(function(){if(!r.current)r.current=!0;else return t()},n)}},Lu=function(e){return typeof e=="function"},Vu=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test";const Lw=Rw(D.useEffect);function Bu(e){var t=D.useRef(e);return t.current=e,t}var Vw=function(e){Vu&&(Lu(e)||console.error("useUnmount expected parameter is a function, got ".concat(typeof e)));var t=Bu(e);D.useEffect(function(){return function(){t.current()}},[])},zr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Bw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function zw(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var zu=zw,Hw=typeof zr=="object"&&zr&&zr.Object===Object&&zr,Uw=Hw,jw=Uw,Ww=typeof self=="object"&&self&&self.Object===Object&&self,Gw=jw||Ww||Function("return this")(),Hu=Gw,qw=Hu,Kw=function(){return qw.Date.now()},Xw=Kw,Yw=/\s/;function Jw(e){for(var t=e.length;t--&&Yw.test(e.charAt(t)););return t}var Zw=Jw,Qw=Zw,eb=/^\s+/;function tb(e){return e&&e.slice(0,Qw(e)+1).replace(eb,"")}var nb=tb,rb=Hu,ob=rb.Symbol,Uu=ob,ju=Uu,Wu=Object.prototype,sb=Wu.hasOwnProperty,ib=Wu.toString,Mn=ju?ju.toStringTag:void 0;function ab(e){var t=sb.call(e,Mn),n=e[Mn];try{e[Mn]=void 0;var r=!0}catch{}var o=ib.call(e);return r&&(t?e[Mn]=n:delete e[Mn]),o}var lb=ab,cb=Object.prototype,ub=cb.toString;function db(e){return ub.call(e)}var fb=db,Gu=Uu,pb=lb,gb=fb,hb="[object Null]",mb="[object Undefined]",qu=Gu?Gu.toStringTag:void 0;function vb(e){return e==null?e===void 0?mb:hb:qu&&qu in Object(e)?pb(e):gb(e)}var yb=vb;function wb(e){return e!=null&&typeof e=="object"}var bb=wb,xb=yb,Cb=bb,Sb="[object Symbol]";function Eb(e){return typeof e=="symbol"||Cb(e)&&xb(e)==Sb}var Nb=Eb,Tb=nb,Ku=zu,Pb=Nb,Xu=NaN,Ab=/^[-+]0x[0-9a-f]+$/i,_b=/^0b[01]+$/i,Fb=/^0o[0-7]+$/i,Ob=parseInt;function Db(e){if(typeof e=="number")return e;if(Pb(e))return Xu;if(Ku(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ku(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Tb(e);var n=_b.test(e);return n||Fb.test(e)?Ob(e.slice(2),n?2:8):Ab.test(e)?Xu:+e}var Mb=Db,kb=zu,Ys=Xw,Yu=Mb,$b="Expected a function",Ib=Math.max,Rb=Math.min;function Lb(e,t,n){var r,o,s,i,a,u,c=0,f=!1,g=!1,m=!0;if(typeof e!="function")throw new TypeError($b);t=Yu(t)||0,kb(n)&&(f=!!n.leading,g="maxWait"in n,s=g?Ib(Yu(n.maxWait)||0,t):s,m="trailing"in n?!!n.trailing:m);function p(P){var _=r,O=o;return r=o=void 0,c=P,i=e.apply(O,_),i}function v(P){return c=P,a=setTimeout(w,t),f?p(P):i}function h(P){var _=P-u,O=P-c,k=t-_;return g?Rb(k,s-O):k}function y(P){var _=P-u,O=P-c;return u===void 0||_>=t||_<0||g&&O>=s}function w(){var P=Ys();if(y(P))return x(P);a=setTimeout(w,h(P))}function x(P){return a=void 0,m&&r?p(P):(r=o=void 0,i)}function S(){a!==void 0&&clearTimeout(a),c=0,r=u=o=a=void 0}function E(){return a===void 0?i:x(Ys())}function C(){var P=Ys(),_=y(P);if(r=arguments,o=this,u=P,_){if(a===void 0)return v(u);if(g)return clearTimeout(a),a=setTimeout(w,t),p(u)}return a===void 0&&(a=setTimeout(w,t)),i}return C.cancel=S,C.flush=E,C}var Vb=Lb;const Bb=Bw(Vb);function zb(){var e=(typeof global>"u"?"undefined":typeof global)=="object"&&global&&global.Object===Object&&global,t=typeof self=="object"&&self&&self.Object===Object&&self;return e||t}zb()||(global.Date=Date);function Hb(e,t){var n;Vu&&(Lu(e)||console.error("useDebounceFn expected parameter is a function, got ".concat(typeof e)));var r=Bu(e),o=(n=t==null?void 0:t.wait)!==null&&n!==void 0?n:1e3,s=D.useMemo(function(){return Bb(function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];return r.current.apply(r,nl([],tl(i),!1))},o,t)},[]);return Vw(function(){s.cancel()}),{run:s,cancel:s.cancel,flush:s.flush}}function Ub(e,t,n){var r=tl(D.useState({}),2),o=r[0],s=r[1],i=Hb(function(){s({})},n).run;D.useEffect(function(){return i()},t),Lw(e,[o])}const jb=D.forwardRef(({onChange:e},t)=>{const n=D.useRef(null),[r,o]=D.useState("");return D.useImperativeHandle(t,()=>({setValue:s=>{var i;o(s),(i=n.current)==null||i.focus()}})),Ub(()=>{e==null||e(r)},[r],{wait:300}),l.jsxs(l.Fragment,{children:[l.jsx(_t,{ref:n,type:"text",placeholder:"Search files...",value:r,onChange:s=>o(s.target.value),className:"pr-8"}),r&&l.jsx("button",{onClick:()=>{var s;o(""),(s=n.current)==null||s.focus()},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700",children:l.jsx(Iw,{className:"h-5 w-5"})})]})}),Xe={current:!1},Ju="crawl:jobs",dn="crawl:current_job",Wb=e=>{const[t,n]=D.useState(null),[r,o]=D.useState(0);return D.useEffect(()=>{const s=localStorage.getItem(dn);if(s){const i=JSON.parse(s);n(i),i!=null&&i.startTime&&o(Math.floor((Date.now()-i.startTime)/1e3))}},[]),D.useEffect(()=>{if(!(t!=null&&t.startTime))return;const s=setInterval(()=>{o(Math.floor((Date.now()-t.startTime)/1e3))},1e3);return()=>clearInterval(s)},[t==null?void 0:t.startTime]),D.useEffect(()=>{if(!(t!=null&&t.id))return;const s=async()=>{try{const u=(await oe.get(`${e}/api/crawl/${t.id}?taskId=${t.taskId}`)).data;n(c=>{if(!c)return null;const f={...c,status:u};return localStorage.setItem(dn,JSON.stringify(f)),(u.status==="completed"||u.status==="failed")&&setTimeout(()=>{n(null),localStorage.removeItem(dn)},100),f})}catch(a){console.error("Error polling job status:",a)}},i=setInterval(s,3e3);return s(),()=>clearInterval(i)},[t==null?void 0:t.id,e]),{currentJob:t,elapsedTime:r,setCurrentJob:s=>{s&&!s.startTime&&(s.startTime=Date.now()),n(s),s?localStorage.setItem(dn,JSON.stringify(s)):localStorage.removeItem(dn)}}},Gb=(e,t,n)=>{const r=[],o=s=>{(e[s]||[]).forEach(a=>{a.name.toLowerCase().includes(t.toLowerCase())&&r.push(a),a.isFolder&&a.key.startsWith(n)&&o(a.key)})};return o(n),r},Hr=(e,t)=>{const n=[],r=o=>{(e[o]||[]).forEach(i=>{n.push(i.key),i.isFolder&&r(i.key)})};return r(t),n},qb=(e,t)=>{const n=[];return(e[t]||[]).forEach(o=>{n.push(o.key),o.isFolder&&n.push(...Hr(e,o.key))}),n},Kb=(e,t,n=[])=>{const[r,o]=D.useState({}),[s,i]=D.useState(!1),[a,u]=D.useState(null),c=async()=>{i(!0);try{const f=!Xe.current;Xe.current&&(Xe.current=!1);const g=await oe.get(`${e}/api/files`,{params:{cache:f,displayPrefixes:JSON.stringify(n),prefix:t},timeout:3e5});o(g.data),u(null)}catch(f){u(f instanceof Error?f:new Error("Failed to fetch files"))}finally{i(!1)}};return D.useEffect(()=>{c()},[]),{data:r,isLoading:s,error:a,refetch:c}},Ur=e=>{var r,o,s;const t=((s=(o=(r=e==null?void 0:e.name)==null?void 0:r.split("."))==null?void 0:o.pop())==null?void 0:s.toLowerCase())??"";return["txt","md","json","js","ts","jsx","tsx","css","html","xml","yaml","yml"].includes(t||"")},Xb=D.memo(({homeLabel:e="Kho tài liệu",apiBaseUrl:t="http://localhost:3001",rootPrefix:n="",asSelector:r=!1,onSelected:o=i=>console.log("Đã chọn:",i),displayPrefixes:s})=>{var xd;const[i,a]=D.useState(""),[u,c]=D.useState(new Set),[f,g]=D.useState(n),[m,p]=D.useState(!1),[v,h]=D.useState(""),[y,w]=D.useState(!1),[x,S]=D.useState(null),[E,C]=D.useState(!1),[P,_]=D.useState(!1),[O,k]=D.useState(!1),[F,G]=D.useState(null),$=D.useRef(null),{toast:R}=As(),[M,q]=D.useState(null),[U,X]=D.useState(""),[K,ee]=D.useState(!1),[ie,fe]=D.useState(new Set),[Oe,xe]=D.useState(""),[Be,kt]=D.useState(!1),[we,Ee]=D.useState(!1),[Je,De]=D.useState("rename"),[pn,ht]=D.useState(!1),[mt,ze]=D.useState(""),[$t,gn]=D.useState("1"),[It,Vn]=D.useState(!1),{currentJob:b,elapsedTime:N,setCurrentJob:A}=Wb(t),{data:B={},isLoading:z,error:L,refetch:j}=Kb(t,n,s);D.useEffect(()=>{b!=null&&b.status&&(b.status.status==="completed"?(R({title:"Thu thập website hoàn tất",description:`Đã thu thập thành công ${b.url} với ${b.status.completed} trang`}),Xe.current=!0,j()):b.status.status==="failed"&&R({title:"Thu thập website thất bại",description:`Không thể thu thập ${b.url}. Vui lòng thử lại.`,variant:"destructive"}))},[(xd=b==null?void 0:b.status)==null?void 0:xd.status]);const re=D.useMemo(()=>B[f]||[],[B,f]),ce=D.useMemo(()=>i?Gb(B,i,f):re,[re,i,f,B]),pe=D.useMemo(()=>{const I={};return ce.forEach((V,W)=>{u.has(V.key)&&(I[W]=!0)}),I},[u,ce]),vt=I=>{const V=Hr(B,I);if(V.length===0)return u.has(I)?"all":"none";const W=V.filter(te=>u.has(te)).length;return W===0?"none":W===V.length?"all":"partial"},hn=I=>{g(I)},Bn=async(I,V)=>{w(!0);try{const W=`${V}${I}/`;if((await oe.post(`${t}/api/create-folder`,{prefix:W})).status!==200){R({title:"Lỗi",description:"Không thể tạo thư mục",variant:"destructive"});return}Xe.current=!0,await j(),R({title:"Đã tạo thư mục",description:`Đã tạo thành công thư mục "${I}"`}),h(""),p(!1)}catch(W){console.error("Error creating folder:",W),R({title:"Lỗi",description:"Không thể tạo thư mục",variant:"destructive"})}finally{w(!1)}},mn=async(I,V,W)=>{G(W);try{const te=new FormData;te.append("prefix",V),Array.from(I).forEach(le=>{le instanceof File&&te.append("files",le)}),(await oe.post(`${t}/api/upload`,te,{headers:{"Content-Type":"multipart/form-data"}})).status===200&&(Xe.current=!0,await j(),R({title:"Đã tải lên tập tin",description:`Đã tải lên thành công ${I.length} tập tin`}))}catch(te){console.error("Error uploading files:",te),R({title:"Lỗi",description:"Không thể tải lên tập tin",variant:"destructive"})}finally{G(null)}},ui=async I=>{C(!0);try{await oe.delete(`${t}/api/files`,{data:{paths:[I.key]}}),Xe.current=!0,await j(),R({title:"Đã xóa tập tin",description:`Đã xóa thành công "${I.name}"`}),S(null)}catch(V){console.error("Error deleting file:",V),R({title:"Lỗi",description:"Không thể xóa tập tin",variant:"destructive"})}finally{C(!1)}},Wt=I=>{const V=new Set(u),W=typeof I=="function"?I(pe):I;new Set(Object.keys(pe).map(Number)).forEach(ae=>{const le=ce[ae];le&&(W[ae]||(V.delete(le.key),le.isFolder&&Hr(B,le.key).forEach(Ne=>V.delete(Ne))))}),Object.entries(W).forEach(([ae,le])=>{const Ne=parseInt(ae),yt=ce[Ne];yt&&le&&(V.add(yt.key),yt.isFolder&&Hr(B,yt.key).forEach(pi=>V.add(pi)))}),c(V)},di=async()=>{_(!0);try{const I=Array.from(u).map(V=>{var W;for(const te in B){const ae=(W=B[te])==null?void 0:W.find(le=>le.key===V);if(ae)return ae}return null}).filter(V=>V!==null);await oe.delete(`${t}/api/files`,{data:{paths:Array.from(u)}}),Xe.current=!0,await j(),R({title:"Đã xóa tập tin",description:`Đã xóa thành công ${I.length} mục`}),k(!1),c(new Set)}catch(I){console.error("Error deleting files:",I),R({title:"Lỗi",description:"Không thể xóa các tập tin đã chọn",variant:"destructive"})}finally{_(!1)}},Yr=async(I,V)=>{ee(!0);try{const W=I.key;let te;I.isFolder?te=W.split("/").slice(0,-2).join("/")+"/":te=W.substring(0,W.lastIndexOf("/")+1);const ae=te+V+(I.isFolder?"/":"");await oe.post(`${t}/api/rename`,{oldPath:W,newPath:ae}),Xe.current=!0,await j(),R({title:"Đã đổi tên",description:`Đã đổi tên thành công "${I.name}" thành "${V}"`}),q(null),X("")}catch(W){console.error("Error renaming item:",W),R({title:"Lỗi",description:"Không thể đổi tên",variant:"destructive"})}finally{ee(!1)}},yd=async I=>{fe(V=>new Set([...V,...I]));try{const V=await oe.post(`${t}/api/download`,{paths:I},{responseType:"blob"}),W=window.URL.createObjectURL(V.data),te=document.createElement("a");te.href=W;const ae=V.headers["Content-Disposition"]||V.headers["content-disposition"],le=ae==null?void 0:ae.match(/filename="(.+)"/),Ne=le?decodeURIComponent(le[1]):"download.zip";te.setAttribute("download",Ne),document.body.appendChild(te),te.click(),document.body.removeChild(te),window.URL.revokeObjectURL(W),R({title:"Bắt đầu tải xuống",description:`Đã bắt đầu tải xuống ${I.length} mục${I.length>1,""}`})}catch(V){console.error("Error downloading files:",V),R({title:"Lỗi",description:"Không thể tải xuống tập tin",variant:"destructive"})}finally{fe(V=>{const W=new Set(V);return I.forEach(te=>W.delete(te)),W})}},wd=f?f.replace(n,"").split("/").filter(Boolean):[],bx=()=>Array.from(u).map(I=>{var V;for(const W in B){const te=(V=B[W])==null?void 0:V.find(ae=>ae.key===I);if(te)return te}return null}).filter(I=>I!==null),bd=D.useMemo(()=>{const I=[{id:"select",header:()=>{const V=qb(B,f),W=V.length>0&&V.every(ae=>u.has(ae)),te=V.some(ae=>u.has(ae));return l.jsx(Bo,{checked:W?!0:te?"indeterminate":!1,onCheckedChange:ae=>{if(ae){const le=ce.reduce((Ne,yt,pi)=>(Ne[pi]=!0,Ne),{});Wt(le)}else Wt({})},"aria-label":"Chọn tất cả"})},cell:({row:V})=>{const W=V.original,ae=W.isFolder?vt(W.key):u.has(W.key)?"all":"none";return l.jsx("div",{className:"flex items-center",children:l.jsx(Bo,{checked:ae==="partial"?"indeterminate":ae==="all",onCheckedChange:le=>{const Ne={...pe};le?Ne[V.index]=!0:delete Ne[V.index],Wt(Ne)},"aria-label":"Chọn dòng"})})},enableSorting:!1},{id:"fileName",header:"Tên tập tin",accessorKey:"name",cell:({row:V})=>{const W=V.original,te=W.key.substring(0,W.key.lastIndexOf("/"))||"/",ae=i.trim()!==""&&te!==f,le=te.split("/").filter(Boolean);return l.jsxs("div",{className:"flex flex-col",children:[l.jsxs("div",{className:`flex items-center gap-2 ${W.isFolder?"cursor-pointer hover:text-blue-600":""}`,onClick:()=>{W.isFolder&&hn(W.key)},children:[W.isFolder?l.jsx(Zr,{className:"h-5 w-5 text-blue-500"}):null,W.name]}),ae&&l.jsxs("div",{className:"text-sm text-gray-500 flex items-center",children:[l.jsx(Zr,{className:"h-4 w-4 text-gray-500 my-auto"}),l.jsxs("span",{className:"flex items-center ml-1",children:[l.jsx("span",{className:"cursor-pointer hover:text-blue-600",onClick:()=>{hn("")},children:"/"}),le.map((Ne,yt)=>l.jsxs("span",{className:"flex items-center",children:[l.jsx("span",{className:"cursor-pointer hover:text-blue-600",onClick:()=>{hn(le.slice(0,yt+1).join("/")+"/")},children:Ne}),yt<le.length-1&&l.jsx("span",{children:"/"})]},yt))]})]})]})}}];return r||I.push({id:"size",header:"Kích thước",accessorKey:"size",cell:({getValue:V,row:W})=>{const te=V();return l.jsx("span",{children:W.original.isFolder?"-":Dg(te)})}},{id:"lastModified",header:"Sửa đổi lần cuối",accessorKey:"lastModified",cell:({row:V})=>{const W=V.original.lastModified;return l.jsx("span",{children:W.toLocaleString()})}},{id:"actions",header:"Hành động",accessorKey:"key",cell:({row:V})=>l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(se,{variant:"ghost",size:"icon",onClick:()=>yd([V.original.key]),className:"h-8 w-8 p-0",disabled:ie.has(V.original.key),children:ie.has(V.original.key)?l.jsx(be,{className:"h-4 w-4 animate-spin"}):l.jsx(hi,{className:"h-4 w-4"})}),l.jsx(se,{variant:"ghost",size:"icon",onClick:()=>{q(V.original),X(V.original.name)},className:"h-8 w-8 p-0",children:l.jsx(Md,{className:"h-4 w-4"})}),l.jsx(se,{variant:"ghost",size:"icon",onClick:()=>S(V.original),className:"h-8 w-8 p-0",children:l.jsx(mi,{className:"h-4 w-4"})})]})}),I},[u,ce,pe,ie,r]),fi=_i({data:ce,columns:bd,state:{rowSelection:pe},enableRowSelection:!0,onRowSelectionChange:Wt,getCoreRowModel:Ai()}),xx=async I=>{if(Ur(I)){kt(!0);try{const V=await oe.get(`${t}/api/read-text`,{params:{path:I.key}});xe(V.data.content)}catch(V){console.error("Error loading file content:",V),R({title:"Lỗi",description:"Không thể tải nội dung tập tin",variant:"destructive"})}finally{kt(!1)}}},Cx=async(I,V)=>{Ee(!0);try{await oe.post(`${t}/api/modify-text`,{path:I.key,content:V}),R({title:"Đã lưu tập tin",description:"Nội dung tập tin đã được cập nhật thành công"}),Xe.current=!0,await j(),q(null),xe(""),De("rename")}catch(W){console.error("Error saving file content:",W),R({title:"Lỗi",description:"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{Ee(!1)}};D.useEffect(()=>{M&&Ur(M)&&(xx(M),De("rename"))},[M]);const Sx=async(I,V)=>{var W;if(b){R({title:"Đang thu thập website",description:"Vui lòng đợi cho công việc thu thập hiện tại hoàn thành.",variant:"destructive"});return}Vn(!0);try{const{data:te}=await oe.post(`${t}/api/crawl`,{url:I,limit:V,prefix:f});if(te.id){A({id:te.id,url:I,limit:V,prefix:f,taskId:((W=te.task)==null?void 0:W.id)||""});const ae=localStorage.getItem(Ju),le=ae?JSON.parse(ae):[];le.some(Ne=>Ne.id===te.id)||(le.unshift({url:I,id:te.id,limit:V,prefix:f,timestamp:Date.now()}),le.length>20&&(le.length=20),localStorage.setItem(Ju,JSON.stringify(le))),R({title:"Bắt đầu thu thập website",description:`Đã thêm nhiệm vụ thu thập ${I} với giới hạn ${V}. Dữ liệu sẽ có sẵn sau khi thu thập hoàn tất.`}),ht(!1),ze(""),gn("1")}}catch(te){console.error("Error crawling website:",te),R({title:"Lỗi",description:"Không thể bắt đầu thu thập website",variant:"destructive"})}finally{Vn(!1)}},Ex=async()=>{try{if(!(b!=null&&b.id))return;A(null),localStorage.removeItem(dn),R({title:"Đã dừng thu thập",description:`Đã dừng thu thập website ${b.url}`})}catch(I){console.error("Error stopping job:",I),R({title:"Lỗi",description:"Không thể dừng thu thập website",variant:"destructive"})}};return l.jsxs("div",{className:"space-y-4 s3-explr-container",children:[l.jsx(Pa,{className:"s3-explr-breadcrumb",children:l.jsxs(Aa,{className:"s3-explr-breadcrumb-list",children:[l.jsx($o,{className:"s3-explr-breadcrumb-item",children:l.jsx(Io,{onClick:()=>g(n),className:"flex items-center gap-1 cursor-pointer s3-explr-breadcrumb-home",children:e})}),wd.map((I,V)=>l.jsxs(l.Fragment,{children:[l.jsx(_a,{className:"s3-explr-breadcrumb-separator"},`sep-${V}`),l.jsx($o,{className:"s3-explr-breadcrumb-item",children:l.jsx(Io,{onClick:()=>hn(n+wd.slice(0,V+1).join("/")+"/"),className:"cursor-pointer s3-explr-breadcrumb-link",children:I})},`item-${I}`)]}))]})}),l.jsxs("div",{className:"flex items-center space-x-4 s3-explr-toolbar",children:[l.jsx("div",{className:"relative max-w-sm w-full s3-explr-search-container",children:l.jsx(jb,{ref:$,onChange:I=>a(I)})}),l.jsxs(se,{variant:"outline",size:"sm",onClick:()=>{Xe.current=!0,j()},disabled:z,className:"flex items-center gap-2 s3-explr-refresh-btn",children:[l.jsx(Ed,{className:`h-4 w-4 s3-explr-refresh-icon ${z?"animate-spin":""}`}),"Làm mới"]}),!r&&l.jsxs(l.Fragment,{children:[u.size>0&&l.jsxs(l.Fragment,{children:[l.jsxs(se,{variant:"outline",size:"sm",onClick:()=>yd(Array.from(u)),disabled:Array.from(u).some(I=>ie.has(I)),className:"flex items-center gap-2 s3-explr-download-selected-btn",children:[Array.from(u).some(I=>ie.has(I))?l.jsx(be,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}):l.jsx(hi,{className:"h-4 w-4 s3-explr-download-icon"}),"Tải xuống đã chọn (",u.size,")"]}),l.jsxs(zt,{open:O,onOpenChange:k,children:[l.jsx(gr,{asChild:!0,children:l.jsxs(se,{variant:"destructive",size:"sm",className:"flex items-center gap-2 s3-explr-bulk-delete-btn",children:[l.jsx(mi,{className:"h-4 w-4 s3-explr-trash-icon"}),"Xóa đã chọn (",u.size,")"]})}),l.jsxs(Tt,{className:"s3-explr-dialog-content",children:[l.jsxs(Pt,{className:"s3-explr-dialog-header",children:[l.jsx(At,{className:"s3-explr-dialog-title",children:"Xác nhận xóa hàng loạt"}),l.jsxs(hr,{className:"s3-explr-dialog-description",children:["Bạn có chắc chắn muốn xóa ",u.size," mục đã chọn? Hành động này không thể hoàn tác."]})]}),l.jsxs(Nn,{className:"s3-explr-dialog-footer",children:[l.jsx(se,{variant:"outline",onClick:()=>k(!1),className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(se,{variant:"destructive",onClick:di,disabled:P,className:"s3-explr-confirm-delete-btn",children:P?l.jsxs(l.Fragment,{children:[l.jsx(be,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa đã chọn"})]})]})]})]}),l.jsxs(zt,{open:m,onOpenChange:p,children:[l.jsx(gr,{asChild:!0,children:l.jsxs(se,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-new-folder-btn",disabled:!!s&&!f,children:[l.jsx(Ad,{className:"h-4 w-4 s3-explr-folder-plus-icon"}),"Thư mục mới"]})}),l.jsxs(Tt,{className:"s3-explr-dialog-content",children:[l.jsx(Pt,{className:"s3-explr-dialog-header",children:l.jsx(At,{className:"s3-explr-dialog-title",children:"Tạo thư mục mới"})}),l.jsxs("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:[l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(Ht,{htmlFor:"name",className:"s3-explr-label",children:"Tên thư mục"}),l.jsx(_t,{disabled:y,id:"name",value:v,onChange:I=>h(I.target.value),placeholder:"Nhập tên thư mục",className:"s3-explr-input"})]}),l.jsxs(se,{onClick:()=>{v.trim()&&Bn(v,f)},disabled:y,className:"s3-explr-create-btn",children:[y&&l.jsx(be,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),y?"Đang tạo...":"Tạo"]})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2 s3-explr-upload-group",children:[l.jsx(se,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-upload-files-btn",onClick:()=>{const I=document.createElement("input");I.type="file",I.multiple=!0,I.onchange=V=>{const W=V.target.files;W&&mn(W,f,"files")},I.click()},disabled:F!==null||!!s&&!f,children:F==="files"?l.jsxs(l.Fragment,{children:[l.jsx(be,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}),"Đang tải lên..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Td,{className:"h-4 w-4 s3-explr-upload-icon"}),"Tải lên tập tin"]})}),l.jsx(se,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-upload-folder-btn",onClick:()=>{const I=document.createElement("input");I.type="file",I.multiple=!0,I.webkitdirectory=!0,I.onchange=V=>{const W=V.target.files;W&&mn(W,f,"folder")},I.click()},disabled:F!==null||!!s&&!f,children:F==="folder"?l.jsxs(l.Fragment,{children:[l.jsx(be,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}),"Đang tải lên..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Zr,{className:"h-4 w-4 s3-explr-folder-icon"}),"Tải lên thư mục"]})}),b?l.jsx($u,{delayDuration:0,children:l.jsxs(Iu,{children:[l.jsx(Ru,{asChild:!0,children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(se,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!0,children:[l.jsx(be,{className:"h-4 w-4 animate-spin s3-explr-loader"}),b.status?l.jsxs(l.Fragment,{children:["Đang thu thập (",b.status.completed,"/",b.status.total,") - ",Math.floor(N/60),":",String(N%60).padStart(2,"0")]}):"Đang thu thập..."]}),l.jsxs(se,{variant:"destructive",size:"sm",onClick:()=>void Ex(),className:"flex items-center gap-2",children:[l.jsx("span",{className:"sr-only",children:"Dừng thu thập"}),l.jsx($d,{className:"h-4 w-4"})]})]})}),b.status&&l.jsx(Xs,{side:"right",sideOffset:5,children:l.jsxs("div",{className:"space-y-1 p-2",children:[l.jsxs("p",{className:"font-semibold",children:["Đang thu thập ",b.url]}),l.jsxs("p",{children:["Tiến độ: ",b.status.completed,"/",b.status.total," trang"]}),l.jsxs("p",{children:["Thời gian: ",Math.floor(N/60),":",String(N%60).padStart(2,"0")]}),l.jsxs("p",{children:["Trạng thái:"," ",b.status.status==="scraping"?"Đang thu thập":b.status.status==="completed"?"Hoàn thành":"Thất bại"]})]})})]})}):l.jsxs(zt,{open:pn,onOpenChange:ht,children:[l.jsx(gr,{asChild:!0,children:l.jsxs(se,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!!s&&!f,children:[l.jsx(Od,{className:"h-4 w-4 s3-explr-globe-icon"}),"Thêm website"]})}),l.jsxs(Tt,{className:"s3-explr-dialog-content",children:[l.jsxs(Pt,{className:"s3-explr-dialog-header",children:[l.jsx(At,{className:"s3-explr-dialog-title",children:"Thêm website"}),l.jsx(hr,{className:"s3-explr-dialog-description",children:"Nhập URL website để thu thập và thêm vào S3."})]}),l.jsxs("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:[l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(Ht,{htmlFor:"websiteUrl",className:"s3-explr-label",children:"URL Website"}),l.jsx(_t,{id:"websiteUrl",value:mt,onChange:I=>ze(I.target.value),placeholder:"https://example.com",type:"url",disabled:It,className:"s3-explr-input"})]}),l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(Ht,{htmlFor:"crawlLimit",className:"s3-explr-label",children:"Giới hạn thu thập"}),l.jsx(_t,{id:"crawlLimit",value:$t,onChange:I=>{const V=I.target.value;/^\d*$/.test(V)&&gn(V)},placeholder:"1",type:"text",disabled:It,className:"s3-explr-input"}),l.jsx("p",{className:"text-sm text-gray-500",children:"Số lượng liên kết cần thu thập (mặc định: 1)"})]})]}),l.jsxs(Nn,{className:"s3-explr-dialog-footer",children:[l.jsx(se,{variant:"outline",onClick:()=>{ht(!1),ze(""),gn("1")},disabled:It,className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(se,{onClick:()=>{mt.trim()&&Sx(mt.trim(),parseInt($t)||1)},disabled:It||!mt.trim(),className:"s3-explr-crawl-btn",children:It?l.jsxs(l.Fragment,{children:[l.jsx(be,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang thu thập..."]}):"Bắt đầu thu thập"})]})]})]})]}),l.jsx(zt,{open:!!x,onOpenChange:I=>!I&&S(null),children:l.jsxs(Tt,{className:"s3-explr-dialog-content",children:[l.jsxs(Pt,{className:"s3-explr-dialog-header",children:[l.jsx(At,{className:"s3-explr-dialog-title",children:"Xác nhận xóa"}),l.jsxs(hr,{className:"s3-explr-dialog-description",children:["Bạn có chắc chắn muốn xóa ",x==null?void 0:x.name,"? Hành động này không thể hoàn tác."]})]}),l.jsxs(Nn,{className:"s3-explr-dialog-footer",children:[l.jsx(se,{variant:"outline",onClick:()=>S(null),className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(se,{variant:"destructive",onClick:()=>ui(x),disabled:E,className:"s3-explr-confirm-delete-btn",children:E?l.jsxs(l.Fragment,{children:[l.jsx(be,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa"})]})]})}),l.jsx(zt,{open:!!M,onOpenChange:I=>{I||(q(null),X(""),xe(""),De("rename"))},children:l.jsxs(Tt,{className:"s3-explr-dialog-content max-w-2xl",children:[l.jsx(Pt,{className:"s3-explr-dialog-header",children:l.jsx(At,{className:"s3-explr-dialog-title",children:M!=null&&M.isFolder?"Đổi tên thư mục":Ur(M)?"Quản lý tập tin":"Đổi tên tập tin"})}),M&&!M.isFolder&&Ur(M)?l.jsxs(iv,{value:Je,onValueChange:I=>De(I),children:[l.jsxs(pc,{className:"grid w-full grid-cols-2",children:[l.jsx(gs,{value:"rename",children:"Đổi tên"}),l.jsx(gs,{value:"edit",children:"Sửa nội dung"})]}),l.jsx(hs,{value:"rename",children:l.jsx("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(Ht,{htmlFor:"newName",className:"s3-explr-label",children:"Tên mới"}),l.jsx(_t,{id:"newName",value:U,onChange:I=>X(I.target.value),placeholder:"Nhập tên mới",disabled:K,className:"s3-explr-input"})]})})}),l.jsx(hs,{value:"edit",children:l.jsx("div",{className:"space-y-4 py-4",children:Be?l.jsx("div",{className:"flex items-center justify-center py-4",children:l.jsx(be,{className:"h-6 w-6 animate-spin"})}):l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ht,{htmlFor:"content",className:"s3-explr-label",children:"Nội dung tập tin"}),l.jsx(Cr,{id:"content",value:Oe,onChange:I=>xe(I.target.value),placeholder:"Nhập nội dung tập tin",className:"min-h-[200px] font-mono",disabled:we})]})})})]}):l.jsx("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(Ht,{htmlFor:"newName",className:"s3-explr-label",children:"Tên mới"}),l.jsx(_t,{id:"newName",value:U,onChange:I=>X(I.target.value),placeholder:"Nhập tên mới",disabled:K,className:"s3-explr-input"})]})}),l.jsxs(Nn,{className:"s3-explr-dialog-footer",children:[l.jsx(se,{variant:"outline",onClick:()=>{q(null),X(""),xe("")},className:"s3-explr-cancel-btn",children:"Hủy"}),Je==="edit"?l.jsx(se,{onClick:()=>M&&Cx(M,Oe),disabled:we||Be,className:"s3-explr-save-btn",children:we?l.jsxs(l.Fragment,{children:[l.jsx(be,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang lưu..."]}):"Lưu thay đổi"}):l.jsx(se,{onClick:()=>{U.trim()&&M&&Yr(M,U.trim())},disabled:K||!U.trim()||U.trim()===(M==null?void 0:M.name),className:"s3-explr-rename-btn",children:K?l.jsxs(l.Fragment,{children:[l.jsx(be,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang đổi tên..."]}):"Đổi tên"})]})]})})]})]}),L&&l.jsx("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative s3-explr-error",children:"Đã xảy ra lỗi khi tải danh sách tập tin"}),l.jsx("div",{className:"rounded-md border s3-explr-table-container",children:l.jsxs(mr,{className:"s3-explr-table",children:[l.jsx(vr,{className:"s3-explr-table-header",children:fi.getHeaderGroups().map(I=>l.jsx(Ge,{className:"hover:bg-transparent s3-explr-header-row",children:I.headers.map(V=>l.jsx(et,{className:"s3-explr-header-cell",children:V.isPlaceholder?null:Gn(V.column.columnDef.header,V.getContext())},V.id))},I.id))}),l.jsx(yr,{className:"s3-explr-table-body",children:fi.getRowModel().rows.length===0?l.jsx(Ge,{className:"s3-explr-empty-row",children:l.jsx(_e,{colSpan:bd.length,className:"h-24 text-center s3-explr-empty-cell",children:i?l.jsxs("div",{className:"text-gray-500 s3-explr-no-results",children:['Không tìm thấy tập tin hoặc thư mục nào khớp với "',i,'"']}):l.jsx("div",{className:"text-gray-500 s3-explr-empty-message",children:z?"Đang tải nội dung thư mục... Vui lòng đợi":"Thư mục này không chứa tập tin hoặc thư mục con nào"})})}):fi.getRowModel().rows.map(I=>l.jsx(Ge,{className:"h-12 s3-explr-row",children:I.getVisibleCells().map(V=>l.jsx(_e,{className:"align-middle s3-explr-cell",children:Gn(V.column.columnDef.cell,V.getContext())},V.id))},I.id))})]})}),r&&o&&l.jsxs("div",{className:"flex justify-between items-center mt-4 s3-explr-selector-footer",children:[l.jsxs("div",{className:"text-sm text-gray-500 s3-explr-selection-count",children:[u.size," ",(u.size===1,"tập tin")," đã chọn"]}),l.jsx(se,{variant:"default",onClick:()=>o(bx()),disabled:u.size===0,className:"s3-explr-ok-btn",children:"OK"})]}),!r&&l.jsx(Bc,{})]})});var kn=e=>e.type==="checkbox",jt=e=>e instanceof Date,Pe=e=>e==null;const Zu=e=>typeof e=="object";var he=e=>!Pe(e)&&!Array.isArray(e)&&Zu(e)&&!jt(e),Yb=e=>he(e)&&e.target?kn(e.target)?e.target.checked:e.target.value:e,Jb=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Zb=(e,t)=>e.has(Jb(t)),Qb=e=>{const t=e.constructor&&e.constructor.prototype;return he(t)&&t.hasOwnProperty("isPrototypeOf")},Js=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ve(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(Js&&(e instanceof Blob||r))&&(n||he(e)))if(t=n?[]:{},!n&&!Qb(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=Ve(e[o]));else return e;return t}var jr=e=>Array.isArray(e)?e.filter(Boolean):[],ge=e=>e===void 0,H=(e,t,n)=>{if(!t||!he(e))return n;const r=jr(t.split(/[,[\].]+?/)).reduce((o,s)=>Pe(o)?o:o[s],e);return ge(r)||r===e?ge(e[t])?n:e[t]:r},ot=e=>typeof e=="boolean",Zs=e=>/^\w*$/.test(e),Qu=e=>jr(e.replace(/["|']|\]/g,"").split(/\.|\[/)),de=(e,t,n)=>{let r=-1;const o=Zs(t)?[t]:Qu(t),s=o.length,i=s-1;for(;++r<s;){const a=o[r];let u=n;if(r!==i){const c=e[a];u=he(c)||Array.isArray(c)?c:isNaN(+o[r+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=u,e=e[a]}return e};const ed={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Ye={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},pt={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};D.createContext(null);var ex=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(o,s,{get:()=>{const i=s;return t._proxyFormState[i]!==Ye.all&&(t._proxyFormState[i]=!r||Ye.all),e[i]}});return o},Fe=e=>he(e)&&!Object.keys(e).length,tx=(e,t,n,r)=>{n(e);const{name:o,...s}=e;return Fe(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(i=>t[i]===Ye.all)},Wr=e=>Array.isArray(e)?e:[e];function nx(e){const t=D.useRef(e);t.current=e,D.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}var st=e=>typeof e=="string",rx=(e,t,n,r,o)=>st(e)?(r&&t.watch.add(e),H(n,e,o)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),H(n,s))):(r&&(t.watchAll=!0),n),ox=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},td=e=>({isOnSubmit:!e||e===Ye.onSubmit,isOnBlur:e===Ye.onBlur,isOnChange:e===Ye.onChange,isOnAll:e===Ye.all,isOnTouch:e===Ye.onTouched}),nd=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const $n=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const s=H(e,o);if(s){const{_f:i,...a}=s;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],o)&&!r)return!0;if(i.ref&&t(i.ref,i.name)&&!r)return!0;if($n(a,t))break}else if(he(a)&&$n(a,t))break}}};var sx=(e,t,n)=>{const r=Wr(H(e,n));return de(r,"root",t[n]),de(e,n,r),e},Qs=e=>e.type==="file",it=e=>typeof e=="function",Gr=e=>{if(!Js)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},qr=e=>st(e),ei=e=>e.type==="radio",Kr=e=>e instanceof RegExp;const rd={value:!1,isValid:!1},od={value:!0,isValid:!0};var sd=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!ge(e[0].attributes.value)?ge(e[0].value)||e[0].value===""?od:{value:e[0].value,isValid:!0}:od:rd}return rd};const id={isValid:!1,value:null};var ad=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,id):id;function ld(e,t,n="validate"){if(qr(e)||Array.isArray(e)&&e.every(qr)||ot(e)&&!e)return{type:n,message:qr(e)?e:"",ref:t}}var fn=e=>he(e)&&!Kr(e)?e:{value:e,message:""},cd=async(e,t,n,r,o)=>{const{ref:s,refs:i,required:a,maxLength:u,minLength:c,min:f,max:g,pattern:m,validate:p,name:v,valueAsNumber:h,mount:y,disabled:w}=e._f,x=H(t,v);if(!y||w)return{};const S=i?i[0]:s,E=$=>{r&&S.reportValidity&&(S.setCustomValidity(ot($)?"":$||""),S.reportValidity())},C={},P=ei(s),_=kn(s),O=P||_,k=(h||Qs(s))&&ge(s.value)&&ge(x)||Gr(s)&&s.value===""||x===""||Array.isArray(x)&&!x.length,F=ox.bind(null,v,n,C),G=($,R,M,q=pt.maxLength,U=pt.minLength)=>{const X=$?R:M;C[v]={type:$?q:U,message:X,ref:s,...F($?q:U,X)}};if(o?!Array.isArray(x)||!x.length:a&&(!O&&(k||Pe(x))||ot(x)&&!x||_&&!sd(i).isValid||P&&!ad(i).isValid)){const{value:$,message:R}=qr(a)?{value:!!a,message:a}:fn(a);if($&&(C[v]={type:pt.required,message:R,ref:S,...F(pt.required,R)},!n))return E(R),C}if(!k&&(!Pe(f)||!Pe(g))){let $,R;const M=fn(g),q=fn(f);if(!Pe(x)&&!isNaN(x)){const U=s.valueAsNumber||x&&+x;Pe(M.value)||($=U>M.value),Pe(q.value)||(R=U<q.value)}else{const U=s.valueAsDate||new Date(x),X=ie=>new Date(new Date().toDateString()+" "+ie),K=s.type=="time",ee=s.type=="week";st(M.value)&&x&&($=K?X(x)>X(M.value):ee?x>M.value:U>new Date(M.value)),st(q.value)&&x&&(R=K?X(x)<X(q.value):ee?x<q.value:U<new Date(q.value))}if(($||R)&&(G(!!$,M.message,q.message,pt.max,pt.min),!n))return E(C[v].message),C}if((u||c)&&!k&&(st(x)||o&&Array.isArray(x))){const $=fn(u),R=fn(c),M=!Pe($.value)&&x.length>+$.value,q=!Pe(R.value)&&x.length<+R.value;if((M||q)&&(G(M,$.message,R.message),!n))return E(C[v].message),C}if(m&&!k&&st(x)){const{value:$,message:R}=fn(m);if(Kr($)&&!x.match($)&&(C[v]={type:pt.pattern,message:R,ref:s,...F(pt.pattern,R)},!n))return E(R),C}if(p){if(it(p)){const $=await p(x,t),R=ld($,S);if(R&&(C[v]={...R,...F(pt.validate,R.message)},!n))return E(R.message),C}else if(he(p)){let $={};for(const R in p){if(!Fe($)&&!n)break;const M=ld(await p[R](x,t),S,R);M&&($={...M,...F(R,M.message)},E(M.message),n&&(C[v]=$))}if(!Fe($)&&(C[v]={ref:S,...$},!n))return C}}return E(!0),C};function ix(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=ge(e)?r++:e[t[r++]];return e}function ax(e){for(const t in e)if(e.hasOwnProperty(t)&&!ge(e[t]))return!1;return!0}function ye(e,t){const n=Array.isArray(t)?t:Zs(t)?[t]:Qu(t),r=n.length===1?e:ix(e,n),o=n.length-1,s=n[o];return r&&delete r[s],o!==0&&(he(r)&&Fe(r)||Array.isArray(r)&&ax(r))&&ye(e,n.slice(0,-1)),e}var ti=()=>{let e=[];return{get observers(){return e},next:o=>{for(const s of e)s.next&&s.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(s=>s!==o)}}),unsubscribe:()=>{e=[]}}},ni=e=>Pe(e)||!Zu(e);function Mt(e,t){if(ni(e)||ni(t))return e===t;if(jt(e)&&jt(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const s=e[o];if(!r.includes(o))return!1;if(o!=="ref"){const i=t[o];if(jt(s)&&jt(i)||he(s)&&he(i)||Array.isArray(s)&&Array.isArray(i)?!Mt(s,i):s!==i)return!1}}return!0}var ud=e=>e.type==="select-multiple",lx=e=>ei(e)||kn(e),ri=e=>Gr(e)&&e.isConnected,dd=e=>{for(const t in e)if(it(e[t]))return!0;return!1};function Xr(e,t={}){const n=Array.isArray(e);if(he(e)||n)for(const r in e)Array.isArray(e[r])||he(e[r])&&!dd(e[r])?(t[r]=Array.isArray(e[r])?[]:{},Xr(e[r],t[r])):Pe(e[r])||(t[r]=!0);return t}function fd(e,t,n){const r=Array.isArray(e);if(he(e)||r)for(const o in e)Array.isArray(e[o])||he(e[o])&&!dd(e[o])?ge(t)||ni(n[o])?n[o]=Array.isArray(e[o])?Xr(e[o],[]):{...Xr(e[o])}:fd(e[o],Pe(t)?{}:t[o],n[o]):n[o]=!Mt(e[o],t[o]);return n}var In=(e,t)=>fd(e,t,Xr(t)),pd=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>ge(e)?e:t?e===""?NaN:e&&+e:n&&st(e)?new Date(e):r?r(e):e;function oi(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return Qs(t)?t.files:ei(t)?ad(e.refs).value:ud(t)?[...t.selectedOptions].map(({value:n})=>n):kn(t)?sd(e.refs).value:pd(ge(t.value)?e.ref.value:t.value,e)}var cx=(e,t,n,r)=>{const o={};for(const s of e){const i=H(t,s);i&&de(o,s,i._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},Rn=e=>ge(e)?e:Kr(e)?e.source:he(e)?Kr(e.value)?e.value.source:e.value:e;const gd="AsyncFunction";var ux=e=>!!e&&!!e.validate&&!!(it(e.validate)&&e.validate.constructor.name===gd||he(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===gd)),dx=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function hd(e,t,n){const r=H(e,n);if(r||Zs(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const s=o.join("."),i=H(t,s),a=H(e,s);if(i&&!Array.isArray(i)&&n!==s)return{name:n};if(a&&a.type)return{name:s,error:a};o.pop()}return{name:n}}var fx=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,px=(e,t)=>!jr(H(e,t)).length&&ye(e,t);const gx={mode:Ye.onSubmit,reValidateMode:Ye.onChange,shouldFocusError:!0};function hx(e={}){let t={...gx,...e},n={submitCount:0,isDirty:!1,isLoading:it(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},o=he(t.defaultValues)||he(t.values)?Ve(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:Ve(o),i={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},u,c=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},g={values:ti(),array:ti(),state:ti()},m=td(t.mode),p=td(t.reValidateMode),v=t.criteriaMode===Ye.all,h=b=>N=>{clearTimeout(c),c=setTimeout(b,N)},y=async b=>{if(!t.disabled&&(f.isValid||b)){const N=t.resolver?Fe((await O()).errors):await F(r,!0);N!==n.isValid&&g.state.next({isValid:N})}},w=(b,N)=>{!t.disabled&&(f.isValidating||f.validatingFields)&&((b||Array.from(a.mount)).forEach(A=>{A&&(N?de(n.validatingFields,A,N):ye(n.validatingFields,A))}),g.state.next({validatingFields:n.validatingFields,isValidating:!Fe(n.validatingFields)}))},x=(b,N=[],A,B,z=!0,L=!0)=>{if(B&&A&&!t.disabled){if(i.action=!0,L&&Array.isArray(H(r,b))){const j=A(H(r,b),B.argA,B.argB);z&&de(r,b,j)}if(L&&Array.isArray(H(n.errors,b))){const j=A(H(n.errors,b),B.argA,B.argB);z&&de(n.errors,b,j),px(n.errors,b)}if(f.touchedFields&&L&&Array.isArray(H(n.touchedFields,b))){const j=A(H(n.touchedFields,b),B.argA,B.argB);z&&de(n.touchedFields,b,j)}f.dirtyFields&&(n.dirtyFields=In(o,s)),g.state.next({name:b,isDirty:$(b,N),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else de(s,b,N)},S=(b,N)=>{de(n.errors,b,N),g.state.next({errors:n.errors})},E=b=>{n.errors=b,g.state.next({errors:n.errors,isValid:!1})},C=(b,N,A,B)=>{const z=H(r,b);if(z){const L=H(s,b,ge(A)?H(o,b):A);ge(L)||B&&B.defaultChecked||N?de(s,b,N?L:oi(z._f)):q(b,L),i.mount&&y()}},P=(b,N,A,B,z)=>{let L=!1,j=!1;const re={name:b};if(!t.disabled){const ce=!!(H(r,b)&&H(r,b)._f&&H(r,b)._f.disabled);if(!A||B){f.isDirty&&(j=n.isDirty,n.isDirty=re.isDirty=$(),L=j!==re.isDirty);const pe=ce||Mt(H(o,b),N);j=!!(!ce&&H(n.dirtyFields,b)),pe||ce?ye(n.dirtyFields,b):de(n.dirtyFields,b,!0),re.dirtyFields=n.dirtyFields,L=L||f.dirtyFields&&j!==!pe}if(A){const pe=H(n.touchedFields,b);pe||(de(n.touchedFields,b,A),re.touchedFields=n.touchedFields,L=L||f.touchedFields&&pe!==A)}L&&z&&g.state.next(re)}return L?re:{}},_=(b,N,A,B)=>{const z=H(n.errors,b),L=f.isValid&&ot(N)&&n.isValid!==N;if(t.delayError&&A?(u=h(()=>S(b,A)),u(t.delayError)):(clearTimeout(c),u=null,A?de(n.errors,b,A):ye(n.errors,b)),(A?!Mt(z,A):z)||!Fe(B)||L){const j={...B,...L&&ot(N)?{isValid:N}:{},errors:n.errors,name:b};n={...n,...j},g.state.next(j)}},O=async b=>{w(b,!0);const N=await t.resolver(s,t.context,cx(b||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return w(b),N},k=async b=>{const{errors:N}=await O(b);if(b)for(const A of b){const B=H(N,A);B?de(n.errors,A,B):ye(n.errors,A)}else n.errors=N;return N},F=async(b,N,A={valid:!0})=>{for(const B in b){const z=b[B];if(z){const{_f:L,...j}=z;if(L){const re=a.array.has(L.name),ce=z._f&&ux(z._f);ce&&f.validatingFields&&w([B],!0);const pe=await cd(z,s,v,t.shouldUseNativeValidation&&!N,re);if(ce&&f.validatingFields&&w([B]),pe[L.name]&&(A.valid=!1,N))break;!N&&(H(pe,L.name)?re?sx(n.errors,pe,L.name):de(n.errors,L.name,pe[L.name]):ye(n.errors,L.name))}!Fe(j)&&await F(j,N,A)}}return A.valid},G=()=>{for(const b of a.unMount){const N=H(r,b);N&&(N._f.refs?N._f.refs.every(A=>!ri(A)):!ri(N._f.ref))&&we(b)}a.unMount=new Set},$=(b,N)=>!t.disabled&&(b&&N&&de(s,b,N),!Mt(fe(),o)),R=(b,N,A)=>rx(b,a,{...i.mount?s:ge(N)?o:st(b)?{[b]:N}:N},A,N),M=b=>jr(H(i.mount?s:o,b,t.shouldUnregister?H(o,b,[]):[])),q=(b,N,A={})=>{const B=H(r,b);let z=N;if(B){const L=B._f;L&&(!L.disabled&&de(s,b,pd(N,L)),z=Gr(L.ref)&&Pe(N)?"":N,ud(L.ref)?[...L.ref.options].forEach(j=>j.selected=z.includes(j.value)):L.refs?kn(L.ref)?L.refs.length>1?L.refs.forEach(j=>(!j.defaultChecked||!j.disabled)&&(j.checked=Array.isArray(z)?!!z.find(re=>re===j.value):z===j.value)):L.refs[0]&&(L.refs[0].checked=!!z):L.refs.forEach(j=>j.checked=j.value===z):Qs(L.ref)?L.ref.value="":(L.ref.value=z,L.ref.type||g.values.next({name:b,values:{...s}})))}(A.shouldDirty||A.shouldTouch)&&P(b,z,A.shouldTouch,A.shouldDirty,!0),A.shouldValidate&&ie(b)},U=(b,N,A)=>{for(const B in N){const z=N[B],L=`${b}.${B}`,j=H(r,L);(a.array.has(b)||he(z)||j&&!j._f)&&!jt(z)?U(L,z,A):q(L,z,A)}},X=(b,N,A={})=>{const B=H(r,b),z=a.array.has(b),L=Ve(N);de(s,b,L),z?(g.array.next({name:b,values:{...s}}),(f.isDirty||f.dirtyFields)&&A.shouldDirty&&g.state.next({name:b,dirtyFields:In(o,s),isDirty:$(b,L)})):B&&!B._f&&!Pe(L)?U(b,L,A):q(b,L,A),nd(b,a)&&g.state.next({...n}),g.values.next({name:i.mount?b:void 0,values:{...s}})},K=async b=>{i.mount=!0;const N=b.target;let A=N.name,B=!0;const z=H(r,A),L=()=>N.type?oi(z._f):Yb(b),j=re=>{B=Number.isNaN(re)||jt(re)&&isNaN(re.getTime())||Mt(re,H(s,A,re))};if(z){let re,ce;const pe=L(),vt=b.type===ed.BLUR||b.type===ed.FOCUS_OUT,hn=!dx(z._f)&&!t.resolver&&!H(n.errors,A)&&!z._f.deps||fx(vt,H(n.touchedFields,A),n.isSubmitted,p,m),Bn=nd(A,a,vt);de(s,A,pe),vt?(z._f.onBlur&&z._f.onBlur(b),u&&u(0)):z._f.onChange&&z._f.onChange(b);const mn=P(A,pe,vt,!1),ui=!Fe(mn)||Bn;if(!vt&&g.values.next({name:A,type:b.type,values:{...s}}),hn)return f.isValid&&(t.mode==="onBlur"?vt&&y():y()),ui&&g.state.next({name:A,...Bn?{}:mn});if(!vt&&Bn&&g.state.next({...n}),t.resolver){const{errors:Wt}=await O([A]);if(j(pe),B){const di=hd(n.errors,r,A),Yr=hd(Wt,r,di.name||A);re=Yr.error,A=Yr.name,ce=Fe(Wt)}}else w([A],!0),re=(await cd(z,s,v,t.shouldUseNativeValidation))[A],w([A]),j(pe),B&&(re?ce=!1:f.isValid&&(ce=await F(r,!0)));B&&(z._f.deps&&ie(z._f.deps),_(A,ce,re,mn))}},ee=(b,N)=>{if(H(n.errors,N)&&b.focus)return b.focus(),1},ie=async(b,N={})=>{let A,B;const z=Wr(b);if(t.resolver){const L=await k(ge(b)?b:z);A=Fe(L),B=b?!z.some(j=>H(L,j)):A}else b?(B=(await Promise.all(z.map(async L=>{const j=H(r,L);return await F(j&&j._f?{[L]:j}:j)}))).every(Boolean),!(!B&&!n.isValid)&&y()):B=A=await F(r);return g.state.next({...!st(b)||f.isValid&&A!==n.isValid?{}:{name:b},...t.resolver||!b?{isValid:A}:{},errors:n.errors}),N.shouldFocus&&!B&&$n(r,ee,b?z:a.mount),B},fe=b=>{const N={...i.mount?s:o};return ge(b)?N:st(b)?H(N,b):b.map(A=>H(N,A))},Oe=(b,N)=>({invalid:!!H((N||n).errors,b),isDirty:!!H((N||n).dirtyFields,b),error:H((N||n).errors,b),isValidating:!!H(n.validatingFields,b),isTouched:!!H((N||n).touchedFields,b)}),xe=b=>{b&&Wr(b).forEach(N=>ye(n.errors,N)),g.state.next({errors:b?n.errors:{}})},Be=(b,N,A)=>{const B=(H(r,b,{_f:{}})._f||{}).ref,z=H(n.errors,b)||{},{ref:L,message:j,type:re,...ce}=z;de(n.errors,b,{...ce,...N,ref:B}),g.state.next({name:b,errors:n.errors,isValid:!1}),A&&A.shouldFocus&&B&&B.focus&&B.focus()},kt=(b,N)=>it(b)?g.values.subscribe({next:A=>b(R(void 0,N),A)}):R(b,N,!0),we=(b,N={})=>{for(const A of b?Wr(b):a.mount)a.mount.delete(A),a.array.delete(A),N.keepValue||(ye(r,A),ye(s,A)),!N.keepError&&ye(n.errors,A),!N.keepDirty&&ye(n.dirtyFields,A),!N.keepTouched&&ye(n.touchedFields,A),!N.keepIsValidating&&ye(n.validatingFields,A),!t.shouldUnregister&&!N.keepDefaultValue&&ye(o,A);g.values.next({values:{...s}}),g.state.next({...n,...N.keepDirty?{isDirty:$()}:{}}),!N.keepIsValid&&y()},Ee=({disabled:b,name:N,field:A,fields:B,value:z})=>{if(ot(b)&&i.mount||b){const L=b?void 0:ge(z)?oi(A?A._f:H(B,N)._f):z;(b||!b&&!ge(L))&&de(s,N,L),P(N,L,!1,!1,!0)}},Je=(b,N={})=>{let A=H(r,b);const B=ot(N.disabled)||ot(t.disabled);return de(r,b,{...A||{},_f:{...A&&A._f?A._f:{ref:{name:b}},name:b,mount:!0,...N}}),a.mount.add(b),A?Ee({field:A,disabled:ot(N.disabled)?N.disabled:t.disabled,name:b,value:N.value}):C(b,!0,N.value),{...B?{disabled:N.disabled||t.disabled}:{},...t.progressive?{required:!!N.required,min:Rn(N.min),max:Rn(N.max),minLength:Rn(N.minLength),maxLength:Rn(N.maxLength),pattern:Rn(N.pattern)}:{},name:b,onChange:K,onBlur:K,ref:z=>{if(z){Je(b,N),A=H(r,b);const L=ge(z.value)&&z.querySelectorAll&&z.querySelectorAll("input,select,textarea")[0]||z,j=lx(L),re=A._f.refs||[];if(j?re.find(ce=>ce===L):L===A._f.ref)return;de(r,b,{_f:{...A._f,...j?{refs:[...re.filter(ri),L,...Array.isArray(H(o,b))?[{}]:[]],ref:{type:L.type,name:b}}:{ref:L}}}),C(b,!1,void 0,L)}else A=H(r,b,{}),A._f&&(A._f.mount=!1),(t.shouldUnregister||N.shouldUnregister)&&!(Zb(a.array,b)&&i.action)&&a.unMount.add(b)}}},De=()=>t.shouldFocusError&&$n(r,ee,a.mount),pn=b=>{ot(b)&&(g.state.next({disabled:b}),$n(r,(N,A)=>{const B=H(r,A);B&&(N.disabled=B._f.disabled||b,Array.isArray(B._f.refs)&&B._f.refs.forEach(z=>{z.disabled=B._f.disabled||b}))},0,!1))},ht=(b,N)=>async A=>{let B;if(A&&(A.preventDefault&&A.preventDefault(),A.persist&&A.persist()),t.disabled){N&&await N({...n.errors},A);return}let z=Ve(s);if(g.state.next({isSubmitting:!0}),t.resolver){const{errors:L,values:j}=await O();n.errors=L,z=j}else await F(r);if(ye(n.errors,"root"),Fe(n.errors)){g.state.next({errors:{}});try{await b(z,A)}catch(L){B=L}}else N&&await N({...n.errors},A),De(),setTimeout(De);if(g.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Fe(n.errors)&&!B,submitCount:n.submitCount+1,errors:n.errors}),B)throw B},mt=(b,N={})=>{H(r,b)&&(ge(N.defaultValue)?X(b,Ve(H(o,b))):(X(b,N.defaultValue),de(o,b,Ve(N.defaultValue))),N.keepTouched||ye(n.touchedFields,b),N.keepDirty||(ye(n.dirtyFields,b),n.isDirty=N.defaultValue?$(b,Ve(H(o,b))):$()),N.keepError||(ye(n.errors,b),f.isValid&&y()),g.state.next({...n}))},ze=(b,N={})=>{const A=b?Ve(b):o,B=Ve(A),z=Fe(b),L=z?o:B;if(N.keepDefaultValues||(o=A),!N.keepValues){if(N.keepDirtyValues){const j=new Set([...a.mount,...Object.keys(In(o,s))]);for(const re of Array.from(j))H(n.dirtyFields,re)?de(L,re,H(s,re)):X(re,H(L,re))}else{if(Js&&ge(b))for(const j of a.mount){const re=H(r,j);if(re&&re._f){const ce=Array.isArray(re._f.refs)?re._f.refs[0]:re._f.ref;if(Gr(ce)){const pe=ce.closest("form");if(pe){pe.reset();break}}}}r={}}s=t.shouldUnregister?N.keepDefaultValues?Ve(o):{}:Ve(L),g.array.next({values:{...L}}),g.values.next({values:{...L}})}a={mount:N.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!f.isValid||!!N.keepIsValid||!!N.keepDirtyValues,i.watch=!!t.shouldUnregister,g.state.next({submitCount:N.keepSubmitCount?n.submitCount:0,isDirty:z?!1:N.keepDirty?n.isDirty:!!(N.keepDefaultValues&&!Mt(b,o)),isSubmitted:N.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:z?{}:N.keepDirtyValues?N.keepDefaultValues&&s?In(o,s):n.dirtyFields:N.keepDefaultValues&&b?In(o,b):N.keepDirty?n.dirtyFields:{},touchedFields:N.keepTouched?n.touchedFields:{},errors:N.keepErrors?n.errors:{},isSubmitSuccessful:N.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},$t=(b,N)=>ze(it(b)?b(s):b,N);return{control:{register:Je,unregister:we,getFieldState:Oe,handleSubmit:ht,setError:Be,_executeSchema:O,_getWatch:R,_getDirty:$,_updateValid:y,_removeUnmounted:G,_updateFieldArray:x,_updateDisabledField:Ee,_getFieldArray:M,_reset:ze,_resetDefaultValues:()=>it(t.defaultValues)&&t.defaultValues().then(b=>{$t(b,t.resetOptions),g.state.next({isLoading:!1})}),_updateFormState:b=>{n={...n,...b}},_disableForm:pn,_subjects:g,_proxyFormState:f,_setErrors:E,get _fields(){return r},get _formValues(){return s},get _state(){return i},set _state(b){i=b},get _defaultValues(){return o},get _names(){return a},set _names(b){a=b},get _formState(){return n},set _formState(b){n=b},get _options(){return t},set _options(b){t={...t,...b}}},trigger:ie,register:Je,handleSubmit:ht,watch:kt,setValue:X,getValues:fe,reset:$t,resetField:mt,clearErrors:xe,unregister:we,setError:Be,setFocus:(b,N={})=>{const A=H(r,b),B=A&&A._f;if(B){const z=B.refs?B.refs[0]:B.ref;z.focus&&(z.focus(),N.shouldSelect&&it(z.select)&&z.select())}},getFieldState:Oe}}function mx(e={}){const t=D.useRef(),n=D.useRef(),[r,o]=D.useState({isDirty:!1,isValidating:!1,isLoading:it(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:it(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...hx(e),formState:r});const s=t.current.control;return s._options=e,nx({subject:s._subjects.state,next:i=>{tx(i,s._proxyFormState,s._updateFormState)&&o({...s._formState})}}),D.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),D.useEffect(()=>{if(s._proxyFormState.isDirty){const i=s._getDirty();i!==r.isDirty&&s._subjects.state.next({isDirty:i})}},[s,r.isDirty]),D.useEffect(()=>{e.values&&!Mt(e.values,n.current)?(s._reset(e.values,s._options.resetOptions),n.current=e.values,o(i=>({...i}))):s._resetDefaultValues()},[e.values,s]),D.useEffect(()=>{e.errors&&s._setErrors(e.errors)},[e.errors,s]),D.useEffect(()=>{s._state.mount||(s._updateValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),D.useEffect(()=>{e.shouldUnregister&&s._subjects.values.next({values:s._getWatch()})},[e.shouldUnregister,s]),D.useMemo(()=>({...t.current,formState:ex(r,s)}),[r,s])}const md=({className:e,children:t,content:n,side:r})=>{const[o,s]=D.useState(!1);return l.jsx($u,{delayDuration:0,children:l.jsxs(Iu,{open:o,children:[l.jsx(Ru,{asChild:!0,children:l.jsx("button",{type:"button",className:Z("cursor-pointer",e),onClick:()=>s(!o),onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),onTouchStart:()=>s(!o),onKeyDown:i=>{i.preventDefault(),i.key==="Enter"&&s(!o)},children:t})}),l.jsx(Xs,{side:r,className:n?"":"hidden",children:l.jsx("span",{className:"inline-block",children:n})})]})})},si=({className:e,...t})=>l.jsx("nav",{role:"navigation","aria-label":"pagination",className:Z("mx-auto flex w-full justify-center",e),...t});si.displayName="Pagination";const ii=d.forwardRef(({className:e,...t},n)=>l.jsx("ul",{ref:n,className:Z("flex flex-row items-center gap-1",e),...t}));ii.displayName="PaginationContent";const gt=d.forwardRef(({className:e,...t},n)=>l.jsx("li",{ref:n,className:Z("",e),...t}));gt.displayName="PaginationItem";const Ln=({className:e,isActive:t,size:n="icon",...r})=>l.jsx("a",{"aria-current":t?"page":void 0,className:Z(Da({variant:t?"outline":"ghost",size:n}),e),...r});Ln.displayName="PaginationLink";const ai=({className:e,...t})=>l.jsxs(Ln,{"aria-label":"Go to previous page",size:"default",className:Z("gap-1 pl-2.5",e),...t,children:[l.jsx(qp,{className:"h-4 w-4"}),l.jsx("span",{children:"Previous"})]});ai.displayName="PaginationPrevious";const li=({className:e,...t})=>l.jsxs(Ln,{"aria-label":"Go to next page",size:"default",className:Z("gap-1 pr-2.5",e),...t,children:[l.jsx("span",{children:"Next"}),l.jsx(ha,{className:"h-4 w-4"})]});li.displayName="PaginationNext";const ci=({className:e,...t})=>l.jsxs("span",{"aria-hidden":!0,className:Z("flex h-9 w-9 items-center justify-center",e),...t,children:[l.jsx(Kp,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"More pages"})]});ci.displayName="PaginationEllipsis";const vx=(e,t)=>{const[n,r]=D.useState(e);return D.useEffect(()=>{const o=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(o)}},[e,t]),n},yx=({apiBaseUrl:e="http://localhost:3001"})=>{var P,_;const[t,n]=D.useState([]),[r,o]=D.useState(!1),[s,i]=D.useState([]),[a,u]=D.useState(1),[c,f]=D.useState(1),[g,m]=D.useState(null),[p,v]=D.useState(""),h=vx(p,500),y=O=>{const k=O.match(/\d{6}/);if(!k)return{month:"",year:""};const F=k[0],G=F.substring(0,2),$=F.substring(2);return{month:G,year:$}},w=O=>O.map(F=>{let G=(F==null?void 0:F.month)||"",$=(F==null?void 0:F.year)||"";if((!G||!$)&&(F!=null&&F.file_name)){const R=y(F.file_name);G=G||R.month,$=$||R.year}return{id:F==null?void 0:F.id,prefix:(F==null?void 0:F.prefix)||"",model:(F==null?void 0:F.model)||"",fileName:(F==null?void 0:F.file_name)||"",code:(F==null?void 0:F.stock_id)||"",month:G,year:$,content:(F==null?void 0:F.text_summary)||"",status:(F==null?void 0:F.status)||"",note:(F==null?void 0:F.note)||"",lastUpdate:F==null?void 0:F.updated_at,stock_id:F==null?void 0:F.stock_id}}),x=O=>{if(!(O!=null&&O.data))return[];const k=w(O==null?void 0:O.data);n(k),f(O.pagination.totalPages)},S=async(O=1,k=15)=>{m(O),o(!0);try{const F=await oe.get(`${e}/api/latest-summaries`,{params:{page:O,limit:k,search:p}});(F==null?void 0:F.status)===200?x(F.data):console.error(F)}catch(F){console.error("Error fetching data:",F)}finally{m(null),o(!1)}};D.useEffect(()=>{h&&u(1),S(a)},[a,h]);const E=D.useMemo(()=>[{id:"code",header:"Mã",accessorKey:"code",cell:({row:k})=>l.jsx("span",{className:"flex flex-col",children:k.original.code})},{id:"month",header:"Tháng",accessorKey:"month",cell:({row:k})=>{const F=k.original.month,G=k.original.year;return l.jsx("span",{className:"flex flex-col",children:`${F.toString().padStart(2,"0")}/${G}`})}},{id:"content",header:"Nội dung",accessorKey:"content",cell:({row:k})=>{const F=k.getValue("content");return l.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[30dvw]",children:F})}},{id:"status",header:"Trạng thái",accessorKey:"status",cell:({row:k})=>{const G=k.original.status!=="unpublish";return l.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0 text-[10px] font-bold ${G?"bg-green-50 text-green-700 ring-1 ring-inset ring-green-600/20":"bg-gray-50 text-gray-600 ring-1 ring-inset ring-gray-500/20"}`,children:G?"PUBLISHED":"UNPUBLISHED"})}},{id:"note",header:"Ghi chú",accessorKey:"note",cell:({row:k})=>l.jsx(md,{content:l.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:k.original.note}),children:l.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[20dvw]",children:k.original.note})})},{id:"last-update",header:"Cập nhật",accessorKey:"last-update",cell:({row:k})=>{const F=new Date(k.original.lastUpdate),G=F.getDate(),$=F.getMonth()+1,R=`ngày ${G} tháng ${$}`;return l.jsx("span",{className:"flex flex-col",children:R})}},{accessorKey:"actions",header:()=>l.jsx("div",{className:"font-medium text-right",children:"Hành động"}),cell:({row:k})=>{const[F,G]=D.useState(!1),[$,R]=D.useState(!1),[M,q]=D.useState(!1),{handleSubmit:U,register:X,reset:K}=mx(),ee=k.original.id,ie=k.getValue("status"),fe=k.getValue("content"),[Oe,xe]=D.useState(!1),Be=async()=>{try{xe(!0);const we=ie==="unpublish"?"published":"unpublish",Ee=await oe.patch(`${e}/api/toggle-publish/${ee}`,{id:ee,typeAction:"update",status:ie,idInput:ee,stock_id:k.original.stock_id,prefix:k.original.prefix,model:k.original.model,summary_result:k.original.content,note:k.original.note});Ee.status===200?n(Je=>Je.map(De=>De.id===ee?{...De,status:we}:De)):console.error("Failed to toggle publish status:",Ee)}catch(we){console.error("Error toggling publish status:",we)}finally{xe(!1)}},kt=async we=>{G(!0);try{const Ee=await oe.patch(`${e}/api/update-summary`,{note:we.note,text_summary:we.content,id:ee});Ee.status===200?(await S(a),R(!1)):console.error("Failed to update summary:",Ee)}catch(Ee){console.error("Error updating summary:",Ee)}return G(!1)};return l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsx(se,{variant:"outline",size:"sm",onClick:()=>q(!0),className:"px-2 py-0.5 h-7",children:l.jsx(Xp,{className:"h-4 w-4"})}),l.jsx(zt,{open:M,onOpenChange:q,children:l.jsxs(Tt,{className:"max-w-3xl max-h-[80vh]",children:[l.jsx(Pt,{children:l.jsx(At,{children:"Nội dung chi tiết"})}),l.jsx("div",{className:"mt-4 overflow-y-auto max-h-[60vh]",children:l.jsx("div",{className:"whitespace-pre-wrap text-[16px] leading-relaxed",children:fe})})]})}),l.jsxs(zt,{open:$,onOpenChange:we=>{R(we),we?K({content:k.original.content,note:k.original.note}):K()},children:[l.jsx(gr,{asChild:!0,children:l.jsx(se,{variant:"outline",size:"sm",onClick:()=>R(!0),className:"px-2 py-0.5 h-7",children:"Sửa"})}),l.jsx(Tt,{className:"rounded-lg sm:px-3 h-[calc(100dvh-200px)] min-w-[calc(100dvw-112px)]",children:l.jsxs(Pt,{className:"flex flex-col gap-3",children:[l.jsx(At,{className:"max-sm:hidden text-center",children:"Sửa summary"}),l.jsxs("form",{className:"flex flex-col gap-3 h-full justify-between",onSubmit:U(kt),children:[l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsxs("div",{className:"flex flex-col items-start",children:[l.jsx("span",{children:"Nội dung:"}),l.jsx(Cr,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:k.original.answer||"",rows:10,...X("content")})]}),l.jsxs("div",{className:"flex flex-col items-start",children:[l.jsx("span",{children:"Ghi chú:"}),l.jsx(Cr,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:k.original.note||"",rows:1,...X("note")})]})]}),l.jsx("div",{className:"flex justify-end",children:l.jsx(se,{disabled:F,type:"submit",variant:"default",children:F?l.jsx(be,{className:"h-4 w-4 animate-spin"}):"Ok"})})]})]})})]}),l.jsx(se,{variant:"outline",size:"sm",onClick:Be,disabled:Oe,className:"w-[70px] px-2 py-0.5 h-7",children:Oe?l.jsx(be,{className:"h-4 w-4 animate-spin"}):ie==="unpublish"?"Publish":"Unpublish"})]})}}],[]),C=_i({data:t,columns:E,state:{columnFilters:s},enableRowSelection:!0,onColumnFiltersChange:i,getFilteredRowModel:hf(),getCoreRowModel:Ai()});return l.jsxs("div",{className:"space-y-4 s3-explr-container",children:[l.jsx("div",{className:"flex items-center space-x-4 s3-explr-toolbar",children:l.jsxs("div",{className:"relative max-w-sm",children:[l.jsx(_t,{placeholder:"Tìm kiếm theo mã...",value:p,onChange:O=>v(O.target.value),className:"pr-8"}),p&&l.jsx(se,{variant:"ghost",size:"sm",className:"absolute right-1 top-1/2 -translate-y-1/2 h-6 w-6 p-0",onClick:()=>v(""),children:l.jsx(Fo,{className:"h-4 w-4"})})]})}),l.jsx("div",{className:"rounded-md border s3-explr-table-container",children:l.jsxs(mr,{className:"s3-explr-table",children:[l.jsx(vr,{className:"s3-explr-table-header",children:C.getHeaderGroups().map(O=>l.jsx(Ge,{className:"hover:bg-transparent s3-explr-header-row",children:O.headers.map(k=>l.jsx(et,{className:"s3-explr-header-cell",children:k.isPlaceholder?null:Gn(k.column.columnDef.header,k.getContext())},k.id))},O.id))}),l.jsx(yr,{className:"s3-explr-table-body",children:r?l.jsx(Ge,{children:l.jsx(_e,{colSpan:E.length,className:"h-24 text-center",children:"Đang tải dữ liệu..."})}):(P=C.getRowModel().rows)!=null&&P.length?(_=C.getRowModel().rows)==null?void 0:_.map(O=>l.jsx(Ge,{className:"h-12 s3-explr-row",children:O.getVisibleCells().map(k=>l.jsx(_e,{className:"align-middle s3-explr-cell",children:Gn(k.column.columnDef.cell,k.getContext())},k.id))},O.id)):l.jsx(Ge,{children:l.jsx(_e,{colSpan:E.length,className:"h-24 text-center",children:"Không có kết quả."})})})]})}),l.jsx("div",{className:"mt-4",children:l.jsx(si,{children:l.jsxs(ii,{children:[l.jsx(gt,{children:l.jsx(ai,{onClick:()=>u(O=>Math.max(1,O-1)),className:a===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:c},(O,k)=>k+1).filter(O=>O===1||O===c||Math.abs(O-a)<=1).map((O,k,F)=>l.jsxs(l.Fragment,{children:[k>0&&F[k-1]!==O-1&&l.jsx(gt,{children:l.jsx(ci,{})},O+"..."),l.jsx(gt,{children:l.jsx(Ln,{onClick:()=>u(O),isActive:a===O,className:`cursor-pointer ${r?"pointer-events-none":""}`,children:g===O?l.jsx(be,{className:"h-4 w-4 animate-spin"}):O})},O)]})),l.jsx(gt,{children:l.jsx(li,{onClick:()=>u(O=>Math.min(c,O+1)),className:a===c||g!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})})]})},vd=10,wx=D.memo(({apiBaseUrl:e="http://localhost:3001"})=>{const[t,n]=D.useState(1),[r,o]=D.useState([]),[s,i]=D.useState({total:0,page:1,limit:vd,totalPages:1}),[a,u]=D.useState(!0),[c,f]=D.useState(null),[g,m]=D.useState(new Set),{toast:p}=As(),[v,h]=D.useState(!1),y=async C=>{try{f(C);const P=await oe.get(`${e}/api/jobs`,{params:{page:C.toString(),limit:vd.toString()}});o(P.data.data),i(P.data.pagination)}catch{p({variant:"destructive",title:"Error",description:"Failed to fetch jobs. Please try again."})}finally{f(null),u(!1)}};D.useEffect(()=>{y(t)},[t,e]);const w=async C=>{m(P=>new Set(P).add(C.toString()));try{await oe.post(`${e}/api/retry-job`,{jobId:C}),p({title:"Job Restarted",description:`Job ${C} has been successfully restarted.`}),y(t)}catch{p({variant:"destructive",title:"Retry Failed",description:`Failed to restart job ${C}. Please try again.`})}finally{m(P=>{const _=new Set(P);return _.delete(C.toString()),_})}},x=async()=>{h(!0),n(1),await y(1),h(!1)},S=C=>new Date(C).toLocaleString(),E=C=>{if(C=parseFloat(C),C<60)return`${C.toFixed(2)}s`;const P=Math.floor(C/60),_=(C%60).toFixed(0);return`${P}m ${_}s`};return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[l.jsx(Wp,{className:"w-8 h-8 text-primary"}),l.jsx("h2",{className:"text-3xl font-bold tracking-tight",children:"Job Management"}),l.jsx(se,{variant:"outline",size:"icon",onClick:x,disabled:v||a,className:"ml-2",children:l.jsx(Yp,{className:`h-4 w-4 ${v?"animate-spin":""}`})})]}),l.jsx("div",{className:"rounded-md border",children:l.jsxs(mr,{children:[l.jsx(vr,{children:l.jsxs(Ge,{children:[l.jsx(et,{children:"ID"}),l.jsx(et,{children:"Tên Công Việc"}),l.jsx(et,{children:"Thời Gian Bắt Đầu"}),l.jsx(et,{children:"Thời Gian Cập Nhật"}),l.jsx(et,{children:"Thời Gian Thực Thi"}),l.jsx(et,{children:"Trạng Thái"}),l.jsx(et,{children:"Thao Tác"})]})}),l.jsx(yr,{children:a&&r.length===0?l.jsx(Ge,{children:l.jsx(_e,{colSpan:7,className:"text-center py-4",children:l.jsx(be,{className:"w-6 h-6 animate-spin mx-auto"})})}):r.map(C=>{var P,_;return l.jsxs(Ge,{children:[l.jsx(_e,{className:"!w-[100px]",children:C.id}),l.jsx(_e,{className:"font-medium",children:(P=C.job_name)==null?void 0:P.replace("Upload file","Summary")}),l.jsx(_e,{className:"!w-[200px]",children:S(C.created_at)}),l.jsx(_e,{className:"!w-[200px]",children:S(C.updated_at)}),l.jsx(_e,{className:"!w-[150px]",children:E(C.execution_time_seconds)}),l.jsx(_e,{className:"!w-[200px]",children:l.jsx(md,{content:C.status==="fail"&&C.error?l.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:C.error}):null,children:l.jsx("div",{className:`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[30dvw]
137
- ${C.status==="done"?"bg-green-100 text-green-800":C.status==="fail"?"bg-red-100 text-red-800":"bg-yellow-100 text-yellow-800"}`,children:C.status==="fail"?"FAILED":(_=C.status)==null?void 0:_.toUpperCase()})})}),l.jsx(_e,{className:"!w-[200px]",children:C.status==="fail"?l.jsx(se,{variant:"outline",size:"sm",onClick:()=>w(C.id),disabled:g.has(C.id.toString()),className:"h-[32px]",children:g.has(C.id.toString())?l.jsxs(l.Fragment,{children:[l.jsx(be,{className:"mr-2 h-4 w-4 animate-spin"}),"Đang thử lại..."]}):"Thử Lại"}):l.jsx("div",{className:"h-[32px]"})})]},C.id)})})]})}),l.jsx("div",{className:"mt-4",children:l.jsx(si,{children:l.jsxs(ii,{children:[l.jsx(gt,{children:l.jsx(ai,{onClick:()=>n(C=>Math.max(1,C-1)),className:t===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:s.totalPages},(C,P)=>P+1).filter(C=>C===1||C===s.totalPages||Math.abs(C-t)<=1).map((C,P,_)=>l.jsxs(l.Fragment,{children:[P>0&&_[P-1]!==C-1&&l.jsx(gt,{children:l.jsx(ci,{})},C+"..."),l.jsx(gt,{children:l.jsx(Ln,{onClick:()=>n(C),isActive:t===C,className:`cursor-pointer ${c!==null?"pointer-events-none":""}`,children:c===C?l.jsx(be,{className:"h-4 w-4 animate-spin"}):C})},C)]})),l.jsx(gt,{children:l.jsx(li,{onClick:()=>n(C=>Math.min(s.totalPages,C+1)),className:t===s.totalPages||c!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})}),l.jsx(Bc,{})]})});He.Job=wx,He.S3Explorer=Xb,He.Summary=yx,Object.defineProperty(He,Symbol.toStringTag,{value:"Module"})});
136
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return d.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},hm="DialogDescriptionWarning",mm=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${kl(hm).contentName}}.`;return d.useEffect(()=>{var s;const o=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},vm=bl,ym=Cl,wm=El,$l=Nl,Il=Tl,Ll=Al,Rl=Fl,bm=Dl;const Ut=vm,hr=ym,xm=wm,Vl=d.forwardRef(({className:e,...t},n)=>l.jsx($l,{ref:n,className:Z("s3-explr-ui-dialog-overlay fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Vl.displayName=$l.displayName;const At=d.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(xm,{children:[l.jsx(Vl,{}),l.jsxs(Il,{ref:r,className:Z("s3-explr-ui-dialog-content fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,l.jsxs(bm,{className:Z("s3-explr-ui-dialog-close absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"),children:[l.jsx(ko,{className:"s3-explr-ui-dialog-close-icon h-4 w-4"}),l.jsx("span",{className:"s3-explr-ui-dialog-close-text sr-only",children:"Close"})]})]})]}));At.displayName=Il.displayName;const _t=({className:e,...t})=>l.jsx("div",{className:Z("s3-explr-ui-dialog-header flex flex-col space-y-1.5 text-center sm:text-left",e),...t});_t.displayName="DialogHeader";const Nn=({className:e,...t})=>l.jsx("div",{className:Z("s3-explr-ui-dialog-footer flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Nn.displayName="DialogFooter";const Ft=d.forwardRef(({className:e,...t},n)=>l.jsx(Ll,{ref:n,className:Z("s3-explr-ui-dialog-title text-lg font-semibold leading-none tracking-tight",e),...t}));Ft.displayName=Ll.displayName;const mr=d.forwardRef(({className:e,...t},n)=>l.jsx(Rl,{ref:n,className:Z("s3-explr-ui-dialog-description text-sm text-muted-foreground",e),...t}));mr.displayName=Rl.displayName;const Ot=d.forwardRef(({className:e,type:t,...n},r)=>l.jsx("input",{type:t,className:Z("s3-explr-ui-input","flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));Ot.displayName="Input";var Cm="Label",Bl=d.forwardRef((e,t)=>l.jsx(ve.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Bl.displayName=Cm;var zl=Bl;const Sm=zo("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 s3-explr-ui-label",{variants:{variant:{default:"s3-explr-ui-label-default",required:"s3-explr-ui-label-required",disabled:"s3-explr-ui-label-disabled"},size:{default:"s3-explr-ui-label-size-default",sm:"s3-explr-ui-label-size-sm",lg:"s3-explr-ui-label-size-lg"}},defaultVariants:{variant:"default",size:"default"}}),jt=d.forwardRef(({className:e,variant:t,size:n,...r},o)=>l.jsx(zl,{ref:o,className:Z(Sm({variant:t,size:n}),e),...r}));jt.displayName=zl.displayName;const vr=d.forwardRef(({className:e,...t},n)=>l.jsx("div",{className:Z("relative w-full overflow-auto","s3-explr-ui-table-container"),children:l.jsx("table",{ref:n,className:Z("w-full caption-bottom text-sm","s3-explr-ui-table",e),...t})}));vr.displayName="Table";const yr=d.forwardRef(({className:e,...t},n)=>l.jsx("thead",{ref:n,className:Z("[&_tr]:border-b","s3-explr-ui-table-header",e),...t}));yr.displayName="TableHeader";const wr=d.forwardRef(({className:e,...t},n)=>l.jsx("tbody",{ref:n,className:Z("[&_tr:last-child]:border-0","s3-explr-ui-table-body",e),...t}));wr.displayName="TableBody";const Em=d.forwardRef(({className:e,...t},n)=>l.jsx("tfoot",{ref:n,className:Z("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0","s3-explr-ui-table-footer",e),...t}));Em.displayName="TableFooter";const Xe=d.forwardRef(({className:e,...t},n)=>l.jsx("tr",{ref:n,className:Z("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted","s3-explr-ui-table-row",e),...t}));Xe.displayName="TableRow";const nt=d.forwardRef(({className:e,...t},n)=>l.jsx("th",{ref:n,className:Z("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]","s3-explr-ui-table-head",e),...t}));nt.displayName="TableHead";const Fe=d.forwardRef(({className:e,...t},n)=>l.jsx("td",{ref:n,className:Z("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]","s3-explr-ui-table-cell",e),...t}));Fe.displayName="TableCell";const Nm=d.forwardRef(({className:e,...t},n)=>l.jsx("caption",{ref:n,className:Z("mt-4 text-sm text-muted-foreground","s3-explr-ui-table-caption",e),...t}));Nm.displayName="TableCaption";function as(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function an(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Hl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ls(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Hl(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Hl(e[o],null)}}}}function cs(...e){return d.useCallback(ls(...e),e)}var us=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Pm);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(ds,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(ds,{...r,ref:t,children:n})});us.displayName="Slot";var ds=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=_m(n);return d.cloneElement(n,{...Am(r,n.props),ref:t?ls(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});ds.displayName="SlotClone";var Tm=({children:e})=>l.jsx(l.Fragment,{children:e});function Pm(e){return d.isValidElement(e)&&e.type===Tm}function Am(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function _m(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Fm(e){const t=e+"CollectionProvider",[n,r]=Nt(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:v,children:h}=p,y=D.useRef(null),w=D.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:w,collectionRef:y,children:h})};i.displayName=t;const a=e+"CollectionSlot",u=D.forwardRef((p,v)=>{const{scope:h,children:y}=p,w=s(a,h),b=cs(v,w.collectionRef);return l.jsx(us,{ref:b,children:y})});u.displayName=a;const c=e+"CollectionItemSlot",f="data-radix-collection-item",g=D.forwardRef((p,v)=>{const{scope:h,children:y,...w}=p,b=D.useRef(null),S=cs(v,b),E=s(c,h);return D.useEffect(()=>(E.itemMap.set(b,{ref:b,...w}),()=>void E.itemMap.delete(b))),l.jsx(us,{[f]:"",ref:S,children:y})});g.displayName=c;function m(p){const v=s(e+"CollectionConsumer",p);return D.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((E,x)=>w.indexOf(E.ref.current)-w.indexOf(x.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:u,ItemSlot:g},m,r]}var Ul=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Dm);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(fs,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(fs,{...r,ref:t,children:n})});Ul.displayName="Slot";var fs=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=km(n);return d.cloneElement(n,{...Mm(r,n.props),ref:t?ls(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});fs.displayName="SlotClone";var Om=({children:e})=>l.jsx(l.Fragment,{children:e});function Dm(e){return d.isValidElement(e)&&e.type===Om}function Mm(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function km(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var $m=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],jl=$m.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Ul:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Im=d.createContext(void 0);function Wl(e){const t=d.useContext(Im);return e||t||"ltr"}var ps="rovingFocusGroup.onEntryFocus",Lm={bubbles:!1,cancelable:!0},br="RovingFocusGroup",[gs,Gl,Rm]=Fm(br),[Vm,ql]=Nt(br,[Rm]),[Bm,zm]=Vm(br),Kl=d.forwardRef((e,t)=>l.jsx(gs.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(gs.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Hm,{...e,ref:t})})}));Kl.displayName=br;var Hm=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:u,onEntryFocus:c,preventScrollOnEntryFocus:f=!1,...g}=e,m=d.useRef(null),p=cs(t,m),v=Wl(s),[h=null,y]=Qt({prop:i,defaultProp:a,onChange:u}),[w,b]=d.useState(!1),S=Pe(c),E=Gl(n),x=d.useRef(!1),[P,_]=d.useState(0);return d.useEffect(()=>{const O=m.current;if(O)return O.addEventListener(ps,S),()=>O.removeEventListener(ps,S)},[S]),l.jsx(Bm,{scope:n,orientation:r,dir:v,loop:o,currentTabStopId:h,onItemFocus:d.useCallback(O=>y(O),[y]),onItemShiftTab:d.useCallback(()=>b(!0),[]),onFocusableItemAdd:d.useCallback(()=>_(O=>O+1),[]),onFocusableItemRemove:d.useCallback(()=>_(O=>O-1),[]),children:l.jsx(jl.div,{tabIndex:w||P===0?-1:0,"data-orientation":r,...g,ref:p,style:{outline:"none",...e.style},onMouseDown:an(e.onMouseDown,()=>{x.current=!0}),onFocus:an(e.onFocus,O=>{const k=!x.current;if(O.target===O.currentTarget&&k&&!w){const F=new CustomEvent(ps,Lm);if(O.currentTarget.dispatchEvent(F),!F.defaultPrevented){const G=E().filter(W=>W.focusable),$=G.find(W=>W.active),L=G.find(W=>W.id===h),q=[$,L,...G].filter(Boolean).map(W=>W.ref.current);Jl(q,f)}}x.current=!1}),onBlur:an(e.onBlur,()=>b(!1))})})}),Xl="RovingFocusGroupItem",Yl=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,...i}=e,a=tn(),u=s||a,c=zm(Xl,n),f=c.currentTabStopId===u,g=Gl(n),{onFocusableItemAdd:m,onFocusableItemRemove:p}=c;return d.useEffect(()=>{if(r)return m(),()=>p()},[r,m,p]),l.jsx(gs.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:l.jsx(jl.span,{tabIndex:f?0:-1,"data-orientation":c.orientation,...i,ref:t,onMouseDown:an(e.onMouseDown,v=>{r?c.onItemFocus(u):v.preventDefault()}),onFocus:an(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:an(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const h=Wm(v,c.orientation,c.dir);if(h!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let w=g().filter(b=>b.focusable).map(b=>b.ref.current);if(h==="last")w.reverse();else if(h==="prev"||h==="next"){h==="prev"&&w.reverse();const b=w.indexOf(v.currentTarget);w=c.loop?Gm(w,b+1):w.slice(b+1)}setTimeout(()=>Jl(w))}})})})});Yl.displayName=Xl;var Um={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function jm(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Wm(e,t,n){const r=jm(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Um[r]}function Jl(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Gm(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var qm=Kl,Km=Yl;function Zl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Xm(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Zl(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Zl(e[o],null)}}}}function Ym(...e){return d.useCallback(Xm(...e),e)}function Jm(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var Ql=e=>{const{present:t,children:n}=e,r=Zm(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=Ym(r.ref,Qm(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};Ql.displayName="Presence";function Zm(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=Jm(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=xr(r.current);s.current=a==="mounted"?c:"none"},[a]),Le(()=>{const c=r.current,f=o.current;if(f!==e){const m=s.current,p=xr(c);e?u("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&m!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),Le(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,g=p=>{const h=xr(r.current).includes(p.animationName);if(p.target===t&&h&&(u("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},m=p=>{p.target===t&&(s.current=xr(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:d.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function xr(e){return(e==null?void 0:e.animationName)||"none"}function Qm(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ec(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ev(...e){return t=>{let n=!1;const r=e.map(o=>{const s=ec(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():ec(e[o],null)}}}}var tc=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(nv);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(hs,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(hs,{...r,ref:t,children:n})});tc.displayName="Slot";var hs=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=ov(n);return d.cloneElement(n,{...rv(r,n.props),ref:t?ev(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});hs.displayName="SlotClone";var tv=({children:e})=>l.jsx(l.Fragment,{children:e});function nv(e){return d.isValidElement(e)&&e.type===tv}function rv(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function ov(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var sv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Cr=sv.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?tc:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),ms="Tabs",[iv,Zx]=Nt(ms,[ql]),nc=ql(),[av,vs]=iv(ms),rc=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:a,activationMode:u="automatic",...c}=e,f=Wl(a),[g,m]=Qt({prop:r,onChange:o,defaultProp:s});return l.jsx(av,{scope:n,baseId:tn(),value:g,onValueChange:m,orientation:i,dir:f,activationMode:u,children:l.jsx(Cr.div,{dir:f,"data-orientation":i,...c,ref:t})})});rc.displayName=ms;var oc="TabsList",sc=d.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,s=vs(oc,n),i=nc(n);return l.jsx(qm,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:r,children:l.jsx(Cr.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});sc.displayName=oc;var ic="TabsTrigger",ac=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...s}=e,i=vs(ic,n),a=nc(n),u=uc(i.baseId,r),c=dc(i.baseId,r),f=r===i.value;return l.jsx(Km,{asChild:!0,...a,focusable:!o,active:f,children:l.jsx(Cr.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":c,"data-state":f?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:u,...s,ref:t,onMouseDown:as(e.onMouseDown,g=>{!o&&g.button===0&&g.ctrlKey===!1?i.onValueChange(r):g.preventDefault()}),onKeyDown:as(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&i.onValueChange(r)}),onFocus:as(e.onFocus,()=>{const g=i.activationMode!=="manual";!f&&!o&&g&&i.onValueChange(r)})})})});ac.displayName=ic;var lc="TabsContent",cc=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:s,...i}=e,a=vs(lc,n),u=uc(a.baseId,r),c=dc(a.baseId,r),f=r===a.value,g=d.useRef(f);return d.useEffect(()=>{const m=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(m)},[]),l.jsx(Ql,{present:o||f,children:({present:m})=>l.jsx(Cr.div,{"data-state":f?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":u,hidden:!m,id:c,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:g.current?"0s":void 0},children:m&&s})})});cc.displayName=lc;function uc(e,t){return`${e}-trigger-${t}`}function dc(e,t){return`${e}-content-${t}`}var lv=rc,fc=sc,pc=ac,gc=cc;const cv=lv,hc=d.forwardRef(({className:e,...t},n)=>l.jsx(fc,{ref:n,className:Z("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));hc.displayName=fc.displayName;const ys=d.forwardRef(({className:e,...t},n)=>l.jsx(pc,{ref:n,className:Z("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));ys.displayName=pc.displayName;const ws=d.forwardRef(({className:e,...t},n)=>l.jsx(gc,{ref:n,className:Z("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));ws.displayName=gc.displayName;const Sr=d.forwardRef(({className:e,...t},n)=>l.jsx("textarea",{className:Z("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...t}));Sr.displayName="Textarea";function uv(e,t=[]){let n=[];function r(s,i){const a=d.createContext(i),u=n.length;n=[...n,i];function c(g){const{scope:m,children:p,...v}=g,h=(m==null?void 0:m[e][u])||a,y=d.useMemo(()=>v,Object.values(v));return l.jsx(h.Provider,{value:y,children:p})}function f(g,m){const p=(m==null?void 0:m[e][u])||a,v=d.useContext(p);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${g}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,f]}const o=()=>{const s=n.map(i=>d.createContext(i));return function(a){const u=(a==null?void 0:a[e])||s;return d.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return o.scopeName=e,[r,dv(o,...t)]}function dv(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:u,scopeName:c})=>{const g=u(s)[`__scope${c}`];return{...a,...g}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var bs=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(pv);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(xs,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(xs,{...r,ref:t,children:n})});bs.displayName="Slot";var xs=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=hv(n);return d.cloneElement(n,{...gv(r,n.props),ref:t?sr(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});xs.displayName="SlotClone";var fv=({children:e})=>l.jsx(l.Fragment,{children:e});function pv(e){return d.isValidElement(e)&&e.type===fv}function gv(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function hv(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function mv(e){const t=e+"CollectionProvider",[n,r]=uv(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:v,children:h}=p,y=D.useRef(null),w=D.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:w,collectionRef:y,children:h})};i.displayName=t;const a=e+"CollectionSlot",u=D.forwardRef((p,v)=>{const{scope:h,children:y}=p,w=s(a,h),b=ze(v,w.collectionRef);return l.jsx(bs,{ref:b,children:y})});u.displayName=a;const c=e+"CollectionItemSlot",f="data-radix-collection-item",g=D.forwardRef((p,v)=>{const{scope:h,children:y,...w}=p,b=D.useRef(null),S=ze(v,b),E=s(c,h);return D.useEffect(()=>(E.itemMap.set(b,{ref:b,...w}),()=>void E.itemMap.delete(b))),l.jsx(bs,{[f]:"",ref:S,children:y})});g.displayName=c;function m(p){const v=s(e+"CollectionConsumer",p);return D.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((E,x)=>w.indexOf(E.ref.current)-w.indexOf(x.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:u,ItemSlot:g},m,r]}var vv="VisuallyHidden",Cs=d.forwardRef((e,t)=>l.jsx(ve.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Cs.displayName=vv;var Ss="ToastProvider",[Es,yv,wv]=mv("Toast"),[mc,Qx]=Nt("Toast",[wv]),[bv,Er]=mc(Ss),vc=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:s=50,children:i}=e,[a,u]=d.useState(null),[c,f]=d.useState(0),g=d.useRef(!1),m=d.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Ss}\`. Expected non-empty \`string\`.`),l.jsx(Es.Provider,{scope:t,children:l.jsx(bv,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:s,toastCount:c,viewport:a,onViewportChange:u,onToastAdd:d.useCallback(()=>f(p=>p+1),[]),onToastRemove:d.useCallback(()=>f(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:g,isClosePausedRef:m,children:i})})};vc.displayName=Ss;var yc="ToastViewport",xv=["F8"],Ns="toast.viewportPause",Ts="toast.viewportResume",wc=d.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=xv,label:o="Notifications ({hotkey})",...s}=e,i=Er(yc,n),a=yv(n),u=d.useRef(null),c=d.useRef(null),f=d.useRef(null),g=d.useRef(null),m=ze(t,g,i.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),v=i.toastCount>0;d.useEffect(()=>{const y=w=>{var S;r.length!==0&&r.every(E=>w[E]||w.code===E)&&((S=g.current)==null||S.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),d.useEffect(()=>{const y=u.current,w=g.current;if(v&&y&&w){const b=()=>{if(!i.isClosePausedRef.current){const P=new CustomEvent(Ns);w.dispatchEvent(P),i.isClosePausedRef.current=!0}},S=()=>{if(i.isClosePausedRef.current){const P=new CustomEvent(Ts);w.dispatchEvent(P),i.isClosePausedRef.current=!1}},E=P=>{!y.contains(P.relatedTarget)&&S()},x=()=>{y.contains(document.activeElement)||S()};return y.addEventListener("focusin",b),y.addEventListener("focusout",E),y.addEventListener("pointermove",b),y.addEventListener("pointerleave",x),window.addEventListener("blur",b),window.addEventListener("focus",S),()=>{y.removeEventListener("focusin",b),y.removeEventListener("focusout",E),y.removeEventListener("pointermove",b),y.removeEventListener("pointerleave",x),window.removeEventListener("blur",b),window.removeEventListener("focus",S)}}},[v,i.isClosePausedRef]);const h=d.useCallback(({tabbingDirection:y})=>{const b=a().map(S=>{const E=S.ref.current,x=[E,...kv(E)];return y==="forwards"?x:x.reverse()});return(y==="forwards"?b.reverse():b).flat()},[a]);return d.useEffect(()=>{const y=g.current;if(y){const w=b=>{var x,P,_;const S=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!S){const O=document.activeElement,k=b.shiftKey;if(b.target===y&&k){(x=c.current)==null||x.focus();return}const $=h({tabbingDirection:k?"backwards":"forwards"}),L=$.findIndex(M=>M===O);_s($.slice(L+1))?b.preventDefault():k?(P=c.current)==null||P.focus():(_=f.current)==null||_.focus()}};return y.addEventListener("keydown",w),()=>y.removeEventListener("keydown",w)}},[a,h]),l.jsxs(uh,{ref:u,role:"region","aria-label":o.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&l.jsx(Ps,{ref:c,onFocusFromOutsideViewport:()=>{const y=h({tabbingDirection:"forwards"});_s(y)}}),l.jsx(Es.Slot,{scope:n,children:l.jsx(ve.ol,{tabIndex:-1,...s,ref:m})}),v&&l.jsx(Ps,{ref:f,onFocusFromOutsideViewport:()=>{const y=h({tabbingDirection:"backwards"});_s(y)}})]})});wc.displayName=yc;var bc="ToastFocusProxy",Ps=d.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,s=Er(bc,n);return l.jsx(Cs,{"aria-hidden":!0,tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:i=>{var c;const a=i.relatedTarget;!((c=s.viewport)!=null&&c.contains(a))&&r()}})});Ps.displayName=bc;var Nr="Toast",Cv="toast.swipeStart",Sv="toast.swipeMove",Ev="toast.swipeCancel",Nv="toast.swipeEnd",xc=d.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:s,...i}=e,[a=!0,u]=Qt({prop:r,defaultProp:o,onChange:s});return l.jsx(en,{present:n||a,children:l.jsx(Av,{open:a,...i,ref:t,onClose:()=>u(!1),onPause:Pe(e.onPause),onResume:Pe(e.onResume),onSwipeStart:he(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:he(e.onSwipeMove,c=>{const{x:f,y:g}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${g}px`)}),onSwipeCancel:he(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:he(e.onSwipeEnd,c=>{const{x:f,y:g}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${g}px`),u(!1)})})})});xc.displayName=Nr;var[Tv,Pv]=mc(Nr,{onClose(){}}),Av=d.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:s,onClose:i,onEscapeKeyDown:a,onPause:u,onResume:c,onSwipeStart:f,onSwipeMove:g,onSwipeCancel:m,onSwipeEnd:p,...v}=e,h=Er(Nr,n),[y,w]=d.useState(null),b=ze(t,M=>w(M)),S=d.useRef(null),E=d.useRef(null),x=o||h.duration,P=d.useRef(0),_=d.useRef(x),O=d.useRef(0),{onToastAdd:k,onToastRemove:F}=h,G=Pe(()=>{var q;(y==null?void 0:y.contains(document.activeElement))&&((q=h.viewport)==null||q.focus()),i()}),$=d.useCallback(M=>{!M||M===1/0||(window.clearTimeout(O.current),P.current=new Date().getTime(),O.current=window.setTimeout(G,M))},[G]);d.useEffect(()=>{const M=h.viewport;if(M){const q=()=>{$(_.current),c==null||c()},W=()=>{const X=new Date().getTime()-P.current;_.current=_.current-X,window.clearTimeout(O.current),u==null||u()};return M.addEventListener(Ns,W),M.addEventListener(Ts,q),()=>{M.removeEventListener(Ns,W),M.removeEventListener(Ts,q)}}},[h.viewport,x,u,c,$]),d.useEffect(()=>{s&&!h.isClosePausedRef.current&&$(x)},[s,x,h.isClosePausedRef,$]),d.useEffect(()=>(k(),()=>F()),[k,F]);const L=d.useMemo(()=>y?Ac(y):null,[y]);return h.viewport?l.jsxs(l.Fragment,{children:[L&&l.jsx(_v,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:L}),l.jsx(Tv,{scope:n,onClose:G,children:Hn.createPortal(l.jsx(Es.ItemSlot,{scope:n,children:l.jsx(ch,{asChild:!0,onEscapeKeyDown:he(a,()=>{h.isFocusedToastEscapeKeyDownRef.current||G(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:l.jsx(ve.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":h.swipeDirection,...v,ref:b,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:he(e.onKeyDown,M=>{M.key==="Escape"&&(a==null||a(M.nativeEvent),M.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,G()))}),onPointerDown:he(e.onPointerDown,M=>{M.button===0&&(S.current={x:M.clientX,y:M.clientY})}),onPointerMove:he(e.onPointerMove,M=>{if(!S.current)return;const q=M.clientX-S.current.x,W=M.clientY-S.current.y,X=!!E.current,K=["left","right"].includes(h.swipeDirection),ne=["left","up"].includes(h.swipeDirection)?Math.min:Math.max,ae=K?ne(0,q):0,de=K?0:ne(0,W),De=M.pointerType==="touch"?10:2,Se={x:ae,y:de},Ue={originalEvent:M,delta:Se};X?(E.current=Se,Tr(Sv,g,Ue,{discrete:!1})):_c(Se,h.swipeDirection,De)?(E.current=Se,Tr(Cv,f,Ue,{discrete:!1}),M.target.setPointerCapture(M.pointerId)):(Math.abs(q)>De||Math.abs(W)>De)&&(S.current=null)}),onPointerUp:he(e.onPointerUp,M=>{const q=E.current,W=M.target;if(W.hasPointerCapture(M.pointerId)&&W.releasePointerCapture(M.pointerId),E.current=null,S.current=null,q){const X=M.currentTarget,K={originalEvent:M,delta:q};_c(q,h.swipeDirection,h.swipeThreshold)?Tr(Nv,p,K,{discrete:!0}):Tr(Ev,m,K,{discrete:!0}),X.addEventListener("click",ne=>ne.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),_v=e=>{const{__scopeToast:t,children:n,...r}=e,o=Er(Nr,t),[s,i]=d.useState(!1),[a,u]=d.useState(!1);return Dv(()=>i(!0)),d.useEffect(()=>{const c=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:l.jsx(Xo,{asChild:!0,children:l.jsx(Cs,{...r,children:s&&l.jsxs(l.Fragment,{children:[o.label," ",n]})})})},Fv="ToastTitle",Cc=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(ve.div,{...r,ref:t})});Cc.displayName=Fv;var Ov="ToastDescription",Sc=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(ve.div,{...r,ref:t})});Sc.displayName=Ov;var Ec="ToastAction",Nc=d.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?l.jsx(Pc,{altText:n,asChild:!0,children:l.jsx(As,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Ec}\`. Expected non-empty \`string\`.`),null)});Nc.displayName=Ec;var Tc="ToastClose",As=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=Pv(Tc,n);return l.jsx(Pc,{asChild:!0,children:l.jsx(ve.button,{type:"button",...r,ref:t,onClick:he(e.onClick,o.onClose)})})});As.displayName=Tc;var Pc=d.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return l.jsx(ve.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function Ac(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),Mv(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!o)if(s){const i=r.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...Ac(r))}}),t}function Tr(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?La(o,s):o.dispatchEvent(s)}var _c=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),s=r>o;return t==="left"||t==="right"?s&&r>n:!s&&o>n};function Dv(e=()=>{}){const t=Pe(e);Le(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function Mv(e){return e.nodeType===e.ELEMENT_NODE}function kv(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function _s(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var $v=vc,Fc=wc,Oc=xc,Dc=Cc,Mc=Sc,kc=Nc,$c=As;const Iv=$v,Ic=d.forwardRef(({className:e,...t},n)=>l.jsx(Fc,{ref:n,className:Z("s3-explr-ui-toast-viewport fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));Ic.displayName=Fc.displayName;const Lv=zo("s3-explr-ui-toast group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"s3-explr-ui-toast-default border bg-background text-foreground",destructive:"s3-explr-ui-toast-destructive destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Lc=d.forwardRef(({className:e,variant:t,...n},r)=>l.jsx(Oc,{ref:r,className:Z(Lv({variant:t}),e),...n}));Lc.displayName=Oc.displayName;const Rv=d.forwardRef(({className:e,...t},n)=>l.jsx(kc,{ref:n,className:Z("s3-explr-ui-toast-action inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));Rv.displayName=kc.displayName;const Rc=d.forwardRef(({className:e,...t},n)=>l.jsx($c,{ref:n,className:Z("s3-explr-ui-toast-close absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:l.jsx(ko,{className:"s3-explr-ui-toast-close-icon h-4 w-4"})}));Rc.displayName=$c.displayName;const Vc=d.forwardRef(({className:e,...t},n)=>l.jsx(Dc,{ref:n,className:Z("s3-explr-ui-toast-title text-sm font-semibold [&+div]:text-xs",e),...t}));Vc.displayName=Dc.displayName;const Bc=d.forwardRef(({className:e,...t},n)=>l.jsx(Mc,{ref:n,className:Z("s3-explr-ui-toast-description text-sm opacity-90",e),...t}));Bc.displayName=Mc.displayName;const Vv=1,Bv=1e6;let Fs=0;function zv(){return Fs=(Fs+1)%Number.MAX_SAFE_INTEGER,Fs.toString()}const Os=new Map,zc=e=>{if(Os.has(e))return;const t=setTimeout(()=>{Os.delete(e),Tn({type:"REMOVE_TOAST",toastId:e})},Bv);Os.set(e,t)},Hv=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Vv)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?zc(n):e.toasts.forEach(r=>{zc(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Pr=[];let Ar={toasts:[]};function Tn(e){Ar=Hv(Ar,e),Pr.forEach(t=>{t(Ar)})}function Uv({...e}){const t=zv(),n=o=>Tn({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>Tn({type:"DISMISS_TOAST",toastId:t});return Tn({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function Ds(){const[e,t]=d.useState(Ar);return d.useEffect(()=>(Pr.push(t),()=>{const n=Pr.indexOf(t);n>-1&&Pr.splice(n,1)}),[e]),{...e,toast:Uv,dismiss:n=>Tn({type:"DISMISS_TOAST",toastId:n})}}function Hc(){const{toasts:e}=Ds();return l.jsxs(Iv,{children:[e.map(function({id:t,title:n,description:r,action:o,...s}){return l.jsxs(Lc,{...s,className:`s3-explr-ui-toast ${s.className||""}`,children:[l.jsxs("div",{className:"s3-explr-ui-toast-content grid gap-1",children:[n&&l.jsx(Vc,{className:"s3-explr-ui-toast-title",children:n}),r&&l.jsx(Bc,{className:"s3-explr-ui-toast-description",children:r})]}),o&&l.jsx("div",{className:"s3-explr-ui-toast-action",children:o}),l.jsx(Rc,{className:"s3-explr-ui-toast-close"})]},t)}),l.jsx(Ic,{className:"s3-explr-ui-toast-viewport"})]})}function pt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Uc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function jv(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Uc(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Uc(e[o],null)}}}}function Pn(...e){return d.useCallback(jv(...e),e)}var Wv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],An=Wv.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Yt:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Gv(e,t){e&&Hn.flushSync(()=>e.dispatchEvent(t))}var qv="DismissableLayer",Ms="dismissableLayer.update",Kv="dismissableLayer.pointerDownOutside",Xv="dismissableLayer.focusOutside",jc,Wc=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Gc=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...u}=e,c=d.useContext(Wc),[f,g]=d.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=d.useState({}),v=Pn(t,_=>g(_)),h=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=h.indexOf(y),b=f?h.indexOf(f):-1,S=c.layersWithOutsidePointerEventsDisabled.size>0,E=b>=w,x=Zv(_=>{const O=_.target,k=[...c.branches].some(F=>F.contains(O));!E||k||(o==null||o(_),i==null||i(_),_.defaultPrevented||a==null||a())},m),P=Qv(_=>{const O=_.target;[...c.branches].some(F=>F.contains(O))||(s==null||s(_),i==null||i(_),_.defaultPrevented||a==null||a())},m);return Ua(_=>{b===c.layers.size-1&&(r==null||r(_),!_.defaultPrevented&&a&&(_.preventDefault(),a()))},m),d.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(jc=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),qc(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=jc)}},[f,m,n,c]),d.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),qc())},[f,c]),d.useEffect(()=>{const _=()=>p({});return document.addEventListener(Ms,_),()=>document.removeEventListener(Ms,_)},[]),l.jsx(An.div,{...u,ref:v,style:{pointerEvents:S?E?"auto":"none":void 0,...e.style},onFocusCapture:pt(e.onFocusCapture,P.onFocusCapture),onBlurCapture:pt(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:pt(e.onPointerDownCapture,x.onPointerDownCapture)})});Gc.displayName=qv;var Yv="DismissableLayerBranch",Jv=d.forwardRef((e,t)=>{const n=d.useContext(Wc),r=d.useRef(null),o=Pn(t,r);return d.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(An.div,{...e,ref:o})});Jv.displayName=Yv;function Zv(e,t=globalThis==null?void 0:globalThis.document){const n=Pe(e),r=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let u=function(){Kc(Kv,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Qv(e,t=globalThis==null?void 0:globalThis.document){const n=Pe(e),r=d.useRef(!1);return d.useEffect(()=>{const o=s=>{s.target&&!r.current&&Kc(Xv,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function qc(){const e=new CustomEvent(Ms);document.dispatchEvent(e)}function Kc(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Gv(o,s):o.dispatchEvent(s)}const ey=["top","right","bottom","left"],Dt=Math.min,Re=Math.max,_r=Math.round,Fr=Math.floor,rt=e=>({x:e,y:e}),ty={left:"right",right:"left",bottom:"top",top:"bottom"},ny={start:"end",end:"start"};function ks(e,t,n){return Re(e,Dt(t,n))}function gt(e,t){return typeof e=="function"?e(t):e}function ht(e){return e.split("-")[0]}function ln(e){return e.split("-")[1]}function $s(e){return e==="x"?"y":"x"}function Is(e){return e==="y"?"height":"width"}function Mt(e){return["top","bottom"].includes(ht(e))?"y":"x"}function Ls(e){return $s(Mt(e))}function ry(e,t,n){n===void 0&&(n=!1);const r=ln(e),o=Ls(e),s=Is(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Or(i)),[i,Or(i)]}function oy(e){const t=Or(e);return[Rs(e),t,Rs(t)]}function Rs(e){return e.replace(/start|end/g,t=>ny[t])}function sy(e,t,n){const r=["left","right"],o=["right","left"],s=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?s:i;default:return[]}}function iy(e,t,n,r){const o=ln(e);let s=sy(ht(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Rs)))),s}function Or(e){return e.replace(/left|right|bottom|top/g,t=>ty[t])}function ay(e){return{top:0,right:0,bottom:0,left:0,...e}}function Xc(e){return typeof e!="number"?ay(e):{top:e,right:e,bottom:e,left:e}}function Dr(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Yc(e,t,n){let{reference:r,floating:o}=e;const s=Mt(t),i=Ls(t),a=Is(i),u=ht(t),c=s==="y",f=r.x+r.width/2-o.width/2,g=r.y+r.height/2-o.height/2,m=r[a]/2-o[a]/2;let p;switch(u){case"top":p={x:f,y:r.y-o.height};break;case"bottom":p={x:f,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:g};break;case"left":p={x:r.x-o.width,y:g};break;default:p={x:r.x,y:r.y}}switch(ln(t)){case"start":p[i]-=m*(n&&c?-1:1);break;case"end":p[i]+=m*(n&&c?-1:1);break}return p}const ly=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),u=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:g}=Yc(c,r,u),m=r,p={},v=0;for(let h=0;h<a.length;h++){const{name:y,fn:w}=a[h],{x:b,y:S,data:E,reset:x}=await w({x:f,y:g,initialPlacement:r,placement:m,strategy:o,middlewareData:p,rects:c,platform:i,elements:{reference:e,floating:t}});f=b??f,g=S??g,p={...p,[y]:{...p[y],...E}},x&&v<=50&&(v++,typeof x=="object"&&(x.placement&&(m=x.placement),x.rects&&(c=x.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):x.rects),{x:f,y:g}=Yc(c,m,u)),h=-1)}return{x:f,y:g,placement:m,strategy:o,middlewareData:p}};async function _n(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:g="floating",altBoundary:m=!1,padding:p=0}=gt(t,e),v=Xc(p),y=a[m?g==="floating"?"reference":"floating":g],w=Dr(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:f,strategy:u})),b=g==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),E=await(s.isElement==null?void 0:s.isElement(S))?await(s.getScale==null?void 0:s.getScale(S))||{x:1,y:1}:{x:1,y:1},x=Dr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:S,strategy:u}):b);return{top:(w.top-x.top+v.top)/E.y,bottom:(x.bottom-w.bottom+v.bottom)/E.y,left:(w.left-x.left+v.left)/E.x,right:(x.right-w.right+v.right)/E.x}}const cy=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:u}=t,{element:c,padding:f=0}=gt(e,t)||{};if(c==null)return{};const g=Xc(f),m={x:n,y:r},p=Ls(o),v=Is(p),h=await i.getDimensions(c),y=p==="y",w=y?"top":"left",b=y?"bottom":"right",S=y?"clientHeight":"clientWidth",E=s.reference[v]+s.reference[p]-m[p]-s.floating[v],x=m[p]-s.reference[p],P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let _=P?P[S]:0;(!_||!await(i.isElement==null?void 0:i.isElement(P)))&&(_=a.floating[S]||s.floating[v]);const O=E/2-x/2,k=_/2-h[v]/2-1,F=Dt(g[w],k),G=Dt(g[b],k),$=F,L=_-h[v]-G,M=_/2-h[v]/2+O,q=ks($,M,L),W=!u.arrow&&ln(o)!=null&&M!==q&&s.reference[v]/2-(M<$?F:G)-h[v]/2<0,X=W?M<$?M-$:M-L:0;return{[p]:m[p]+X,data:{[p]:q,centerOffset:M-q-X,...W&&{alignmentOffset:X}},reset:W}}}),uy=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:u,elements:c}=t,{mainAxis:f=!0,crossAxis:g=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:h=!0,...y}=gt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=ht(o),b=Mt(a),S=ht(a)===a,E=await(u.isRTL==null?void 0:u.isRTL(c.floating)),x=m||(S||!h?[Or(a)]:oy(a)),P=v!=="none";!m&&P&&x.push(...iy(a,h,v,E));const _=[a,...x],O=await _n(t,y),k=[];let F=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&k.push(O[w]),g){const M=ry(o,i,E);k.push(O[M[0]],O[M[1]])}if(F=[...F,{placement:o,overflows:k}],!k.every(M=>M<=0)){var G,$;const M=(((G=s.flip)==null?void 0:G.index)||0)+1,q=_[M];if(q)return{data:{index:M,overflows:F},reset:{placement:q}};let W=($=F.filter(X=>X.overflows[0]<=0).sort((X,K)=>X.overflows[1]-K.overflows[1])[0])==null?void 0:$.placement;if(!W)switch(p){case"bestFit":{var L;const X=(L=F.filter(K=>{if(P){const ne=Mt(K.placement);return ne===b||ne==="y"}return!0}).map(K=>[K.placement,K.overflows.filter(ne=>ne>0).reduce((ne,ae)=>ne+ae,0)]).sort((K,ne)=>K[1]-ne[1])[0])==null?void 0:L[0];X&&(W=X);break}case"initialPlacement":W=a;break}if(o!==W)return{reset:{placement:W}}}return{}}}};function Jc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Zc(e){return ey.some(t=>e[t]>=0)}const dy=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=gt(e,t);switch(r){case"referenceHidden":{const s=await _n(t,{...o,elementContext:"reference"}),i=Jc(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Zc(i)}}}case"escaped":{const s=await _n(t,{...o,altBoundary:!0}),i=Jc(s,n.floating);return{data:{escapedOffsets:i,escaped:Zc(i)}}}default:return{}}}}};async function fy(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=ht(n),a=ln(n),u=Mt(n)==="y",c=["left","top"].includes(i)?-1:1,f=s&&u?-1:1,g=gt(t,e);let{mainAxis:m,crossAxis:p,alignmentAxis:v}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return a&&typeof v=="number"&&(p=a==="end"?v*-1:v),u?{x:p*f,y:m*c}:{x:m*c,y:p*f}}const py=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,u=await fy(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:s+u.y,data:{...u,placement:i}}}}},gy=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:y=>{let{x:w,y:b}=y;return{x:w,y:b}}},...u}=gt(e,t),c={x:n,y:r},f=await _n(t,u),g=Mt(ht(o)),m=$s(g);let p=c[m],v=c[g];if(s){const y=m==="y"?"top":"left",w=m==="y"?"bottom":"right",b=p+f[y],S=p-f[w];p=ks(b,p,S)}if(i){const y=g==="y"?"top":"left",w=g==="y"?"bottom":"right",b=v+f[y],S=v-f[w];v=ks(b,v,S)}const h=a.fn({...t,[m]:p,[g]:v});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[m]:s,[g]:i}}}}}},hy=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:u=!0,crossAxis:c=!0}=gt(e,t),f={x:n,y:r},g=Mt(o),m=$s(g);let p=f[m],v=f[g];const h=gt(a,t),y=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(u){const S=m==="y"?"height":"width",E=s.reference[m]-s.floating[S]+y.mainAxis,x=s.reference[m]+s.reference[S]-y.mainAxis;p<E?p=E:p>x&&(p=x)}if(c){var w,b;const S=m==="y"?"width":"height",E=["top","left"].includes(ht(o)),x=s.reference[g]-s.floating[S]+(E&&((w=i.offset)==null?void 0:w[g])||0)+(E?0:y.crossAxis),P=s.reference[g]+s.reference[S]+(E?0:((b=i.offset)==null?void 0:b[g])||0)-(E?y.crossAxis:0);v<x?v=x:v>P&&(v=P)}return{[m]:p,[g]:v}}}},my=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:u=()=>{},...c}=gt(e,t),f=await _n(t,c),g=ht(o),m=ln(o),p=Mt(o)==="y",{width:v,height:h}=s.floating;let y,w;g==="top"||g==="bottom"?(y=g,w=m===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(w=g,y=m==="end"?"top":"bottom");const b=h-f.top-f.bottom,S=v-f.left-f.right,E=Dt(h-f[y],b),x=Dt(v-f[w],S),P=!t.middlewareData.shift;let _=E,O=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(_=b),P&&!m){const F=Re(f.left,0),G=Re(f.right,0),$=Re(f.top,0),L=Re(f.bottom,0);p?O=v-2*(F!==0||G!==0?F+G:Re(f.left,f.right)):_=h-2*($!==0||L!==0?$+L:Re(f.top,f.bottom))}await u({...t,availableWidth:O,availableHeight:_});const k=await i.getDimensions(a.floating);return v!==k.width||h!==k.height?{reset:{rects:!0}}:{}}}};function Mr(){return typeof window<"u"}function cn(e){return Qc(e)?(e.nodeName||"").toLowerCase():"#document"}function Ve(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ot(e){var t;return(t=(Qc(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Qc(e){return Mr()?e instanceof Node||e instanceof Ve(e).Node:!1}function Ye(e){return Mr()?e instanceof Element||e instanceof Ve(e).Element:!1}function st(e){return Mr()?e instanceof HTMLElement||e instanceof Ve(e).HTMLElement:!1}function eu(e){return!Mr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ve(e).ShadowRoot}function Fn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Je(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function vy(e){return["table","td","th"].includes(cn(e))}function kr(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Vs(e){const t=Bs(),n=Ye(e)?Je(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function yy(e){let t=kt(e);for(;st(t)&&!un(t);){if(Vs(t))return t;if(kr(t))return null;t=kt(t)}return null}function Bs(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function un(e){return["html","body","#document"].includes(cn(e))}function Je(e){return Ve(e).getComputedStyle(e)}function $r(e){return Ye(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function kt(e){if(cn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||eu(e)&&e.host||ot(e);return eu(t)?t.host:t}function tu(e){const t=kt(e);return un(t)?e.ownerDocument?e.ownerDocument.body:e.body:st(t)&&Fn(t)?t:tu(t)}function On(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=tu(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Ve(o);if(s){const a=zs(i);return t.concat(i,i.visualViewport||[],Fn(o)?o:[],a&&n?On(a):[])}return t.concat(o,On(o,[],n))}function zs(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function nu(e){const t=Je(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=st(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=_r(n)!==s||_r(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Hs(e){return Ye(e)?e:e.contextElement}function dn(e){const t=Hs(e);if(!st(t))return rt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=nu(t);let i=(s?_r(n.width):n.width)/r,a=(s?_r(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const wy=rt(0);function ru(e){const t=Ve(e);return!Bs()||!t.visualViewport?wy:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function by(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ve(e)?!1:t}function Wt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Hs(e);let i=rt(1);t&&(r?Ye(r)&&(i=dn(r)):i=dn(e));const a=by(s,n,r)?ru(s):rt(0);let u=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,f=o.width/i.x,g=o.height/i.y;if(s){const m=Ve(s),p=r&&Ye(r)?Ve(r):r;let v=m,h=zs(v);for(;h&&r&&p!==v;){const y=dn(h),w=h.getBoundingClientRect(),b=Je(h),S=w.left+(h.clientLeft+parseFloat(b.paddingLeft))*y.x,E=w.top+(h.clientTop+parseFloat(b.paddingTop))*y.y;u*=y.x,c*=y.y,f*=y.x,g*=y.y,u+=S,c+=E,v=Ve(h),h=zs(v)}}return Dr({width:f,height:g,x:u,y:c})}function Us(e,t){const n=$r(e).scrollLeft;return t?t.left+n:Wt(ot(e)).left+n}function ou(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Us(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function xy(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=ot(r),a=t?kr(t.floating):!1;if(r===i||a&&s)return n;let u={scrollLeft:0,scrollTop:0},c=rt(1);const f=rt(0),g=st(r);if((g||!g&&!s)&&((cn(r)!=="body"||Fn(i))&&(u=$r(r)),st(r))){const p=Wt(r);c=dn(r),f.x=p.x+r.clientLeft,f.y=p.y+r.clientTop}const m=i&&!g&&!s?ou(i,u,!0):rt(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+f.x+m.x,y:n.y*c.y-u.scrollTop*c.y+f.y+m.y}}function Cy(e){return Array.from(e.getClientRects())}function Sy(e){const t=ot(e),n=$r(e),r=e.ownerDocument.body,o=Re(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Re(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Us(e);const a=-n.scrollTop;return Je(r).direction==="rtl"&&(i+=Re(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function Ey(e,t){const n=Ve(e),r=ot(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,u=0;if(o){s=o.width,i=o.height;const c=Bs();(!c||c&&t==="fixed")&&(a=o.offsetLeft,u=o.offsetTop)}return{width:s,height:i,x:a,y:u}}function Ny(e,t){const n=Wt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=st(e)?dn(e):rt(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,u=o*s.x,c=r*s.y;return{width:i,height:a,x:u,y:c}}function su(e,t,n){let r;if(t==="viewport")r=Ey(e,n);else if(t==="document")r=Sy(ot(e));else if(Ye(t))r=Ny(t,n);else{const o=ru(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Dr(r)}function iu(e,t){const n=kt(e);return n===t||!Ye(n)||un(n)?!1:Je(n).position==="fixed"||iu(n,t)}function Ty(e,t){const n=t.get(e);if(n)return n;let r=On(e,[],!1).filter(a=>Ye(a)&&cn(a)!=="body"),o=null;const s=Je(e).position==="fixed";let i=s?kt(e):e;for(;Ye(i)&&!un(i);){const a=Je(i),u=Vs(i);!u&&a.position==="fixed"&&(o=null),(s?!u&&!o:!u&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Fn(i)&&!u&&iu(e,i))?r=r.filter(f=>f!==i):o=a,i=kt(i)}return t.set(e,r),r}function Py(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?kr(t)?[]:Ty(t,this._c):[].concat(n),r],a=i[0],u=i.reduce((c,f)=>{const g=su(t,f,o);return c.top=Re(g.top,c.top),c.right=Dt(g.right,c.right),c.bottom=Dt(g.bottom,c.bottom),c.left=Re(g.left,c.left),c},su(t,a,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Ay(e){const{width:t,height:n}=nu(e);return{width:t,height:n}}function _y(e,t,n){const r=st(t),o=ot(t),s=n==="fixed",i=Wt(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const u=rt(0);if(r||!r&&!s)if((cn(t)!=="body"||Fn(o))&&(a=$r(t)),r){const m=Wt(t,!0,s,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}else o&&(u.x=Us(o));const c=o&&!r&&!s?ou(o,a):rt(0),f=i.left+a.scrollLeft-u.x-c.x,g=i.top+a.scrollTop-u.y-c.y;return{x:f,y:g,width:i.width,height:i.height}}function js(e){return Je(e).position==="static"}function au(e,t){if(!st(e)||Je(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ot(e)===n&&(n=n.ownerDocument.body),n}function lu(e,t){const n=Ve(e);if(kr(e))return n;if(!st(e)){let o=kt(e);for(;o&&!un(o);){if(Ye(o)&&!js(o))return o;o=kt(o)}return n}let r=au(e,t);for(;r&&vy(r)&&js(r);)r=au(r,t);return r&&un(r)&&js(r)&&!Vs(r)?n:r||yy(e)||n}const Fy=async function(e){const t=this.getOffsetParent||lu,n=this.getDimensions,r=await n(e.floating);return{reference:_y(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Oy(e){return Je(e).direction==="rtl"}const Dy={convertOffsetParentRelativeRectToViewportRelativeRect:xy,getDocumentElement:ot,getClippingRect:Py,getOffsetParent:lu,getElementRects:Fy,getClientRects:Cy,getDimensions:Ay,getScale:dn,isElement:Ye,isRTL:Oy};function My(e,t){let n=null,r;const o=ot(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,u){a===void 0&&(a=!1),u===void 0&&(u=1),s();const{left:c,top:f,width:g,height:m}=e.getBoundingClientRect();if(a||t(),!g||!m)return;const p=Fr(f),v=Fr(o.clientWidth-(c+g)),h=Fr(o.clientHeight-(f+m)),y=Fr(c),b={rootMargin:-p+"px "+-v+"px "+-h+"px "+-y+"px",threshold:Re(0,Dt(1,u))||1};let S=!0;function E(x){const P=x[0].intersectionRatio;if(P!==u){if(!S)return i();P?i(!1,P):r=setTimeout(()=>{i(!1,1e-7)},1e3)}S=!1}try{n=new IntersectionObserver(E,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(E,b)}n.observe(e)}return i(!0),s}function ky(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,c=Hs(e),f=o||s?[...c?On(c):[],...On(t)]:[];f.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const g=c&&a?My(c,n):null;let m=-1,p=null;i&&(p=new ResizeObserver(w=>{let[b]=w;b&&b.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var S;(S=p)==null||S.observe(t)})),n()}),c&&!u&&p.observe(c),p.observe(t));let v,h=u?Wt(e):null;u&&y();function y(){const w=Wt(e);h&&(w.x!==h.x||w.y!==h.y||w.width!==h.width||w.height!==h.height)&&n(),h=w,v=requestAnimationFrame(y)}return n(),()=>{var w;f.forEach(b=>{o&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),g==null||g(),(w=p)==null||w.disconnect(),p=null,u&&cancelAnimationFrame(v)}}const $y=py,Iy=gy,Ly=uy,Ry=my,Vy=dy,cu=cy,By=hy,zy=(e,t,n)=>{const r=new Map,o={platform:Dy,...n},s={...o.platform,_c:r};return ly(e,t,{...o,platform:s})};var Ir=typeof document<"u"?D.useLayoutEffect:D.useEffect;function Lr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Lr(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Lr(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function uu(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function du(e,t){const n=uu(e);return Math.round(t*n)/n}function Ws(e){const t=d.useRef(e);return Ir(()=>{t.current=e}),t}function Hy(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:u,open:c}=e,[f,g]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=d.useState(r);Lr(m,r)||p(r);const[v,h]=d.useState(null),[y,w]=d.useState(null),b=d.useCallback(K=>{K!==P.current&&(P.current=K,h(K))},[]),S=d.useCallback(K=>{K!==_.current&&(_.current=K,w(K))},[]),E=s||v,x=i||y,P=d.useRef(null),_=d.useRef(null),O=d.useRef(f),k=u!=null,F=Ws(u),G=Ws(o),$=Ws(c),L=d.useCallback(()=>{if(!P.current||!_.current)return;const K={placement:t,strategy:n,middleware:m};G.current&&(K.platform=G.current),zy(P.current,_.current,K).then(ne=>{const ae={...ne,isPositioned:$.current!==!1};M.current&&!Lr(O.current,ae)&&(O.current=ae,Hn.flushSync(()=>{g(ae)}))})},[m,t,n,G,$]);Ir(()=>{c===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,g(K=>({...K,isPositioned:!1})))},[c]);const M=d.useRef(!1);Ir(()=>(M.current=!0,()=>{M.current=!1}),[]),Ir(()=>{if(E&&(P.current=E),x&&(_.current=x),E&&x){if(F.current)return F.current(E,x,L);L()}},[E,x,L,F,k]);const q=d.useMemo(()=>({reference:P,floating:_,setReference:b,setFloating:S}),[b,S]),W=d.useMemo(()=>({reference:E,floating:x}),[E,x]),X=d.useMemo(()=>{const K={position:n,left:0,top:0};if(!W.floating)return K;const ne=du(W.floating,f.x),ae=du(W.floating,f.y);return a?{...K,transform:"translate("+ne+"px, "+ae+"px)",...uu(W.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ne,top:ae}},[n,a,W.floating,f.x,f.y]);return d.useMemo(()=>({...f,update:L,refs:q,elements:W,floatingStyles:X}),[f,L,q,W,X])}const Uy=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?cu({element:r.current,padding:o}).fn(n):{}:r?cu({element:r,padding:o}).fn(n):{}}}},jy=(e,t)=>({...$y(e),options:[e,t]}),Wy=(e,t)=>({...Iy(e),options:[e,t]}),Gy=(e,t)=>({...By(e),options:[e,t]}),qy=(e,t)=>({...Ly(e),options:[e,t]}),Ky=(e,t)=>({...Ry(e),options:[e,t]}),Xy=(e,t)=>({...Vy(e),options:[e,t]}),Yy=(e,t)=>({...Uy(e),options:[e,t]});var Jy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Zy=Jy.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Yt:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Qy="Arrow",fu=d.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return l.jsx(Zy.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});fu.displayName=Qy;var ew=fu;function pu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function tw(...e){return t=>{let n=!1;const r=e.map(o=>{const s=pu(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():pu(e[o],null)}}}}function gu(...e){return d.useCallback(tw(...e),e)}var nw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],hu=nw.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Yt:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Gs="Popper",[mu,vu]=Nt(Gs),[rw,yu]=mu(Gs),wu=e=>{const{__scopePopper:t,children:n}=e,[r,o]=d.useState(null);return l.jsx(rw,{scope:t,anchor:r,onAnchorChange:o,children:n})};wu.displayName=Gs;var bu="PopperAnchor",xu=d.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=yu(bu,n),i=d.useRef(null),a=gu(t,i);return d.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:l.jsx(hu.div,{...o,ref:a})});xu.displayName=bu;var qs="PopperContent",[ow,sw]=mu(qs),Cu=d.forwardRef((e,t)=>{var Te,Qe,Me,hn,yt,wt;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:u=!0,collisionBoundary:c=[],collisionPadding:f=0,sticky:g="partial",hideWhenDetached:m=!1,updatePositionStrategy:p="optimized",onPlaced:v,...h}=e,y=yu(qs,n),[w,b]=d.useState(null),S=gu(t,je=>b(je)),[E,x]=d.useState(null),P=$a(E),_=(P==null?void 0:P.width)??0,O=(P==null?void 0:P.height)??0,k=r+(s!=="center"?"-"+s:""),F=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},G=Array.isArray(c)?c:[c],$=G.length>0,L={padding:F,boundary:G.filter(aw),altBoundary:$},{refs:M,floatingStyles:q,placement:W,isPositioned:X,middlewareData:K}=Hy({strategy:"fixed",placement:k,whileElementsMounted:(...je)=>ky(...je,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[jy({mainAxis:o+O,alignmentAxis:i}),u&&Wy({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?Gy():void 0,...L}),u&&qy({...L}),Ky({...L,apply:({elements:je,rects:Lt,availableWidth:mn,availableHeight:Rt})=>{const{width:Vn,height:C}=Lt.reference,N=je.floating.style;N.setProperty("--radix-popper-available-width",`${mn}px`),N.setProperty("--radix-popper-available-height",`${Rt}px`),N.setProperty("--radix-popper-anchor-width",`${Vn}px`),N.setProperty("--radix-popper-anchor-height",`${C}px`)}}),E&&Yy({element:E,padding:a}),lw({arrowWidth:_,arrowHeight:O}),m&&Xy({strategy:"referenceHidden",...L})]}),[ne,ae]=Nu(W),de=Pe(v);Le(()=>{X&&(de==null||de())},[X,de]);const De=(Te=K.arrow)==null?void 0:Te.x,Se=(Qe=K.arrow)==null?void 0:Qe.y,Ue=((Me=K.arrow)==null?void 0:Me.centerOffset)!==0,[It,we]=d.useState();return Le(()=>{w&&we(window.getComputedStyle(w).zIndex)},[w]),l.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:X?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:It,"--radix-popper-transform-origin":[(hn=K.transformOrigin)==null?void 0:hn.x,(yt=K.transformOrigin)==null?void 0:yt.y].join(" "),...((wt=K.hide)==null?void 0:wt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(ow,{scope:n,placedSide:ne,onArrowChange:x,arrowX:De,arrowY:Se,shouldHideArrow:Ue,children:l.jsx(hu.div,{"data-side":ne,"data-align":ae,...h,ref:S,style:{...h.style,animation:X?void 0:"none"}})})})});Cu.displayName=qs;var Su="PopperArrow",iw={top:"bottom",right:"left",bottom:"top",left:"right"},Eu=d.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=sw(Su,r),i=iw[s.placedSide];return l.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:l.jsx(ew,{...o,ref:n,style:{...o.style,display:"block"}})})});Eu.displayName=Su;function aw(e){return e!==null}var lw=e=>({name:"transformOrigin",options:e,fn(t){var y,w,b;const{placement:n,rects:r,middlewareData:o}=t,i=((y=o.arrow)==null?void 0:y.centerOffset)!==0,a=i?0:e.arrowWidth,u=i?0:e.arrowHeight,[c,f]=Nu(n),g={start:"0%",center:"50%",end:"100%"}[f],m=(((w=o.arrow)==null?void 0:w.x)??0)+a/2,p=(((b=o.arrow)==null?void 0:b.y)??0)+u/2;let v="",h="";return c==="bottom"?(v=i?g:`${m}px`,h=`${-u}px`):c==="top"?(v=i?g:`${m}px`,h=`${r.floating.height+u}px`):c==="right"?(v=`${-u}px`,h=i?g:`${p}px`):c==="left"&&(v=`${r.floating.width+u}px`,h=i?g:`${p}px`),{data:{x:v,y:h}}}});function Nu(e){const[t,n="center"]=e.split("-");return[t,n]}var cw=wu,uw=xu,dw=Cu,fw=Eu,pw="Portal",Tu=d.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=d.useState(!1);Le(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?to.createPortal(l.jsx(An.div,{...r,ref:t}),i):null});Tu.displayName=pw;function gw(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var Ks=e=>{const{present:t,children:n}=e,r=hw(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=Pn(r.ref,mw(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};Ks.displayName="Presence";function hw(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=gw(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=Rr(r.current);s.current=a==="mounted"?c:"none"},[a]),Le(()=>{const c=r.current,f=o.current;if(f!==e){const m=s.current,p=Rr(c);e?u("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&m!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),Le(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,g=p=>{const h=Rr(r.current).includes(p.animationName);if(p.target===t&&h&&(u("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},m=p=>{p.target===t&&(s.current=Rr(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:d.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Rr(e){return(e==null?void 0:e.animationName)||"none"}function mw(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var vw="VisuallyHidden",Pu=d.forwardRef((e,t)=>l.jsx(An.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Pu.displayName=vw;var yw=Pu,[Vr,eC]=Nt("Tooltip",[vu]),Br=vu(),Au="TooltipProvider",ww=700,Xs="tooltip.open",[bw,Ys]=Vr(Au),_u=e=>{const{__scopeTooltip:t,delayDuration:n=ww,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,[i,a]=d.useState(!0),u=d.useRef(!1),c=d.useRef(0);return d.useEffect(()=>{const f=c.current;return()=>window.clearTimeout(f)},[]),l.jsx(bw,{scope:t,isOpenDelayed:i,delayDuration:n,onOpen:d.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:d.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:d.useCallback(f=>{u.current=f},[]),disableHoverableContent:o,children:s})};_u.displayName=Au;var zr="Tooltip",[xw,Dn]=Vr(zr),Fu=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,u=Ys(zr,e.__scopeTooltip),c=Br(t),[f,g]=d.useState(null),m=tn(),p=d.useRef(0),v=i??u.disableHoverableContent,h=a??u.delayDuration,y=d.useRef(!1),[w=!1,b]=Qt({prop:r,defaultProp:o,onChange:_=>{_?(u.onOpen(),document.dispatchEvent(new CustomEvent(Xs))):u.onClose(),s==null||s(_)}}),S=d.useMemo(()=>w?y.current?"delayed-open":"instant-open":"closed",[w]),E=d.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y.current=!1,b(!0)},[b]),x=d.useCallback(()=>{window.clearTimeout(p.current),p.current=0,b(!1)},[b]),P=d.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{y.current=!0,b(!0),p.current=0},h)},[h,b]);return d.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),l.jsx(cw,{...c,children:l.jsx(xw,{scope:t,contentId:m,open:w,stateAttribute:S,trigger:f,onTriggerChange:g,onTriggerEnter:d.useCallback(()=>{u.isOpenDelayed?P():E()},[u.isOpenDelayed,P,E]),onTriggerLeave:d.useCallback(()=>{v?x():(window.clearTimeout(p.current),p.current=0)},[x,v]),onOpen:E,onClose:x,disableHoverableContent:v,children:n})})};Fu.displayName=zr;var Js="TooltipTrigger",Ou=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Dn(Js,n),s=Ys(Js,n),i=Br(n),a=d.useRef(null),u=Pn(t,a,o.onTriggerChange),c=d.useRef(!1),f=d.useRef(!1),g=d.useCallback(()=>c.current=!1,[]);return d.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),l.jsx(uw,{asChild:!0,...i,children:l.jsx(An.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:pt(e.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:pt(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:pt(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:pt(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:pt(e.onBlur,o.onClose),onClick:pt(e.onClick,o.onClose)})})});Ou.displayName=Js;var Zs="TooltipPortal",[Cw,Sw]=Vr(Zs,{forceMount:void 0}),Du=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=Dn(Zs,t);return l.jsx(Cw,{scope:t,forceMount:n,children:l.jsx(Ks,{present:n||s.open,children:l.jsx(Tu,{asChild:!0,container:o,children:r})})})};Du.displayName=Zs;var fn="TooltipContent",Mu=d.forwardRef((e,t)=>{const n=Sw(fn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=Dn(fn,e.__scopeTooltip);return l.jsx(Ks,{present:r||i.open,children:i.disableHoverableContent?l.jsx(ku,{side:o,...s,ref:t}):l.jsx(Ew,{side:o,...s,ref:t})})}),Ew=d.forwardRef((e,t)=>{const n=Dn(fn,e.__scopeTooltip),r=Ys(fn,e.__scopeTooltip),o=d.useRef(null),s=Pn(t,o),[i,a]=d.useState(null),{trigger:u,onClose:c}=n,f=o.current,{onPointerInTransitChange:g}=r,m=d.useCallback(()=>{a(null),g(!1)},[g]),p=d.useCallback((v,h)=>{const y=v.currentTarget,w={x:v.clientX,y:v.clientY},b=Aw(w,y.getBoundingClientRect()),S=_w(w,b),E=Fw(h.getBoundingClientRect()),x=Dw([...S,...E]);a(x),g(!0)},[g]);return d.useEffect(()=>()=>m(),[m]),d.useEffect(()=>{if(u&&f){const v=y=>p(y,f),h=y=>p(y,u);return u.addEventListener("pointerleave",v),f.addEventListener("pointerleave",h),()=>{u.removeEventListener("pointerleave",v),f.removeEventListener("pointerleave",h)}}},[u,f,p,m]),d.useEffect(()=>{if(i){const v=h=>{const y=h.target,w={x:h.clientX,y:h.clientY},b=(u==null?void 0:u.contains(y))||(f==null?void 0:f.contains(y)),S=!Ow(w,i);b?m():S&&(m(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[u,f,i,c,m]),l.jsx(ku,{...e,ref:s})}),[Nw,Tw]=Vr(zr,{isInside:!1}),ku=d.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,u=Dn(fn,n),c=Br(n),{onClose:f}=u;return d.useEffect(()=>(document.addEventListener(Xs,f),()=>document.removeEventListener(Xs,f)),[f]),d.useEffect(()=>{if(u.trigger){const g=m=>{const p=m.target;p!=null&&p.contains(u.trigger)&&f()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[u.trigger,f]),l.jsx(Gc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:g=>g.preventDefault(),onDismiss:f,children:l.jsxs(dw,{"data-state":u.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(wa,{children:r}),l.jsx(Nw,{scope:n,isInside:!0,children:l.jsx(yw,{id:u.contentId,role:"tooltip",children:o||r})})]})})});Mu.displayName=fn;var $u="TooltipArrow",Pw=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Br(n);return Tw($u,n).isInside?null:l.jsx(fw,{...o,...r,ref:t})});Pw.displayName=$u;function Aw(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function _w(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Fw(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Ow(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s].x,u=t[s].y,c=t[i].x,f=t[i].y;u>r!=f>r&&n<(c-a)*(r-u)/(f-u)+a&&(o=!o)}return o}function Dw(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Mw(t)}function Mw(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var kw=_u,$w=Fu,Iw=Ou,Lw=Du,Iu=Mu;const Lu=kw,Ru=$w,Vu=Iw,Qs=d.forwardRef(({className:e,sideOffset:t=4,...n},r)=>l.jsx(Lw,{children:l.jsx(Iu,{ref:r,sideOffset:t,className:Z("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Qs.displayName=Iu.displayName;function Rw({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const Vw=d.forwardRef(Rw);var Bw=function(e){return function(t,n){var r=D.useRef(!1);e(function(){return function(){r.current=!1}},[]),e(function(){if(!r.current)r.current=!0;else return t()},n)}},Bu=function(e){return typeof e=="function"},zu=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test";const zw=Bw(D.useEffect);function Hu(e){var t=D.useRef(e);return t.current=e,t}var Hw=function(e){zu&&(Bu(e)||console.error("useUnmount expected parameter is a function, got ".concat(typeof e)));var t=Hu(e);D.useEffect(function(){return function(){t.current()}},[])},Hr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Uw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function jw(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Uu=jw,Ww=typeof Hr=="object"&&Hr&&Hr.Object===Object&&Hr,Gw=Ww,qw=Gw,Kw=typeof self=="object"&&self&&self.Object===Object&&self,Xw=qw||Kw||Function("return this")(),ju=Xw,Yw=ju,Jw=function(){return Yw.Date.now()},Zw=Jw,Qw=/\s/;function eb(e){for(var t=e.length;t--&&Qw.test(e.charAt(t)););return t}var tb=eb,nb=tb,rb=/^\s+/;function ob(e){return e&&e.slice(0,nb(e)+1).replace(rb,"")}var sb=ob,ib=ju,ab=ib.Symbol,Wu=ab,Gu=Wu,qu=Object.prototype,lb=qu.hasOwnProperty,cb=qu.toString,Mn=Gu?Gu.toStringTag:void 0;function ub(e){var t=lb.call(e,Mn),n=e[Mn];try{e[Mn]=void 0;var r=!0}catch{}var o=cb.call(e);return r&&(t?e[Mn]=n:delete e[Mn]),o}var db=ub,fb=Object.prototype,pb=fb.toString;function gb(e){return pb.call(e)}var hb=gb,Ku=Wu,mb=db,vb=hb,yb="[object Null]",wb="[object Undefined]",Xu=Ku?Ku.toStringTag:void 0;function bb(e){return e==null?e===void 0?wb:yb:Xu&&Xu in Object(e)?mb(e):vb(e)}var xb=bb;function Cb(e){return e!=null&&typeof e=="object"}var Sb=Cb,Eb=xb,Nb=Sb,Tb="[object Symbol]";function Pb(e){return typeof e=="symbol"||Nb(e)&&Eb(e)==Tb}var Ab=Pb,_b=sb,Yu=Uu,Fb=Ab,Ju=NaN,Ob=/^[-+]0x[0-9a-f]+$/i,Db=/^0b[01]+$/i,Mb=/^0o[0-7]+$/i,kb=parseInt;function $b(e){if(typeof e=="number")return e;if(Fb(e))return Ju;if(Yu(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Yu(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=_b(e);var n=Db.test(e);return n||Mb.test(e)?kb(e.slice(2),n?2:8):Ob.test(e)?Ju:+e}var Ib=$b,Lb=Uu,ei=Zw,Zu=Ib,Rb="Expected a function",Vb=Math.max,Bb=Math.min;function zb(e,t,n){var r,o,s,i,a,u,c=0,f=!1,g=!1,m=!0;if(typeof e!="function")throw new TypeError(Rb);t=Zu(t)||0,Lb(n)&&(f=!!n.leading,g="maxWait"in n,s=g?Vb(Zu(n.maxWait)||0,t):s,m="trailing"in n?!!n.trailing:m);function p(P){var _=r,O=o;return r=o=void 0,c=P,i=e.apply(O,_),i}function v(P){return c=P,a=setTimeout(w,t),f?p(P):i}function h(P){var _=P-u,O=P-c,k=t-_;return g?Bb(k,s-O):k}function y(P){var _=P-u,O=P-c;return u===void 0||_>=t||_<0||g&&O>=s}function w(){var P=ei();if(y(P))return b(P);a=setTimeout(w,h(P))}function b(P){return a=void 0,m&&r?p(P):(r=o=void 0,i)}function S(){a!==void 0&&clearTimeout(a),c=0,r=u=o=a=void 0}function E(){return a===void 0?i:b(ei())}function x(){var P=ei(),_=y(P);if(r=arguments,o=this,u=P,_){if(a===void 0)return v(u);if(g)return clearTimeout(a),a=setTimeout(w,t),p(u)}return a===void 0&&(a=setTimeout(w,t)),i}return x.cancel=S,x.flush=E,x}var Hb=zb;const Ub=Uw(Hb);function jb(){var e=(typeof global>"u"?"undefined":typeof global)=="object"&&global&&global.Object===Object&&global,t=typeof self=="object"&&self&&self.Object===Object&&self;return e||t}jb()||(global.Date=Date);function Wb(e,t){var n;zu&&(Bu(e)||console.error("useDebounceFn expected parameter is a function, got ".concat(typeof e)));var r=Hu(e),o=(n=t==null?void 0:t.wait)!==null&&n!==void 0?n:1e3,s=D.useMemo(function(){return Ub(function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];return r.current.apply(r,ol([],rl(i),!1))},o,t)},[]);return Hw(function(){s.cancel()}),{run:s,cancel:s.cancel,flush:s.flush}}function Gb(e,t,n){var r=rl(D.useState({}),2),o=r[0],s=r[1],i=Wb(function(){s({})},n).run;D.useEffect(function(){return i()},t),zw(e,[o])}const qb=D.forwardRef(({onChange:e},t)=>{const n=D.useRef(null),[r,o]=D.useState("");return D.useImperativeHandle(t,()=>({setValue:s=>{var i;o(s),(i=n.current)==null||i.focus()}})),Gb(()=>{e==null||e(r)},[r],{wait:300}),l.jsxs(l.Fragment,{children:[l.jsx(Ot,{ref:n,type:"text",placeholder:"Search files...",value:r,onChange:s=>o(s.target.value),className:"pr-8"}),r&&l.jsx("button",{onClick:()=>{var s;o(""),(s=n.current)==null||s.focus()},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700",children:l.jsx(Vw,{className:"h-5 w-5"})})]})}),Be={current:!1},Qu="crawl:jobs",pn="crawl:current_job",Kb=e=>{const[t,n]=D.useState(null),[r,o]=D.useState(0);return D.useEffect(()=>{const s=localStorage.getItem(pn);if(s){const i=JSON.parse(s);n(i),i!=null&&i.startTime&&o(Math.floor((Date.now()-i.startTime)/1e3))}},[]),D.useEffect(()=>{if(!(t!=null&&t.startTime))return;const s=setInterval(()=>{o(Math.floor((Date.now()-t.startTime)/1e3))},1e3);return()=>clearInterval(s)},[t==null?void 0:t.startTime]),D.useEffect(()=>{if(!(t!=null&&t.id))return;const s=async()=>{try{const u=(await oe.get(`${e}/api/crawl/${t.id}?taskId=${t.taskId}`)).data;n(c=>{if(!c)return null;const f={...c,status:u};return localStorage.setItem(pn,JSON.stringify(f)),(u.status==="completed"||u.status==="failed")&&setTimeout(()=>{n(null),localStorage.removeItem(pn)},100),f})}catch(a){console.error("Error polling job status:",a)}},i=setInterval(s,3e3);return s(),()=>clearInterval(i)},[t==null?void 0:t.id,e]),{currentJob:t,elapsedTime:r,setCurrentJob:s=>{s&&!s.startTime&&(s.startTime=Date.now()),n(s),s?localStorage.setItem(pn,JSON.stringify(s)):localStorage.removeItem(pn)}}},Xb=(e,t,n)=>{const r=[],o=s=>{(e[s]||[]).forEach(a=>{a.name.toLowerCase().includes(t.toLowerCase())&&r.push(a),a.isFolder&&a.key.startsWith(n)&&o(a.key)})};return o(n),r},Ur=(e,t)=>{const n=[],r=o=>{(e[o]||[]).forEach(i=>{n.push(i.key),i.isFolder&&r(i.key)})};return r(t),n},Yb=(e,t)=>{const n=[];return(e[t]||[]).forEach(o=>{n.push(o.key),o.isFolder&&n.push(...Ur(e,o.key))}),n},Jb=(e,t,n=[])=>{const[r,o]=D.useState({}),[s,i]=D.useState(!1),[a,u]=D.useState(null),c=D.useRef(t);D.useEffect(()=>{c.current=t},[t]);const f=async()=>{i(!0);try{const g=!Be.current;Be.current&&(Be.current=!1);const m=await oe.get(`${e}/api/files`,{params:{cache:g,displayPrefixes:JSON.stringify(n),prefix:c.current},timeout:3e5});o(m.data),u(null)}catch(g){u(g instanceof Error?g:new Error("Failed to fetch files"))}finally{i(!1)}};return D.useEffect(()=>{f()},[]),{data:r,isLoading:s,error:a,refetch:f}},jr=e=>{var r,o,s;const t=((s=(o=(r=e==null?void 0:e.name)==null?void 0:r.split("."))==null?void 0:o.pop())==null?void 0:s.toLowerCase())??"";return["txt","md","json","js","ts","jsx","tsx","css","html","xml","yaml","yml"].includes(t||"")},Zb=D.memo(({homeLabel:e="Kho tài liệu",apiBaseUrl:t="http://localhost:3002",rootPrefix:n="",asSelector:r=!1,onSelected:o=i=>console.log("Đã chọn:",i),displayPrefixes:s})=>{var Ed;const[i,a]=D.useState(""),[u,c]=D.useState(new Set),[f,g]=D.useState(n),[m,p]=D.useState(null),[v,h]=D.useState(!1),[y,w]=D.useState(""),[b,S]=D.useState(!1),[E,x]=D.useState(null),[P,_]=D.useState(!1),[O,k]=D.useState(!1),[F,G]=D.useState(null),$=D.useRef(null),{toast:L}=Ds(),[M,q]=D.useState(null),[W,X]=D.useState(""),[K,ne]=D.useState(!1),[ae,de]=D.useState(new Set),[De,Se]=D.useState(""),[Ue,It]=D.useState(!1),[we,Te]=D.useState(!1),[Qe,Me]=D.useState("rename"),[hn,yt]=D.useState(!1),[wt,je]=D.useState(""),[Lt,mn]=D.useState("1"),[Rt,Vn]=D.useState(!1),[C,N]=D.useState(!1),[A,H]=D.useState(!1),[B,V]=D.useState(!1),{currentJob:z,elapsedTime:Q,setCurrentJob:ge}=Kb(t),me=m||n,{data:be,isLoading:Bn,error:zn,refetch:ke}=Jb(t,me,s);D.useEffect(()=>{z!=null&&z.status&&(z.status.status==="completed"?(L({title:"Thu thập website hoàn tất",description:`Đã thu thập thành công ${z.url} với ${z.status.completed} trang`}),Be.current=!0,ke()):z.status.status==="failed"&&L({title:"Thu thập website thất bại",description:`Không thể thu thập ${z.url}. Vui lòng thử lại.`,variant:"destructive"}))},[(Ed=z==null?void 0:z.status)==null?void 0:Ed.status]);const Jr=D.useMemo(()=>be[f]||[],[be,f]),ct=D.useMemo(()=>i?Xb(be,i,f):Jr,[Jr,i,f,be]),qt=D.useMemo(()=>{const I={};return ct.forEach((R,U)=>{u.has(R.key)&&(I[U]=!0)}),I},[u,ct]),Zr=I=>{const R=Ur(be,I);if(R.length===0)return u.has(I)?"all":"none";const U=R.filter(ee=>u.has(ee)).length;return U===0?"none":U===R.length?"all":"partial"},Qr=I=>{V(!0),p(I),g(I)};D.useEffect(()=>{B&&(Be.current=!0,ke().finally(()=>V(!1)))},[B]);const Sx=async(I,R)=>{S(!0);try{const U=`${R}${I}/`;if((await oe.post(`${t}/api/create-folder`,{prefix:U})).status!==200){L({title:"Lỗi",description:"Không thể tạo thư mục",variant:"destructive"});return}Be.current=!0,await ke(),L({title:"Đã tạo thư mục",description:`Đã tạo thành công thư mục "${I}"`}),w(""),h(!1)}catch(U){console.error("Error creating folder:",U),L({title:"Lỗi",description:"Không thể tạo thư mục",variant:"destructive"})}finally{S(!1)}},bd=async(I,R,U)=>{G(U),N(!0);try{const ee=new FormData;ee.append("prefix",R),Array.from(I).forEach(se=>ee.append("files",se)),await oe.post(`${t}/api/upload`,ee,{headers:{"Content-Type":"multipart/form-data"}}),p(R),Be.current=!0,await ke()}catch(ee){console.error("Lỗi tải lên:",ee)}finally{G(null),N(!1)}},Ex=async I=>{var R;H(!0);try{await oe.delete(`${t}/api/files`,{data:{paths:[I.key]}});const U=((R=I.key)==null?void 0:R.replace(/^(.*?)(\/.*)?$/,(ee,se,le)=>!le||le==="/"?"":se+"/"))||"";p(U),Be.current=!0,L({title:"Đã xóa tập tin",description:`Đã xóa thành công "${I.name}"`}),x(null)}catch(U){console.error("Error deleting file:",U),L({title:"Lỗi",description:"Không thể xóa tập tin",variant:"destructive"})}finally{H(!1),await ke()}},eo=I=>{const R=new Set(u),U=typeof I=="function"?I(qt):I;new Set(Object.keys(qt).map(Number)).forEach(se=>{const le=ct[se];le&&(U[se]||(R.delete(le.key),le.isFolder&&Ur(be,le.key).forEach(xe=>R.delete(xe))))}),Object.entries(U).forEach(([se,le])=>{const xe=parseInt(se),bt=ct[xe];bt&&le&&(R.add(bt.key),bt.isFolder&&Ur(be,bt.key).forEach(hi=>R.add(hi)))}),c(R)},Nx=async()=>{var I;_(!0);try{const R=Array.from(u),U=R.map(se=>Object.values(be).flat().find(le=>le.key===se)).filter(se=>se!==void 0);if(U.length===0){L({title:"Lỗi",description:"Không có tập tin nào được chọn để xóa",variant:"destructive"});return}await oe.delete(`${t}/api/files`,{data:{paths:R}});const ee=((I=U[0])==null?void 0:I.key.replace(/^(.*?)(\/.*)?$/,(se,le,xe)=>!xe||xe==="/"?"":le+"/"))||"";p(ee),Be.current=!0,ke(),L({title:"Đã xóa tập tin",description:`Đã xóa thành công ${U.length} mục`}),k(!1),c(new Set)}catch(R){console.error("Error deleting files:",R),L({title:"Lỗi",description:"Không thể xóa các tập tin đã chọn",variant:"destructive"})}finally{_(!1)}},Tx=async(I,R)=>{ne(!0);try{const U=I.key;let ee;I.isFolder?ee=U.split("/").slice(0,-2).join("/")+"/":ee=U.substring(0,U.lastIndexOf("/")+1);const se=ee+R+(I.isFolder?"/":"");await oe.post(`${t}/api/rename`,{oldPath:U,newPath:se}),Be.current=!0,await ke(),L({title:"Đã đổi tên",description:`Đã đổi tên thành công "${I.name}" thành "${R}"`}),q(null),X("")}catch(U){console.error("Error renaming item:",U),L({title:"Lỗi",description:"Không thể đổi tên",variant:"destructive"})}finally{ne(!1)}},xd=async I=>{de(R=>new Set([...R,...I]));try{const R=await oe.post(`${t}/api/download`,{paths:I},{responseType:"blob"}),U=window.URL.createObjectURL(R.data),ee=document.createElement("a");ee.href=U;const se=R.headers["Content-Disposition"]||R.headers["content-disposition"],le=se==null?void 0:se.match(/filename="(.+)"/),xe=le?decodeURIComponent(le[1]):"download.zip";ee.setAttribute("download",xe),document.body.appendChild(ee),ee.click(),document.body.removeChild(ee),window.URL.revokeObjectURL(U),L({title:"Bắt đầu tải xuống",description:`Đã bắt đầu tải xuống ${I.length} mục${I.length>1,""}`})}catch(R){console.error("Error downloading files:",R),L({title:"Lỗi",description:"Không thể tải xuống tập tin",variant:"destructive"})}finally{de(R=>{const U=new Set(R);return I.forEach(ee=>U.delete(ee)),U})}},Cd=f?f.replace(n,"").split("/").filter(Boolean):[],Px=()=>Array.from(u).map(I=>{var R;for(const U in be){const ee=(R=be[U])==null?void 0:R.find(se=>se.key===I);if(ee)return ee}return null}).filter(I=>I!==null),Sd=D.useMemo(()=>{const I=[{id:"select",header:()=>{const R=Yb(be,f),U=R.length>0&&R.every(se=>u.has(se)),ee=R.some(se=>u.has(se));return l.jsx(jo,{checked:U?!0:ee?"indeterminate":!1,onCheckedChange:se=>{if(se){const le=ct.reduce((xe,bt,hi)=>(xe[hi]=!0,xe),{});eo(le)}else eo({})},"aria-label":"Chọn tất cả"})},cell:({row:R})=>{const U=R.original,se=U.isFolder?Zr(U.key):u.has(U.key)?"all":"none";return l.jsx("div",{className:"flex items-center",children:l.jsx(jo,{checked:se==="partial"?"indeterminate":se==="all",onCheckedChange:le=>{const xe={...qt};le?xe[R.index]=!0:delete xe[R.index],eo(xe)},"aria-label":"Chọn dòng"})})},enableSorting:!1},{id:"fileName",header:"Tên tập tin",accessorKey:"name",cell:({row:R})=>{const U=R.original,ee=U.key.substring(0,U.key.lastIndexOf("/"))||"/",se=i.trim()!==""&&ee!==f,le=ee.split("/").filter(Boolean);return l.jsxs("div",{className:"flex flex-col",children:[l.jsxs("div",{className:`flex items-center gap-2 ${U.isFolder?"cursor-pointer hover:text-blue-600":""}`,onClick:()=>{U.isFolder&&Qr(U.key)},children:[U.isFolder?l.jsx(no,{className:"h-5 w-5 text-blue-500"}):null,U.name]}),se&&l.jsxs("div",{className:"text-sm text-gray-500 flex items-center",children:[l.jsx(no,{className:"h-4 w-4 text-gray-500 my-auto"}),l.jsxs("span",{className:"flex items-center ml-1",children:[l.jsx("span",{className:"cursor-pointer hover:text-blue-600",onClick:()=>{Qr("")},children:"/"}),le.map((xe,bt)=>l.jsxs("span",{className:"flex items-center",children:[l.jsx("span",{className:"cursor-pointer hover:text-blue-600",onClick:()=>{Qr(le.slice(0,bt+1).join("/")+"/")},children:xe}),bt<le.length-1&&l.jsx("span",{children:"/"})]},bt))]})]})]})}}];return r||I.push({id:"size",header:"Kích thước",accessorKey:"size",cell:({getValue:R,row:U})=>{const ee=R();return l.jsx("span",{children:U.original.isFolder?"-":$g(ee)})}},{id:"lastModified",header:"Sửa đổi lần cuối",accessorKey:"lastModified",cell:({row:R})=>{const U=R.original.lastModified;return l.jsx("span",{children:U.toLocaleString()})}},{id:"actions",header:"Hành động",accessorKey:"key",cell:({row:R})=>l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>xd([R.original.key]),className:"h-8 w-8 p-0",disabled:ae.has(R.original.key),children:ae.has(R.original.key)?l.jsx(Ce,{className:"h-4 w-4 animate-spin"}):l.jsx(vi,{className:"h-4 w-4"})}),l.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>{q(R.original),X(R.original.name)},className:"h-8 w-8 p-0",children:l.jsx(Id,{className:"h-4 w-4"})}),l.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>x(R.original),className:"h-8 w-8 p-0",children:l.jsx(yi,{className:"h-4 w-4"})})]})}),I},[u,ct,qt,ae,r]),gi=Oi({data:ct,columns:Sd,state:{rowSelection:qt},enableRowSelection:!0,onRowSelectionChange:eo,getCoreRowModel:Fi()}),Ax=async I=>{if(jr(I)){It(!0);try{const R=await oe.get(`${t}/api/read-text`,{params:{path:I.key}});Se(R.data.content)}catch(R){console.error("Error loading file content:",R),L({title:"Lỗi",description:"Không thể tải nội dung tập tin",variant:"destructive"})}finally{It(!1)}}},_x=async(I,R)=>{Te(!0);try{await oe.post(`${t}/api/modify-text`,{path:I.key,content:R}),L({title:"Đã lưu tập tin",description:"Nội dung tập tin đã được cập nhật thành công"}),Be.current=!0,await ke(),q(null),Se(""),Me("rename")}catch(U){console.error("Error saving file content:",U),L({title:"Lỗi",description:"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{Te(!1)}};D.useEffect(()=>{M&&jr(M)&&(Ax(M),Me("rename"))},[M]);const Fx=async(I,R)=>{var U;if(z){L({title:"Đang thu thập website",description:"Vui lòng đợi cho công việc thu thập hiện tại hoàn thành.",variant:"destructive"});return}Vn(!0);try{const{data:ee}=await oe.post(`${t}/api/crawl`,{url:I,limit:R,prefix:f});if(ee.id){ge({id:ee.id,url:I,limit:R,prefix:f,taskId:((U=ee.task)==null?void 0:U.id)||""});const se=localStorage.getItem(Qu),le=se?JSON.parse(se):[];le.some(xe=>xe.id===ee.id)||(le.unshift({url:I,id:ee.id,limit:R,prefix:f,timestamp:Date.now()}),le.length>20&&(le.length=20),localStorage.setItem(Qu,JSON.stringify(le))),L({title:"Bắt đầu thu thập website",description:`Đã thêm nhiệm vụ thu thập ${I} với giới hạn ${R}. Dữ liệu sẽ có sẵn sau khi thu thập hoàn tất.`}),yt(!1),je(""),mn("1")}}catch(ee){console.error("Error crawling website:",ee),L({title:"Lỗi",description:"Không thể bắt đầu thu thập website",variant:"destructive"})}finally{Vn(!1)}},Ox=async()=>{try{if(!(z!=null&&z.id))return;ge(null),localStorage.removeItem(pn),L({title:"Đã dừng thu thập",description:`Đã dừng thu thập website ${z.url}`})}catch(I){console.error("Error stopping job:",I),L({title:"Lỗi",description:"Không thể dừng thu thập website",variant:"destructive"})}};return l.jsxs("div",{className:"space-y-4 s3-explr-container",children:[l.jsx(_a,{className:"s3-explr-breadcrumb",children:l.jsxs(Fa,{className:"s3-explr-breadcrumb-list",children:[l.jsx(Vo,{className:"s3-explr-breadcrumb-item",children:l.jsx(Bo,{onClick:()=>{p(""),g(""),Be.current=!0,setTimeout(()=>{ke()},0)},className:"flex items-center gap-1 cursor-pointer s3-explr-breadcrumb-home",children:e})}),Cd.map((I,R)=>l.jsxs(l.Fragment,{children:[l.jsx(Oa,{className:"s3-explr-breadcrumb-separator"},`sep-${R}`),l.jsx(Vo,{className:"s3-explr-breadcrumb-item",children:l.jsx(Bo,{onClick:()=>Qr(n+Cd.slice(0,R+1).join("/")+"/"),className:"cursor-pointer s3-explr-breadcrumb-link",children:I})},`item-${I}`)]}))]})}),l.jsxs("div",{className:"flex items-center space-x-4 s3-explr-toolbar",children:[l.jsx("div",{className:"relative max-w-sm w-full s3-explr-search-container",children:l.jsx(qb,{ref:$,onChange:I=>a(I)})}),l.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>{p(f),Be.current=!0,ke()},disabled:Bn,className:"flex items-center gap-2 s3-explr-refresh-btn",children:[l.jsx(Pd,{className:`h-4 w-4 s3-explr-refresh-icon ${Bn?"animate-spin":""}`}),"Làm mới"]}),!r&&l.jsxs(l.Fragment,{children:[u.size>0&&l.jsxs(l.Fragment,{children:[l.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>xd(Array.from(u)),disabled:Array.from(u).some(I=>ae.has(I)),className:"flex items-center gap-2 s3-explr-download-selected-btn",children:[Array.from(u).some(I=>ae.has(I))?l.jsx(Ce,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}):l.jsx(vi,{className:"h-4 w-4 s3-explr-download-icon"}),"Tải xuống đã chọn (",u.size,")"]}),l.jsxs(Ut,{open:O,onOpenChange:k,children:[l.jsx(hr,{asChild:!0,children:l.jsxs(ie,{variant:"destructive",size:"sm",className:"flex items-center gap-2 s3-explr-bulk-delete-btn",children:[l.jsx(yi,{className:"h-4 w-4 s3-explr-trash-icon"}),"Xóa đã chọn (",u.size,")"]})}),l.jsxs(At,{className:"s3-explr-dialog-content",children:[l.jsxs(_t,{className:"s3-explr-dialog-header",children:[l.jsx(Ft,{className:"s3-explr-dialog-title",children:"Xác nhận xóa hàng loạt"}),l.jsxs(mr,{className:"s3-explr-dialog-description",children:["Bạn có chắc chắn muốn xóa ",u.size," mục đã chọn? Hành động này không thể hoàn tác."]})]}),l.jsxs(Nn,{className:"s3-explr-dialog-footer",children:[l.jsx(ie,{variant:"outline",onClick:()=>k(!1),className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(ie,{variant:"destructive",onClick:Nx,disabled:P,className:"s3-explr-confirm-delete-btn",children:P?l.jsxs(l.Fragment,{children:[l.jsx(Ce,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa đã chọn"})]})]})]})]}),l.jsxs(Ut,{open:v,onOpenChange:h,children:[l.jsx(hr,{asChild:!0,children:l.jsxs(ie,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-new-folder-btn",disabled:!!s&&!f,children:[l.jsx(Od,{className:"h-4 w-4 s3-explr-folder-plus-icon"}),"Thư mục mới"]})}),l.jsxs(At,{className:"s3-explr-dialog-content",children:[l.jsx(_t,{className:"s3-explr-dialog-header",children:l.jsx(Ft,{className:"s3-explr-dialog-title",children:"Tạo thư mục mới"})}),l.jsxs("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:[l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(jt,{htmlFor:"name",className:"s3-explr-label",children:"Tên thư mục"}),l.jsx(Ot,{disabled:b,id:"name",value:y,onChange:I=>w(I.target.value),placeholder:"Nhập tên thư mục",className:"s3-explr-input"})]}),l.jsxs(ie,{onClick:()=>{y.trim()&&Sx(y,f)},disabled:b,className:"s3-explr-create-btn",children:[b&&l.jsx(Ce,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),b?"Đang tạo...":"Tạo"]})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2 s3-explr-upload-group",children:[l.jsx(ie,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-upload-files-btn",onClick:()=>{const I=document.createElement("input");I.type="file",I.multiple=!0,I.onchange=R=>{const U=R.target.files;U&&bd(U,f,"files")},I.click()},disabled:F!==null||!!s&&!f,children:F==="files"?l.jsxs(l.Fragment,{children:[l.jsx(Ce,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}),"Đang tải lên..."]}):l.jsxs(l.Fragment,{children:[l.jsx(_d,{className:"h-4 w-4 s3-explr-upload-icon"}),"Tải lên tập tin"]})}),l.jsx(ie,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-upload-folder-btn",onClick:()=>{const I=document.createElement("input");I.type="file",I.multiple=!0,I.webkitdirectory=!0,I.onchange=R=>{const U=R.target.files;U&&bd(U,f,"folder")},I.click()},disabled:F!==null||!!s&&!f,children:F==="folder"?l.jsxs(l.Fragment,{children:[l.jsx(Ce,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}),"Đang tải lên..."]}):l.jsxs(l.Fragment,{children:[l.jsx(no,{className:"h-4 w-4 s3-explr-folder-icon"}),"Tải lên thư mục"]})}),z?l.jsx(Lu,{delayDuration:0,children:l.jsxs(Ru,{children:[l.jsx(Vu,{asChild:!0,children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(ie,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!0,children:[l.jsx(Ce,{className:"h-4 w-4 animate-spin s3-explr-loader"}),z.status?l.jsxs(l.Fragment,{children:["Đang thu thập (",z.status.completed,"/",z.status.total,") - ",Math.floor(Q/60),":",String(Q%60).padStart(2,"0")]}):"Đang thu thập..."]}),l.jsxs(ie,{variant:"destructive",size:"sm",onClick:()=>void Ox(),className:"flex items-center gap-2",children:[l.jsx("span",{className:"sr-only",children:"Dừng thu thập"}),l.jsx(Rd,{className:"h-4 w-4"})]})]})}),z.status&&l.jsx(Qs,{side:"right",sideOffset:5,children:l.jsxs("div",{className:"space-y-1 p-2",children:[l.jsxs("p",{className:"font-semibold",children:["Đang thu thập ",z.url]}),l.jsxs("p",{children:["Tiến độ: ",z.status.completed,"/",z.status.total," trang"]}),l.jsxs("p",{children:["Thời gian: ",Math.floor(Q/60),":",String(Q%60).padStart(2,"0")]}),l.jsxs("p",{children:["Trạng thái:"," ",z.status.status==="scraping"?"Đang thu thập":z.status.status==="completed"?"Hoàn thành":"Thất bại"]})]})})]})}):l.jsxs(Ut,{open:hn,onOpenChange:yt,children:[l.jsx(hr,{asChild:!0,children:l.jsxs(ie,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!!s&&!f,children:[l.jsx(kd,{className:"h-4 w-4 s3-explr-globe-icon"}),"Thêm website"]})}),l.jsxs(At,{className:"s3-explr-dialog-content",children:[l.jsxs(_t,{className:"s3-explr-dialog-header",children:[l.jsx(Ft,{className:"s3-explr-dialog-title",children:"Thêm website"}),l.jsx(mr,{className:"s3-explr-dialog-description",children:"Nhập URL website để thu thập và thêm vào S3."})]}),l.jsxs("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:[l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(jt,{htmlFor:"websiteUrl",className:"s3-explr-label",children:"URL Website"}),l.jsx(Ot,{id:"websiteUrl",value:wt,onChange:I=>je(I.target.value),placeholder:"https://example.com",type:"url",disabled:Rt,className:"s3-explr-input"})]}),l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(jt,{htmlFor:"crawlLimit",className:"s3-explr-label",children:"Giới hạn thu thập"}),l.jsx(Ot,{id:"crawlLimit",value:Lt,onChange:I=>{const R=I.target.value;/^\d*$/.test(R)&&mn(R)},placeholder:"1",type:"text",disabled:Rt,className:"s3-explr-input"}),l.jsx("p",{className:"text-sm text-gray-500",children:"Số lượng liên kết cần thu thập (mặc định: 1)"})]})]}),l.jsxs(Nn,{className:"s3-explr-dialog-footer",children:[l.jsx(ie,{variant:"outline",onClick:()=>{yt(!1),je(""),mn("1")},disabled:Rt,className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(ie,{onClick:()=>{wt.trim()&&Fx(wt.trim(),parseInt(Lt)||1)},disabled:Rt||!wt.trim(),className:"s3-explr-crawl-btn",children:Rt?l.jsxs(l.Fragment,{children:[l.jsx(Ce,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang thu thập..."]}):"Bắt đầu thu thập"})]})]})]})]}),l.jsx(Ut,{open:!!E,onOpenChange:I=>!I&&x(null),children:l.jsxs(At,{className:"s3-explr-dialog-content",children:[l.jsxs(_t,{className:"s3-explr-dialog-header",children:[l.jsx(Ft,{className:"s3-explr-dialog-title",children:"Xác nhận xóa"}),l.jsxs(mr,{className:"s3-explr-dialog-description",children:["Bạn có chắc chắn muốn xóa ",E==null?void 0:E.name,"? Hành động này không thể hoàn tác."]})]}),l.jsxs(Nn,{className:"s3-explr-dialog-footer",children:[l.jsx(ie,{variant:"outline",onClick:()=>x(null),className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(ie,{variant:"destructive",onClick:()=>Ex(E),disabled:A,className:"s3-explr-confirm-delete-btn",children:A?l.jsxs(l.Fragment,{children:[l.jsx(Ce,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa"})]})]})}),l.jsx(Ut,{open:!!M,onOpenChange:I=>{I||(q(null),X(""),Se(""),Me("rename"))},children:l.jsxs(At,{className:"s3-explr-dialog-content max-w-2xl",children:[l.jsx(_t,{className:"s3-explr-dialog-header",children:l.jsx(Ft,{className:"s3-explr-dialog-title",children:M!=null&&M.isFolder?"Đổi tên thư mục":jr(M)?"Quản lý tập tin":"Đổi tên tập tin"})}),M&&!M.isFolder&&jr(M)?l.jsxs(cv,{value:Qe,onValueChange:I=>Me(I),children:[l.jsxs(hc,{className:"grid w-full grid-cols-2",children:[l.jsx(ys,{value:"rename",children:"Đổi tên"}),l.jsx(ys,{value:"edit",children:"Sửa nội dung"})]}),l.jsx(ws,{value:"rename",children:l.jsx("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(jt,{htmlFor:"newName",className:"s3-explr-label",children:"Tên mới"}),l.jsx(Ot,{id:"newName",value:W,onChange:I=>X(I.target.value),placeholder:"Nhập tên mới",disabled:K,className:"s3-explr-input"})]})})}),l.jsx(ws,{value:"edit",children:l.jsx("div",{className:"space-y-4 py-4",children:Ue?l.jsx("div",{className:"flex items-center justify-center py-4",children:l.jsx(Ce,{className:"h-6 w-6 animate-spin"})}):l.jsxs("div",{className:"space-y-2",children:[l.jsx(jt,{htmlFor:"content",className:"s3-explr-label",children:"Nội dung tập tin"}),l.jsx(Sr,{id:"content",value:De,onChange:I=>Se(I.target.value),placeholder:"Nhập nội dung tập tin",className:"min-h-[200px] font-mono",disabled:we})]})})})]}):l.jsx("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(jt,{htmlFor:"newName",className:"s3-explr-label",children:"Tên mới"}),l.jsx(Ot,{id:"newName",value:W,onChange:I=>X(I.target.value),placeholder:"Nhập tên mới",disabled:K,className:"s3-explr-input"})]})}),l.jsxs(Nn,{className:"s3-explr-dialog-footer",children:[l.jsx(ie,{variant:"outline",onClick:()=>{q(null),X(""),Se("")},className:"s3-explr-cancel-btn",children:"Hủy"}),Qe==="edit"?l.jsx(ie,{onClick:()=>M&&_x(M,De),disabled:we||Ue,className:"s3-explr-save-btn",children:we?l.jsxs(l.Fragment,{children:[l.jsx(Ce,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang lưu..."]}):"Lưu thay đổi"}):l.jsx(ie,{onClick:()=>{W.trim()&&M&&Tx(M,W.trim())},disabled:K||!W.trim()||W.trim()===(M==null?void 0:M.name),className:"s3-explr-rename-btn",children:K?l.jsxs(l.Fragment,{children:[l.jsx(Ce,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang đổi tên..."]}):"Đổi tên"})]})]})})]})]}),zn&&l.jsx("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative s3-explr-error",children:"Đã xảy ra lỗi khi tải danh sách tập tin"}),l.jsx("div",{className:"rounded-md border s3-explr-table-container",children:l.jsxs(vr,{className:"s3-explr-table",children:[l.jsx(yr,{className:"s3-explr-table-header",children:gi.getHeaderGroups().map(I=>l.jsx(Xe,{className:"hover:bg-transparent s3-explr-header-row",children:I.headers.map(R=>l.jsx(nt,{className:"s3-explr-header-cell",children:R.isPlaceholder?null:qn(R.column.columnDef.header,R.getContext())},R.id))},I.id))}),l.jsx(wr,{className:"s3-explr-table-body",children:gi.getRowModel().rows.length===0?l.jsx(Xe,{className:"s3-explr-empty-row",children:l.jsx(Fe,{colSpan:Sd.length,className:"h-24 text-center s3-explr-empty-cell",children:i?l.jsxs("div",{className:"text-gray-500 s3-explr-no-results",children:['Không tìm thấy tập tin hoặc thư mục nào khớp với "',i,'"']}):l.jsx("div",{className:"text-gray-500 s3-explr-empty-message",children:Bn?"Đang tải nội dung thư mục... Vui lòng đợi":"Thư mục này không chứa tập tin hoặc thư mục con nào"})})}):gi.getRowModel().rows.map(I=>l.jsx(Xe,{className:"h-12 s3-explr-row",children:I.getVisibleCells().map(R=>l.jsx(Fe,{className:"align-middle s3-explr-cell",children:qn(R.column.columnDef.cell,R.getContext())},R.id))},I.id))})]})}),r&&o&&l.jsxs("div",{className:"flex justify-between items-center mt-4 s3-explr-selector-footer",children:[l.jsxs("div",{className:"text-sm text-gray-500 s3-explr-selection-count",children:[u.size," ",(u.size===1,"tập tin")," đã chọn"]}),l.jsx(ie,{variant:"default",onClick:()=>o(Px()),disabled:u.size===0,className:"s3-explr-ok-btn",children:"OK"})]}),!r&&l.jsx(Hc,{})]})});var kn=e=>e.type==="checkbox",Gt=e=>e instanceof Date,Ae=e=>e==null;const ed=e=>typeof e=="object";var pe=e=>!Ae(e)&&!Array.isArray(e)&&ed(e)&&!Gt(e),Qb=e=>pe(e)&&e.target?kn(e.target)?e.target.checked:e.target.value:e,ex=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,tx=(e,t)=>e.has(ex(t)),nx=e=>{const t=e.constructor&&e.constructor.prototype;return pe(t)&&t.hasOwnProperty("isPrototypeOf")},ti=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function He(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(ti&&(e instanceof Blob||r))&&(n||pe(e)))if(t=n?[]:{},!n&&!nx(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=He(e[o]));else return e;return t}var Wr=e=>Array.isArray(e)?e.filter(Boolean):[],fe=e=>e===void 0,j=(e,t,n)=>{if(!t||!pe(e))return n;const r=Wr(t.split(/[,[\].]+?/)).reduce((o,s)=>Ae(o)?o:o[s],e);return fe(r)||r===e?fe(e[t])?n:e[t]:r},it=e=>typeof e=="boolean",ni=e=>/^\w*$/.test(e),td=e=>Wr(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ue=(e,t,n)=>{let r=-1;const o=ni(t)?[t]:td(t),s=o.length,i=s-1;for(;++r<s;){const a=o[r];let u=n;if(r!==i){const c=e[a];u=pe(c)||Array.isArray(c)?c:isNaN(+o[r+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=u,e=e[a]}return e};const nd={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Ze={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},mt={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};D.createContext(null);var rx=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(o,s,{get:()=>{const i=s;return t._proxyFormState[i]!==Ze.all&&(t._proxyFormState[i]=!r||Ze.all),e[i]}});return o},Oe=e=>pe(e)&&!Object.keys(e).length,ox=(e,t,n,r)=>{n(e);const{name:o,...s}=e;return Oe(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(i=>t[i]===Ze.all)},Gr=e=>Array.isArray(e)?e:[e];function sx(e){const t=D.useRef(e);t.current=e,D.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}var at=e=>typeof e=="string",ix=(e,t,n,r,o)=>at(e)?(r&&t.watch.add(e),j(n,e,o)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),j(n,s))):(r&&(t.watchAll=!0),n),ax=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},rd=e=>({isOnSubmit:!e||e===Ze.onSubmit,isOnBlur:e===Ze.onBlur,isOnChange:e===Ze.onChange,isOnAll:e===Ze.all,isOnTouch:e===Ze.onTouched}),od=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const $n=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const s=j(e,o);if(s){const{_f:i,...a}=s;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],o)&&!r)return!0;if(i.ref&&t(i.ref,i.name)&&!r)return!0;if($n(a,t))break}else if(pe(a)&&$n(a,t))break}}};var lx=(e,t,n)=>{const r=Gr(j(e,n));return ue(r,"root",t[n]),ue(e,n,r),e},ri=e=>e.type==="file",lt=e=>typeof e=="function",qr=e=>{if(!ti)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Kr=e=>at(e),oi=e=>e.type==="radio",Xr=e=>e instanceof RegExp;const sd={value:!1,isValid:!1},id={value:!0,isValid:!0};var ad=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!fe(e[0].attributes.value)?fe(e[0].value)||e[0].value===""?id:{value:e[0].value,isValid:!0}:id:sd}return sd};const ld={isValid:!1,value:null};var cd=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,ld):ld;function ud(e,t,n="validate"){if(Kr(e)||Array.isArray(e)&&e.every(Kr)||it(e)&&!e)return{type:n,message:Kr(e)?e:"",ref:t}}var gn=e=>pe(e)&&!Xr(e)?e:{value:e,message:""},dd=async(e,t,n,r,o)=>{const{ref:s,refs:i,required:a,maxLength:u,minLength:c,min:f,max:g,pattern:m,validate:p,name:v,valueAsNumber:h,mount:y,disabled:w}=e._f,b=j(t,v);if(!y||w)return{};const S=i?i[0]:s,E=$=>{r&&S.reportValidity&&(S.setCustomValidity(it($)?"":$||""),S.reportValidity())},x={},P=oi(s),_=kn(s),O=P||_,k=(h||ri(s))&&fe(s.value)&&fe(b)||qr(s)&&s.value===""||b===""||Array.isArray(b)&&!b.length,F=ax.bind(null,v,n,x),G=($,L,M,q=mt.maxLength,W=mt.minLength)=>{const X=$?L:M;x[v]={type:$?q:W,message:X,ref:s,...F($?q:W,X)}};if(o?!Array.isArray(b)||!b.length:a&&(!O&&(k||Ae(b))||it(b)&&!b||_&&!ad(i).isValid||P&&!cd(i).isValid)){const{value:$,message:L}=Kr(a)?{value:!!a,message:a}:gn(a);if($&&(x[v]={type:mt.required,message:L,ref:S,...F(mt.required,L)},!n))return E(L),x}if(!k&&(!Ae(f)||!Ae(g))){let $,L;const M=gn(g),q=gn(f);if(!Ae(b)&&!isNaN(b)){const W=s.valueAsNumber||b&&+b;Ae(M.value)||($=W>M.value),Ae(q.value)||(L=W<q.value)}else{const W=s.valueAsDate||new Date(b),X=ae=>new Date(new Date().toDateString()+" "+ae),K=s.type=="time",ne=s.type=="week";at(M.value)&&b&&($=K?X(b)>X(M.value):ne?b>M.value:W>new Date(M.value)),at(q.value)&&b&&(L=K?X(b)<X(q.value):ne?b<q.value:W<new Date(q.value))}if(($||L)&&(G(!!$,M.message,q.message,mt.max,mt.min),!n))return E(x[v].message),x}if((u||c)&&!k&&(at(b)||o&&Array.isArray(b))){const $=gn(u),L=gn(c),M=!Ae($.value)&&b.length>+$.value,q=!Ae(L.value)&&b.length<+L.value;if((M||q)&&(G(M,$.message,L.message),!n))return E(x[v].message),x}if(m&&!k&&at(b)){const{value:$,message:L}=gn(m);if(Xr($)&&!b.match($)&&(x[v]={type:mt.pattern,message:L,ref:s,...F(mt.pattern,L)},!n))return E(L),x}if(p){if(lt(p)){const $=await p(b,t),L=ud($,S);if(L&&(x[v]={...L,...F(mt.validate,L.message)},!n))return E(L.message),x}else if(pe(p)){let $={};for(const L in p){if(!Oe($)&&!n)break;const M=ud(await p[L](b,t),S,L);M&&($={...M,...F(L,M.message)},E(M.message),n&&(x[v]=$))}if(!Oe($)&&(x[v]={ref:S,...$},!n))return x}}return E(!0),x};function cx(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=fe(e)?r++:e[t[r++]];return e}function ux(e){for(const t in e)if(e.hasOwnProperty(t)&&!fe(e[t]))return!1;return!0}function ye(e,t){const n=Array.isArray(t)?t:ni(t)?[t]:td(t),r=n.length===1?e:cx(e,n),o=n.length-1,s=n[o];return r&&delete r[s],o!==0&&(pe(r)&&Oe(r)||Array.isArray(r)&&ux(r))&&ye(e,n.slice(0,-1)),e}var si=()=>{let e=[];return{get observers(){return e},next:o=>{for(const s of e)s.next&&s.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(s=>s!==o)}}),unsubscribe:()=>{e=[]}}},ii=e=>Ae(e)||!ed(e);function $t(e,t){if(ii(e)||ii(t))return e===t;if(Gt(e)&&Gt(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const s=e[o];if(!r.includes(o))return!1;if(o!=="ref"){const i=t[o];if(Gt(s)&&Gt(i)||pe(s)&&pe(i)||Array.isArray(s)&&Array.isArray(i)?!$t(s,i):s!==i)return!1}}return!0}var fd=e=>e.type==="select-multiple",dx=e=>oi(e)||kn(e),ai=e=>qr(e)&&e.isConnected,pd=e=>{for(const t in e)if(lt(e[t]))return!0;return!1};function Yr(e,t={}){const n=Array.isArray(e);if(pe(e)||n)for(const r in e)Array.isArray(e[r])||pe(e[r])&&!pd(e[r])?(t[r]=Array.isArray(e[r])?[]:{},Yr(e[r],t[r])):Ae(e[r])||(t[r]=!0);return t}function gd(e,t,n){const r=Array.isArray(e);if(pe(e)||r)for(const o in e)Array.isArray(e[o])||pe(e[o])&&!pd(e[o])?fe(t)||ii(n[o])?n[o]=Array.isArray(e[o])?Yr(e[o],[]):{...Yr(e[o])}:gd(e[o],Ae(t)?{}:t[o],n[o]):n[o]=!$t(e[o],t[o]);return n}var In=(e,t)=>gd(e,t,Yr(t)),hd=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>fe(e)?e:t?e===""?NaN:e&&+e:n&&at(e)?new Date(e):r?r(e):e;function li(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return ri(t)?t.files:oi(t)?cd(e.refs).value:fd(t)?[...t.selectedOptions].map(({value:n})=>n):kn(t)?ad(e.refs).value:hd(fe(t.value)?e.ref.value:t.value,e)}var fx=(e,t,n,r)=>{const o={};for(const s of e){const i=j(t,s);i&&ue(o,s,i._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},Ln=e=>fe(e)?e:Xr(e)?e.source:pe(e)?Xr(e.value)?e.value.source:e.value:e;const md="AsyncFunction";var px=e=>!!e&&!!e.validate&&!!(lt(e.validate)&&e.validate.constructor.name===md||pe(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===md)),gx=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function vd(e,t,n){const r=j(e,n);if(r||ni(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const s=o.join("."),i=j(t,s),a=j(e,s);if(i&&!Array.isArray(i)&&n!==s)return{name:n};if(a&&a.type)return{name:s,error:a};o.pop()}return{name:n}}var hx=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,mx=(e,t)=>!Wr(j(e,t)).length&&ye(e,t);const vx={mode:Ze.onSubmit,reValidateMode:Ze.onChange,shouldFocusError:!0};function yx(e={}){let t={...vx,...e},n={submitCount:0,isDirty:!1,isLoading:lt(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},o=pe(t.defaultValues)||pe(t.values)?He(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:He(o),i={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},u,c=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},g={values:si(),array:si(),state:si()},m=rd(t.mode),p=rd(t.reValidateMode),v=t.criteriaMode===Ze.all,h=C=>N=>{clearTimeout(c),c=setTimeout(C,N)},y=async C=>{if(!t.disabled&&(f.isValid||C)){const N=t.resolver?Oe((await O()).errors):await F(r,!0);N!==n.isValid&&g.state.next({isValid:N})}},w=(C,N)=>{!t.disabled&&(f.isValidating||f.validatingFields)&&((C||Array.from(a.mount)).forEach(A=>{A&&(N?ue(n.validatingFields,A,N):ye(n.validatingFields,A))}),g.state.next({validatingFields:n.validatingFields,isValidating:!Oe(n.validatingFields)}))},b=(C,N=[],A,H,B=!0,V=!0)=>{if(H&&A&&!t.disabled){if(i.action=!0,V&&Array.isArray(j(r,C))){const z=A(j(r,C),H.argA,H.argB);B&&ue(r,C,z)}if(V&&Array.isArray(j(n.errors,C))){const z=A(j(n.errors,C),H.argA,H.argB);B&&ue(n.errors,C,z),mx(n.errors,C)}if(f.touchedFields&&V&&Array.isArray(j(n.touchedFields,C))){const z=A(j(n.touchedFields,C),H.argA,H.argB);B&&ue(n.touchedFields,C,z)}f.dirtyFields&&(n.dirtyFields=In(o,s)),g.state.next({name:C,isDirty:$(C,N),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else ue(s,C,N)},S=(C,N)=>{ue(n.errors,C,N),g.state.next({errors:n.errors})},E=C=>{n.errors=C,g.state.next({errors:n.errors,isValid:!1})},x=(C,N,A,H)=>{const B=j(r,C);if(B){const V=j(s,C,fe(A)?j(o,C):A);fe(V)||H&&H.defaultChecked||N?ue(s,C,N?V:li(B._f)):q(C,V),i.mount&&y()}},P=(C,N,A,H,B)=>{let V=!1,z=!1;const Q={name:C};if(!t.disabled){const ge=!!(j(r,C)&&j(r,C)._f&&j(r,C)._f.disabled);if(!A||H){f.isDirty&&(z=n.isDirty,n.isDirty=Q.isDirty=$(),V=z!==Q.isDirty);const me=ge||$t(j(o,C),N);z=!!(!ge&&j(n.dirtyFields,C)),me||ge?ye(n.dirtyFields,C):ue(n.dirtyFields,C,!0),Q.dirtyFields=n.dirtyFields,V=V||f.dirtyFields&&z!==!me}if(A){const me=j(n.touchedFields,C);me||(ue(n.touchedFields,C,A),Q.touchedFields=n.touchedFields,V=V||f.touchedFields&&me!==A)}V&&B&&g.state.next(Q)}return V?Q:{}},_=(C,N,A,H)=>{const B=j(n.errors,C),V=f.isValid&&it(N)&&n.isValid!==N;if(t.delayError&&A?(u=h(()=>S(C,A)),u(t.delayError)):(clearTimeout(c),u=null,A?ue(n.errors,C,A):ye(n.errors,C)),(A?!$t(B,A):B)||!Oe(H)||V){const z={...H,...V&&it(N)?{isValid:N}:{},errors:n.errors,name:C};n={...n,...z},g.state.next(z)}},O=async C=>{w(C,!0);const N=await t.resolver(s,t.context,fx(C||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return w(C),N},k=async C=>{const{errors:N}=await O(C);if(C)for(const A of C){const H=j(N,A);H?ue(n.errors,A,H):ye(n.errors,A)}else n.errors=N;return N},F=async(C,N,A={valid:!0})=>{for(const H in C){const B=C[H];if(B){const{_f:V,...z}=B;if(V){const Q=a.array.has(V.name),ge=B._f&&px(B._f);ge&&f.validatingFields&&w([H],!0);const me=await dd(B,s,v,t.shouldUseNativeValidation&&!N,Q);if(ge&&f.validatingFields&&w([H]),me[V.name]&&(A.valid=!1,N))break;!N&&(j(me,V.name)?Q?lx(n.errors,me,V.name):ue(n.errors,V.name,me[V.name]):ye(n.errors,V.name))}!Oe(z)&&await F(z,N,A)}}return A.valid},G=()=>{for(const C of a.unMount){const N=j(r,C);N&&(N._f.refs?N._f.refs.every(A=>!ai(A)):!ai(N._f.ref))&&we(C)}a.unMount=new Set},$=(C,N)=>!t.disabled&&(C&&N&&ue(s,C,N),!$t(de(),o)),L=(C,N,A)=>ix(C,a,{...i.mount?s:fe(N)?o:at(C)?{[C]:N}:N},A,N),M=C=>Wr(j(i.mount?s:o,C,t.shouldUnregister?j(o,C,[]):[])),q=(C,N,A={})=>{const H=j(r,C);let B=N;if(H){const V=H._f;V&&(!V.disabled&&ue(s,C,hd(N,V)),B=qr(V.ref)&&Ae(N)?"":N,fd(V.ref)?[...V.ref.options].forEach(z=>z.selected=B.includes(z.value)):V.refs?kn(V.ref)?V.refs.length>1?V.refs.forEach(z=>(!z.defaultChecked||!z.disabled)&&(z.checked=Array.isArray(B)?!!B.find(Q=>Q===z.value):B===z.value)):V.refs[0]&&(V.refs[0].checked=!!B):V.refs.forEach(z=>z.checked=z.value===B):ri(V.ref)?V.ref.value="":(V.ref.value=B,V.ref.type||g.values.next({name:C,values:{...s}})))}(A.shouldDirty||A.shouldTouch)&&P(C,B,A.shouldTouch,A.shouldDirty,!0),A.shouldValidate&&ae(C)},W=(C,N,A)=>{for(const H in N){const B=N[H],V=`${C}.${H}`,z=j(r,V);(a.array.has(C)||pe(B)||z&&!z._f)&&!Gt(B)?W(V,B,A):q(V,B,A)}},X=(C,N,A={})=>{const H=j(r,C),B=a.array.has(C),V=He(N);ue(s,C,V),B?(g.array.next({name:C,values:{...s}}),(f.isDirty||f.dirtyFields)&&A.shouldDirty&&g.state.next({name:C,dirtyFields:In(o,s),isDirty:$(C,V)})):H&&!H._f&&!Ae(V)?W(C,V,A):q(C,V,A),od(C,a)&&g.state.next({...n}),g.values.next({name:i.mount?C:void 0,values:{...s}})},K=async C=>{i.mount=!0;const N=C.target;let A=N.name,H=!0;const B=j(r,A),V=()=>N.type?li(B._f):Qb(C),z=Q=>{H=Number.isNaN(Q)||Gt(Q)&&isNaN(Q.getTime())||$t(Q,j(s,A,Q))};if(B){let Q,ge;const me=V(),be=C.type===nd.BLUR||C.type===nd.FOCUS_OUT,Bn=!gx(B._f)&&!t.resolver&&!j(n.errors,A)&&!B._f.deps||hx(be,j(n.touchedFields,A),n.isSubmitted,p,m),zn=od(A,a,be);ue(s,A,me),be?(B._f.onBlur&&B._f.onBlur(C),u&&u(0)):B._f.onChange&&B._f.onChange(C);const ke=P(A,me,be,!1),Jr=!Oe(ke)||zn;if(!be&&g.values.next({name:A,type:C.type,values:{...s}}),Bn)return f.isValid&&(t.mode==="onBlur"?be&&y():y()),Jr&&g.state.next({name:A,...zn?{}:ke});if(!be&&zn&&g.state.next({...n}),t.resolver){const{errors:ct}=await O([A]);if(z(me),H){const qt=vd(n.errors,r,A),Zr=vd(ct,r,qt.name||A);Q=Zr.error,A=Zr.name,ge=Oe(ct)}}else w([A],!0),Q=(await dd(B,s,v,t.shouldUseNativeValidation))[A],w([A]),z(me),H&&(Q?ge=!1:f.isValid&&(ge=await F(r,!0)));H&&(B._f.deps&&ae(B._f.deps),_(A,ge,Q,ke))}},ne=(C,N)=>{if(j(n.errors,N)&&C.focus)return C.focus(),1},ae=async(C,N={})=>{let A,H;const B=Gr(C);if(t.resolver){const V=await k(fe(C)?C:B);A=Oe(V),H=C?!B.some(z=>j(V,z)):A}else C?(H=(await Promise.all(B.map(async V=>{const z=j(r,V);return await F(z&&z._f?{[V]:z}:z)}))).every(Boolean),!(!H&&!n.isValid)&&y()):H=A=await F(r);return g.state.next({...!at(C)||f.isValid&&A!==n.isValid?{}:{name:C},...t.resolver||!C?{isValid:A}:{},errors:n.errors}),N.shouldFocus&&!H&&$n(r,ne,C?B:a.mount),H},de=C=>{const N={...i.mount?s:o};return fe(C)?N:at(C)?j(N,C):C.map(A=>j(N,A))},De=(C,N)=>({invalid:!!j((N||n).errors,C),isDirty:!!j((N||n).dirtyFields,C),error:j((N||n).errors,C),isValidating:!!j(n.validatingFields,C),isTouched:!!j((N||n).touchedFields,C)}),Se=C=>{C&&Gr(C).forEach(N=>ye(n.errors,N)),g.state.next({errors:C?n.errors:{}})},Ue=(C,N,A)=>{const H=(j(r,C,{_f:{}})._f||{}).ref,B=j(n.errors,C)||{},{ref:V,message:z,type:Q,...ge}=B;ue(n.errors,C,{...ge,...N,ref:H}),g.state.next({name:C,errors:n.errors,isValid:!1}),A&&A.shouldFocus&&H&&H.focus&&H.focus()},It=(C,N)=>lt(C)?g.values.subscribe({next:A=>C(L(void 0,N),A)}):L(C,N,!0),we=(C,N={})=>{for(const A of C?Gr(C):a.mount)a.mount.delete(A),a.array.delete(A),N.keepValue||(ye(r,A),ye(s,A)),!N.keepError&&ye(n.errors,A),!N.keepDirty&&ye(n.dirtyFields,A),!N.keepTouched&&ye(n.touchedFields,A),!N.keepIsValidating&&ye(n.validatingFields,A),!t.shouldUnregister&&!N.keepDefaultValue&&ye(o,A);g.values.next({values:{...s}}),g.state.next({...n,...N.keepDirty?{isDirty:$()}:{}}),!N.keepIsValid&&y()},Te=({disabled:C,name:N,field:A,fields:H,value:B})=>{if(it(C)&&i.mount||C){const V=C?void 0:fe(B)?li(A?A._f:j(H,N)._f):B;(C||!C&&!fe(V))&&ue(s,N,V),P(N,V,!1,!1,!0)}},Qe=(C,N={})=>{let A=j(r,C);const H=it(N.disabled)||it(t.disabled);return ue(r,C,{...A||{},_f:{...A&&A._f?A._f:{ref:{name:C}},name:C,mount:!0,...N}}),a.mount.add(C),A?Te({field:A,disabled:it(N.disabled)?N.disabled:t.disabled,name:C,value:N.value}):x(C,!0,N.value),{...H?{disabled:N.disabled||t.disabled}:{},...t.progressive?{required:!!N.required,min:Ln(N.min),max:Ln(N.max),minLength:Ln(N.minLength),maxLength:Ln(N.maxLength),pattern:Ln(N.pattern)}:{},name:C,onChange:K,onBlur:K,ref:B=>{if(B){Qe(C,N),A=j(r,C);const V=fe(B.value)&&B.querySelectorAll&&B.querySelectorAll("input,select,textarea")[0]||B,z=dx(V),Q=A._f.refs||[];if(z?Q.find(ge=>ge===V):V===A._f.ref)return;ue(r,C,{_f:{...A._f,...z?{refs:[...Q.filter(ai),V,...Array.isArray(j(o,C))?[{}]:[]],ref:{type:V.type,name:C}}:{ref:V}}}),x(C,!1,void 0,V)}else A=j(r,C,{}),A._f&&(A._f.mount=!1),(t.shouldUnregister||N.shouldUnregister)&&!(tx(a.array,C)&&i.action)&&a.unMount.add(C)}}},Me=()=>t.shouldFocusError&&$n(r,ne,a.mount),hn=C=>{it(C)&&(g.state.next({disabled:C}),$n(r,(N,A)=>{const H=j(r,A);H&&(N.disabled=H._f.disabled||C,Array.isArray(H._f.refs)&&H._f.refs.forEach(B=>{B.disabled=H._f.disabled||C}))},0,!1))},yt=(C,N)=>async A=>{let H;if(A&&(A.preventDefault&&A.preventDefault(),A.persist&&A.persist()),t.disabled){N&&await N({...n.errors},A);return}let B=He(s);if(g.state.next({isSubmitting:!0}),t.resolver){const{errors:V,values:z}=await O();n.errors=V,B=z}else await F(r);if(ye(n.errors,"root"),Oe(n.errors)){g.state.next({errors:{}});try{await C(B,A)}catch(V){H=V}}else N&&await N({...n.errors},A),Me(),setTimeout(Me);if(g.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Oe(n.errors)&&!H,submitCount:n.submitCount+1,errors:n.errors}),H)throw H},wt=(C,N={})=>{j(r,C)&&(fe(N.defaultValue)?X(C,He(j(o,C))):(X(C,N.defaultValue),ue(o,C,He(N.defaultValue))),N.keepTouched||ye(n.touchedFields,C),N.keepDirty||(ye(n.dirtyFields,C),n.isDirty=N.defaultValue?$(C,He(j(o,C))):$()),N.keepError||(ye(n.errors,C),f.isValid&&y()),g.state.next({...n}))},je=(C,N={})=>{const A=C?He(C):o,H=He(A),B=Oe(C),V=B?o:H;if(N.keepDefaultValues||(o=A),!N.keepValues){if(N.keepDirtyValues){const z=new Set([...a.mount,...Object.keys(In(o,s))]);for(const Q of Array.from(z))j(n.dirtyFields,Q)?ue(V,Q,j(s,Q)):X(Q,j(V,Q))}else{if(ti&&fe(C))for(const z of a.mount){const Q=j(r,z);if(Q&&Q._f){const ge=Array.isArray(Q._f.refs)?Q._f.refs[0]:Q._f.ref;if(qr(ge)){const me=ge.closest("form");if(me){me.reset();break}}}}r={}}s=t.shouldUnregister?N.keepDefaultValues?He(o):{}:He(V),g.array.next({values:{...V}}),g.values.next({values:{...V}})}a={mount:N.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!f.isValid||!!N.keepIsValid||!!N.keepDirtyValues,i.watch=!!t.shouldUnregister,g.state.next({submitCount:N.keepSubmitCount?n.submitCount:0,isDirty:B?!1:N.keepDirty?n.isDirty:!!(N.keepDefaultValues&&!$t(C,o)),isSubmitted:N.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:B?{}:N.keepDirtyValues?N.keepDefaultValues&&s?In(o,s):n.dirtyFields:N.keepDefaultValues&&C?In(o,C):N.keepDirty?n.dirtyFields:{},touchedFields:N.keepTouched?n.touchedFields:{},errors:N.keepErrors?n.errors:{},isSubmitSuccessful:N.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Lt=(C,N)=>je(lt(C)?C(s):C,N);return{control:{register:Qe,unregister:we,getFieldState:De,handleSubmit:yt,setError:Ue,_executeSchema:O,_getWatch:L,_getDirty:$,_updateValid:y,_removeUnmounted:G,_updateFieldArray:b,_updateDisabledField:Te,_getFieldArray:M,_reset:je,_resetDefaultValues:()=>lt(t.defaultValues)&&t.defaultValues().then(C=>{Lt(C,t.resetOptions),g.state.next({isLoading:!1})}),_updateFormState:C=>{n={...n,...C}},_disableForm:hn,_subjects:g,_proxyFormState:f,_setErrors:E,get _fields(){return r},get _formValues(){return s},get _state(){return i},set _state(C){i=C},get _defaultValues(){return o},get _names(){return a},set _names(C){a=C},get _formState(){return n},set _formState(C){n=C},get _options(){return t},set _options(C){t={...t,...C}}},trigger:ae,register:Qe,handleSubmit:yt,watch:It,setValue:X,getValues:de,reset:Lt,resetField:wt,clearErrors:Se,unregister:we,setError:Ue,setFocus:(C,N={})=>{const A=j(r,C),H=A&&A._f;if(H){const B=H.refs?H.refs[0]:H.ref;B.focus&&(B.focus(),N.shouldSelect&&lt(B.select)&&B.select())}},getFieldState:De}}function wx(e={}){const t=D.useRef(),n=D.useRef(),[r,o]=D.useState({isDirty:!1,isValidating:!1,isLoading:lt(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:lt(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...yx(e),formState:r});const s=t.current.control;return s._options=e,sx({subject:s._subjects.state,next:i=>{ox(i,s._proxyFormState,s._updateFormState)&&o({...s._formState})}}),D.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),D.useEffect(()=>{if(s._proxyFormState.isDirty){const i=s._getDirty();i!==r.isDirty&&s._subjects.state.next({isDirty:i})}},[s,r.isDirty]),D.useEffect(()=>{e.values&&!$t(e.values,n.current)?(s._reset(e.values,s._options.resetOptions),n.current=e.values,o(i=>({...i}))):s._resetDefaultValues()},[e.values,s]),D.useEffect(()=>{e.errors&&s._setErrors(e.errors)},[e.errors,s]),D.useEffect(()=>{s._state.mount||(s._updateValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),D.useEffect(()=>{e.shouldUnregister&&s._subjects.values.next({values:s._getWatch()})},[e.shouldUnregister,s]),D.useMemo(()=>({...t.current,formState:rx(r,s)}),[r,s])}const yd=({className:e,children:t,content:n,side:r})=>{const[o,s]=D.useState(!1);return l.jsx(Lu,{delayDuration:0,children:l.jsxs(Ru,{open:o,children:[l.jsx(Vu,{asChild:!0,children:l.jsx("button",{type:"button",className:Z("cursor-pointer",e),onClick:()=>s(!o),onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),onTouchStart:()=>s(!o),onKeyDown:i=>{i.preventDefault(),i.key==="Enter"&&s(!o)},children:t})}),l.jsx(Qs,{side:r,className:n?"":"hidden",children:l.jsx("span",{className:"inline-block",children:n})})]})})},ci=({className:e,...t})=>l.jsx("nav",{role:"navigation","aria-label":"pagination",className:Z("mx-auto flex w-full justify-center",e),...t});ci.displayName="Pagination";const ui=d.forwardRef(({className:e,...t},n)=>l.jsx("ul",{ref:n,className:Z("flex flex-row items-center gap-1",e),...t}));ui.displayName="PaginationContent";const vt=d.forwardRef(({className:e,...t},n)=>l.jsx("li",{ref:n,className:Z("",e),...t}));vt.displayName="PaginationItem";const Rn=({className:e,isActive:t,size:n="icon",...r})=>l.jsx("a",{"aria-current":t?"page":void 0,className:Z(ka({variant:t?"outline":"ghost",size:n}),e),...r});Rn.displayName="PaginationLink";const di=({className:e,...t})=>l.jsxs(Rn,{"aria-label":"Go to previous page",size:"default",className:Z("gap-1 pl-2.5",e),...t,children:[l.jsx(Yp,{className:"h-4 w-4"}),l.jsx("span",{children:"Previous"})]});di.displayName="PaginationPrevious";const fi=({className:e,...t})=>l.jsxs(Rn,{"aria-label":"Go to next page",size:"default",className:Z("gap-1 pr-2.5",e),...t,children:[l.jsx("span",{children:"Next"}),l.jsx(va,{className:"h-4 w-4"})]});fi.displayName="PaginationNext";const pi=({className:e,...t})=>l.jsxs("span",{"aria-hidden":!0,className:Z("flex h-9 w-9 items-center justify-center",e),...t,children:[l.jsx(Jp,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"More pages"})]});pi.displayName="PaginationEllipsis";const bx=(e,t)=>{const[n,r]=D.useState(e);return D.useEffect(()=>{const o=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(o)}},[e,t]),n},xx=({apiBaseUrl:e="http://localhost:3002"})=>{var P,_;const[t,n]=D.useState([]),[r,o]=D.useState(!1),[s,i]=D.useState([]),[a,u]=D.useState(1),[c,f]=D.useState(1),[g,m]=D.useState(null),[p,v]=D.useState(""),h=bx(p,500),y=O=>{const k=O.match(/\d{6}/);if(!k)return{month:"",year:""};const F=k[0],G=F.substring(0,2),$=F.substring(2);return{month:G,year:$}},w=O=>O.map(F=>{let G=(F==null?void 0:F.month)||"",$=(F==null?void 0:F.year)||"";if((!G||!$)&&(F!=null&&F.file_name)){const L=y(F.file_name);G=G||L.month,$=$||L.year}return{id:F==null?void 0:F.id,prefix:(F==null?void 0:F.prefix)||"",model:(F==null?void 0:F.model)||"",fileName:(F==null?void 0:F.file_name)||"",code:(F==null?void 0:F.stock_id)||"",month:G,year:$,content:(F==null?void 0:F.text_summary)||"",status:(F==null?void 0:F.status)||"",note:(F==null?void 0:F.note)||"",lastUpdate:F==null?void 0:F.updated_at,stock_id:F==null?void 0:F.stock_id}}),b=O=>{if(!(O!=null&&O.data))return[];const k=w(O==null?void 0:O.data);n(k),f(O.pagination.totalPages)},S=async(O=1,k=15)=>{m(O),o(!0);try{const F=await oe.get(`${e}/api/latest-summaries`,{params:{page:O,limit:k,search:p}});(F==null?void 0:F.status)===200?b(F.data):console.error(F)}catch(F){console.error("Error fetching data:",F)}finally{m(null),o(!1)}};D.useEffect(()=>{h&&u(1),S(a)},[a,h]);const E=D.useMemo(()=>[{id:"code",header:"Mã",accessorKey:"code",cell:({row:k})=>l.jsx("span",{className:"flex flex-col",children:k.original.code})},{id:"month",header:"Tháng",accessorKey:"month",cell:({row:k})=>{const F=k.original.month,G=k.original.year;return l.jsx("span",{className:"flex flex-col",children:`${F.toString().padStart(2,"0")}/${G}`})}},{id:"content",header:"Nội dung",accessorKey:"content",cell:({row:k})=>{const F=k.getValue("content");return l.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[30dvw]",children:F})}},{id:"status",header:"Trạng thái",accessorKey:"status",cell:({row:k})=>{const G=k.original.status!=="unpublish";return l.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0 text-[10px] font-bold ${G?"bg-green-50 text-green-700 ring-1 ring-inset ring-green-600/20":"bg-gray-50 text-gray-600 ring-1 ring-inset ring-gray-500/20"}`,children:G?"PUBLISHED":"UNPUBLISHED"})}},{id:"note",header:"Ghi chú",accessorKey:"note",cell:({row:k})=>l.jsx(yd,{content:l.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:k.original.note}),children:l.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[20dvw]",children:k.original.note})})},{id:"last-update",header:"Cập nhật",accessorKey:"last-update",cell:({row:k})=>{const F=new Date(k.original.lastUpdate),G=F.getDate(),$=F.getMonth()+1,L=`ngày ${G} tháng ${$}`;return l.jsx("span",{className:"flex flex-col",children:L})}},{accessorKey:"actions",header:()=>l.jsx("div",{className:"font-medium text-right",children:"Hành động"}),cell:({row:k})=>{const[F,G]=D.useState(!1),[$,L]=D.useState(!1),[M,q]=D.useState(!1),{handleSubmit:W,register:X,reset:K}=wx(),ne=k.original.id,ae=k.getValue("status"),de=k.getValue("content"),[De,Se]=D.useState(!1),Ue=async()=>{try{Se(!0);const we=ae==="unpublish"?"published":"unpublish",Te=await oe.patch(`${e}/api/toggle-publish/${ne}`,{id:ne,typeAction:"update",status:ae,idInput:ne,stock_id:k.original.stock_id,prefix:k.original.prefix,model:k.original.model,summary_result:k.original.content,note:k.original.note});Te.status===200?n(Qe=>Qe.map(Me=>Me.id===ne?{...Me,status:we}:Me)):console.error("Failed to toggle publish status:",Te)}catch(we){console.error("Error toggling publish status:",we)}finally{Se(!1)}},It=async we=>{G(!0);try{const Te=await oe.patch(`${e}/api/update-summary`,{note:we.note,text_summary:we.content,id:ne});Te.status===200?(await S(a),L(!1)):console.error("Failed to update summary:",Te)}catch(Te){console.error("Error updating summary:",Te)}return G(!1)};return l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsx(ie,{variant:"outline",size:"sm",onClick:()=>q(!0),className:"px-2 py-0.5 h-7",children:l.jsx(Zp,{className:"h-4 w-4"})}),l.jsx(Ut,{open:M,onOpenChange:q,children:l.jsxs(At,{className:"max-w-3xl max-h-[80vh]",children:[l.jsx(_t,{children:l.jsx(Ft,{children:"Nội dung chi tiết"})}),l.jsx("div",{className:"mt-4 overflow-y-auto max-h-[60vh]",children:l.jsx("div",{className:"whitespace-pre-wrap text-[16px] leading-relaxed",children:de})})]})}),l.jsxs(Ut,{open:$,onOpenChange:we=>{L(we),we?K({content:k.original.content,note:k.original.note}):K()},children:[l.jsx(hr,{asChild:!0,children:l.jsx(ie,{variant:"outline",size:"sm",onClick:()=>L(!0),className:"px-2 py-0.5 h-7",children:"Sửa"})}),l.jsx(At,{className:"rounded-lg sm:px-3 h-[calc(100dvh-200px)] min-w-[calc(100dvw-112px)]",children:l.jsxs(_t,{className:"flex flex-col gap-3",children:[l.jsx(Ft,{className:"max-sm:hidden text-center",children:"Sửa summary"}),l.jsxs("form",{className:"flex flex-col gap-3 h-full justify-between",onSubmit:W(It),children:[l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsxs("div",{className:"flex flex-col items-start",children:[l.jsx("span",{children:"Nội dung:"}),l.jsx(Sr,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:k.original.answer||"",rows:10,...X("content")})]}),l.jsxs("div",{className:"flex flex-col items-start",children:[l.jsx("span",{children:"Ghi chú:"}),l.jsx(Sr,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:k.original.note||"",rows:1,...X("note")})]})]}),l.jsx("div",{className:"flex justify-end",children:l.jsx(ie,{disabled:F,type:"submit",variant:"default",children:F?l.jsx(Ce,{className:"h-4 w-4 animate-spin"}):"Ok"})})]})]})})]}),l.jsx(ie,{variant:"outline",size:"sm",onClick:Ue,disabled:De,className:"w-[70px] px-2 py-0.5 h-7",children:De?l.jsx(Ce,{className:"h-4 w-4 animate-spin"}):ae==="unpublish"?"Publish":"Unpublish"})]})}}],[]),x=Oi({data:t,columns:E,state:{columnFilters:s},enableRowSelection:!0,onColumnFiltersChange:i,getFilteredRowModel:yf(),getCoreRowModel:Fi()});return l.jsxs("div",{className:"space-y-4 s3-explr-container",children:[l.jsx("div",{className:"flex items-center space-x-4 s3-explr-toolbar",children:l.jsxs("div",{className:"relative max-w-sm",children:[l.jsx(Ot,{placeholder:"Tìm kiếm theo mã...",value:p,onChange:O=>v(O.target.value),className:"pr-8"}),p&&l.jsx(ie,{variant:"ghost",size:"sm",className:"absolute right-1 top-1/2 -translate-y-1/2 h-6 w-6 p-0",onClick:()=>v(""),children:l.jsx(ko,{className:"h-4 w-4"})})]})}),l.jsx("div",{className:"rounded-md border s3-explr-table-container",children:l.jsxs(vr,{className:"s3-explr-table",children:[l.jsx(yr,{className:"s3-explr-table-header",children:x.getHeaderGroups().map(O=>l.jsx(Xe,{className:"hover:bg-transparent s3-explr-header-row",children:O.headers.map(k=>l.jsx(nt,{className:"s3-explr-header-cell",children:k.isPlaceholder?null:qn(k.column.columnDef.header,k.getContext())},k.id))},O.id))}),l.jsx(wr,{className:"s3-explr-table-body",children:r?l.jsx(Xe,{children:l.jsx(Fe,{colSpan:E.length,className:"h-24 text-center",children:"Đang tải dữ liệu..."})}):(P=x.getRowModel().rows)!=null&&P.length?(_=x.getRowModel().rows)==null?void 0:_.map(O=>l.jsx(Xe,{className:"h-12 s3-explr-row",children:O.getVisibleCells().map(k=>l.jsx(Fe,{className:"align-middle s3-explr-cell",children:qn(k.column.columnDef.cell,k.getContext())},k.id))},O.id)):l.jsx(Xe,{children:l.jsx(Fe,{colSpan:E.length,className:"h-24 text-center",children:"Không có kết quả."})})})]})}),l.jsx("div",{className:"mt-4",children:l.jsx(ci,{children:l.jsxs(ui,{children:[l.jsx(vt,{children:l.jsx(di,{onClick:()=>u(O=>Math.max(1,O-1)),className:a===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:c},(O,k)=>k+1).filter(O=>O===1||O===c||Math.abs(O-a)<=1).map((O,k,F)=>l.jsxs(l.Fragment,{children:[k>0&&F[k-1]!==O-1&&l.jsx(vt,{children:l.jsx(pi,{})},O+"..."),l.jsx(vt,{children:l.jsx(Rn,{onClick:()=>u(O),isActive:a===O,className:`cursor-pointer ${r?"pointer-events-none":""}`,children:g===O?l.jsx(Ce,{className:"h-4 w-4 animate-spin"}):O})},O)]})),l.jsx(vt,{children:l.jsx(fi,{onClick:()=>u(O=>Math.min(c,O+1)),className:a===c||g!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})})]})},wd=10,Cx=D.memo(({apiBaseUrl:e="http://localhost:3002"})=>{const[t,n]=D.useState(1),[r,o]=D.useState([]),[s,i]=D.useState({total:0,page:1,limit:wd,totalPages:1}),[a,u]=D.useState(!0),[c,f]=D.useState(null),[g,m]=D.useState(new Set),{toast:p}=Ds(),[v,h]=D.useState(!1),y=async x=>{try{f(x);const P=await oe.get(`${e}/api/jobs`,{params:{page:x.toString(),limit:wd.toString()}});o(P.data.data),i(P.data.pagination)}catch{p({variant:"destructive",title:"Error",description:"Failed to fetch jobs. Please try again."})}finally{f(null),u(!1)}};D.useEffect(()=>{y(t)},[t,e]);const w=async x=>{m(P=>new Set(P).add(x.toString()));try{await oe.post(`${e}/api/retry-job`,{jobId:x}),p({title:"Job Restarted",description:`Job ${x} has been successfully restarted.`}),y(t)}catch{p({variant:"destructive",title:"Retry Failed",description:`Failed to restart job ${x}. Please try again.`})}finally{m(P=>{const _=new Set(P);return _.delete(x.toString()),_})}},b=async()=>{h(!0),n(1),await y(1),h(!1)},S=x=>new Date(x).toLocaleString(),E=x=>{if(x=parseFloat(x),x<60)return`${x.toFixed(2)}s`;const P=Math.floor(x/60),_=(x%60).toFixed(0);return`${P}m ${_}s`};return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[l.jsx(Kp,{className:"w-8 h-8 text-primary"}),l.jsx("h2",{className:"text-3xl font-bold tracking-tight",children:"Job Management"}),l.jsx(ie,{variant:"outline",size:"icon",onClick:b,disabled:v||a,className:"ml-2",children:l.jsx(Qp,{className:`h-4 w-4 ${v?"animate-spin":""}`})})]}),l.jsx("div",{className:"rounded-md border",children:l.jsxs(vr,{children:[l.jsx(yr,{children:l.jsxs(Xe,{children:[l.jsx(nt,{children:"ID"}),l.jsx(nt,{children:"Tên Công Việc"}),l.jsx(nt,{children:"Thời Gian Bắt Đầu"}),l.jsx(nt,{children:"Thời Gian Cập Nhật"}),l.jsx(nt,{children:"Thời Gian Thực Thi"}),l.jsx(nt,{children:"Trạng Thái"}),l.jsx(nt,{children:"Thao Tác"})]})}),l.jsx(wr,{children:a&&r.length===0?l.jsx(Xe,{children:l.jsx(Fe,{colSpan:7,className:"text-center py-4",children:l.jsx(Ce,{className:"w-6 h-6 animate-spin mx-auto"})})}):r.map(x=>{var P,_;return l.jsxs(Xe,{children:[l.jsx(Fe,{className:"!w-[100px]",children:x.id}),l.jsx(Fe,{className:"font-medium",children:(P=x.job_name)==null?void 0:P.replace("Upload file","Summary")}),l.jsx(Fe,{className:"!w-[200px]",children:S(x.created_at)}),l.jsx(Fe,{className:"!w-[200px]",children:S(x.updated_at)}),l.jsx(Fe,{className:"!w-[150px]",children:E(x.execution_time_seconds)}),l.jsx(Fe,{className:"!w-[200px]",children:l.jsx(yd,{content:x.status==="fail"&&x.error?l.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:x.error}):null,children:l.jsx("div",{className:`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[30dvw]
137
+ ${x.status==="done"?"bg-green-100 text-green-800":x.status==="fail"?"bg-red-100 text-red-800":"bg-yellow-100 text-yellow-800"}`,children:x.status==="fail"?"FAILED":(_=x.status)==null?void 0:_.toUpperCase()})})}),l.jsx(Fe,{className:"!w-[200px]",children:x.status==="fail"?l.jsx(ie,{variant:"outline",size:"sm",onClick:()=>w(x.id),disabled:g.has(x.id.toString()),className:"h-[32px]",children:g.has(x.id.toString())?l.jsxs(l.Fragment,{children:[l.jsx(Ce,{className:"mr-2 h-4 w-4 animate-spin"}),"Đang thử lại..."]}):"Thử Lại"}):l.jsx("div",{className:"h-[32px]"})})]},x.id)})})]})}),l.jsx("div",{className:"mt-4",children:l.jsx(ci,{children:l.jsxs(ui,{children:[l.jsx(vt,{children:l.jsx(di,{onClick:()=>n(x=>Math.max(1,x-1)),className:t===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:s.totalPages},(x,P)=>P+1).filter(x=>x===1||x===s.totalPages||Math.abs(x-t)<=1).map((x,P,_)=>l.jsxs(l.Fragment,{children:[P>0&&_[P-1]!==x-1&&l.jsx(vt,{children:l.jsx(pi,{})},x+"..."),l.jsx(vt,{children:l.jsx(Rn,{onClick:()=>n(x),isActive:t===x,className:`cursor-pointer ${c!==null?"pointer-events-none":""}`,children:c===x?l.jsx(Ce,{className:"h-4 w-4 animate-spin"}):x})},x)]})),l.jsx(vt,{children:l.jsx(fi,{onClick:()=>n(x=>Math.min(s.totalPages,x+1)),className:t===s.totalPages||c!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})}),l.jsx(Hc,{})]})});We.Job=Cx,We.S3Explorer=Zb,We.Summary=xx,Object.defineProperty(We,Symbol.toStringTag,{value:"Module"})});
138
138
  //# sourceMappingURL=s3-explorer.umd.cjs.map