dccxx-s3-explorer 1.0.31 → 1.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/s3-explorer.js +4157 -4010
- package/dist/s3-explorer.js.map +1 -1
- package/dist/s3-explorer.umd.cjs +41 -36
- package/dist/s3-explorer.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/s3-explorer.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(qe,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):(qe=typeof globalThis<"u"?globalThis:qe||self,l(qe.S3Explorer={},qe.jsxRuntime,qe.React,qe.ReactDOM))})(this,function(qe,l,P,bo){"use strict";function Ai(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=Ai(P),er=Ai(bo);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:"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 _i=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:"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 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:"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 Bd=d.forwardRef(Vd);function Hd({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 zd=d.forwardRef(Hd);function Ud({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 xo=d.forwardRef(Ud);function jd({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 Wd=d.forwardRef(jd);function Gd({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 qd=d.forwardRef(Gd);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 Xd=d.forwardRef(Kd);function Jd({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 Fi=d.forwardRef(Jd);/**
|
|
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
|
|
10
|
+
*/function Tt(e,t){return typeof e=="function"?e(t):e}function $e(e,t){return n=>{t.setState(r=>({...r,[e]:Tt(n,r[e])}))}}function tr(e){return e instanceof Function}function Yd(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 Q(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 Kd(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:Z(()=>[e,n,t,s],(i,a,u,c)=>({table:i,column:a,row:u,cell:c,getValue:c.getValue,renderValue:c.renderValue}),Q(e.options,"debugCells","cell.getContext"))};return e._features.forEach(i=>{i.createCell==null||i.createCell(s,n,t,e)},{}),s}function Xd(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 g=m;for(const h of u.split(".")){var v;g=(v=g)==null?void 0:v[h],process.env.NODE_ENV!=="production"&&g===void 0&&console.warn(`"${h}" in deeply nested key "${u}" returned undefined.`)}return g}: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 p={id:`${String(c)}`,accessorFn:f,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:Z(()=>[!0],()=>{var m;return[p,...(m=p.columns)==null?void 0:m.flatMap(g=>g.getFlatColumns())]},Q(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:Z(()=>[e._getOrderColumnsFn()],m=>{var g;if((g=p.columns)!=null&&g.length){let v=p.columns.flatMap(h=>h.getLeafColumns());return m(v)}return[p]},Q(e.options,"debugColumns","column.getLeafColumns"))};for(const m of e._features)m.createColumn==null||m.createColumn(p,e);return p}const Ne="debugHeaders";function Pi(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=Z(()=>[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(p=>n.find(m=>m.id===p)).filter(Boolean))!=null?s:[],u=(i=o==null?void 0:o.map(p=>n.find(m=>m.id===p)).filter(Boolean))!=null?i:[],c=n.filter(p=>!(r!=null&&r.includes(p.id))&&!(o!=null&&o.includes(p.id)));return Qn(t,[...a,...c,...u],e)},Q(e.options,Ne,"getHeaderGroups")),e.getCenterHeaderGroups=Z(()=>[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))),Qn(t,n,e,"center")),Q(e.options,Ne,"getCenterHeaderGroups")),e.getLeftHeaderGroups=Z(()=>[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 Qn(t,s,e,"left")},Q(e.options,Ne,"getLeftHeaderGroups")),e.getRightHeaderGroups=Z(()=>[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 Qn(t,s,e,"right")},Q(e.options,Ne,"getRightHeaderGroups")),e.getFooterGroups=Z(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Q(e.options,Ne,"getFooterGroups")),e.getLeftFooterGroups=Z(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Q(e.options,Ne,"getLeftFooterGroups")),e.getCenterFooterGroups=Z(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Q(e.options,Ne,"getCenterFooterGroups")),e.getRightFooterGroups=Z(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Q(e.options,Ne,"getRightFooterGroups")),e.getFlatHeaders=Z(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Q(e.options,Ne,"getFlatHeaders")),e.getLeftFlatHeaders=Z(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Q(e.options,Ne,"getLeftFlatHeaders")),e.getCenterFlatHeaders=Z(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Q(e.options,Ne,"getCenterFlatHeaders")),e.getRightFlatHeaders=Z(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Q(e.options,Ne,"getRightFlatHeaders")),e.getCenterLeafHeaders=Z(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Q(e.options,Ne,"getCenterLeafHeaders")),e.getLeftLeafHeaders=Z(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Q(e.options,Ne,"getLeftLeafHeaders")),e.getRightLeafHeaders=Z(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Q(e.options,Ne,"getRightLeafHeaders")),e.getLeafHeaders=Z(()=>[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()},Q(e.options,Ne,"getLeafHeaders"))}};function Qn(e,t,n,r){var o,s;let i=0;const a=function(m,g){g===void 0&&(g=1),i=Math.max(i,g),m.filter(v=>v.getIsVisible()).forEach(v=>{var h;(h=v.columns)!=null&&h.length&&a(v.columns,g+1)},0)};a(e);let u=[];const c=(m,g)=>{const v={depth:g,id:[r,`${g}`].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=Pi(n,S,{id:[r,g,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:g,index:h.length});x.subHeaders.push(y),h.push(x)}v.headers.push(y),y.headerGroup=v}),u.push(v),g>0&&c(h,g-1)},f=t.map((m,g)=>Pi(n,m,{depth:i,index:g}));c(f,i-1),u.reverse();const p=m=>m.filter(v=>v.column.getIsVisible()).map(v=>{let h=0,y=0,w=[0];v.subHeaders&&v.subHeaders.length?(w=[],p(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 p((o=(s=u[0])==null?void 0:s.headers)!=null?o:[]),u}const po=(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:()=>qd(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:Z(()=>[e.getAllLeafColumns()],u=>u.map(c=>Kd(e,a,c,c.id)),Q(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:Z(()=>[a.getAllCells()],u=>u.reduce((c,f)=>(c[f.column.id]=f,c),{}),Q(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},Yd={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()}}},Ai=(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))};Ai.autoRemove=e=>qe(e);const _i=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};_i.autoRemove=e=>qe(e);const Fi=(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())};Fi.autoRemove=e=>qe(e);const Oi=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};Oi.autoRemove=e=>qe(e)||!(e!=null&&e.length);const Di=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});Di.autoRemove=e=>qe(e)||!(e!=null&&e.length);const Mi=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});Mi.autoRemove=e=>qe(e)||!(e!=null&&e.length);const Ii=(e,t,n)=>e.getValue(t)===n;Ii.autoRemove=e=>qe(e);const ki=(e,t,n)=>e.getValue(t)==n;ki.autoRemove=e=>qe(e);const go=(e,t,n)=>{let[r,o]=n;const s=e.getValue(t);return s>=r&&s<=o};go.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]},go.autoRemove=e=>qe(e)||qe(e[0])&&qe(e[1]);const ht={includesString:Ai,includesStringSensitive:_i,equalsString:Fi,arrIncludes:Oi,arrIncludesAll:Di,arrIncludesSome:Mi,equals:Ii,weakEquals:ki,inNumberRange:go};function qe(e){return e==null||e===""}const Zd={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"?ht.includesString:typeof r=="number"?ht.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?ht.equals:Array.isArray(r)?ht.arrIncludes:ht.weakEquals},e.getFilterFn=()=>{var n,r;return Zn(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:ht[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=Pt(n,s?s.value:void 0);if($i(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=Pt(t,o))==null?void 0:s.filter(i=>{const a=n.find(u=>u.id===i.id);if(a){const u=a.getFilterFn();if($i(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 $i(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const ho={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(!Gd(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 ho.sum;if(Object.prototype.toString.call(r)==="[object Date]")return ho.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Zn(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:ho[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 ef(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 tf={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:$e("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Z(n=>[Nn(t,n)],n=>n.findIndex(r=>r.id===e.id),Q(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return((r=Nn(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=Nn(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=Z(()=>[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 ef(s,n,r)},Q(e.options,"debugTable","_getOrderColumnsFn"))}},mo=()=>({left:[],right:[]}),nf={getInitialState:e=>({columnPinning:mo(),...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(p=>!(r!=null&&r.includes(p))),right:[...((u=o==null?void 0:o.right)!=null?u:[]).filter(p=>!(r!=null&&r.includes(p))),...r]}}if(n==="left"){var c,f;return{left:[...((c=o==null?void 0:o.left)!=null?c:[]).filter(p=>!(r!=null&&r.includes(p))),...r],right:((f=o==null?void 0:o.right)!=null?f:[]).filter(p=>!(r!=null&&r.includes(p)))}}return{left:((s=o==null?void 0:o.left)!=null?s:[]).filter(p=>!(r!=null&&r.includes(p))),right:((i=o==null?void 0:o.right)!=null?i:[]).filter(p=>!(r!=null&&r.includes(p)))}})},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=Z(()=>[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))},Q(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=Z(()=>[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"})),Q(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=Z(()=>[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"})),Q(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?mo():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:mo())},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=Z(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),Q(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=Z(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),Q(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=Z(()=>[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))},Q(e.options,"debugColumns","getCenterLeafColumns"))}},er={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},vo=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),rf={getDefaultColumnDef:()=>er,getInitialState:e=>({columnSizing:{},columnSizingInfo:vo(),...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:er.minSize,(r=s??e.columnDef.size)!=null?r:er.size),(o=e.columnDef.maxSize)!=null?o:er.maxSize)},e.getStart=Z(n=>[n,Nn(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,s)=>o+s.getSize(),0),Q(t.options,"debugColumns","getStart")),e.getAfter=Z(n=>[n,Nn(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,s)=>o+s.getSize(),0),Q(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(),yo(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=yo(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,F=(b-((E=S==null?void 0:S.startOffset)!=null?E:0))*P,O=Math.max(F/((x=S==null?void 0:S.startSize)!=null?x:0),-.999999);return S.columnSizingStart.forEach(I=>{let[D,q]=I;c[D]=Math.round(Math.max(q+q*O,0)*100)/100}),{...S,deltaOffset:F,deltaPercentage:O}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(S=>({...S,...c})))},p=w=>f("move",w),m=w=>{f("end",w),t.setColumnSizingInfo(b=>({...b,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},g=n||typeof document<"u"?document:null,v={moveHandler:w=>p(w.clientX),upHandler:w=>{g==null||g.removeEventListener("mousemove",v.moveHandler),g==null||g.removeEventListener("mouseup",v.upHandler),m(w.clientX)}},h={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),p(w.touches[0].clientX),!1),upHandler:w=>{var b;g==null||g.removeEventListener("touchmove",h.moveHandler),g==null||g.removeEventListener("touchend",h.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),m((b=w.touches[0])==null?void 0:b.clientX)}},y=of()?{passive:!1}:!1;yo(s)?(g==null||g.addEventListener("touchmove",h.moveHandler,y),g==null||g.addEventListener("touchend",h.upHandler,y)):(g==null||g.addEventListener("mousemove",v.moveHandler,y),g==null||g.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?vo():(n=e.initialState.columnSizingInfo)!=null?n:vo())},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 tr=null;function of(){if(typeof tr=="boolean")return tr;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 tr=e,tr}function yo(e){return e.type==="touchstart"}const sf={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=Z(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Q(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=Z(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],Q(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,r)=>Z(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),Q(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 Nn(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const af={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()}}},lf={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=()=>ht.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Zn(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:ht[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},cf={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()}}}},wo=0,bo=10,xo=()=>({pageIndex:wo,pageSize:bo}),uf={getInitialState:e=>({...e,pagination:{...xo(),...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=>Pt(r,s);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?xo():(o=e.initialState.pagination)!=null?o:xo())},e.setPageIndex=r=>{e.setPagination(o=>{let s=Pt(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?wo:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?o:wo)},e.resetPageSize=r=>{var o,s;e.setPageSize(r?bo:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?o:bo)},e.setPageSize=r=>{e.setPagination(o=>{const s=Math.max(1,Pt(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=Pt(r,(s=e.options.pageCount)!=null?s:-1);return typeof i=="number"&&(i=Math.max(-1,i)),{...o,pageCount:i}}),e.getPageOptions=Z(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((s,i)=>i)),o},Q(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}}},Co=()=>({top:[],bottom:[]}),df={getInitialState:e=>({rowPinning:Co(),...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 p,m;return{top:((p=u==null?void 0:u.top)!=null?p:[]).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 g,v;return{top:[...((g=u==null?void 0:u.top)!=null?g:[]).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?Co():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Co())},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=Z(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Q(e.options,"debugRows","getTopRows")),e.getBottomRows=Z(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Q(e.options,"debugRows","getBottomRows")),e.getCenterRows=Z(()=>[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))},Q(e.options,"debugRows","getCenterRows"))}},ff={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=>{So(o,s.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Z(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Eo(e,n):{rows:[],flatRows:[],rowsById:{}},Q(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=Z(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Eo(e,n):{rows:[],flatRows:[],rowsById:{}},Q(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=Z(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Eo(e,n):{rows:[],flatRows:[],rowsById:{}},Q(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 So(a,e.id,n,(i=r==null?void 0:r.selectChildren)!=null?i:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return No(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return To(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return To(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)}}}},So=(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=>So(e,a.id,n,r,o))};function Eo(e,t){const n=e.getState().rowSelection,r=[],o={},s=function(i,a){return i.map(u=>{var c;const f=No(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 No(e,t){var n;return(n=t[e.id])!=null?n:!1}function To(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()&&(No(i,t)?s=!0:o=!1),i.subRows&&i.subRows.length)){const a=To(i,t);a==="all"?s=!0:(a==="some"&&(s=!0),o=!1)}}),o?"all":s?"some":!1}const Po=/([0-9]+)/gm,pf=(e,t,n)=>Li(At(e.getValue(n)).toLowerCase(),At(t.getValue(n)).toLowerCase()),gf=(e,t,n)=>Li(At(e.getValue(n)),At(t.getValue(n))),hf=(e,t,n)=>Ao(At(e.getValue(n)).toLowerCase(),At(t.getValue(n)).toLowerCase()),mf=(e,t,n)=>Ao(At(e.getValue(n)),At(t.getValue(n))),vf=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},yf=(e,t,n)=>Ao(e.getValue(n),t.getValue(n));function Ao(e,t){return e===t?0:e>t?1:-1}function At(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Li(e,t){const n=e.split(Po).filter(Boolean),r=t.split(Po).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 Tn={alphanumeric:pf,alphanumericCaseSensitive:gf,text:hf,textCaseSensitive:mf,datetime:vf,basic:yf},wf=[Jd,sf,tf,nf,Yd,Zd,af,lf,{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 Tn.datetime;if(typeof s=="string"&&(r=!0,s.split(Po).length>1))return Tn.alphanumeric}return r?Tn.text:Tn.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 Zn(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:Tn[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(g=>g.id===e.id),u=i==null?void 0:i.findIndex(g=>g.id===e.id);let c=[],f,p=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:p}],c.splice(0,c.length-((m=t.options.maxMultiSortColCount)!=null?m:Number.MAX_SAFE_INTEGER))}else f==="toggle"?c=i.map(g=>g.id===e.id?{...g,desc:p}:g):f==="remove"?c=i.filter(g=>g.id!==e.id):c=[{id:e.id,desc:p}];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,cf,uf,df,ff,rf];function bf(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const r=[...wf,...(t=e._features)!=null?t:[]];let o={_features:r};const s=o._features.reduce((m,g)=>Object.assign(m,g.getDefaultOptions==null?void 0:g.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 g;u=(g=m.getInitialState==null?void 0:m.getInitialState(u))!=null?g:u});const c=[];let f=!1;const p={_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(g=>setTimeout(()=>{throw g})))},reset:()=>{o.setState(o.initialState)},setOptions:m=>{const g=Pt(m,o.options);o.options=i(g)},getState:()=>o.options.state,setState:m=>{o.options.onStateChange==null||o.options.onStateChange(m)},_getRowId:(m,g,v)=>{var h;return(h=o.options.getRowId==null?void 0:o.options.getRowId(m,g,v))!=null?h:`${v?[v.id,g].join("."):g}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(m,g)=>{let v=(g?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:Z(()=>[o.options.defaultColumn],m=>{var g;return m=(g=m)!=null?g:{},{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}},Q(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>o.options.columns,getAllColumns:Z(()=>[o._getColumnDefs()],m=>{const g=function(v,h,y){return y===void 0&&(y=0),v.map(w=>{const b=Xd(o,w,y,h),S=w;return b.columns=S.columns?g(S.columns,b,y+1):[],b})};return g(m)},Q(e,"debugColumns","getAllColumns")),getAllFlatColumns:Z(()=>[o.getAllColumns()],m=>m.flatMap(g=>g.getFlatColumns()),Q(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:Z(()=>[o.getAllFlatColumns()],m=>m.reduce((g,v)=>(g[v.id]=v,g),{}),Q(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:Z(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(m,g)=>{let v=m.flatMap(h=>h.getLeafColumns());return g(v)},Q(e,"debugColumns","getAllLeafColumns")),getColumn:m=>{const g=o._getAllFlatColumnsById()[m];return process.env.NODE_ENV!=="production"&&!g&&console.error(`[Table] Column with id '${m}' does not exist.`),g}};Object.assign(o,p);for(let m=0;m<o._features.length;m++){const g=o._features[m];g==null||g.createTable==null||g.createTable(o)}return o}function Ri(){return e=>Z(()=>[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=po(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},Q(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function xf(e,t,n){return n.options.filterFromLeafRows?Cf(e,t,n):Sf(e,t,n)}function Cf(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 p;let g=u[m];const v=po(n,g.id,g.original,g.index,g.depth,void 0,g.parentId);if(v.columnFilters=g.columnFilters,(p=g.subRows)!=null&&p.length&&c<i){if(v.subRows=a(g.subRows,c+1),g=v,t(g)&&!v.subRows.length){f.push(g),s[g.id]=g,o.push(g);continue}if(t(g)||v.subRows.length){f.push(g),s[g.id]=g,o.push(g);continue}}else g=v,t(g)&&(f.push(g),s[g.id]=g,o.push(g))}return f};return{rows:a(e),flatRows:o,rowsById:s}}function Sf(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 g=u[m];if(t(g)){var p;if((p=g.subRows)!=null&&p.length&&c<i){const h=po(n,g.id,g.original,g.index,g.depth,void 0,g.parentId);h.subRows=a(g.subRows,c+1),g=h}f.push(g),o.push(g),s[g.id]=g}}return f};return{rows:a(e),flatRows:o,rowsById:s}}function Ef(){return e=>Z(()=>[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 g;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:(g=h.resolveFilterValue==null?void 0:h.resolveFilterValue(m.value))!=null?g: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 g;s.push({id:m.id,filterFn:a,resolvedValue:(g=a.resolveFilterValue==null?void 0:a.resolveFilterValue(r))!=null?g:r})}));let c,f;for(let m=0;m<t.flatRows.length;m++){const g=t.flatRows[m];if(g.columnFilters={},o.length)for(let v=0;v<o.length;v++){c=o[v];const h=c.id;g.columnFilters[h]=c.filterFn(g,h,c.resolvedValue,y=>{g.columnFiltersMeta[h]=y})}if(s.length){for(let v=0;v<s.length;v++){f=s[v];const h=f.id;if(f.filterFn(g,h,f.resolvedValue,y=>{g.columnFiltersMeta[h]=y})){g.columnFilters.__global__=!0;break}}g.columnFilters.__global__!==!0&&(g.columnFilters.__global__=!1)}}const p=m=>{for(let g=0;g<i.length;g++)if(m.columnFilters[i[g]]===!1)return!1;return!0};return xf(t.rows,p,e)},Q(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 Z(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 Qd(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}),Z(e.options,"debugCells","cell.getContext"))};return e._features.forEach(i=>{i.createCell==null||i.createCell(s,n,t,e)},{}),s}function ef(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())]},Z(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]},Z(e.options,"debugColumns","column.getLeafColumns"))};for(const m of e._features)m.createColumn==null||m.createColumn(g,e);return g}const Te="debugHeaders";function Oi(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 tf={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 nr(t,[...a,...c,...u],e)},Z(e.options,Te,"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))),nr(t,n,e,"center")),Z(e.options,Te,"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 nr(t,s,e,"left")},Z(e.options,Te,"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 nr(t,s,e,"right")},Z(e.options,Te,"getRightHeaderGroups")),e.getFooterGroups=Y(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Z(e.options,Te,"getFooterGroups")),e.getLeftFooterGroups=Y(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Z(e.options,Te,"getLeftFooterGroups")),e.getCenterFooterGroups=Y(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Z(e.options,Te,"getCenterFooterGroups")),e.getRightFooterGroups=Y(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Z(e.options,Te,"getRightFooterGroups")),e.getFlatHeaders=Y(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Z(e.options,Te,"getFlatHeaders")),e.getLeftFlatHeaders=Y(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Z(e.options,Te,"getLeftFlatHeaders")),e.getCenterFlatHeaders=Y(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Z(e.options,Te,"getCenterFlatHeaders")),e.getRightFlatHeaders=Y(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Z(e.options,Te,"getRightFlatHeaders")),e.getCenterLeafHeaders=Y(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Z(e.options,Te,"getCenterLeafHeaders")),e.getLeftLeafHeaders=Y(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Z(e.options,Te,"getLeftLeafHeaders")),e.getRightLeafHeaders=Y(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Z(e.options,Te,"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()},Z(e.options,Te,"getLeafHeaders"))}};function nr(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=Oi(n,S,{id:[r,p,S.id,y==null?void 0:y.id].filter(Boolean).join("_"),isPlaceholder:E,placeholderId:E?`${h.filter(A=>A.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)=>Oi(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 Co=(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=>Qd(e,a,c,c.id)),Z(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:Y(()=>[a.getAllCells()],u=>u.reduce((c,f)=>(c[f.column.id]=f,c),{}),Z(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},nf={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()}}},Di=(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))};Di.autoRemove=e=>Ke(e);const Mi=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};Mi.autoRemove=e=>Ke(e);const Ii=(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())};Ii.autoRemove=e=>Ke(e);const ki=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};ki.autoRemove=e=>Ke(e)||!(e!=null&&e.length);const $i=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});$i.autoRemove=e=>Ke(e)||!(e!=null&&e.length);const Li=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});Li.autoRemove=e=>Ke(e)||!(e!=null&&e.length);const Ri=(e,t,n)=>e.getValue(t)===n;Ri.autoRemove=e=>Ke(e);const Vi=(e,t,n)=>e.getValue(t)==n;Vi.autoRemove=e=>Ke(e);const So=(e,t,n)=>{let[r,o]=n;const s=e.getValue(t);return s>=r&&s<=o};So.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]},So.autoRemove=e=>Ke(e)||Ke(e[0])&&Ke(e[1]);const mt={includesString:Di,includesStringSensitive:Mi,equalsString:Ii,arrIncludes:ki,arrIncludesAll:$i,arrIncludesSome:Li,equals:Ri,weakEquals:Vi,inNumberRange:So};function Ke(e){return e==null||e===""}const rf={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"?mt.includesString:typeof r=="number"?mt.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?mt.equals:Array.isArray(r)?mt.arrIncludes:mt.weakEquals},e.getFilterFn=()=>{var n,r;return tr(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:mt[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=Tt(n,s?s.value:void 0);if(Bi(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=Tt(t,o))==null?void 0:s.filter(i=>{const a=n.find(u=>u.id===i.id);if(a){const u=a.getFilterFn();if(Bi(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 Bi(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const Eo={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(!Yd(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},of={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 Eo.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Eo.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return tr(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:Eo[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 sf(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 af={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:$e("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Y(n=>[Pn(t,n)],n=>n.findIndex(r=>r.id===e.id),Z(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return((r=Pn(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=Pn(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 sf(s,n,r)},Z(e.options,"debugTable","_getOrderColumnsFn"))}},No=()=>({left:[],right:[]}),lf={getInitialState:e=>({columnPinning:No(),...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))},Z(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"})),Z(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"})),Z(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),Z(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),Z(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))},Z(e.options,"debugColumns","getCenterLeafColumns"))}},rr={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},To=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),cf={getDefaultColumnDef:()=>rr,getInitialState:e=>({columnSizing:{},columnSizingInfo:To(),...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:rr.minSize,(r=s??e.columnDef.size)!=null?r:rr.size),(o=e.columnDef.maxSize)!=null?o:rr.maxSize)},e.getStart=Y(n=>[n,Pn(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,s)=>o+s.getSize(),0),Z(t.options,"debugColumns","getStart")),e.getAfter=Y(n=>[n,Pn(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,s)=>o+s.getSize(),0),Z(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(),Po(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=Po(s)?Math.round(s.touches[0].clientX):s.clientX,c={},f=(w,b)=>{typeof b=="number"&&(t.setColumnSizingInfo(S=>{var E,x;const A=t.options.columnResizeDirection==="rtl"?-1:1,F=(b-((E=S==null?void 0:S.startOffset)!=null?E:0))*A,O=Math.max(F/((x=S==null?void 0:S.startSize)!=null?x:0),-.999999);return S.columnSizingStart.forEach(k=>{let[M,q]=k;c[M]=Math.round(Math.max(q+q*O,0)*100)/100}),{...S,deltaOffset:F,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=uf()?{passive:!1}:!1;Po(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?To():(n=e.initialState.columnSizingInfo)!=null?n:To())},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 or=null;function uf(){if(typeof or=="boolean")return or;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 or=e,or}function Po(e){return e.type==="touchstart"}const df={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()),Z(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=Y(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],Z(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()),Z(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 Pn(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const ff={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()}}},pf={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=()=>mt.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return tr(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:mt[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},gf={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()}}}},Ao=0,_o=10,Fo=()=>({pageIndex:Ao,pageSize:_o}),hf={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=>Tt(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=Tt(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?Ao:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?o:Ao)},e.resetPageSize=r=>{var o,s;e.setPageSize(r?_o:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?o:_o)},e.setPageSize=r=>{e.setPagination(o=>{const s=Math.max(1,Tt(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=Tt(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},Z(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}}},Oo=()=>({top:[],bottom:[]}),mf={getInitialState:e=>({rowPinning:Oo(),...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?Oo():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Oo())},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"),Z(e.options,"debugRows","getTopRows")),e.getBottomRows=Y(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Z(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))},Z(e.options,"debugRows","getCenterRows"))}},vf={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=>{Do(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?Mo(e,n):{rows:[],flatRows:[],rowsById:{}},Z(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=Y(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Mo(e,n):{rows:[],flatRows:[],rowsById:{}},Z(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=Y(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Mo(e,n):{rows:[],flatRows:[],rowsById:{}},Z(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 Do(a,e.id,n,(i=r==null?void 0:r.selectChildren)!=null?i:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Io(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return ko(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return ko(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)}}}},Do=(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=>Do(e,a.id,n,r,o))};function Mo(e,t){const n=e.getState().rowSelection,r=[],o={},s=function(i,a){return i.map(u=>{var c;const f=Io(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 Io(e,t){var n;return(n=t[e.id])!=null?n:!1}function ko(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()&&(Io(i,t)?s=!0:o=!1),i.subRows&&i.subRows.length)){const a=ko(i,t);a==="all"?s=!0:(a==="some"&&(s=!0),o=!1)}}),o?"all":s?"some":!1}const $o=/([0-9]+)/gm,yf=(e,t,n)=>Hi(Pt(e.getValue(n)).toLowerCase(),Pt(t.getValue(n)).toLowerCase()),wf=(e,t,n)=>Hi(Pt(e.getValue(n)),Pt(t.getValue(n))),bf=(e,t,n)=>Lo(Pt(e.getValue(n)).toLowerCase(),Pt(t.getValue(n)).toLowerCase()),xf=(e,t,n)=>Lo(Pt(e.getValue(n)),Pt(t.getValue(n))),Cf=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},Sf=(e,t,n)=>Lo(e.getValue(n),t.getValue(n));function Lo(e,t){return e===t?0:e>t?1:-1}function Pt(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Hi(e,t){const n=e.split($o).filter(Boolean),r=t.split($o).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 An={alphanumeric:yf,alphanumericCaseSensitive:wf,text:bf,textCaseSensitive:xf,datetime:Cf,basic:Sf},Ef=[tf,df,af,lf,nf,rf,ff,pf,{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 An.datetime;if(typeof s=="string"&&(r=!0,s.split($o).length>1))return An.alphanumeric}return r?An.text:An.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 tr(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:An[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())}},of,gf,hf,mf,vf,cf];function Nf(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const r=[...Ef,...(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=Tt(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}},Z(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=ef(o,w,y,h),S=w;return b.columns=S.columns?p(S.columns,b,y+1):[],b})};return p(m)},Z(e,"debugColumns","getAllColumns")),getAllFlatColumns:Y(()=>[o.getAllColumns()],m=>m.flatMap(p=>p.getFlatColumns()),Z(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:Y(()=>[o.getAllFlatColumns()],m=>m.reduce((p,v)=>(p[v.id]=v,p),{}),Z(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:Y(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(m,p)=>{let v=m.flatMap(h=>h.getLeafColumns());return p(v)},Z(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 zi(){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=Co(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},Z(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Tf(e,t,n){return n.options.filterFromLeafRows?Pf(e,t,n):Af(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=Co(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 Af(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=Co(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 _f(){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 Tf(t.rows,g,e)},Z(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Ff(){return e=>Y(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,o=[],s=r.filter(u=>{var c;return(c=e.getColumn(u.id))==null?void 0:c.getCanSort()}),i={};s.forEach(u=>{const c=e.getColumn(u.id);c&&(i[u.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});const a=u=>{const c=u.map(f=>({...f}));return c.sort((f,g)=>{for(let p=0;p<s.length;p+=1){var m;const v=s[p],h=i[v.id],y=h.sortUndefined,w=(m=v==null?void 0:v.desc)!=null?m:!1;let b=0;if(y){const S=f.getValue(v.id),E=g.getValue(v.id),x=S===void 0,A=E===void 0;if(x||A){if(y==="first")return x?-1:1;if(y==="last")return x?1:-1;b=x&&A?0:x?y:-y}}if(b===0&&(b=h.sortingFn(f,g,v.id)),b!==0)return w&&(b*=-1),h.invertSorting&&(b*=-1),b}return f.index-g.index}),c.forEach(f=>{var g;o.push(f),(g=f.subRows)!=null&&g.length&&(f.subRows=a(f.subRows))}),c};return{rows:a(n.rows),flatRows:o,rowsById:n.rowsById}},Z(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
|
|
14
14
|
* react-table
|
|
15
15
|
*
|
|
16
16
|
* Copyright (c) TanStack
|
|
@@ -19,92 +19,97 @@
|
|
|
19
19
|
* LICENSE.md file in the root directory of this source tree.
|
|
20
20
|
*
|
|
21
21
|
* @license MIT
|
|
22
|
-
*/function nr(e,t){return e?Nf(e)?d.createElement(e,t):e:null}function Nf(e){return Tf(e)||typeof e=="function"||Pf(e)}function Tf(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Pf(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Vi(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=d.useState(()=>({current:bf(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 Bi(e,t){return function(){return e.apply(t,arguments)}}const{toString:Af}=Object.prototype,{getPrototypeOf:_o}=Object,rr=(e=>t=>{const n=Af.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Ke=e=>(e=e.toLowerCase(),t=>rr(t)===e),or=e=>t=>typeof t===e,{isArray:Yt}=Array,Pn=or("undefined");function _f(e){return e!==null&&!Pn(e)&&e.constructor!==null&&!Pn(e.constructor)&&Le(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const zi=Ke("ArrayBuffer");function Ff(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&zi(e.buffer),t}const Of=or("string"),Le=or("function"),Hi=or("number"),sr=e=>e!==null&&typeof e=="object",Df=e=>e===!0||e===!1,ir=e=>{if(rr(e)!=="object")return!1;const t=_o(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Mf=Ke("Date"),If=Ke("File"),kf=Ke("Blob"),$f=Ke("FileList"),Lf=e=>sr(e)&&Le(e.pipe),Rf=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Le(e.append)&&((t=rr(e))==="formdata"||t==="object"&&Le(e.toString)&&e.toString()==="[object FormData]"))},Vf=Ke("URLSearchParams"),[Bf,zf,Hf,Uf]=["ReadableStream","Request","Response","Headers"].map(Ke),jf=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function An(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),Yt(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 Ui(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 zt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ji=e=>!Pn(e)&&e!==zt;function Fo(){const{caseless:e}=ji(this)&&this||{},t={},n=(r,o)=>{const s=e&&Ui(t,o)||o;ir(t[s])&&ir(r)?t[s]=Fo(t[s],r):ir(r)?t[s]=Fo({},r):Yt(r)?t[s]=r.slice():t[s]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&An(arguments[r],n);return t}const Wf=(e,t,n,{allOwnKeys:r}={})=>(An(t,(o,s)=>{n&&Le(o)?e[s]=Bi(o,n):e[s]=o},{allOwnKeys:r}),e),Gf=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),qf=(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)},Kf=(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&&_o(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Xf=(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(Yt(e))return e;let t=e.length;if(!Hi(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Yf=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&_o(Uint8Array)),Zf=(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},ep=Ke("HTMLFormElement"),tp=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),Wi=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),np=Ke("RegExp"),Gi=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};An(n,(o,s)=>{let i;(i=t(o,s,e))!==!1&&(r[s]=i||o)}),Object.defineProperties(e,r)},rp=e=>{Gi(e,(t,n)=>{if(Le(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Le(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+"'")})}})},op=(e,t)=>{const n={},r=o=>{o.forEach(s=>{n[s]=!0})};return Yt(e)?r(e):r(String(e).split(t)),n},sp=()=>{},ip=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Oo="abcdefghijklmnopqrstuvwxyz",qi="0123456789",Ki={DIGIT:qi,ALPHA:Oo,ALPHA_DIGIT:Oo+Oo.toUpperCase()+qi},ap=(e=16,t=Ki.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function lp(e){return!!(e&&Le(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const cp=e=>{const t=new Array(10),n=(r,o)=>{if(sr(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[o]=r;const s=Yt(r)?[]:{};return An(r,(i,a)=>{const u=n(i,o+1);!Pn(u)&&(s[a]=u)}),t[o]=void 0,s}}return r};return n(e,0)},up=Ke("AsyncFunction"),dp=e=>e&&(sr(e)||Le(e))&&Le(e.then)&&Le(e.catch),Xi=((e,t)=>e?setImmediate:t?((n,r)=>(zt.addEventListener("message",({source:o,data:s})=>{o===zt&&s===n&&r.length&&r.shift()()},!1),o=>{r.push(o),zt.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Le(zt.postMessage)),fp=typeof queueMicrotask<"u"?queueMicrotask.bind(zt):typeof process<"u"&&process.nextTick||Xi,T={isArray:Yt,isArrayBuffer:zi,isBuffer:_f,isFormData:Rf,isArrayBufferView:Ff,isString:Of,isNumber:Hi,isBoolean:Df,isObject:sr,isPlainObject:ir,isReadableStream:Bf,isRequest:zf,isResponse:Hf,isHeaders:Uf,isUndefined:Pn,isDate:Mf,isFile:If,isBlob:kf,isRegExp:np,isFunction:Le,isStream:Lf,isURLSearchParams:Vf,isTypedArray:Yf,isFileList:$f,forEach:An,merge:Fo,extend:Wf,trim:jf,stripBOM:Gf,inherits:qf,toFlatObject:Kf,kindOf:rr,kindOfTest:Ke,endsWith:Xf,toArray:Jf,forEachEntry:Zf,matchAll:Qf,isHTMLForm:ep,hasOwnProperty:Wi,hasOwnProp:Wi,reduceDescriptors:Gi,freezeMethods:rp,toObjectSet:op,toCamelCase:tp,noop:sp,toFiniteNumber:ip,findKey:Ui,global:zt,isContextDefined:ji,ALPHABET:Ki,generateString:ap,isSpecCompliantForm:lp,toJSONObject:cp,isAsyncFn:up,isThenable:dp,setImmediate:Xi,asap:fp};function ne(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(ne,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 Ji=ne.prototype,Yi={};["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=>{Yi[e]={value:e}}),Object.defineProperties(ne,Yi),Object.defineProperty(Ji,"isAxiosError",{value:!0}),ne.from=(e,t,n,r,o,s)=>{const i=Object.create(Ji);return T.toFlatObject(e,i,function(u){return u!==Error.prototype},a=>a!=="isAxiosError"),ne.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const pp=null;function Do(e){return T.isPlainObject(e)||T.isArray(e)}function Zi(e){return T.endsWith(e,"[]")?e.slice(0,-2):e}function Qi(e,t,n){return e?e.concat(t).map(function(o,s){return o=Zi(o),!n&&s?"["+o+"]":o}).join(n?".":""):t}function gp(e){return T.isArray(e)&&!e.some(Do)}const hp=T.toFlatObject(T,{},null,function(t){return/^is[A-Z]/.test(t)});function ar(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 ne("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)&&gp(v)||(T.isFileList(v)||T.endsWith(h,"[]"))&&(w=T.toArray(v)))return h=Zi(h),w.forEach(function(S,E){!(T.isUndefined(S)||S===null)&&t.append(i===!0?Qi([h],E,s):i===null?h:h+"[]",c(S))}),!1}return Do(v)?!0:(t.append(Qi(y,h,s),c(v)),!1)}const p=[],m=Object.assign(hp,{defaultVisitor:f,convertValue:c,isVisitable:Do});function g(v,h){if(!T.isUndefined(v)){if(p.indexOf(v)!==-1)throw Error("Circular reference detected in "+h.join("."));p.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&&g(w,h?h.concat(b):[b])}),p.pop()}}if(!T.isObject(e))throw new TypeError("data must be an object");return g(e),t}function ea(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Mo(e,t){this._pairs=[],e&&ar(e,this,t)}const ta=Mo.prototype;ta.append=function(t,n){this._pairs.push([t,n])},ta.toString=function(t){const n=t?function(r){return t.call(this,r,ea)}:ea;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function mp(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function na(e,t,n){if(!t)return e;const r=n&&n.encode||mp;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 Mo(t,n).toString(r),s){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class ra{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 oa={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},vp={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Mo,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Io=typeof window<"u"&&typeof document<"u",ko=typeof navigator=="object"&&navigator||void 0,yp=Io&&(!ko||["ReactNative","NativeScript","NS"].indexOf(ko.product)<0),wp=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",bp=Io&&window.location.href||"http://localhost",Te={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Io,hasStandardBrowserEnv:yp,hasStandardBrowserWebWorkerEnv:wp,navigator:ko,origin:bp},Symbol.toStringTag,{value:"Module"})),...vp};function xp(e,t){return ar(e,new Te.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,s){return Te.isNode&&T.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function Cp(e){return T.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Sp(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 sa(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]=Sp(o[i])),!a)}if(T.isFormData(e)&&T.isFunction(e.entries)){const n={};return T.forEachEntry(e,(r,o)=>{t(Cp(r),o,n,0)}),n}return null}function Ep(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 _n={transitional:oa,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(sa(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 xp(t,this.formSerializer).toString();if((a=T.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return ar(a?{"files[]":t}:t,u&&new u,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),Ep(t)):t}],transformResponse:[function(t){const n=this.transitional||_n.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"?ne.from(a,ne.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:Te.classes.FormData,Blob:Te.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=>{_n.headers[e]={}});const Np=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"]),Tp=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]&&
|
|
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[ia]=this[ia]={accessors:{}}).accessors,o=this.prototype;function s(i){const a=Fn(i);r[a]||(Fp(o,i),r[a]=!0)}return T.isArray(t)?t.forEach(s):s(t),this}}Oe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),T.reduceDescriptors(Oe.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),T.freezeMethods(Oe);function Lo(e,t){const n=this||_n,r=t||n,o=Oe.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 aa(e){return!!(e&&e.__CANCEL__)}function Zt(e,t,n){ne.call(this,e??"canceled",ne.ERR_CANCELED,t,n),this.name="CanceledError"}T.inherits(Zt,ne,{__CANCEL__:!0});function la(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ne("Request failed with status code "+n.status,[ne.ERR_BAD_REQUEST,ne.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Op(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Dp(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 p=s,m=0;for(;p!==o;)m+=n[p++],p=p%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),c-i<t)return;const g=f&&c-f;return g?Math.round(m*1e3/g):void 0}}function Mp(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(),p=f-n;p>=r?i(c,f):(o=c,s||(s=setTimeout(()=>{s=null,i(o)},r-p)))},()=>o&&i(o)]}const cr=(e,t,n=3)=>{let r=0;const o=Dp(50,250);return Mp(s=>{const i=s.loaded,a=s.lengthComputable?s.total:void 0,u=i-r,c=o(u),f=i<=a;r=i;const p={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(p)},n)},ca=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ua=e=>(...t)=>T.asap(()=>e(...t)),Ip=Te.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Te.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Te.origin),Te.navigator&&/(msie|trident)/i.test(Te.navigator.userAgent)):()=>!0,kp=Te.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 $p(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Lp(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function da(e,t){return e&&!$p(t)?Lp(e,t):t}const fa=e=>e instanceof Oe?{...e}:e;function Ht(e,t){t=t||{};const n={};function r(c,f,p,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,p,m){if(T.isUndefined(f)){if(!T.isUndefined(c))return r(void 0,c,p,m)}else return r(c,f,p,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,p){if(p in t)return r(c,f);if(p 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,p)=>o(fa(c),fa(f),p,!0)};return T.forEach(Object.keys(Object.assign({},e,t)),function(f){const p=u[f]||o,m=p(e[f],t[f],f);T.isUndefined(m)&&p!==a||(n[f]=m)}),n}const pa=e=>{const t=Ht({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=t;t.headers=i=Oe.from(i),t.url=na(da(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(Te.hasStandardBrowserEnv||Te.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((u=i.getContentType())!==!1){const[c,...f]=u?u.split(";").map(p=>p.trim()).filter(Boolean):[];i.setContentType([c||"multipart/form-data",...f].join("; "))}}if(Te.hasStandardBrowserEnv&&(r&&T.isFunction(r)&&(r=r(t)),r||r!==!1&&Ip(t.url))){const c=o&&s&&kp.read(s);c&&i.set(o,c)}return t},Rp=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const o=pa(e);let s=o.data;const i=Oe.from(o.headers).normalize();let{responseType:a,onUploadProgress:u,onDownloadProgress:c}=o,f,p,m,g,v;function h(){g&&g(),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=Oe.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};la(function(F){n(F),h()},function(F){r(F),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 ne("Request aborted",ne.ECONNABORTED,e,y)),y=null)},y.onerror=function(){r(new ne("Network Error",ne.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||oa;o.timeoutErrorMessage&&(E=o.timeoutErrorMessage),r(new ne(E,x.clarifyTimeoutError?ne.ETIMEDOUT:ne.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]=cr(c,!0),y.addEventListener("progress",m)),u&&y.upload&&([p,g]=cr(u),y.upload.addEventListener("progress",p),y.upload.addEventListener("loadend",g)),(o.cancelToken||o.signal)&&(f=S=>{y&&(r(!S||S.type?new Zt(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=Op(o.url);if(b&&Te.protocols.indexOf(b)===-1){r(new ne("Unsupported protocol "+b+":",ne.ERR_BAD_REQUEST,e));return}y.send(s||null)})},Vp=(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 ne?f:new Zt(f instanceof Error?f.message:f))}};let i=t&&setTimeout(()=>{i=null,s(new ne(`timeout ${t} of ms exceeded`,ne.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}},Bp=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},zp=async function*(e,t){for await(const n of Hp(e))yield*Bp(n,t)},Hp=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()}},ga=(e,t,n,r)=>{const o=zp(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 p=f.byteLength;if(n){let m=s+=p;n(m)}u.enqueue(new Uint8Array(f))}catch(c){throw a(c),c}},cancel(u){return a(u),o.return()}},{highWaterMark:2})},ur=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ha=ur&&typeof ReadableStream=="function",Up=ur&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),ma=(e,...t)=>{try{return!!e(...t)}catch{return!1}},jp=ha&&ma(()=>{let e=!1;const t=new Request(Te.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),va=64*1024,Ro=ha&&ma(()=>T.isReadableStream(new Response("").body)),dr={stream:Ro&&(e=>e.body)};ur&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!dr[t]&&(dr[t]=T.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new ne(`Response type '${t}' is not supported`,ne.ERR_NOT_SUPPORT,r)})})})(new Response);const Wp=async e=>{if(e==null)return 0;if(T.isBlob(e))return e.size;if(T.isSpecCompliantForm(e))return(await new Request(Te.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 Up(e)).byteLength},Gp=async(e,t)=>{const n=T.toFiniteNumber(e.getContentLength());return n??Wp(t)},Vo={http:pp,xhr:Rp,fetch:ur&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:s,timeout:i,onDownloadProgress:a,onUploadProgress:u,responseType:c,headers:f,withCredentials:p="same-origin",fetchOptions:m}=pa(e);c=c?(c+"").toLowerCase():"text";let g=Vp([o,s&&s.toAbortSignal()],i),v;const h=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let y;try{if(u&&jp&&n!=="get"&&n!=="head"&&(y=await Gp(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[F,O]=ca(y,cr(ua(u)));r=ga(x.body,va,F,O)}}T.isString(p)||(p=p?"include":"omit");const w="credentials"in Request.prototype;v=new Request(t,{...m,signal:g,method:n.toUpperCase(),headers:f.normalize().toJSON(),body:r,duplex:"half",credentials:w?p:void 0});let b=await fetch(v);const S=Ro&&(c==="stream"||c==="response");if(Ro&&(a||S&&h)){const x={};["status","statusText","headers"].forEach(I=>{x[I]=b[I]});const P=T.toFiniteNumber(b.headers.get("content-length")),[F,O]=a&&ca(P,cr(ua(a),!0))||[];b=new Response(ga(b.body,va,F,()=>{O&&O(),h&&h()}),x)}c=c||"text";let E=await dr[T.findKey(dr,c)||"text"](b,e);return!S&&h&&h(),await new Promise((x,P)=>{la(x,P,{data:E,headers:Oe.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 ne("Network Error",ne.ERR_NETWORK,e,v),{cause:w.cause||w}):ne.from(w,w&&w.code,e,v)}})};T.forEach(Vo,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const ya=e=>`- ${e}`,qp=e=>T.isFunction(e)||e===null||e===!1,wa={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,!qp(n)&&(r=Vo[(i=String(n)).toLowerCase()],r===void 0))throw new ne(`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(
|
|
26
|
-
`):" "+
|
|
27
|
-
`+s):r.stack=s}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=
|
|
22
|
+
*/function sr(e,t){return e?Of(e)?d.createElement(e,t):e:null}function Of(e){return Df(e)||typeof e=="function"||Mf(e)}function Df(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Mf(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Ui(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=d.useState(()=>({current:Nf(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 ji(e,t){return function(){return e.apply(t,arguments)}}const{toString:If}=Object.prototype,{getPrototypeOf:Ro}=Object,ir=(e=>t=>{const n=If.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Xe=e=>(e=e.toLowerCase(),t=>ir(t)===e),ar=e=>t=>typeof t===e,{isArray:Qt}=Array,_n=ar("undefined");function kf(e){return e!==null&&!_n(e)&&e.constructor!==null&&!_n(e.constructor)&&Le(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Wi=Xe("ArrayBuffer");function $f(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Wi(e.buffer),t}const Lf=ar("string"),Le=ar("function"),Gi=ar("number"),lr=e=>e!==null&&typeof e=="object",Rf=e=>e===!0||e===!1,cr=e=>{if(ir(e)!=="object")return!1;const t=Ro(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Vf=Xe("Date"),Bf=Xe("File"),Hf=Xe("Blob"),zf=Xe("FileList"),Uf=e=>lr(e)&&Le(e.pipe),jf=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Le(e.append)&&((t=ir(e))==="formdata"||t==="object"&&Le(e.toString)&&e.toString()==="[object FormData]"))},Wf=Xe("URLSearchParams"),[Gf,qf,Kf,Xf]=["ReadableStream","Request","Response","Headers"].map(Xe),Jf=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Fn(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),Qt(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 qi(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 zt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ki=e=>!_n(e)&&e!==zt;function Vo(){const{caseless:e}=Ki(this)&&this||{},t={},n=(r,o)=>{const s=e&&qi(t,o)||o;cr(t[s])&&cr(r)?t[s]=Vo(t[s],r):cr(r)?t[s]=Vo({},r):Qt(r)?t[s]=r.slice():t[s]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&Fn(arguments[r],n);return t}const Yf=(e,t,n,{allOwnKeys:r}={})=>(Fn(t,(o,s)=>{n&&Le(o)?e[s]=ji(o,n):e[s]=o},{allOwnKeys:r}),e),Zf=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Qf=(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)},ep=(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&&Ro(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},tp=(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},np=e=>{if(!e)return null;if(Qt(e))return e;let t=e.length;if(!Gi(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},rp=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ro(Uint8Array)),op=(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])}},sp=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},ip=Xe("HTMLFormElement"),ap=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),Xi=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),lp=Xe("RegExp"),Ji=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Fn(n,(o,s)=>{let i;(i=t(o,s,e))!==!1&&(r[s]=i||o)}),Object.defineProperties(e,r)},cp=e=>{Ji(e,(t,n)=>{if(Le(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Le(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+"'")})}})},up=(e,t)=>{const n={},r=o=>{o.forEach(s=>{n[s]=!0})};return Qt(e)?r(e):r(String(e).split(t)),n},dp=()=>{},fp=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Bo="abcdefghijklmnopqrstuvwxyz",Yi="0123456789",Zi={DIGIT:Yi,ALPHA:Bo,ALPHA_DIGIT:Bo+Bo.toUpperCase()+Yi},pp=(e=16,t=Zi.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function gp(e){return!!(e&&Le(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const hp=e=>{const t=new Array(10),n=(r,o)=>{if(lr(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[o]=r;const s=Qt(r)?[]:{};return Fn(r,(i,a)=>{const u=n(i,o+1);!_n(u)&&(s[a]=u)}),t[o]=void 0,s}}return r};return n(e,0)},mp=Xe("AsyncFunction"),vp=e=>e&&(lr(e)||Le(e))&&Le(e.then)&&Le(e.catch),Qi=((e,t)=>e?setImmediate:t?((n,r)=>(zt.addEventListener("message",({source:o,data:s})=>{o===zt&&s===n&&r.length&&r.shift()()},!1),o=>{r.push(o),zt.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Le(zt.postMessage)),yp=typeof queueMicrotask<"u"?queueMicrotask.bind(zt):typeof process<"u"&&process.nextTick||Qi,T={isArray:Qt,isArrayBuffer:Wi,isBuffer:kf,isFormData:jf,isArrayBufferView:$f,isString:Lf,isNumber:Gi,isBoolean:Rf,isObject:lr,isPlainObject:cr,isReadableStream:Gf,isRequest:qf,isResponse:Kf,isHeaders:Xf,isUndefined:_n,isDate:Vf,isFile:Bf,isBlob:Hf,isRegExp:lp,isFunction:Le,isStream:Uf,isURLSearchParams:Wf,isTypedArray:rp,isFileList:zf,forEach:Fn,merge:Vo,extend:Yf,trim:Jf,stripBOM:Zf,inherits:Qf,toFlatObject:ep,kindOf:ir,kindOfTest:Xe,endsWith:tp,toArray:np,forEachEntry:op,matchAll:sp,isHTMLForm:ip,hasOwnProperty:Xi,hasOwnProp:Xi,reduceDescriptors:Ji,freezeMethods:cp,toObjectSet:up,toCamelCase:ap,noop:dp,toFiniteNumber:fp,findKey:qi,global:zt,isContextDefined:Ki,ALPHABET:Zi,generateString:pp,isSpecCompliantForm:gp,toJSONObject:hp,isAsyncFn:mp,isThenable:vp,setImmediate:Qi,asap:yp};function re(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(re,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 ea=re.prototype,ta={};["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=>{ta[e]={value:e}}),Object.defineProperties(re,ta),Object.defineProperty(ea,"isAxiosError",{value:!0}),re.from=(e,t,n,r,o,s)=>{const i=Object.create(ea);return T.toFlatObject(e,i,function(u){return u!==Error.prototype},a=>a!=="isAxiosError"),re.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const wp=null;function Ho(e){return T.isPlainObject(e)||T.isArray(e)}function na(e){return T.endsWith(e,"[]")?e.slice(0,-2):e}function ra(e,t,n){return e?e.concat(t).map(function(o,s){return o=na(o),!n&&s?"["+o+"]":o}).join(n?".":""):t}function bp(e){return T.isArray(e)&&!e.some(Ho)}const xp=T.toFlatObject(T,{},null,function(t){return/^is[A-Z]/.test(t)});function ur(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 re("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)&&bp(v)||(T.isFileList(v)||T.endsWith(h,"[]"))&&(w=T.toArray(v)))return h=na(h),w.forEach(function(S,E){!(T.isUndefined(S)||S===null)&&t.append(i===!0?ra([h],E,s):i===null?h:h+"[]",c(S))}),!1}return Ho(v)?!0:(t.append(ra(y,h,s),c(v)),!1)}const g=[],m=Object.assign(xp,{defaultVisitor:f,convertValue:c,isVisitable:Ho});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 oa(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function zo(e,t){this._pairs=[],e&&ur(e,this,t)}const sa=zo.prototype;sa.append=function(t,n){this._pairs.push([t,n])},sa.toString=function(t){const n=t?function(r){return t.call(this,r,oa)}:oa;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function Cp(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ia(e,t,n){if(!t)return e;const r=n&&n.encode||Cp;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 zo(t,n).toString(r),s){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class aa{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 la={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Sp={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:zo,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Uo=typeof window<"u"&&typeof document<"u",jo=typeof navigator=="object"&&navigator||void 0,Ep=Uo&&(!jo||["ReactNative","NativeScript","NS"].indexOf(jo.product)<0),Np=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Tp=Uo&&window.location.href||"http://localhost",Pe={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Uo,hasStandardBrowserEnv:Ep,hasStandardBrowserWebWorkerEnv:Np,navigator:jo,origin:Tp},Symbol.toStringTag,{value:"Module"})),...Sp};function Pp(e,t){return ur(e,new Pe.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,s){return Pe.isNode&&T.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function Ap(e){return T.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function _p(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 ca(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]=_p(o[i])),!a)}if(T.isFormData(e)&&T.isFunction(e.entries)){const n={};return T.forEachEntry(e,(r,o)=>{t(Ap(r),o,n,0)}),n}return null}function Fp(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 On={transitional:la,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(ca(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 Pp(t,this.formSerializer).toString();if((a=T.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return ur(a?{"files[]":t}:t,u&&new u,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),Fp(t)):t}],transformResponse:[function(t){const n=this.transitional||On.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"?re.from(a,re.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:Pe.classes.FormData,Blob:Pe.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=>{On.headers[e]={}});const Op=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"]),Dp=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]&&Op[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},ua=Symbol("internals");function Dn(e){return e&&String(e).trim().toLowerCase()}function dr(e){return e===!1||e==null?e:T.isArray(e)?e.map(dr):String(e)}function Mp(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 Ip=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Wo(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 kp(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function $p(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 Me{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function s(a,u,c){const f=Dn(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]=dr(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())&&!Ip(t))i(Dp(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=Dn(t),t){const r=T.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return Mp(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=Dn(t),t){const r=T.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Wo(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function s(i){if(i=Dn(i),i){const a=T.findKey(r,i);a&&(!n||Wo(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||Wo(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]=dr(o),delete n[s];return}const a=t?kp(s):String(s).trim();a!==s&&delete n[s],n[a]=dr(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[ua]=this[ua]={accessors:{}}).accessors,o=this.prototype;function s(i){const a=Dn(i);r[a]||($p(o,i),r[a]=!0)}return T.isArray(t)?t.forEach(s):s(t),this}}Me.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),T.reduceDescriptors(Me.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),T.freezeMethods(Me);function Go(e,t){const n=this||On,r=t||n,o=Me.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 da(e){return!!(e&&e.__CANCEL__)}function en(e,t,n){re.call(this,e??"canceled",re.ERR_CANCELED,t,n),this.name="CanceledError"}T.inherits(en,re,{__CANCEL__:!0});function fa(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new re("Request failed with status code "+n.status,[re.ERR_BAD_REQUEST,re.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Lp(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Rp(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 Vp(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 fr=(e,t,n=3)=>{let r=0;const o=Rp(50,250);return Vp(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)},pa=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ga=e=>(...t)=>T.asap(()=>e(...t)),Bp=Pe.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Pe.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Pe.origin),Pe.navigator&&/(msie|trident)/i.test(Pe.navigator.userAgent)):()=>!0,Hp=Pe.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 zp(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Up(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ha(e,t){return e&&!zp(t)?Up(e,t):t}const ma=e=>e instanceof Me?{...e}:e;function Ut(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(ma(c),ma(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 va=e=>{const t=Ut({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=t;t.headers=i=Me.from(i),t.url=ia(ha(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(Pe.hasStandardBrowserEnv||Pe.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(Pe.hasStandardBrowserEnv&&(r&&T.isFunction(r)&&(r=r(t)),r||r!==!1&&Bp(t.url))){const c=o&&s&&Hp.read(s);c&&i.set(o,c)}return t},jp=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const o=va(e);let s=o.data;const i=Me.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=Me.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};fa(function(F){n(F),h()},function(F){r(F),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 re("Request aborted",re.ECONNABORTED,e,y)),y=null)},y.onerror=function(){r(new re("Network Error",re.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||la;o.timeoutErrorMessage&&(E=o.timeoutErrorMessage),r(new re(E,x.clarifyTimeoutError?re.ETIMEDOUT:re.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]=fr(c,!0),y.addEventListener("progress",m)),u&&y.upload&&([g,p]=fr(u),y.upload.addEventListener("progress",g),y.upload.addEventListener("loadend",p)),(o.cancelToken||o.signal)&&(f=S=>{y&&(r(!S||S.type?new en(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=Lp(o.url);if(b&&Pe.protocols.indexOf(b)===-1){r(new re("Unsupported protocol "+b+":",re.ERR_BAD_REQUEST,e));return}y.send(s||null)})},Wp=(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 re?f:new en(f instanceof Error?f.message:f))}};let i=t&&setTimeout(()=>{i=null,s(new re(`timeout ${t} of ms exceeded`,re.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}},Gp=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},qp=async function*(e,t){for await(const n of Kp(e))yield*Gp(n,t)},Kp=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()}},ya=(e,t,n,r)=>{const o=qp(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})},pr=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",wa=pr&&typeof ReadableStream=="function",Xp=pr&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),ba=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Jp=wa&&ba(()=>{let e=!1;const t=new Request(Pe.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),xa=64*1024,qo=wa&&ba(()=>T.isReadableStream(new Response("").body)),gr={stream:qo&&(e=>e.body)};pr&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!gr[t]&&(gr[t]=T.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new re(`Response type '${t}' is not supported`,re.ERR_NOT_SUPPORT,r)})})})(new Response);const Yp=async e=>{if(e==null)return 0;if(T.isBlob(e))return e.size;if(T.isSpecCompliantForm(e))return(await new Request(Pe.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 Xp(e)).byteLength},Zp=async(e,t)=>{const n=T.toFiniteNumber(e.getContentLength());return n??Yp(t)},Ko={http:wp,xhr:jp,fetch:pr&&(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}=va(e);c=c?(c+"").toLowerCase():"text";let p=Wp([o,s&&s.toAbortSignal()],i),v;const h=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let y;try{if(u&&Jp&&n!=="get"&&n!=="head"&&(y=await Zp(f,r))!==0){let x=new Request(t,{method:"POST",body:r,duplex:"half"}),A;if(T.isFormData(r)&&(A=x.headers.get("content-type"))&&f.setContentType(A),x.body){const[F,O]=pa(y,fr(ga(u)));r=ya(x.body,xa,F,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=qo&&(c==="stream"||c==="response");if(qo&&(a||S&&h)){const x={};["status","statusText","headers"].forEach(k=>{x[k]=b[k]});const A=T.toFiniteNumber(b.headers.get("content-length")),[F,O]=a&&pa(A,fr(ga(a),!0))||[];b=new Response(ya(b.body,xa,F,()=>{O&&O(),h&&h()}),x)}c=c||"text";let E=await gr[T.findKey(gr,c)||"text"](b,e);return!S&&h&&h(),await new Promise((x,A)=>{fa(x,A,{data:E,headers:Me.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 re("Network Error",re.ERR_NETWORK,e,v),{cause:w.cause||w}):re.from(w,w&&w.code,e,v)}})};T.forEach(Ko,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Ca=e=>`- ${e}`,Qp=e=>T.isFunction(e)||e===null||e===!1,Sa={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,!Qp(n)&&(r=Ko[(i=String(n)).toLowerCase()],r===void 0))throw new re(`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(Ca).join(`
|
|
26
|
+
`):" "+Ca(s[0]):"as no adapter specified";throw new re("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:Ko};function Xo(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new en(null,e)}function Ea(e){return Xo(e),e.headers=Me.from(e.headers),e.data=Go.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Sa.getAdapter(e.adapter||On.adapter)(e).then(function(r){return Xo(e),r.data=Go.call(e,e.transformResponse,r),r.headers=Me.from(r.headers),r},function(r){return da(r)||(Xo(e),r&&r.response&&(r.response.data=Go.call(e,e.transformResponse,r.response),r.response.headers=Me.from(r.response.headers))),Promise.reject(r)})}const Na="1.7.9",hr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{hr[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Ta={};hr.transitional=function(t,n,r){function o(s,i){return"[Axios v"+Na+"] Transitional option '"+s+"'"+i+(r?". "+r:"")}return(s,i,a)=>{if(t===!1)throw new re(o(i," has been removed"+(n?" in "+n:"")),re.ERR_DEPRECATED);return n&&!Ta[i]&&(Ta[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}},hr.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function eg(e,t,n){if(typeof e!="object")throw new re("options must be an object",re.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 re("option "+s+" must be "+u,re.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new re("Unknown option "+s,re.ERR_BAD_OPTION)}}const mr={assertOptions:eg,validators:hr},ot=mr.validators;class jt{constructor(t){this.defaults=t,this.interceptors={request:new aa,response:new aa}}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=Ut(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&mr.assertOptions(r,{silentJSONParsing:ot.transitional(ot.boolean),forcedJSONParsing:ot.transitional(ot.boolean),clarifyTimeoutError:ot.transitional(ot.boolean)},!1),o!=null&&(T.isFunction(o)?n.paramsSerializer={serialize:o}:mr.assertOptions(o,{encode:ot.function,serialize:ot.function},!0)),mr.assertOptions(n,{baseUrl:ot.spelling("baseURL"),withXsrfToken:ot.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=Me.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=[Ea.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=Ea.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=Ut(this.defaults,t);const n=ha(t.baseURL,t.url);return ia(n,t.params,t.paramsSerializer)}}T.forEach(["delete","get","head","options"],function(t){jt.prototype[t]=function(n,r){return this.request(Ut(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(Ut(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}jt.prototype[t]=n(),jt.prototype[t+"Form"]=n(!0)});class Jo{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 en(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 Jo(function(o){t=o}),cancel:t}}}function tg(e){return function(n){return e.apply(null,n)}}function ng(e){return T.isObject(e)&&e.isAxiosError===!0}const Yo={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(Yo).forEach(([e,t])=>{Yo[t]=e});function Pa(e){const t=new jt(e),n=ji(jt.prototype.request,t);return T.extend(n,jt.prototype,t,{allOwnKeys:!0}),T.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return Pa(Ut(e,o))},n}const se=Pa(On);se.Axios=jt,se.CanceledError=en,se.CancelToken=Jo,se.isCancel=da,se.VERSION=Na,se.toFormData=ur,se.AxiosError=re,se.Cancel=se.CanceledError,se.all=function(t){return Promise.all(t)},se.spread=tg,se.isAxiosError=ng,se.mergeConfig=Ut,se.AxiosHeaders=Me,se.formToJSON=e=>ca(T.isHTMLForm(e)?new FormData(e):e),se.getAdapter=Sa.getAdapter,se.HttpStatusCode=Yo,se.default=se;/**
|
|
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
|
|
32
|
+
*/const rg=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Aa=(...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
|
|
37
|
+
*/var og={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
|
|
42
|
+
*/const sg=P.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},u)=>P.createElement("svg",{ref:u,...og,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Aa("lucide",o),...a},[...i.map(([c,f])=>P.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
|
|
47
|
+
*/const ze=(e,t)=>{const n=P.forwardRef(({className:r,...o},s)=>P.createElement(sg,{ref:s,iconNode:t,className:Aa(`lucide-${rg(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
|
|
52
|
+
*/const Zo=ze("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/**
|
|
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
|
|
57
|
+
*/const ig=ze("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"}]]);/**
|
|
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
|
|
62
|
+
*/const ag=ze("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
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
|
|
67
|
+
*/const lg=ze("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
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
|
|
72
|
+
*/const _a=ze("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
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
|
|
77
|
+
*/const cg=ze("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"}]]);/**
|
|
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
|
|
82
|
+
*/const ug=ze("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"}]]);/**
|
|
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
|
|
87
|
+
*/const ve=ze("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
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
|
|
92
|
+
*/const dg=ze("MoveUpRight",[["path",{d:"M13 5H19V11",key:"1n1gyv"}],["path",{d:"M19 5L5 19",key:"72u4yj"}]]);/**
|
|
93
93
|
* @license lucide-react v0.468.0 - ISC
|
|
94
94
|
*
|
|
95
95
|
* This source code is licensed under the ISC license.
|
|
96
96
|
* See the LICENSE file in the root directory of this source tree.
|
|
97
|
-
*/const
|
|
97
|
+
*/const fg=ze("PenOff",[["path",{d:"m10 10-6.157 6.162a2 2 0 0 0-.5.833l-1.322 4.36a.5.5 0 0 0 .622.624l4.358-1.323a2 2 0 0 0 .83-.5L14 13.982",key:"bjo8r8"}],["path",{d:"m12.829 7.172 4.359-4.346a1 1 0 1 1 3.986 3.986l-4.353 4.353",key:"16h5ne"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
98
98
|
* @license lucide-react v0.468.0 - ISC
|
|
99
99
|
*
|
|
100
100
|
* This source code is licensed under the ISC license.
|
|
101
101
|
* See the LICENSE file in the root directory of this source tree.
|
|
102
|
-
*/const Uo=Xe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),lg={category:"Thư mục gốc",fileName:"Tên tệp",fullPath:"Đường dẫn đầy đủ",createAt:"Ngày tạo",creator:"Người tạo",creatorId:"ID người tạo",DataSource:"Nguồn dữ liệu",SuggestedAICategories:"Danh mục AI gợi ý",KeywordAISuggestion:"Từ khóa AI gợi ý",SummaryOfSuggestedAI:"Tóm tắt AI gợi ý",AccessLevel:"Cấp độ truy cập"},cg=e=>e==="SummaryOfSuggestedAI"||e==="KeywordAISuggestion"||e==="SuggestedAICategories",jo=e=>e==="fullPath"||e==="createAt"||e==="creator"||e==="creatorId"||e==="DataSource"||e==="AccessLevel"||e==="category"||e==="fileName",ug=(e,t)=>{if(e.length>30)return t({title:"Lỗi tải lên",description:"Bạn chỉ có thể tải lên tối đa 30 tệp.",variant:"destructive"}),!0;for(let o=0;o<e.length;o++){const s=e[o];if(s&&s.size>20971520)return t({title:"Lỗi tải lên",description:`Tệp ${s.name} vượt quá giới hạn kích thước 20MB.`,variant:"destructive"}),!0}return!1};function Ta(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function dg(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Ta(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():Ta(e[o],null)}}}}var Qt=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(fg);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(Wo,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Wo,{...r,ref:t,children:n})});Qt.displayName="Slot";var Wo=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=gg(n);return d.cloneElement(n,{...pg(r,n.props),ref:t?dg(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Wo.displayName="SlotClone";var Pa=({children:e})=>l.jsx(l.Fragment,{children:e});function fg(e){return d.isValidElement(e)&&e.type===Pa}function pg(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 gg(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 Aa(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=Aa(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function _a(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Aa(e))&&(r&&(r+=" "),r+=t);return r}const Go="-",hg=e=>{const t=vg(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(Go);return a[0]===""&&a.length!==1&&a.shift(),Fa(a,t)||mg(i)},getConflictingClassGroupIds:(i,a)=>{const u=n[i]||[];return a&&r[i]?[...u,...r[i]]:u}}},Fa=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Fa(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Go);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},Oa=/^\[(.+)\]$/,mg=e=>{if(Oa.test(e)){const t=Oa.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},vg=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return wg(Object.entries(e.classGroups),n).forEach(([s,i])=>{qo(i,r,s,t)}),r},qo=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:Da(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(yg(o)){qo(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{qo(i,Da(t,s),n,r)})})},Da=(e,t)=>{let n=e;return t.split(Go).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},yg=e=>e.isThemeGetter,wg=(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,bg=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)}}},Ma="!",xg=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,p;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==="/"){p=y;continue}}w==="["?c++:w==="]"&&c--}const m=u.length===0?a:a.substring(f),g=m.startsWith(Ma),v=g?m.substring(1):m,h=p&&p>f?p-f:void 0;return{modifiers:u,hasImportantModifier:g,baseClassName:v,maybePostfixModifierPosition:h}};return n?a=>n({className:a,parseClassName:i}):i},Cg=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},Sg=e=>({cache:bg(e.cacheSize),parseClassName:xg(e),...hg(e)}),Eg=/\s+/,Ng=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(Eg);let a="";for(let u=i.length-1;u>=0;u-=1){const c=i[u],{modifiers:f,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:g}=n(c);let v=!!g,h=r(v?m.substring(0,g):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=Cg(f).join(":"),w=p?y+Ma: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 Tg(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Ia(t))&&(r&&(r+=" "),r+=n);return r}const Ia=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Ia(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,p)=>p(f),e());return n=Sg(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=Ng(u,n);return o(u,f),f}return function(){return s(Tg.apply(null,arguments))}}const de=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},ka=/^\[(?:([a-z-]+):)?(.+)\]$/i,Ag=/^\d+\/\d+$/,_g=new Set(["px","full","screen"]),Fg=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Og=/\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$/,Dg=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Mg=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ig=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,mt=e=>en(e)||_g.has(e)||Ag.test(e),_t=e=>tn(e,"length",Hg),en=e=>!!e&&!Number.isNaN(Number(e)),Ko=e=>tn(e,"number",en),On=e=>!!e&&Number.isInteger(Number(e)),kg=e=>e.endsWith("%")&&en(e.slice(0,-1)),re=e=>ka.test(e),Ft=e=>Fg.test(e),$g=new Set(["length","size","percentage"]),Lg=e=>tn(e,$g,$a),Rg=e=>tn(e,"position",$a),Vg=new Set(["image","url"]),Bg=e=>tn(e,Vg,jg),zg=e=>tn(e,"",Ug),Dn=()=>!0,tn=(e,t,n)=>{const r=ka.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Hg=e=>Og.test(e)&&!Dg.test(e),$a=()=>!1,Ug=e=>Mg.test(e),jg=e=>Ig.test(e),Wg=Pg(()=>{const e=de("colors"),t=de("spacing"),n=de("blur"),r=de("brightness"),o=de("borderColor"),s=de("borderRadius"),i=de("borderSpacing"),a=de("borderWidth"),u=de("contrast"),c=de("grayscale"),f=de("hueRotate"),p=de("invert"),m=de("gap"),g=de("gradientColorStops"),v=de("gradientColorStopPositions"),h=de("inset"),y=de("margin"),w=de("opacity"),b=de("padding"),S=de("saturate"),E=de("scale"),x=de("sepia"),P=de("skew"),F=de("space"),O=de("translate"),I=()=>["auto","contain","none"],D=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto",re,t],k=()=>[re,t],z=()=>["",mt,_t],R=()=>["auto",en,re],J=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],B=()=>["solid","dashed","dotted","double","none"],U=()=>["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"],Y=()=>["","0",re],le=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ue=()=>[en,re];return{cacheSize:500,separator:":",theme:{colors:[Dn],spacing:[mt,_t],blur:["none","",Ft,re],brightness:ue(),borderColor:[e],borderRadius:["none","","full",Ft,re],borderSpacing:k(),borderWidth:z(),contrast:ue(),grayscale:Y(),hueRotate:ue(),invert:Y(),gap:k(),gradientColorStops:[e],gradientColorStopPositions:[kg,_t],inset:q(),margin:q(),opacity:ue(),padding:k(),saturate:ue(),scale:ue(),sepia:Y(),skew:ue(),space:k(),translate:k()},classGroups:{aspect:[{aspect:["auto","square","video",re]}],container:["container"],columns:[{columns:[Ft]}],"break-after":[{"break-after":le()}],"break-before":[{"break-before":le()}],"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:[...J(),re]}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],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",On,re]}],basis:[{basis:q()}],"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:Y()}],shrink:[{shrink:Y()}],order:[{order:["first","last","none",On,re]}],"grid-cols":[{"grid-cols":[Dn]}],"col-start-end":[{col:["auto",{span:["full",On,re]},re]}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":[Dn]}],"row-start-end":[{row:["auto",{span:[On,re]},re]}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"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":[F]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[F]}],"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:[Ft]},Ft]}],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",Ft,_t]}],"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:[Dn]}],"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",en,Ko]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",mt,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:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",mt,_t]}],"underline-offset":[{"underline-offset":["auto",mt,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:k()}],"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:[...J(),Rg]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Lg]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Bg]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],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:[...B(),"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:B()}],"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:["",...B()]}],"outline-offset":[{"outline-offset":[mt,re]}],"outline-w":[{outline:[mt,_t]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[mt,_t]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ft,zg]}],"shadow-color":[{shadow:[Dn]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...U(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":U()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",Ft,re]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[p]}],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":[p]}],"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:ue()}],ease:[{ease:["linear","in","out","in-out",re]}],delay:[{delay:ue()}],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:[On,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":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"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:[mt,_t,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 te(...e){return Wg(_a(e))}const Gg=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]}`},La=d.forwardRef(({className:e,...t},n)=>l.jsx("nav",{ref:n,"aria-label":"breadcrumb",className:te("s3-explr-ui-breadcrumb",e),...t}));La.displayName="Breadcrumb";const Ra=d.forwardRef(({className:e,...t},n)=>l.jsx("ol",{ref:n,className:te("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}));Ra.displayName="BreadcrumbList";const Xo=d.forwardRef(({className:e,...t},n)=>l.jsx("li",{ref:n,className:te("inline-flex items-center gap-1.5","s3-explr-ui-breadcrumb-item",e),...t}));Xo.displayName="BreadcrumbItem";const Jo=d.forwardRef(({asChild:e,className:t,...n},r)=>{const o=e?Qt:"a";return l.jsx(o,{ref:r,className:te("transition-colors hover:text-foreground","s3-explr-ui-breadcrumb-link",t),...n})});Jo.displayName="BreadcrumbLink";const qg=d.forwardRef(({className:e,...t},n)=>l.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:te("font-normal text-foreground","s3-explr-ui-breadcrumb-page",e),...t}));qg.displayName="BreadcrumbPage";const Va=({children:e,className:t,...n})=>l.jsx("li",{role:"presentation","aria-hidden":"true",className:te("[&>svg]:w-3.5 [&>svg]:h-3.5","s3-explr-ui-breadcrumb-separator",t),...n,children:e??l.jsx(Na,{})});Va.displayName="BreadcrumbSeparator";const Ba=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,za=_a,Yo=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return za(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],p=s==null?void 0:s[c];if(f===null)return null;const m=Ba(f)||Ba(p);return o[c][m]}),a=n&&Object.entries(n).reduce((c,f)=>{let[p,m]=f;return m===void 0||(c[p]=m),c},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,f)=>{let{class:p,className:m,...g}=f;return Object.entries(g).every(v=>{let[h,y]=v;return Array.isArray(y)?y.includes({...s,...a}[h]):{...s,...a}[h]===y})?[...c,p,m]:c},[]);return za(e,i,u,n==null?void 0:n.class,n==null?void 0:n.className)},Ha=Yo("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?Qt:"button";return l.jsx(i,{className:te(Ha({variant:t,size:n,className:e})),ref:s,...o})});ie.displayName="Button";function Kg(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function gr(...e){return t=>e.forEach(n=>Kg(n,t))}function ze(...e){return d.useCallback(gr(...e),e)}function Xg(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 Ot(e,t=[]){let n=[];function r(s,i){const a=d.createContext(i),u=n.length;n=[...n,i];const c=p=>{var w;const{scope:m,children:g,...v}=p,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:g})};c.displayName=s+"Provider";function f(p,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[u])||a,v=d.useContext(g);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${p}\` 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,Jg(o,...t)]}function Jg(...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 p=u(s)[`__scope${c}`];return{...a,...p}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function we(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 Ae(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 nn({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Yg({defaultProp:t,onChange:n}),s=e!==void 0,i=s?e:r,a=Ae(n),u=d.useCallback(c=>{if(s){const p=typeof c=="function"?c(e):c;p!==e&&a(p)}else o(c)},[s,e,o,a]);return[i,u]}function Yg({defaultProp:e,onChange:t}){const n=d.useState(e),[r]=n,o=d.useRef(r),s=Ae(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 Re=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{};function Ua(e){const[t,n]=d.useState(void 0);return Re(()=>{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 Qg(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var rn=e=>{const{present:t,children:n}=e,r=eh(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=ze(r.ref,th(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};rn.displayName="Presence";function eh(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=Qg(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=hr(r.current);s.current=a==="mounted"?c:"none"},[a]),Re(()=>{const c=r.current,f=o.current;if(f!==e){const m=s.current,g=hr(c);e?u("MOUNT"):g==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),Re(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,p=g=>{const h=hr(r.current).includes(g.animationName);if(g.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=g=>{g.target===t&&(s.current=hr(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:d.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function hr(e){return(e==null?void 0:e.animationName)||"none"}function th(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 ja=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(rh);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})});ja.displayName="Slot";var Zo=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=sh(n);return d.cloneElement(n,{...oh(r,n.props),ref:t?gr(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Zo.displayName="SlotClone";var nh=({children:e})=>l.jsx(l.Fragment,{children:e});function rh(e){return d.isValidElement(e)&&e.type===nh}function oh(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 sh(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 ih=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],be=ih.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?ja: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 Wa(e,t){e&&Yn.flushSync(()=>e.dispatchEvent(t))}var Qo="Checkbox",[ah,uC]=Ot(Qo),[lh,ch]=ah(Qo),Ga=d.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:u="on",onCheckedChange:c,form:f,...p}=e,[m,g]=d.useState(null),v=ze(t,E=>g(E)),h=d.useRef(!1),y=m?f||!!m.closest("form"):!0,[w=!1,b]=nn({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(lh,{scope:n,state:w,disabled:a,children:[l.jsx(be.button,{type:"button",role:"checkbox","aria-checked":Dt(w)?"mixed":w,"aria-required":i,"data-state":Xa(w),"data-disabled":a?"":void 0,disabled:a,value:u,...p,ref:v,onKeyDown:we(e.onKeyDown,E=>{E.key==="Enter"&&E.preventDefault()}),onClick:we(e.onClick,E=>{b(x=>Dt(x)?!0:!x),y&&(h.current=E.isPropagationStopped(),h.current||E.stopPropagation())})}),y&&l.jsx(uh,{control:m,bubbles:!h.current,name:r,value:u,checked:w,required:i,disabled:a,form:f,style:{transform:"translateX(-100%)"},defaultChecked:Dt(s)?!1:s})]})});Ga.displayName=Qo;var qa="CheckboxIndicator",Ka=d.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=ch(qa,n);return l.jsx(rn,{present:r||Dt(s.state)||s.state===!0,children:l.jsx(be.span,{"data-state":Xa(s.state),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});Ka.displayName=qa;var uh=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:o,...s}=e,i=d.useRef(null),a=Zg(n),u=Ua(t);d.useEffect(()=>{const f=i.current,p=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(p,"checked").set;if(a!==n&&g){const v=new Event("click",{bubbles:r});f.indeterminate=Dt(n),g.call(f,Dt(n)?!1:n),f.dispatchEvent(v)}},[a,n,r]);const c=d.useRef(Dt(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 Dt(e){return e==="indeterminate"}function Xa(e){return Dt(e)?"indeterminate":e?"checked":"unchecked"}var Ja=Ga,dh=Ka;const es=d.forwardRef(({className:e,...t},n)=>l.jsx(Ja,{ref:n,className:te("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(dh,{className:te("s3-explr-ui-checkbox-indicator flex items-center justify-center text-current"),children:l.jsx(tg,{className:"s3-explr-ui-checkbox-check h-4 w-4"})})}));es.displayName=Ja.displayName;var fh=d.useId||(()=>{}),ph=0;function on(e){const[t,n]=d.useState(fh());return Re(()=>{e||n(r=>r??String(ph++))},[e]),e||(t?`radix-${t}`:"")}function Ya(e,t=globalThis==null?void 0:globalThis.document){const n=Ae(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 gh="DismissableLayer",ts="dismissableLayer.update",hh="dismissableLayer.pointerDownOutside",mh="dismissableLayer.focusOutside",Za,Qa=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ns=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...u}=e,c=d.useContext(Qa),[f,p]=d.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=d.useState({}),v=ze(t,F=>p(F)),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=yh(F=>{const O=F.target,I=[...c.branches].some(D=>D.contains(O));!E||I||(o==null||o(F),i==null||i(F),F.defaultPrevented||a==null||a())},m),P=wh(F=>{const O=F.target;[...c.branches].some(D=>D.contains(O))||(s==null||s(F),i==null||i(F),F.defaultPrevented||a==null||a())},m);return Ya(F=>{b===c.layers.size-1&&(r==null||r(F),!F.defaultPrevented&&a&&(F.preventDefault(),a()))},m),d.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Za=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),tl(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Za)}},[f,m,n,c]),d.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),tl())},[f,c]),d.useEffect(()=>{const F=()=>g({});return document.addEventListener(ts,F),()=>document.removeEventListener(ts,F)},[]),l.jsx(be.div,{...u,ref:v,style:{pointerEvents:S?E?"auto":"none":void 0,...e.style},onFocusCapture:we(e.onFocusCapture,P.onFocusCapture),onBlurCapture:we(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:we(e.onPointerDownCapture,x.onPointerDownCapture)})});ns.displayName=gh;var vh="DismissableLayerBranch",el=d.forwardRef((e,t)=>{const n=d.useContext(Qa),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(be.div,{...e,ref:o})});el.displayName=vh;function yh(e,t=globalThis==null?void 0:globalThis.document){const n=Ae(e),r=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let u=function(){nl(hh,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 wh(e,t=globalThis==null?void 0:globalThis.document){const n=Ae(e),r=d.useRef(!1);return d.useEffect(()=>{const o=s=>{s.target&&!r.current&&nl(mh,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 tl(){const e=new CustomEvent(ts);document.dispatchEvent(e)}function nl(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?Wa(o,s):o.dispatchEvent(s)}var bh=ns,xh=el,rs="focusScope.autoFocusOnMount",os="focusScope.autoFocusOnUnmount",rl={bubbles:!1,cancelable:!0},Ch="FocusScope",ol=d.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,u]=d.useState(null),c=Ae(o),f=Ae(s),p=d.useRef(null),m=ze(t,h=>u(h)),g=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(r){let h=function(S){if(g.paused||!a)return;const E=S.target;a.contains(E)?p.current=E:Mt(p.current,{select:!0})},y=function(S){if(g.paused||!a)return;const E=S.relatedTarget;E!==null&&(a.contains(E)||Mt(p.current,{select:!0}))},w=function(S){if(document.activeElement===document.body)for(const x of S)x.removedNodes.length>0&&Mt(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,g.paused]),d.useEffect(()=>{if(a){al.add(g);const h=document.activeElement;if(!a.contains(h)){const w=new CustomEvent(rs,rl);a.addEventListener(rs,c),a.dispatchEvent(w),w.defaultPrevented||(Sh(Ah(sl(a)),{select:!0}),document.activeElement===h&&Mt(a))}return()=>{a.removeEventListener(rs,c),setTimeout(()=>{const w=new CustomEvent(os,rl);a.addEventListener(os,f),a.dispatchEvent(w),w.defaultPrevented||Mt(h??document.body,{select:!0}),a.removeEventListener(os,f),al.remove(g)},0)}}},[a,c,f,g]);const v=d.useCallback(h=>{if(!n&&!r||g.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]=Eh(b);S&&E?!h.shiftKey&&w===E?(h.preventDefault(),n&&Mt(S,{select:!0})):h.shiftKey&&w===S&&(h.preventDefault(),n&&Mt(E,{select:!0})):w===b&&h.preventDefault()}},[n,r,g.paused]);return l.jsx(be.div,{tabIndex:-1,...i,ref:m,onKeyDown:v})});ol.displayName=Ch;function Sh(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Mt(r,{select:t}),document.activeElement!==n)return}function Eh(e){const t=sl(e),n=il(t,e),r=il(t.reverse(),e);return[n,r]}function sl(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 il(e,t){for(const n of e)if(!Nh(n,{upTo:t}))return n}function Nh(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 Th(e){return e instanceof HTMLInputElement&&"select"in e}function Mt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Th(e)&&t&&e.select()}}var al=Ph();function Ph(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=ll(e,t),e.unshift(t)},remove(t){var n;e=ll(e,t),(n=e[0])==null||n.resume()}}}function ll(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Ah(e){return e.filter(t=>t.tagName!=="A")}var _h="Portal",ss=d.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=d.useState(!1);Re(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?uo.createPortal(l.jsx(be.div,{...r,ref:t}),i):null});ss.displayName=_h;var is=0;function Fh(){d.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??cl()),document.body.insertAdjacentElement("beforeend",e[1]??cl()),is++,()=>{is===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),is--}},[])}function cl(){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 ot=function(){return ot=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},ot.apply(this,arguments)};function ul(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 dl(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 fl(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 mr="right-scroll-bar-position",vr="width-before-scroll-bar",Oh="with-scroll-bars-hidden",Dh="--removed-body-scroll-bar-size";function as(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Mh(e,t){var n=A.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 Ih=typeof window<"u"?d.useLayoutEffect:d.useEffect,pl=new WeakMap;function kh(e,t){var n=Mh(null,function(r){return e.forEach(function(o){return as(o,r)})});return Ih(function(){var r=pl.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||as(a,null)}),s.forEach(function(a){o.has(a)||as(a,i)})}pl.set(n,e)},[e]),n}function $h(e){return e}function Lh(e,t){t===void 0&&(t=$h);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 Rh(e){e===void 0&&(e={});var t=Lh(null);return t.options=ot({async:!0,ssr:!1},e),t}var gl=function(e){var t=e.sideCar,n=ul(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,ot({},n))};gl.isSideCarExport=!0;function Vh(e,t){return e.useMedium(t),gl}var hl=Rh(),ls=function(){},yr=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:ls,onWheelCapture:ls,onTouchMoveCapture:ls}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,u=e.className,c=e.removeScrollBar,f=e.enabled,p=e.shards,m=e.sideCar,g=e.noIsolation,v=e.inert,h=e.allowPinchZoom,y=e.as,w=y===void 0?"div":y,b=e.gapMode,S=ul(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=m,x=kh([n,t]),P=ot(ot({},S),o);return d.createElement(d.Fragment,null,f&&d.createElement(E,{sideCar:hl,removeScrollBar:c,shards:p,noIsolation:g,inert:v,setCallbacks:s,allowPinchZoom:!!h,lockRef:n,gapMode:b}),i?d.cloneElement(d.Children.only(a),ot(ot({},P),{ref:x})):d.createElement(w,ot({},P,{className:u,ref:x}),a))});yr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},yr.classNames={fullWidth:vr,zeroRight:mr};var Bh=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function zh(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Bh();return t&&e.setAttribute("nonce",t),e}function Hh(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Uh(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var jh=function(){var e=0,t=null;return{add:function(n){e==0&&(t=zh())&&(Hh(t,n),Uh(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Wh=function(){var e=jh();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ml=function(){var e=Wh(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Gh={left:0,top:0,right:0,gap:0},cs=function(e){return parseInt(e||"",10)||0},qh=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[cs(n),cs(r),cs(o)]},Kh=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Gh;var t=qh(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])}},Xh=ml(),sn="data-scroll-locked",Jh=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
103
|
-
|
|
102
|
+
*/const pg=ze("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"}]]);/**
|
|
103
|
+
* @license lucide-react v0.468.0 - ISC
|
|
104
|
+
*
|
|
105
|
+
* This source code is licensed under the ISC license.
|
|
106
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
107
|
+
*/const Qo=ze("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),gg={category:"Thư mục gốc",fileName:"Tên tệp",fullPath:"Đường dẫn đầy đủ",createAt:"Ngày tạo",creator:"Người tạo",creatorId:"ID người tạo",DataSource:"Nguồn dữ liệu",SuggestedAICategories:"Danh mục AI gợi ý",KeywordAISuggestion:"Từ khóa AI gợi ý",SummaryOfSuggestedAI:"Tóm tắt AI gợi ý",AccessLevel:"Cấp độ truy cập"},hg=e=>e==="SummaryOfSuggestedAI"||e==="KeywordAISuggestion"||e==="SuggestedAICategories",es=e=>e==="fullPath"||e==="createAt"||e==="creator"||e==="creatorId"||e==="DataSource"||e==="AccessLevel"||e==="category"||e==="fileName",mg=(e,t)=>{if(e.length>30)return t({title:"Lỗi tải lên",description:"Bạn chỉ có thể tải lên tối đa 30 tệp.",variant:"destructive"}),!0;for(let o=0;o<e.length;o++){const s=e[o];if(s&&s.size>20971520)return t({title:"Lỗi tải lên",description:`Tệp ${s.name} vượt quá giới hạn kích thước 20MB.`,variant:"destructive"}),!0}return!1};function Fa(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function vg(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Fa(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():Fa(e[o],null)}}}}var tn=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(yg);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(ts,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(ts,{...r,ref:t,children:n})});tn.displayName="Slot";var ts=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=bg(n);return d.cloneElement(n,{...wg(r,n.props),ref:t?vg(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});ts.displayName="SlotClone";var Oa=({children:e})=>l.jsx(l.Fragment,{children:e});function yg(e){return d.isValidElement(e)&&e.type===Oa}function wg(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 bg(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 Da(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=Da(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ma(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Da(e))&&(r&&(r+=" "),r+=t);return r}const ns="-",xg=e=>{const t=Sg(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(ns);return a[0]===""&&a.length!==1&&a.shift(),Ia(a,t)||Cg(i)},getConflictingClassGroupIds:(i,a)=>{const u=n[i]||[];return a&&r[i]?[...u,...r[i]]:u}}},Ia=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Ia(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(ns);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},ka=/^\[(.+)\]$/,Cg=e=>{if(ka.test(e)){const t=ka.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Sg=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Ng(Object.entries(e.classGroups),n).forEach(([s,i])=>{rs(i,r,s,t)}),r},rs=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:$a(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(Eg(o)){rs(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{rs(i,$a(t,s),n,r)})})},$a=(e,t)=>{let n=e;return t.split(ns).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Eg=e=>e.isThemeGetter,Ng=(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,Tg=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)}}},La="!",Pg=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(La),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},Ag=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},_g=e=>({cache:Tg(e.cacheSize),parseClassName:Pg(e),...xg(e)}),Fg=/\s+/,Og=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(Fg);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=Ag(f).join(":"),w=g?y+La: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 Dg(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Ra(t))&&(r&&(r+=" "),r+=n);return r}const Ra=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Ra(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=_g(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=Og(u,n);return o(u,f),f}return function(){return s(Dg.apply(null,arguments))}}const de=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Va=/^\[(?:([a-z-]+):)?(.+)\]$/i,Ig=/^\d+\/\d+$/,kg=new Set(["px","full","screen"]),$g=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Lg=/\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$/,Rg=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Vg=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Bg=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,vt=e=>nn(e)||kg.has(e)||Ig.test(e),At=e=>rn(e,"length",Kg),nn=e=>!!e&&!Number.isNaN(Number(e)),os=e=>rn(e,"number",nn),Mn=e=>!!e&&Number.isInteger(Number(e)),Hg=e=>e.endsWith("%")&&nn(e.slice(0,-1)),oe=e=>Va.test(e),_t=e=>$g.test(e),zg=new Set(["length","size","percentage"]),Ug=e=>rn(e,zg,Ba),jg=e=>rn(e,"position",Ba),Wg=new Set(["image","url"]),Gg=e=>rn(e,Wg,Jg),qg=e=>rn(e,"",Xg),In=()=>!0,rn=(e,t,n)=>{const r=Va.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Kg=e=>Lg.test(e)&&!Rg.test(e),Ba=()=>!1,Xg=e=>Vg.test(e),Jg=e=>Bg.test(e),Yg=Mg(()=>{const e=de("colors"),t=de("spacing"),n=de("blur"),r=de("brightness"),o=de("borderColor"),s=de("borderRadius"),i=de("borderSpacing"),a=de("borderWidth"),u=de("contrast"),c=de("grayscale"),f=de("hueRotate"),g=de("invert"),m=de("gap"),p=de("gradientColorStops"),v=de("gradientColorStopPositions"),h=de("inset"),y=de("margin"),w=de("opacity"),b=de("padding"),S=de("saturate"),E=de("scale"),x=de("sepia"),A=de("skew"),F=de("space"),O=de("translate"),k=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto",oe,t],$=()=>[oe,t],U=()=>["",vt,At],L=()=>["auto",nn,oe],X=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],K=()=>["solid","dashed","dotted","double","none"],te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],H=()=>["start","end","center","between","around","evenly","stretch"],j=()=>["","0",oe],le=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ce=()=>[nn,oe];return{cacheSize:500,separator:":",theme:{colors:[In],spacing:[vt,At],blur:["none","",_t,oe],brightness:ce(),borderColor:[e],borderRadius:["none","","full",_t,oe],borderSpacing:$(),borderWidth:U(),contrast:ce(),grayscale:j(),hueRotate:ce(),invert:j(),gap:$(),gradientColorStops:[e],gradientColorStopPositions:[Hg,At],inset:q(),margin:q(),opacity:ce(),padding:$(),saturate:ce(),scale:ce(),sepia:j(),skew:ce(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",oe]}],container:["container"],columns:[{columns:[_t]}],"break-after":[{"break-after":le()}],"break-before":[{"break-before":le()}],"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:[...X(),oe]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],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",Mn,oe]}],basis:[{basis:q()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",oe]}],grow:[{grow:j()}],shrink:[{shrink:j()}],order:[{order:["first","last","none",Mn,oe]}],"grid-cols":[{"grid-cols":[In]}],"col-start-end":[{col:["auto",{span:["full",Mn,oe]},oe]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[In]}],"row-start-end":[{row:["auto",{span:[Mn,oe]},oe]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",oe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",oe]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...H()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...H(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...H(),"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":[F]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[F]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",oe,t]}],"min-w":[{"min-w":[oe,t,"min","max","fit"]}],"max-w":[{"max-w":[oe,t,"none","full","min","max","fit","prose",{screen:[_t]},_t]}],h:[{h:[oe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[oe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[oe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[oe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",_t,At]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",os]}],"font-family":[{font:[In]}],"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",oe]}],"line-clamp":[{"line-clamp":["none",nn,os]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",vt,oe]}],"list-image":[{"list-image":["none",oe]}],"list-style-type":[{list:["none","disc","decimal",oe]}],"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:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",vt,At]}],"underline-offset":[{"underline-offset":["auto",vt,oe]}],"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",oe]}],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",oe]}],"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:[...X(),jg]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Ug]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Gg]}],"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:[...K(),"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:K()}],"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:["",...K()]}],"outline-offset":[{"outline-offset":[vt,oe]}],"outline-w":[{outline:[vt,At]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[vt,At]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",_t,qg]}],"shadow-color":[{shadow:[In]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...te(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":te()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",_t,oe]}],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",oe]}],duration:[{duration:ce()}],ease:[{ease:["linear","in","out","in-out",oe]}],delay:[{delay:ce()}],animate:[{animate:["none","spin","ping","pulse","bounce",oe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[Mn,oe]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"skew-x":[{"skew-x":[A]}],"skew-y":[{"skew-y":[A]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",oe]}],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",oe]}],"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",oe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[vt,At,os]}],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 ee(...e){return Yg(Ma(e))}const Zg=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]}`},Ha=d.forwardRef(({className:e,...t},n)=>l.jsx("nav",{ref:n,"aria-label":"breadcrumb",className:ee("s3-explr-ui-breadcrumb",e),...t}));Ha.displayName="Breadcrumb";const za=d.forwardRef(({className:e,...t},n)=>l.jsx("ol",{ref:n,className:ee("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}));za.displayName="BreadcrumbList";const ss=d.forwardRef(({className:e,...t},n)=>l.jsx("li",{ref:n,className:ee("inline-flex items-center gap-1.5","s3-explr-ui-breadcrumb-item",e),...t}));ss.displayName="BreadcrumbItem";const is=d.forwardRef(({asChild:e,className:t,...n},r)=>{const o=e?tn:"a";return l.jsx(o,{ref:r,className:ee("transition-colors hover:text-foreground","s3-explr-ui-breadcrumb-link",t),...n})});is.displayName="BreadcrumbLink";const Qg=d.forwardRef(({className:e,...t},n)=>l.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:ee("font-normal text-foreground","s3-explr-ui-breadcrumb-page",e),...t}));Qg.displayName="BreadcrumbPage";const Ua=({children:e,className:t,...n})=>l.jsx("li",{role:"presentation","aria-hidden":"true",className:ee("[&>svg]:w-3.5 [&>svg]:h-3.5","s3-explr-ui-breadcrumb-separator",t),...n,children:e??l.jsx(_a,{})});Ua.displayName="BreadcrumbSeparator";const ja=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Wa=Ma,as=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Wa(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=ja(f)||ja(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 Wa(e,i,u,n==null?void 0:n.class,n==null?void 0:n.className)},Ga=as("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?tn:"button";return l.jsx(i,{className:ee(Ga({variant:t,size:n,className:e})),ref:s,...o})});ie.displayName="Button";function eh(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function vr(...e){return t=>e.forEach(n=>eh(n,t))}function Ue(...e){return d.useCallback(vr(...e),e)}function th(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 Ft(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,nh(o,...t)]}function nh(...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 ye(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 Ae(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 on({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=rh({defaultProp:t,onChange:n}),s=e!==void 0,i=s?e:r,a=Ae(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 rh({defaultProp:e,onChange:t}){const n=d.useState(e),[r]=n,o=d.useRef(r),s=Ae(t);return d.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}function oh(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 Re=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{};function qa(e){const[t,n]=d.useState(void 0);return Re(()=>{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 sh(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var sn=e=>{const{present:t,children:n}=e,r=ih(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=Ue(r.ref,ah(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};sn.displayName="Presence";function ih(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=sh(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=yr(r.current);s.current=a==="mounted"?c:"none"},[a]),Re(()=>{const c=r.current,f=o.current;if(f!==e){const m=s.current,p=yr(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]),Re(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,g=p=>{const h=yr(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=yr(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 yr(e){return(e==null?void 0:e.animationName)||"none"}function ah(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(ch);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})});Ka.displayName="Slot";var ls=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=dh(n);return d.cloneElement(n,{...uh(r,n.props),ref:t?vr(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});ls.displayName="SlotClone";var lh=({children:e})=>l.jsx(l.Fragment,{children:e});function ch(e){return d.isValidElement(e)&&e.type===lh}function uh(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 dh(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 fh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],we=fh.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 Xa(e,t){e&&er.flushSync(()=>e.dispatchEvent(t))}var cs="Checkbox",[ph,mC]=Ft(cs),[gh,hh]=ph(cs),Ja=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=Ue(t,E=>p(E)),h=d.useRef(!1),y=m?f||!!m.closest("form"):!0,[w=!1,b]=on({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(gh,{scope:n,state:w,disabled:a,children:[l.jsx(we.button,{type:"button",role:"checkbox","aria-checked":Ot(w)?"mixed":w,"aria-required":i,"data-state":Qa(w),"data-disabled":a?"":void 0,disabled:a,value:u,...g,ref:v,onKeyDown:ye(e.onKeyDown,E=>{E.key==="Enter"&&E.preventDefault()}),onClick:ye(e.onClick,E=>{b(x=>Ot(x)?!0:!x),y&&(h.current=E.isPropagationStopped(),h.current||E.stopPropagation())})}),y&&l.jsx(mh,{control:m,bubbles:!h.current,name:r,value:u,checked:w,required:i,disabled:a,form:f,style:{transform:"translateX(-100%)"},defaultChecked:Ot(s)?!1:s})]})});Ja.displayName=cs;var Ya="CheckboxIndicator",Za=d.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=hh(Ya,n);return l.jsx(sn,{present:r||Ot(s.state)||s.state===!0,children:l.jsx(we.span,{"data-state":Qa(s.state),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});Za.displayName=Ya;var mh=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:o,...s}=e,i=d.useRef(null),a=oh(n),u=qa(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=Ot(n),p.call(f,Ot(n)?!1:n),f.dispatchEvent(v)}},[a,n,r]);const c=d.useRef(Ot(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 Ot(e){return e==="indeterminate"}function Qa(e){return Ot(e)?"indeterminate":e?"checked":"unchecked"}var el=Ja,vh=Za;const us=d.forwardRef(({className:e,...t},n)=>l.jsx(el,{ref:n,className:ee("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(vh,{className:ee("s3-explr-ui-checkbox-indicator flex items-center justify-center text-current"),children:l.jsx(ag,{className:"s3-explr-ui-checkbox-check h-4 w-4"})})}));us.displayName=el.displayName;var yh=d.useId||(()=>{}),wh=0;function an(e){const[t,n]=d.useState(yh());return Re(()=>{e||n(r=>r??String(wh++))},[e]),e||(t?`radix-${t}`:"")}function tl(e,t=globalThis==null?void 0:globalThis.document){const n=Ae(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 bh="DismissableLayer",ds="dismissableLayer.update",xh="dismissableLayer.pointerDownOutside",Ch="dismissableLayer.focusOutside",nl,rl=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),fs=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...u}=e,c=d.useContext(rl),[f,g]=d.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=d.useState({}),v=Ue(t,F=>g(F)),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=Eh(F=>{const O=F.target,k=[...c.branches].some(M=>M.contains(O));!E||k||(o==null||o(F),i==null||i(F),F.defaultPrevented||a==null||a())},m),A=Nh(F=>{const O=F.target;[...c.branches].some(M=>M.contains(O))||(s==null||s(F),i==null||i(F),F.defaultPrevented||a==null||a())},m);return tl(F=>{b===c.layers.size-1&&(r==null||r(F),!F.defaultPrevented&&a&&(F.preventDefault(),a()))},m),d.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(nl=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),sl(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=nl)}},[f,m,n,c]),d.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),sl())},[f,c]),d.useEffect(()=>{const F=()=>p({});return document.addEventListener(ds,F),()=>document.removeEventListener(ds,F)},[]),l.jsx(we.div,{...u,ref:v,style:{pointerEvents:S?E?"auto":"none":void 0,...e.style},onFocusCapture:ye(e.onFocusCapture,A.onFocusCapture),onBlurCapture:ye(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:ye(e.onPointerDownCapture,x.onPointerDownCapture)})});fs.displayName=bh;var Sh="DismissableLayerBranch",ol=d.forwardRef((e,t)=>{const n=d.useContext(rl),r=d.useRef(null),o=Ue(t,r);return d.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(we.div,{...e,ref:o})});ol.displayName=Sh;function Eh(e,t=globalThis==null?void 0:globalThis.document){const n=Ae(e),r=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let u=function(){il(xh,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 Nh(e,t=globalThis==null?void 0:globalThis.document){const n=Ae(e),r=d.useRef(!1);return d.useEffect(()=>{const o=s=>{s.target&&!r.current&&il(Ch,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 sl(){const e=new CustomEvent(ds);document.dispatchEvent(e)}function il(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?Xa(o,s):o.dispatchEvent(s)}var Th=fs,Ph=ol,ps="focusScope.autoFocusOnMount",gs="focusScope.autoFocusOnUnmount",al={bubbles:!1,cancelable:!0},Ah="FocusScope",ll=d.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,u]=d.useState(null),c=Ae(o),f=Ae(s),g=d.useRef(null),m=Ue(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:Dt(g.current,{select:!0})},y=function(S){if(p.paused||!a)return;const E=S.relatedTarget;E!==null&&(a.contains(E)||Dt(g.current,{select:!0}))},w=function(S){if(document.activeElement===document.body)for(const x of S)x.removedNodes.length>0&&Dt(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){dl.add(p);const h=document.activeElement;if(!a.contains(h)){const w=new CustomEvent(ps,al);a.addEventListener(ps,c),a.dispatchEvent(w),w.defaultPrevented||(_h(Ih(cl(a)),{select:!0}),document.activeElement===h&&Dt(a))}return()=>{a.removeEventListener(ps,c),setTimeout(()=>{const w=new CustomEvent(gs,al);a.addEventListener(gs,f),a.dispatchEvent(w),w.defaultPrevented||Dt(h??document.body,{select:!0}),a.removeEventListener(gs,f),dl.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]=Fh(b);S&&E?!h.shiftKey&&w===E?(h.preventDefault(),n&&Dt(S,{select:!0})):h.shiftKey&&w===S&&(h.preventDefault(),n&&Dt(E,{select:!0})):w===b&&h.preventDefault()}},[n,r,p.paused]);return l.jsx(we.div,{tabIndex:-1,...i,ref:m,onKeyDown:v})});ll.displayName=Ah;function _h(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Dt(r,{select:t}),document.activeElement!==n)return}function Fh(e){const t=cl(e),n=ul(t,e),r=ul(t.reverse(),e);return[n,r]}function cl(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 ul(e,t){for(const n of e)if(!Oh(n,{upTo:t}))return n}function Oh(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 Dh(e){return e instanceof HTMLInputElement&&"select"in e}function Dt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Dh(e)&&t&&e.select()}}var dl=Mh();function Mh(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=fl(e,t),e.unshift(t)},remove(t){var n;e=fl(e,t),(n=e[0])==null||n.resume()}}}function fl(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Ih(e){return e.filter(t=>t.tagName!=="A")}var kh="Portal",hs=d.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=d.useState(!1);Re(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?bo.createPortal(l.jsx(we.div,{...r,ref:t}),i):null});hs.displayName=kh;var ms=0;function $h(){d.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??pl()),document.body.insertAdjacentElement("beforeend",e[1]??pl()),ms++,()=>{ms===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ms--}},[])}function pl(){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 st=function(){return st=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},st.apply(this,arguments)};function gl(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 hl(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 ml(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 wr="right-scroll-bar-position",br="width-before-scroll-bar",Lh="with-scroll-bars-hidden",Rh="--removed-body-scroll-bar-size";function vs(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Vh(e,t){var n=P.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,vl=new WeakMap;function Hh(e,t){var n=Vh(null,function(r){return e.forEach(function(o){return vs(o,r)})});return Bh(function(){var r=vl.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||vs(a,null)}),s.forEach(function(a){o.has(a)||vs(a,i)})}vl.set(n,e)},[e]),n}function zh(e){return e}function Uh(e,t){t===void 0&&(t=zh);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 jh(e){e===void 0&&(e={});var t=Uh(null);return t.options=st({async:!0,ssr:!1},e),t}var yl=function(e){var t=e.sideCar,n=gl(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,st({},n))};yl.isSideCarExport=!0;function Wh(e,t){return e.useMedium(t),yl}var wl=jh(),ys=function(){},xr=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:ys,onWheelCapture:ys,onTouchMoveCapture:ys}),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=gl(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=m,x=Hh([n,t]),A=st(st({},S),o);return d.createElement(d.Fragment,null,f&&d.createElement(E,{sideCar:wl,removeScrollBar:c,shards:g,noIsolation:p,inert:v,setCallbacks:s,allowPinchZoom:!!h,lockRef:n,gapMode:b}),i?d.cloneElement(d.Children.only(a),st(st({},A),{ref:x})):d.createElement(w,st({},A,{className:u,ref:x}),a))});xr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},xr.classNames={fullWidth:br,zeroRight:wr};var Gh=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function qh(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Gh();return t&&e.setAttribute("nonce",t),e}function Kh(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Xh(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Jh=function(){var e=0,t=null;return{add:function(n){e==0&&(t=qh())&&(Kh(t,n),Xh(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Yh=function(){var e=Jh();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},bl=function(){var e=Yh(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Zh={left:0,top:0,right:0,gap:0},ws=function(e){return parseInt(e||"",10)||0},Qh=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[ws(n),ws(r),ws(o)]},em=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Zh;var t=Qh(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])}},tm=bl(),ln="data-scroll-locked",nm=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
108
|
+
.`.concat(Lh,` {
|
|
104
109
|
overflow: hidden `).concat(r,`;
|
|
105
110
|
padding-right: `).concat(a,"px ").concat(r,`;
|
|
106
111
|
}
|
|
107
|
-
body[`).concat(
|
|
112
|
+
body[`).concat(ln,`] {
|
|
108
113
|
overflow: hidden `).concat(r,`;
|
|
109
114
|
overscroll-behavior: contain;
|
|
110
115
|
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
@@ -117,32 +122,32 @@
|
|
|
117
122
|
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
118
123
|
}
|
|
119
124
|
|
|
120
|
-
.`).concat(
|
|
125
|
+
.`).concat(wr,` {
|
|
121
126
|
right: `).concat(a,"px ").concat(r,`;
|
|
122
127
|
}
|
|
123
128
|
|
|
124
|
-
.`).concat(
|
|
129
|
+
.`).concat(br,` {
|
|
125
130
|
margin-right: `).concat(a,"px ").concat(r,`;
|
|
126
131
|
}
|
|
127
132
|
|
|
128
|
-
.`).concat(
|
|
133
|
+
.`).concat(wr," .").concat(wr,` {
|
|
129
134
|
right: 0 `).concat(r,`;
|
|
130
135
|
}
|
|
131
136
|
|
|
132
|
-
.`).concat(
|
|
137
|
+
.`).concat(br," .").concat(br,` {
|
|
133
138
|
margin-right: 0 `).concat(r,`;
|
|
134
139
|
}
|
|
135
140
|
|
|
136
|
-
body[`).concat(
|
|
137
|
-
`).concat(
|
|
141
|
+
body[`).concat(ln,`] {
|
|
142
|
+
`).concat(Rh,": ").concat(a,`px;
|
|
138
143
|
}
|
|
139
|
-
`)},
|
|
144
|
+
`)},xl=function(){var e=parseInt(document.body.getAttribute(ln)||"0",10);return isFinite(e)?e:0},rm=function(){d.useEffect(function(){return document.body.setAttribute(ln,(xl()+1).toString()),function(){var e=xl()-1;e<=0?document.body.removeAttribute(ln):document.body.setAttribute(ln,e.toString())}},[])},om=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;rm();var s=d.useMemo(function(){return em(o)},[o]);return d.createElement(tm,{styles:nm(s,!t,o,n?"":"!important")})},bs=!1;if(typeof window<"u")try{var Cr=Object.defineProperty({},"passive",{get:function(){return bs=!0,!0}});window.addEventListener("test",Cr,Cr),window.removeEventListener("test",Cr,Cr)}catch{bs=!1}var cn=bs?{passive:!1}:!1,sm=function(e){return e.tagName==="TEXTAREA"},Cl=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!sm(e)&&n[t]==="visible")},im=function(e){return Cl(e,"overflowY")},am=function(e){return Cl(e,"overflowX")},Sl=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=El(e,r);if(o){var s=Nl(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},lm=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},cm=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},El=function(e,t){return e==="v"?im(t):am(t)},Nl=function(e,t){return e==="v"?lm(t):cm(t)},um=function(e,t){return e==="h"&&t==="rtl"?-1:1},dm=function(e,t,n,r,o){var s=um(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=Nl(e,a),v=p[0],h=p[1],y=p[2],w=h-y-s*v;(v||w)&&El(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},Sr=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Tl=function(e){return[e.deltaX,e.deltaY]},Pl=function(e){return e&&"current"in e?e.current:e},fm=function(e,t){return e[0]===t[0]&&e[1]===t[1]},pm=function(e){return`
|
|
140
145
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
141
146
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
142
|
-
`)},lm=0,ln=[];function cm(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),o=d.useState(lm++)[0],s=d.useState(ml)[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=fl([e.lockRef.current],(e.shards||[]).map(Sl),!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=br(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,F=Math.abs(S)>Math.abs(E)?"h":"v";if("touches"in h&&F==="h"&&P.type==="range")return!1;var O=wl(F,P);if(!O)return!0;if(O?x=F:(x=F==="v"?"h":"v",O=wl(F,P)),!O)return!1;if(!r.current&&"changedTouches"in h&&(S||E)&&(r.current=x),!x)return!0;var I=r.current||x;return sm(I,y,h,I==="h"?S:E,!0)},[]),u=d.useCallback(function(h){var y=h;if(!(!ln.length||ln[ln.length-1]!==s)){var w="deltaY"in y?Cl(y):br(y),b=t.current.filter(function(x){return x.name===y.type&&(x.target===y.target||y.target===x.shadowParent)&&im(x.delta,w)})[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}if(!b){var S=(i.current.shards||[]).map(Sl).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:um(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=br(h),r.current=void 0},[]),p=d.useCallback(function(h){c(h.type,Cl(h),h.target,a(h,e.lockRef.current))},[]),m=d.useCallback(function(h){c(h.type,br(h),h.target,a(h,e.lockRef.current))},[]);d.useEffect(function(){return ln.push(s),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",u,an),document.addEventListener("touchmove",u,an),document.addEventListener("touchstart",f,an),function(){ln=ln.filter(function(h){return h!==s}),document.removeEventListener("wheel",u,an),document.removeEventListener("touchmove",u,an),document.removeEventListener("touchstart",f,an)}},[]);var g=e.removeScrollBar,v=e.inert;return d.createElement(d.Fragment,null,v?d.createElement(s,{styles:am(o)}):null,g?d.createElement(Zh,{gapMode:e.gapMode}):null)}function um(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const dm=Vh(hl,cm);var El=d.forwardRef(function(e,t){return d.createElement(yr,ot({},e,{ref:t,sideCar:dm}))});El.classNames=yr.classNames;var fm=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},cn=new WeakMap,xr=new WeakMap,Cr={},ds=0,Nl=function(e){return e&&(e.host||Nl(e.parentNode))},pm=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Nl(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})},gm=function(e,t,n,r){var o=pm(t,Array.isArray(e)?e:[e]);Cr[n]||(Cr[n]=new WeakMap);var s=Cr[n],i=[],a=new Set,u=new Set(o),c=function(p){!p||a.has(p)||(a.add(p),c(p.parentNode))};o.forEach(c);var f=function(p){!p||u.has(p)||Array.prototype.forEach.call(p.children,function(m){if(a.has(m))f(m);else try{var g=m.getAttribute(r),v=g!==null&&g!=="false",h=(cn.get(m)||0)+1,y=(s.get(m)||0)+1;cn.set(m,h),s.set(m,y),i.push(m),h===1&&v&&xr.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(),ds++,function(){i.forEach(function(p){var m=cn.get(p)-1,g=s.get(p)-1;cn.set(p,m),s.set(p,g),m||(xr.has(p)||p.removeAttribute(r),xr.delete(p)),g||p.removeAttribute(n)}),ds--,ds||(cn=new WeakMap,cn=new WeakMap,xr=new WeakMap,Cr={})}},hm=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=fm(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),gm(r,o,n,"aria-hidden")):function(){return null}},Tl=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(vm);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})});Tl.displayName="Slot";var fs=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=wm(n);return d.cloneElement(n,{...ym(r,n.props),ref:t?gr(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});fs.displayName="SlotClone";var mm=({children:e})=>l.jsx(l.Fragment,{children:e});function vm(e){return d.isValidElement(e)&&e.type===mm}function ym(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 wm(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 ps="Dialog",[Pl,dC]=Ot(ps),[bm,Je]=Pl(ps),Al=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]=nn({prop:r,defaultProp:o,onChange:s});return l.jsx(bm,{scope:t,triggerRef:a,contentRef:u,contentId:on(),titleId:on(),descriptionId:on(),open:c,onOpenChange:f,onOpenToggle:d.useCallback(()=>f(p=>!p),[f]),modal:i,children:n})};Al.displayName=ps;var _l="DialogTrigger",Fl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Je(_l,n),s=ze(t,o.triggerRef);return l.jsx(be.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ms(o.open),...r,ref:s,onClick:we(e.onClick,o.onOpenToggle)})});Fl.displayName=_l;var gs="DialogPortal",[xm,Ol]=Pl(gs,{forceMount:void 0}),Dl=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=Je(gs,t);return l.jsx(xm,{scope:t,forceMount:n,children:d.Children.map(r,i=>l.jsx(rn,{present:n||s.open,children:l.jsx(ss,{asChild:!0,container:o,children:i})}))})};Dl.displayName=gs;var Sr="DialogOverlay",Ml=d.forwardRef((e,t)=>{const n=Ol(Sr,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Je(Sr,e.__scopeDialog);return s.modal?l.jsx(rn,{present:r||s.open,children:l.jsx(Cm,{...o,ref:t})}):null});Ml.displayName=Sr;var Cm=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Je(Sr,n);return l.jsx(El,{as:Tl,allowPinchZoom:!0,shards:[o.contentRef],children:l.jsx(be.div,{"data-state":ms(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),jt="DialogContent",Il=d.forwardRef((e,t)=>{const n=Ol(jt,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Je(jt,e.__scopeDialog);return l.jsx(rn,{present:r||s.open,children:s.modal?l.jsx(Sm,{...o,ref:t}):l.jsx(Em,{...o,ref:t})})});Il.displayName=jt;var Sm=d.forwardRef((e,t)=>{const n=Je(jt,e.__scopeDialog),r=d.useRef(null),o=ze(t,n.contentRef,r);return d.useEffect(()=>{const s=r.current;if(s)return hm(s)},[]),l.jsx(kl,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:we(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:we(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:we(e.onFocusOutside,s=>s.preventDefault())})}),Em=d.forwardRef((e,t)=>{const n=Je(jt,e.__scopeDialog),r=d.useRef(!1),o=d.useRef(!1);return l.jsx(kl,{...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()}})}),kl=d.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=Je(jt,n),u=d.useRef(null),c=ze(t,u);return Fh(),l.jsxs(l.Fragment,{children:[l.jsx(ol,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:l.jsx(ns,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":ms(a.open),...i,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(Nm,{titleId:a.titleId}),l.jsx(Pm,{contentRef:u,descriptionId:a.descriptionId})]})]})}),hs="DialogTitle",$l=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Je(hs,n);return l.jsx(be.h2,{id:o.titleId,...r,ref:t})});$l.displayName=hs;var Ll="DialogDescription",Rl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Je(Ll,n);return l.jsx(be.p,{id:o.descriptionId,...r,ref:t})});Rl.displayName=Ll;var Vl="DialogClose",Bl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Je(Vl,n);return l.jsx(be.button,{type:"button",...r,ref:t,onClick:we(e.onClick,()=>o.onOpenChange(!1))})});Bl.displayName=Vl;function ms(e){return e?"open":"closed"}var zl="DialogTitleWarning",[fC,Hl]=Xg(zl,{contentName:jt,titleName:hs,docsSlug:"dialog"}),Nm=({titleId:e})=>{const t=Hl(zl),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
147
|
+
`)},gm=0,un=[];function hm(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),o=d.useState(gm++)[0],s=d.useState(bl)[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=ml([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=Sr(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,A=h.target,F=Math.abs(S)>Math.abs(E)?"h":"v";if("touches"in h&&F==="h"&&A.type==="range")return!1;var O=Sl(F,A);if(!O)return!0;if(O?x=F:(x=F==="v"?"h":"v",O=Sl(F,A)),!O)return!1;if(!r.current&&"changedTouches"in h&&(S||E)&&(r.current=x),!x)return!0;var k=r.current||x;return dm(k,y,h,k==="h"?S:E,!0)},[]),u=d.useCallback(function(h){var y=h;if(!(!un.length||un[un.length-1]!==s)){var w="deltaY"in y?Tl(y):Sr(y),b=t.current.filter(function(x){return x.name===y.type&&(x.target===y.target||y.target===x.shadowParent)&&fm(x.delta,w)})[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}if(!b){var S=(i.current.shards||[]).map(Pl).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:mm(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=Sr(h),r.current=void 0},[]),g=d.useCallback(function(h){c(h.type,Tl(h),h.target,a(h,e.lockRef.current))},[]),m=d.useCallback(function(h){c(h.type,Sr(h),h.target,a(h,e.lockRef.current))},[]);d.useEffect(function(){return un.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:m}),document.addEventListener("wheel",u,cn),document.addEventListener("touchmove",u,cn),document.addEventListener("touchstart",f,cn),function(){un=un.filter(function(h){return h!==s}),document.removeEventListener("wheel",u,cn),document.removeEventListener("touchmove",u,cn),document.removeEventListener("touchstart",f,cn)}},[]);var p=e.removeScrollBar,v=e.inert;return d.createElement(d.Fragment,null,v?d.createElement(s,{styles:pm(o)}):null,p?d.createElement(om,{gapMode:e.gapMode}):null)}function mm(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const vm=Wh(wl,hm);var Al=d.forwardRef(function(e,t){return d.createElement(xr,st({},e,{ref:t,sideCar:vm}))});Al.classNames=xr.classNames;var ym=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},dn=new WeakMap,Er=new WeakMap,Nr={},xs=0,_l=function(e){return e&&(e.host||_l(e.parentNode))},wm=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=_l(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})},bm=function(e,t,n,r){var o=wm(t,Array.isArray(e)?e:[e]);Nr[n]||(Nr[n]=new WeakMap);var s=Nr[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=(dn.get(m)||0)+1,y=(s.get(m)||0)+1;dn.set(m,h),s.set(m,y),i.push(m),h===1&&v&&Er.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(),xs++,function(){i.forEach(function(g){var m=dn.get(g)-1,p=s.get(g)-1;dn.set(g,m),s.set(g,p),m||(Er.has(g)||g.removeAttribute(r),Er.delete(g)),p||g.removeAttribute(n)}),xs--,xs||(dn=new WeakMap,dn=new WeakMap,Er=new WeakMap,Nr={})}},xm=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=ym(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),bm(r,o,n,"aria-hidden")):function(){return null}},Fl=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Sm);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(Cs,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Cs,{...r,ref:t,children:n})});Fl.displayName="Slot";var Cs=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Nm(n);return d.cloneElement(n,{...Em(r,n.props),ref:t?vr(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Cs.displayName="SlotClone";var Cm=({children:e})=>l.jsx(l.Fragment,{children:e});function Sm(e){return d.isValidElement(e)&&e.type===Cm}function Em(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 Nm(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 Ss="Dialog",[Ol,vC]=Ft(Ss),[Tm,Je]=Ol(Ss),Dl=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]=on({prop:r,defaultProp:o,onChange:s});return l.jsx(Tm,{scope:t,triggerRef:a,contentRef:u,contentId:an(),titleId:an(),descriptionId:an(),open:c,onOpenChange:f,onOpenToggle:d.useCallback(()=>f(g=>!g),[f]),modal:i,children:n})};Dl.displayName=Ss;var Ml="DialogTrigger",Il=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Je(Ml,n),s=Ue(t,o.triggerRef);return l.jsx(we.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Ts(o.open),...r,ref:s,onClick:ye(e.onClick,o.onOpenToggle)})});Il.displayName=Ml;var Es="DialogPortal",[Pm,kl]=Ol(Es,{forceMount:void 0}),$l=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=Je(Es,t);return l.jsx(Pm,{scope:t,forceMount:n,children:d.Children.map(r,i=>l.jsx(sn,{present:n||s.open,children:l.jsx(hs,{asChild:!0,container:o,children:i})}))})};$l.displayName=Es;var Tr="DialogOverlay",Ll=d.forwardRef((e,t)=>{const n=kl(Tr,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Je(Tr,e.__scopeDialog);return s.modal?l.jsx(sn,{present:r||s.open,children:l.jsx(Am,{...o,ref:t})}):null});Ll.displayName=Tr;var Am=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Je(Tr,n);return l.jsx(Al,{as:Fl,allowPinchZoom:!0,shards:[o.contentRef],children:l.jsx(we.div,{"data-state":Ts(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Wt="DialogContent",Rl=d.forwardRef((e,t)=>{const n=kl(Wt,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Je(Wt,e.__scopeDialog);return l.jsx(sn,{present:r||s.open,children:s.modal?l.jsx(_m,{...o,ref:t}):l.jsx(Fm,{...o,ref:t})})});Rl.displayName=Wt;var _m=d.forwardRef((e,t)=>{const n=Je(Wt,e.__scopeDialog),r=d.useRef(null),o=Ue(t,n.contentRef,r);return d.useEffect(()=>{const s=r.current;if(s)return xm(s)},[]),l.jsx(Vl,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ye(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:ye(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:ye(e.onFocusOutside,s=>s.preventDefault())})}),Fm=d.forwardRef((e,t)=>{const n=Je(Wt,e.__scopeDialog),r=d.useRef(!1),o=d.useRef(!1);return l.jsx(Vl,{...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()}})}),Vl=d.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=Je(Wt,n),u=d.useRef(null),c=Ue(t,u);return $h(),l.jsxs(l.Fragment,{children:[l.jsx(ll,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:l.jsx(fs,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Ts(a.open),...i,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(Om,{titleId:a.titleId}),l.jsx(Mm,{contentRef:u,descriptionId:a.descriptionId})]})]})}),Ns="DialogTitle",Bl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Je(Ns,n);return l.jsx(we.h2,{id:o.titleId,...r,ref:t})});Bl.displayName=Ns;var Hl="DialogDescription",zl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Je(Hl,n);return l.jsx(we.p,{id:o.descriptionId,...r,ref:t})});zl.displayName=Hl;var Ul="DialogClose",jl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Je(Ul,n);return l.jsx(we.button,{type:"button",...r,ref:t,onClick:ye(e.onClick,()=>o.onOpenChange(!1))})});jl.displayName=Ul;function Ts(e){return e?"open":"closed"}var Wl="DialogTitleWarning",[yC,Gl]=th(Wl,{contentName:Wt,titleName:Ns,docsSlug:"dialog"}),Om=({titleId:e})=>{const t=Gl(Wl),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
143
148
|
|
|
144
149
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
145
150
|
|
|
146
|
-
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},Tm="DialogDescriptionWarning",Pm=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Hl(Tm).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},Am=Al,_m=Fl,Fm=Dl,Ul=Ml,jl=Il,Wl=$l,Gl=Rl,Om=Bl;const It=Am,Er=_m,Dm=Fm,ql=d.forwardRef(({className:e,...t},n)=>l.jsx(Ul,{ref:n,className:te("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}));ql.displayName=Ul.displayName;const vt=d.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(Dm,{children:[l.jsx(ql,{}),l.jsxs(jl,{ref:r,className:te("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(Om,{className:te("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(Uo,{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"})]})]})]}));vt.displayName=jl.displayName;const yt=({className:e,...t})=>l.jsx("div",{className:te("s3-explr-ui-dialog-header flex flex-col space-y-1.5 text-center sm:text-left",e),...t});yt.displayName="DialogHeader";const un=({className:e,...t})=>l.jsx("div",{className:te("s3-explr-ui-dialog-footer flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});un.displayName="DialogFooter";const wt=d.forwardRef(({className:e,...t},n)=>l.jsx(Wl,{ref:n,className:te("s3-explr-ui-dialog-title text-lg font-semibold leading-none tracking-tight",e),...t}));wt.displayName=Wl.displayName;const Mn=d.forwardRef(({className:e,...t},n)=>l.jsx(Gl,{ref:n,className:te("s3-explr-ui-dialog-description text-sm text-muted-foreground",e),...t}));Mn.displayName=Gl.displayName;const kt=d.forwardRef(({className:e,type:t,...n},r)=>l.jsx("input",{type:t,className:te("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}));kt.displayName="Input";var Mm="Label",Kl=d.forwardRef((e,t)=>l.jsx(be.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())}}));Kl.displayName=Mm;var Xl=Kl;const Im=Yo("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"}}),Wt=d.forwardRef(({className:e,variant:t,size:n,...r},o)=>l.jsx(Xl,{ref:o,className:te(Im({variant:t,size:n}),e),...r}));Wt.displayName=Xl.displayName;const Nr=d.forwardRef(({className:e,...t},n)=>l.jsx("div",{className:te("relative w-full overflow-auto","s3-explr-ui-table-container"),children:l.jsx("table",{ref:n,className:te("w-full caption-bottom text-sm","s3-explr-ui-table",e),...t})}));Nr.displayName="Table";const Tr=d.forwardRef(({className:e,...t},n)=>l.jsx("thead",{ref:n,className:te("[&_tr]:border-b","s3-explr-ui-table-header",e),...t}));Tr.displayName="TableHeader";const Pr=d.forwardRef(({className:e,...t},n)=>l.jsx("tbody",{ref:n,className:te("[&_tr:last-child]:border-0","s3-explr-ui-table-body",e),...t}));Pr.displayName="TableBody";const km=d.forwardRef(({className:e,...t},n)=>l.jsx("tfoot",{ref:n,className:te("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0","s3-explr-ui-table-footer",e),...t}));km.displayName="TableFooter";const Ye=d.forwardRef(({className:e,...t},n)=>l.jsx("tr",{ref:n,className:te("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted","s3-explr-ui-table-row",e),...t}));Ye.displayName="TableRow";const st=d.forwardRef(({className:e,...t},n)=>l.jsx("th",{ref:n,className:te("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}));st.displayName="TableHead";const De=d.forwardRef(({className:e,...t},n)=>l.jsx("td",{ref:n,className:te("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]","s3-explr-ui-table-cell",e),...t}));De.displayName="TableCell";const $m=d.forwardRef(({className:e,...t},n)=>l.jsx("caption",{ref:n,className:te("mt-4 text-sm text-muted-foreground","s3-explr-ui-table-caption",e),...t}));$m.displayName="TableCaption";function vs(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 dn(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 Jl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ys(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Jl(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():Jl(e[o],null)}}}}function ws(...e){return d.useCallback(ys(...e),e)}var bs=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(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=Bm(n);return d.cloneElement(n,{...Vm(r,n.props),ref:t?ys(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});xs.displayName="SlotClone";var Lm=({children:e})=>l.jsx(l.Fragment,{children:e});function Rm(e){return d.isValidElement(e)&&e.type===Lm}function Vm(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 Bm(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 zm(e){const t=e+"CollectionProvider",[n,r]=Ot(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=g=>{const{scope:v,children:h}=g,y=A.useRef(null),w=A.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:w,collectionRef:y,children:h})};i.displayName=t;const a=e+"CollectionSlot",u=A.forwardRef((g,v)=>{const{scope:h,children:y}=g,w=s(a,h),b=ws(v,w.collectionRef);return l.jsx(bs,{ref:b,children:y})});u.displayName=a;const c=e+"CollectionItemSlot",f="data-radix-collection-item",p=A.forwardRef((g,v)=>{const{scope:h,children:y,...w}=g,b=A.useRef(null),S=ws(v,b),E=s(c,h);return A.useEffect(()=>(E.itemMap.set(b,{ref:b,...w}),()=>void E.itemMap.delete(b))),l.jsx(bs,{[f]:"",ref:S,children:y})});p.displayName=c;function m(g){const v=s(e+"CollectionConsumer",g);return A.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:p},m,r]}var Yl=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Um);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(Cs,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Cs,{...r,ref:t,children:n})});Yl.displayName="Slot";var Cs=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Wm(n);return d.cloneElement(n,{...jm(r,n.props),ref:t?ys(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Cs.displayName="SlotClone";var Hm=({children:e})=>l.jsx(l.Fragment,{children:e});function Um(e){return d.isValidElement(e)&&e.type===Hm}function jm(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 Wm(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 Gm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Zl=Gm.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Yl: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}},{}),qm=d.createContext(void 0);function Ql(e){const t=d.useContext(qm);return e||t||"ltr"}var Ss="rovingFocusGroup.onEntryFocus",Km={bubbles:!1,cancelable:!0},Ar="RovingFocusGroup",[Es,ec,Xm]=zm(Ar),[Jm,tc]=Ot(Ar,[Xm]),[Ym,Zm]=Jm(Ar),nc=d.forwardRef((e,t)=>l.jsx(Es.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Es.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Qm,{...e,ref:t})})}));nc.displayName=Ar;var Qm=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,...p}=e,m=d.useRef(null),g=ws(t,m),v=Ql(s),[h=null,y]=nn({prop:i,defaultProp:a,onChange:u}),[w,b]=d.useState(!1),S=Ae(c),E=ec(n),x=d.useRef(!1),[P,F]=d.useState(0);return d.useEffect(()=>{const O=m.current;if(O)return O.addEventListener(Ss,S),()=>O.removeEventListener(Ss,S)},[S]),l.jsx(Ym,{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(()=>F(O=>O+1),[]),onFocusableItemRemove:d.useCallback(()=>F(O=>O-1),[]),children:l.jsx(Zl.div,{tabIndex:w||P===0?-1:0,"data-orientation":r,...p,ref:g,style:{outline:"none",...e.style},onMouseDown:dn(e.onMouseDown,()=>{x.current=!0}),onFocus:dn(e.onFocus,O=>{const I=!x.current;if(O.target===O.currentTarget&&I&&!w){const D=new CustomEvent(Ss,Km);if(O.currentTarget.dispatchEvent(D),!D.defaultPrevented){const q=E().filter(B=>B.focusable),k=q.find(B=>B.active),z=q.find(B=>B.id===h),J=[k,z,...q].filter(Boolean).map(B=>B.ref.current);sc(J,f)}}x.current=!1}),onBlur:dn(e.onBlur,()=>b(!1))})})}),rc="RovingFocusGroupItem",oc=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,...i}=e,a=on(),u=s||a,c=Zm(rc,n),f=c.currentTabStopId===u,p=ec(n),{onFocusableItemAdd:m,onFocusableItemRemove:g}=c;return d.useEffect(()=>{if(r)return m(),()=>g()},[r,m,g]),l.jsx(Es.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:l.jsx(Zl.span,{tabIndex:f?0:-1,"data-orientation":c.orientation,...i,ref:t,onMouseDown:dn(e.onMouseDown,v=>{r?c.onItemFocus(u):v.preventDefault()}),onFocus:dn(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:dn(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const h=nv(v,c.orientation,c.dir);if(h!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let w=p().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?rv(w,b+1):w.slice(b+1)}setTimeout(()=>sc(w))}})})})});oc.displayName=rc;var ev={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function tv(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function nv(e,t,n){const r=tv(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return ev[r]}function sc(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function rv(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ov=nc,sv=oc;function ic(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function iv(...e){return t=>{let n=!1;const r=e.map(o=>{const s=ic(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():ic(e[o],null)}}}}function av(...e){return d.useCallback(iv(...e),e)}function lv(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var ac=e=>{const{present:t,children:n}=e,r=cv(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=av(r.ref,uv(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};ac.displayName="Presence";function cv(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=lv(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=_r(r.current);s.current=a==="mounted"?c:"none"},[a]),Re(()=>{const c=r.current,f=o.current;if(f!==e){const m=s.current,g=_r(c);e?u("MOUNT"):g==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),Re(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,p=g=>{const h=_r(r.current).includes(g.animationName);if(g.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=g=>{g.target===t&&(s.current=_r(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:d.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function _r(e){return(e==null?void 0:e.animationName)||"none"}function uv(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 lc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function dv(...e){return t=>{let n=!1;const r=e.map(o=>{const s=lc(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():lc(e[o],null)}}}}var cc=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(Ns,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Ns,{...r,ref:t,children:n})});cc.displayName="Slot";var Ns=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?dv(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Ns.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)}var mv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Fr=mv.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?cc: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}},{}),Ts="Tabs",[vv,pC]=Ot(Ts,[tc]),uc=tc(),[yv,Ps]=vv(Ts),dc=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:a,activationMode:u="automatic",...c}=e,f=Ql(a),[p,m]=nn({prop:r,onChange:o,defaultProp:s});return l.jsx(yv,{scope:n,baseId:on(),value:p,onValueChange:m,orientation:i,dir:f,activationMode:u,children:l.jsx(Fr.div,{dir:f,"data-orientation":i,...c,ref:t})})});dc.displayName=Ts;var fc="TabsList",pc=d.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,s=Ps(fc,n),i=uc(n);return l.jsx(ov,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:r,children:l.jsx(Fr.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});pc.displayName=fc;var gc="TabsTrigger",hc=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...s}=e,i=Ps(gc,n),a=uc(n),u=yc(i.baseId,r),c=wc(i.baseId,r),f=r===i.value;return l.jsx(sv,{asChild:!0,...a,focusable:!o,active:f,children:l.jsx(Fr.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:vs(e.onMouseDown,p=>{!o&&p.button===0&&p.ctrlKey===!1?i.onValueChange(r):p.preventDefault()}),onKeyDown:vs(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&i.onValueChange(r)}),onFocus:vs(e.onFocus,()=>{const p=i.activationMode!=="manual";!f&&!o&&p&&i.onValueChange(r)})})})});hc.displayName=gc;var mc="TabsContent",vc=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:s,...i}=e,a=Ps(mc,n),u=yc(a.baseId,r),c=wc(a.baseId,r),f=r===a.value,p=d.useRef(f);return d.useEffect(()=>{const m=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(m)},[]),l.jsx(ac,{present:o||f,children:({present:m})=>l.jsx(Fr.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:p.current?"0s":void 0},children:m&&s})})});vc.displayName=mc;function yc(e,t){return`${e}-trigger-${t}`}function wc(e,t){return`${e}-content-${t}`}var wv=dc,bc=pc,xc=hc,Cc=vc;const bv=wv,Sc=d.forwardRef(({className:e,...t},n)=>l.jsx(bc,{ref:n,className:te("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Sc.displayName=bc.displayName;const Or=d.forwardRef(({className:e,...t},n)=>l.jsx(xc,{ref:n,className:te("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}));Or.displayName=xc.displayName;const Dr=d.forwardRef(({className:e,...t},n)=>l.jsx(Cc,{ref:n,className:te("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Dr.displayName=Cc.displayName;const In=d.forwardRef(({className:e,...t},n)=>l.jsx("textarea",{className:te("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}));In.displayName="Textarea";function xv(e,t=[]){let n=[];function r(s,i){const a=d.createContext(i),u=n.length;n=[...n,i];function c(p){const{scope:m,children:g,...v}=p,h=(m==null?void 0:m[e][u])||a,y=d.useMemo(()=>v,Object.values(v));return l.jsx(h.Provider,{value:y,children:g})}function f(p,m){const g=(m==null?void 0:m[e][u])||a,v=d.useContext(g);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${p}\` 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,Cv(o,...t)]}function Cv(...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 p=u(s)[`__scope${c}`];return{...a,...p}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var As=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Ev);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(_s,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(_s,{...r,ref:t,children:n})});As.displayName="Slot";var _s=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Tv(n);return d.cloneElement(n,{...Nv(r,n.props),ref:t?gr(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});_s.displayName="SlotClone";var Sv=({children:e})=>l.jsx(l.Fragment,{children:e});function Ev(e){return d.isValidElement(e)&&e.type===Sv}function Nv(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)}function Pv(e){const t=e+"CollectionProvider",[n,r]=xv(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=g=>{const{scope:v,children:h}=g,y=A.useRef(null),w=A.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:w,collectionRef:y,children:h})};i.displayName=t;const a=e+"CollectionSlot",u=A.forwardRef((g,v)=>{const{scope:h,children:y}=g,w=s(a,h),b=ze(v,w.collectionRef);return l.jsx(As,{ref:b,children:y})});u.displayName=a;const c=e+"CollectionItemSlot",f="data-radix-collection-item",p=A.forwardRef((g,v)=>{const{scope:h,children:y,...w}=g,b=A.useRef(null),S=ze(v,b),E=s(c,h);return A.useEffect(()=>(E.itemMap.set(b,{ref:b,...w}),()=>void E.itemMap.delete(b))),l.jsx(As,{[f]:"",ref:S,children:y})});p.displayName=c;function m(g){const v=s(e+"CollectionConsumer",g);return A.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:p},m,r]}var Av="VisuallyHidden",Fs=d.forwardRef((e,t)=>l.jsx(be.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}}));Fs.displayName=Av;var Os="ToastProvider",[Ds,_v,Fv]=Pv("Toast"),[Ec,gC]=Ot("Toast",[Fv]),[Ov,Mr]=Ec(Os),Nc=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),p=d.useRef(!1),m=d.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Os}\`. Expected non-empty \`string\`.`),l.jsx(Ds.Provider,{scope:t,children:l.jsx(Ov,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:s,toastCount:c,viewport:a,onViewportChange:u,onToastAdd:d.useCallback(()=>f(g=>g+1),[]),onToastRemove:d.useCallback(()=>f(g=>g-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:m,children:i})})};Nc.displayName=Os;var Tc="ToastViewport",Dv=["F8"],Ms="toast.viewportPause",Is="toast.viewportResume",Pc=d.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=Dv,label:o="Notifications ({hotkey})",...s}=e,i=Mr(Tc,n),a=_v(n),u=d.useRef(null),c=d.useRef(null),f=d.useRef(null),p=d.useRef(null),m=ze(t,p,i.onViewportChange),g=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=p.current)==null||S.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),d.useEffect(()=>{const y=u.current,w=p.current;if(v&&y&&w){const b=()=>{if(!i.isClosePausedRef.current){const P=new CustomEvent(Ms);w.dispatchEvent(P),i.isClosePausedRef.current=!0}},S=()=>{if(i.isClosePausedRef.current){const P=new CustomEvent(Is);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,...Wv(E)];return y==="forwards"?x:x.reverse()});return(y==="forwards"?b.reverse():b).flat()},[a]);return d.useEffect(()=>{const y=p.current;if(y){const w=b=>{var x,P,F;const S=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!S){const O=document.activeElement,I=b.shiftKey;if(b.target===y&&I){(x=c.current)==null||x.focus();return}const k=h({tabbingDirection:I?"backwards":"forwards"}),z=k.findIndex(R=>R===O);Ls(k.slice(z+1))?b.preventDefault():I?(P=c.current)==null||P.focus():(F=f.current)==null||F.focus()}};return y.addEventListener("keydown",w),()=>y.removeEventListener("keydown",w)}},[a,h]),l.jsxs(xh,{ref:u,role:"region","aria-label":o.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&l.jsx(ks,{ref:c,onFocusFromOutsideViewport:()=>{const y=h({tabbingDirection:"forwards"});Ls(y)}}),l.jsx(Ds.Slot,{scope:n,children:l.jsx(be.ol,{tabIndex:-1,...s,ref:m})}),v&&l.jsx(ks,{ref:f,onFocusFromOutsideViewport:()=>{const y=h({tabbingDirection:"backwards"});Ls(y)}})]})});Pc.displayName=Tc;var Ac="ToastFocusProxy",ks=d.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,s=Mr(Ac,n);return l.jsx(Fs,{"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()}})});ks.displayName=Ac;var Ir="Toast",Mv="toast.swipeStart",Iv="toast.swipeMove",kv="toast.swipeCancel",$v="toast.swipeEnd",_c=d.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:s,...i}=e,[a=!0,u]=nn({prop:r,defaultProp:o,onChange:s});return l.jsx(rn,{present:n||a,children:l.jsx(Vv,{open:a,...i,ref:t,onClose:()=>u(!1),onPause:Ae(e.onPause),onResume:Ae(e.onResume),onSwipeStart:we(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:we(e.onSwipeMove,c=>{const{x:f,y:p}=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",`${p}px`)}),onSwipeCancel:we(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:we(e.onSwipeEnd,c=>{const{x:f,y:p}=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",`${p}px`),u(!1)})})})});_c.displayName=Ir;var[Lv,Rv]=Ec(Ir,{onClose(){}}),Vv=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:p,onSwipeCancel:m,onSwipeEnd:g,...v}=e,h=Mr(Ir,n),[y,w]=d.useState(null),b=ze(t,R=>w(R)),S=d.useRef(null),E=d.useRef(null),x=o||h.duration,P=d.useRef(0),F=d.useRef(x),O=d.useRef(0),{onToastAdd:I,onToastRemove:D}=h,q=Ae(()=>{var J;(y==null?void 0:y.contains(document.activeElement))&&((J=h.viewport)==null||J.focus()),i()}),k=d.useCallback(R=>{!R||R===1/0||(window.clearTimeout(O.current),P.current=new Date().getTime(),O.current=window.setTimeout(q,R))},[q]);d.useEffect(()=>{const R=h.viewport;if(R){const J=()=>{k(F.current),c==null||c()},B=()=>{const U=new Date().getTime()-P.current;F.current=F.current-U,window.clearTimeout(O.current),u==null||u()};return R.addEventListener(Ms,B),R.addEventListener(Is,J),()=>{R.removeEventListener(Ms,B),R.removeEventListener(Is,J)}}},[h.viewport,x,u,c,k]),d.useEffect(()=>{s&&!h.isClosePausedRef.current&&k(x)},[s,x,h.isClosePausedRef,k]),d.useEffect(()=>(I(),()=>D()),[I,D]);const z=d.useMemo(()=>y?$c(y):null,[y]);return h.viewport?l.jsxs(l.Fragment,{children:[z&&l.jsx(Bv,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:z}),l.jsx(Lv,{scope:n,onClose:q,children:Yn.createPortal(l.jsx(Ds.ItemSlot,{scope:n,children:l.jsx(bh,{asChild:!0,onEscapeKeyDown:we(a,()=>{h.isFocusedToastEscapeKeyDownRef.current||q(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:l.jsx(be.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:we(e.onKeyDown,R=>{R.key==="Escape"&&(a==null||a(R.nativeEvent),R.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,q()))}),onPointerDown:we(e.onPointerDown,R=>{R.button===0&&(S.current={x:R.clientX,y:R.clientY})}),onPointerMove:we(e.onPointerMove,R=>{if(!S.current)return;const J=R.clientX-S.current.x,B=R.clientY-S.current.y,U=!!E.current,K=["left","right"].includes(h.swipeDirection),Y=["left","up"].includes(h.swipeDirection)?Math.min:Math.max,le=K?Y(0,J):0,ue=K?0:Y(0,B),Ee=R.pointerType==="touch"?10:2,Ie={x:le,y:ue},Ue={originalEvent:R,delta:Ie};U?(E.current=Ie,kr(Iv,p,Ue,{discrete:!1})):Lc(Ie,h.swipeDirection,Ee)?(E.current=Ie,kr(Mv,f,Ue,{discrete:!1}),R.target.setPointerCapture(R.pointerId)):(Math.abs(J)>Ee||Math.abs(B)>Ee)&&(S.current=null)}),onPointerUp:we(e.onPointerUp,R=>{const J=E.current,B=R.target;if(B.hasPointerCapture(R.pointerId)&&B.releasePointerCapture(R.pointerId),E.current=null,S.current=null,J){const U=R.currentTarget,K={originalEvent:R,delta:J};Lc(J,h.swipeDirection,h.swipeThreshold)?kr($v,g,K,{discrete:!0}):kr(kv,m,K,{discrete:!0}),U.addEventListener("click",Y=>Y.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),Bv=e=>{const{__scopeToast:t,children:n,...r}=e,o=Mr(Ir,t),[s,i]=d.useState(!1),[a,u]=d.useState(!1);return Uv(()=>i(!0)),d.useEffect(()=>{const c=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:l.jsx(ss,{asChild:!0,children:l.jsx(Fs,{...r,children:s&&l.jsxs(l.Fragment,{children:[o.label," ",n]})})})},zv="ToastTitle",Fc=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(be.div,{...r,ref:t})});Fc.displayName=zv;var Hv="ToastDescription",Oc=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(be.div,{...r,ref:t})});Oc.displayName=Hv;var Dc="ToastAction",Mc=d.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?l.jsx(kc,{altText:n,asChild:!0,children:l.jsx($s,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Dc}\`. Expected non-empty \`string\`.`),null)});Mc.displayName=Dc;var Ic="ToastClose",$s=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=Rv(Ic,n);return l.jsx(kc,{asChild:!0,children:l.jsx(be.button,{type:"button",...r,ref:t,onClick:we(e.onClick,o.onClose)})})});$s.displayName=Ic;var kc=d.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return l.jsx(be.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function $c(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),jv(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(...$c(r))}}),t}function kr(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?Wa(o,s):o.dispatchEvent(s)}var Lc=(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 Uv(e=()=>{}){const t=Ae(e);Re(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function jv(e){return e.nodeType===e.ELEMENT_NODE}function Wv(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 Ls(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var Gv=Nc,Rc=Pc,Vc=_c,Bc=Fc,zc=Oc,Hc=Mc,Uc=$s;const qv=Gv,jc=d.forwardRef(({className:e,...t},n)=>l.jsx(Rc,{ref:n,className:te("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}));jc.displayName=Rc.displayName;const Kv=Yo("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"}}),Wc=d.forwardRef(({className:e,variant:t,...n},r)=>l.jsx(Vc,{ref:r,className:te(Kv({variant:t}),e),...n}));Wc.displayName=Vc.displayName;const Xv=d.forwardRef(({className:e,...t},n)=>l.jsx(Hc,{ref:n,className:te("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}));Xv.displayName=Hc.displayName;const Gc=d.forwardRef(({className:e,...t},n)=>l.jsx(Uc,{ref:n,className:te("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(Uo,{className:"s3-explr-ui-toast-close-icon h-4 w-4"})}));Gc.displayName=Uc.displayName;const qc=d.forwardRef(({className:e,...t},n)=>l.jsx(Bc,{ref:n,className:te("s3-explr-ui-toast-title text-sm font-semibold [&+div]:text-xs",e),...t}));qc.displayName=Bc.displayName;const Kc=d.forwardRef(({className:e,...t},n)=>l.jsx(zc,{ref:n,className:te("s3-explr-ui-toast-description text-sm opacity-90",e),...t}));Kc.displayName=zc.displayName;const Jv=1,Yv=1e6;let Rs=0;function Zv(){return Rs=(Rs+1)%Number.MAX_SAFE_INTEGER,Rs.toString()}const Vs=new Map,Xc=e=>{if(Vs.has(e))return;const t=setTimeout(()=>{Vs.delete(e),kn({type:"REMOVE_TOAST",toastId:e})},Yv);Vs.set(e,t)},Qv=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Jv)};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?Xc(n):e.toasts.forEach(r=>{Xc(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)}}},$r=[];let Lr={toasts:[]};function kn(e){Lr=Qv(Lr,e),$r.forEach(t=>{t(Lr)})}function ey({...e}){const t=Zv(),n=o=>kn({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>kn({type:"DISMISS_TOAST",toastId:t});return kn({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function Rr(){const[e,t]=d.useState(Lr);return d.useEffect(()=>($r.push(t),()=>{const n=$r.indexOf(t);n>-1&&$r.splice(n,1)}),[e]),{...e,toast:ey,dismiss:n=>kn({type:"DISMISS_TOAST",toastId:n})}}function Jc(){const{toasts:e}=Rr();return l.jsxs(qv,{children:[e.map(function({id:t,title:n,description:r,action:o,...s}){return l.jsxs(Wc,{...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(qc,{className:"s3-explr-ui-toast-title",children:n}),r&&l.jsx(Kc,{className:"s3-explr-ui-toast-description",children:r})]}),o&&l.jsx("div",{className:"s3-explr-ui-toast-action",children:o}),l.jsx(Gc,{className:"s3-explr-ui-toast-close"})]},t)}),l.jsx(jc,{className:"s3-explr-ui-toast-viewport"})]})}function bt(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 Yc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ty(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Yc(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():Yc(e[o],null)}}}}function $n(...e){return d.useCallback(ty(...e),e)}var ny=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ln=ny.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Qt: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 ry(e,t){e&&Yn.flushSync(()=>e.dispatchEvent(t))}var oy="DismissableLayer",Bs="dismissableLayer.update",sy="dismissableLayer.pointerDownOutside",iy="dismissableLayer.focusOutside",Zc,Qc=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),eu=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...u}=e,c=d.useContext(Qc),[f,p]=d.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=d.useState({}),v=$n(t,F=>p(F)),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=cy(F=>{const O=F.target,I=[...c.branches].some(D=>D.contains(O));!E||I||(o==null||o(F),i==null||i(F),F.defaultPrevented||a==null||a())},m),P=uy(F=>{const O=F.target;[...c.branches].some(D=>D.contains(O))||(s==null||s(F),i==null||i(F),F.defaultPrevented||a==null||a())},m);return Ya(F=>{b===c.layers.size-1&&(r==null||r(F),!F.defaultPrevented&&a&&(F.preventDefault(),a()))},m),d.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Zc=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),tu(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Zc)}},[f,m,n,c]),d.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),tu())},[f,c]),d.useEffect(()=>{const F=()=>g({});return document.addEventListener(Bs,F),()=>document.removeEventListener(Bs,F)},[]),l.jsx(Ln.div,{...u,ref:v,style:{pointerEvents:S?E?"auto":"none":void 0,...e.style},onFocusCapture:bt(e.onFocusCapture,P.onFocusCapture),onBlurCapture:bt(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:bt(e.onPointerDownCapture,x.onPointerDownCapture)})});eu.displayName=oy;var ay="DismissableLayerBranch",ly=d.forwardRef((e,t)=>{const n=d.useContext(Qc),r=d.useRef(null),o=$n(t,r);return d.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(Ln.div,{...e,ref:o})});ly.displayName=ay;function cy(e,t=globalThis==null?void 0:globalThis.document){const n=Ae(e),r=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let u=function(){nu(sy,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 uy(e,t=globalThis==null?void 0:globalThis.document){const n=Ae(e),r=d.useRef(!1);return d.useEffect(()=>{const o=s=>{s.target&&!r.current&&nu(iy,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 tu(){const e=new CustomEvent(Bs);document.dispatchEvent(e)}function nu(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?ry(o,s):o.dispatchEvent(s)}const dy=["top","right","bottom","left"],$t=Math.min,Ve=Math.max,Vr=Math.round,Br=Math.floor,it=e=>({x:e,y:e}),fy={left:"right",right:"left",bottom:"top",top:"bottom"},py={start:"end",end:"start"};function zs(e,t,n){return Ve(e,$t(t,n))}function xt(e,t){return typeof e=="function"?e(t):e}function Ct(e){return e.split("-")[0]}function fn(e){return e.split("-")[1]}function Hs(e){return e==="x"?"y":"x"}function Us(e){return e==="y"?"height":"width"}function Lt(e){return["top","bottom"].includes(Ct(e))?"y":"x"}function js(e){return Hs(Lt(e))}function gy(e,t,n){n===void 0&&(n=!1);const r=fn(e),o=js(e),s=Us(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=zr(i)),[i,zr(i)]}function hy(e){const t=zr(e);return[Ws(e),t,Ws(t)]}function Ws(e){return e.replace(/start|end/g,t=>py[t])}function my(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 vy(e,t,n,r){const o=fn(e);let s=my(Ct(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Ws)))),s}function zr(e){return e.replace(/left|right|bottom|top/g,t=>fy[t])}function yy(e){return{top:0,right:0,bottom:0,left:0,...e}}function ru(e){return typeof e!="number"?yy(e):{top:e,right:e,bottom:e,left:e}}function Hr(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 ou(e,t,n){let{reference:r,floating:o}=e;const s=Lt(t),i=js(t),a=Us(i),u=Ct(t),c=s==="y",f=r.x+r.width/2-o.width/2,p=r.y+r.height/2-o.height/2,m=r[a]/2-o[a]/2;let g;switch(u){case"top":g={x:f,y:r.y-o.height};break;case"bottom":g={x:f,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:p};break;case"left":g={x:r.x-o.width,y:p};break;default:g={x:r.x,y:r.y}}switch(fn(t)){case"start":g[i]-=m*(n&&c?-1:1);break;case"end":g[i]+=m*(n&&c?-1:1);break}return g}const wy=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:p}=ou(c,r,u),m=r,g={},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:p,initialPlacement:r,placement:m,strategy:o,middlewareData:g,rects:c,platform:i,elements:{reference:e,floating:t}});f=b??f,p=S??p,g={...g,[y]:{...g[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:p}=ou(c,m,u)),h=-1)}return{x:f,y:p,placement:m,strategy:o,middlewareData:g}};async function Rn(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:p="floating",altBoundary:m=!1,padding:g=0}=xt(t,e),v=ru(g),y=a[m?p==="floating"?"reference":"floating":p],w=Hr(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=p==="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=Hr(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 by=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}=xt(e,t)||{};if(c==null)return{};const p=ru(f),m={x:n,y:r},g=js(o),v=Us(g),h=await i.getDimensions(c),y=g==="y",w=y?"top":"left",b=y?"bottom":"right",S=y?"clientHeight":"clientWidth",E=s.reference[v]+s.reference[g]-m[g]-s.floating[v],x=m[g]-s.reference[g],P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let F=P?P[S]:0;(!F||!await(i.isElement==null?void 0:i.isElement(P)))&&(F=a.floating[S]||s.floating[v]);const O=E/2-x/2,I=F/2-h[v]/2-1,D=$t(p[w],I),q=$t(p[b],I),k=D,z=F-h[v]-q,R=F/2-h[v]/2+O,J=zs(k,R,z),B=!u.arrow&&fn(o)!=null&&R!==J&&s.reference[v]/2-(R<k?D:q)-h[v]/2<0,U=B?R<k?R-k:R-z:0;return{[g]:m[g]+U,data:{[g]:J,centerOffset:R-J-U,...B&&{alignmentOffset:U}},reset:B}}}),xy=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:p=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:h=!0,...y}=xt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=Ct(o),b=Lt(a),S=Ct(a)===a,E=await(u.isRTL==null?void 0:u.isRTL(c.floating)),x=m||(S||!h?[zr(a)]:hy(a)),P=v!=="none";!m&&P&&x.push(...vy(a,h,v,E));const F=[a,...x],O=await Rn(t,y),I=[];let D=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&I.push(O[w]),p){const R=gy(o,i,E);I.push(O[R[0]],O[R[1]])}if(D=[...D,{placement:o,overflows:I}],!I.every(R=>R<=0)){var q,k;const R=(((q=s.flip)==null?void 0:q.index)||0)+1,J=F[R];if(J)return{data:{index:R,overflows:D},reset:{placement:J}};let B=(k=D.filter(U=>U.overflows[0]<=0).sort((U,K)=>U.overflows[1]-K.overflows[1])[0])==null?void 0:k.placement;if(!B)switch(g){case"bestFit":{var z;const U=(z=D.filter(K=>{if(P){const Y=Lt(K.placement);return Y===b||Y==="y"}return!0}).map(K=>[K.placement,K.overflows.filter(Y=>Y>0).reduce((Y,le)=>Y+le,0)]).sort((K,Y)=>K[1]-Y[1])[0])==null?void 0:z[0];U&&(B=U);break}case"initialPlacement":B=a;break}if(o!==B)return{reset:{placement:B}}}return{}}}};function su(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function iu(e){return dy.some(t=>e[t]>=0)}const Cy=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=xt(e,t);switch(r){case"referenceHidden":{const s=await Rn(t,{...o,elementContext:"reference"}),i=su(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:iu(i)}}}case"escaped":{const s=await Rn(t,{...o,altBoundary:!0}),i=su(s,n.floating);return{data:{escapedOffsets:i,escaped:iu(i)}}}default:return{}}}}};async function Sy(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Ct(n),a=fn(n),u=Lt(n)==="y",c=["left","top"].includes(i)?-1:1,f=s&&u?-1:1,p=xt(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:v}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return a&&typeof v=="number"&&(g=a==="end"?v*-1:v),u?{x:g*f,y:m*c}:{x:m*c,y:g*f}}const Ey=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 Sy(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}}}}},Ny=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}=xt(e,t),c={x:n,y:r},f=await Rn(t,u),p=Lt(Ct(o)),m=Hs(p);let g=c[m],v=c[p];if(s){const y=m==="y"?"top":"left",w=m==="y"?"bottom":"right",b=g+f[y],S=g-f[w];g=zs(b,g,S)}if(i){const y=p==="y"?"top":"left",w=p==="y"?"bottom":"right",b=v+f[y],S=v-f[w];v=zs(b,v,S)}const h=a.fn({...t,[m]:g,[p]:v});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[m]:s,[p]:i}}}}}},Ty=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}=xt(e,t),f={x:n,y:r},p=Lt(o),m=Hs(p);let g=f[m],v=f[p];const h=xt(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;g<E?g=E:g>x&&(g=x)}if(c){var w,b;const S=m==="y"?"width":"height",E=["top","left"].includes(Ct(o)),x=s.reference[p]-s.floating[S]+(E&&((w=i.offset)==null?void 0:w[p])||0)+(E?0:y.crossAxis),P=s.reference[p]+s.reference[S]+(E?0:((b=i.offset)==null?void 0:b[p])||0)-(E?y.crossAxis:0);v<x?v=x:v>P&&(v=P)}return{[m]:g,[p]: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}=xt(e,t),f=await Rn(t,c),p=Ct(o),m=fn(o),g=Lt(o)==="y",{width:v,height:h}=s.floating;let y,w;p==="top"||p==="bottom"?(y=p,w=m===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(w=p,y=m==="end"?"top":"bottom");const b=h-f.top-f.bottom,S=v-f.left-f.right,E=$t(h-f[y],b),x=$t(v-f[w],S),P=!t.middlewareData.shift;let F=E,O=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(F=b),P&&!m){const D=Ve(f.left,0),q=Ve(f.right,0),k=Ve(f.top,0),z=Ve(f.bottom,0);g?O=v-2*(D!==0||q!==0?D+q:Ve(f.left,f.right)):F=h-2*(k!==0||z!==0?k+z:Ve(f.top,f.bottom))}await u({...t,availableWidth:O,availableHeight:F});const I=await i.getDimensions(a.floating);return v!==I.width||h!==I.height?{reset:{rects:!0}}:{}}}};function Ur(){return typeof window<"u"}function pn(e){return au(e)?(e.nodeName||"").toLowerCase():"#document"}function Be(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function at(e){var t;return(t=(au(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function au(e){return Ur()?e instanceof Node||e instanceof Be(e).Node:!1}function Ze(e){return Ur()?e instanceof Element||e instanceof Be(e).Element:!1}function lt(e){return Ur()?e instanceof HTMLElement||e instanceof Be(e).HTMLElement:!1}function lu(e){return!Ur()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Be(e).ShadowRoot}function Vn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Qe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Ay(e){return["table","td","th"].includes(pn(e))}function jr(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Gs(e){const t=qs(),n=Ze(e)?Qe(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 _y(e){let t=Rt(e);for(;lt(t)&&!gn(t);){if(Gs(t))return t;if(jr(t))return null;t=Rt(t)}return null}function qs(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function gn(e){return["html","body","#document"].includes(pn(e))}function Qe(e){return Be(e).getComputedStyle(e)}function Wr(e){return Ze(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Rt(e){if(pn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||lu(e)&&e.host||at(e);return lu(t)?t.host:t}function cu(e){const t=Rt(e);return gn(t)?e.ownerDocument?e.ownerDocument.body:e.body:lt(t)&&Vn(t)?t:cu(t)}function Bn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=cu(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Be(o);if(s){const a=Ks(i);return t.concat(i,i.visualViewport||[],Vn(o)?o:[],a&&n?Bn(a):[])}return t.concat(o,Bn(o,[],n))}function Ks(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function uu(e){const t=Qe(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=lt(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Vr(n)!==s||Vr(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Xs(e){return Ze(e)?e:e.contextElement}function hn(e){const t=Xs(e);if(!lt(t))return it(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=uu(t);let i=(s?Vr(n.width):n.width)/r,a=(s?Vr(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Fy=it(0);function du(e){const t=Be(e);return!qs()||!t.visualViewport?Fy:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Oy(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Be(e)?!1:t}function Gt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Xs(e);let i=it(1);t&&(r?Ze(r)&&(i=hn(r)):i=hn(e));const a=Oy(s,n,r)?du(s):it(0);let u=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,f=o.width/i.x,p=o.height/i.y;if(s){const m=Be(s),g=r&&Ze(r)?Be(r):r;let v=m,h=Ks(v);for(;h&&r&&g!==v;){const y=hn(h),w=h.getBoundingClientRect(),b=Qe(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,p*=y.y,u+=S,c+=E,v=Be(h),h=Ks(v)}}return Hr({width:f,height:p,x:u,y:c})}function Js(e,t){const n=Wr(e).scrollLeft;return t?t.left+n:Gt(at(e)).left+n}function fu(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Js(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function Dy(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=at(r),a=t?jr(t.floating):!1;if(r===i||a&&s)return n;let u={scrollLeft:0,scrollTop:0},c=it(1);const f=it(0),p=lt(r);if((p||!p&&!s)&&((pn(r)!=="body"||Vn(i))&&(u=Wr(r)),lt(r))){const g=Gt(r);c=hn(r),f.x=g.x+r.clientLeft,f.y=g.y+r.clientTop}const m=i&&!p&&!s?fu(i,u,!0):it(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 My(e){return Array.from(e.getClientRects())}function Iy(e){const t=at(e),n=Wr(e),r=e.ownerDocument.body,o=Ve(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Ve(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Js(e);const a=-n.scrollTop;return Qe(r).direction==="rtl"&&(i+=Ve(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function ky(e,t){const n=Be(e),r=at(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=qs();(!c||c&&t==="fixed")&&(a=o.offsetLeft,u=o.offsetTop)}return{width:s,height:i,x:a,y:u}}function $y(e,t){const n=Gt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=lt(e)?hn(e):it(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 pu(e,t,n){let r;if(t==="viewport")r=ky(e,n);else if(t==="document")r=Iy(at(e));else if(Ze(t))r=$y(t,n);else{const o=du(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Hr(r)}function gu(e,t){const n=Rt(e);return n===t||!Ze(n)||gn(n)?!1:Qe(n).position==="fixed"||gu(n,t)}function Ly(e,t){const n=t.get(e);if(n)return n;let r=Bn(e,[],!1).filter(a=>Ze(a)&&pn(a)!=="body"),o=null;const s=Qe(e).position==="fixed";let i=s?Rt(e):e;for(;Ze(i)&&!gn(i);){const a=Qe(i),u=Gs(i);!u&&a.position==="fixed"&&(o=null),(s?!u&&!o:!u&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Vn(i)&&!u&&gu(e,i))?r=r.filter(f=>f!==i):o=a,i=Rt(i)}return t.set(e,r),r}function Ry(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?jr(t)?[]:Ly(t,this._c):[].concat(n),r],a=i[0],u=i.reduce((c,f)=>{const p=pu(t,f,o);return c.top=Ve(p.top,c.top),c.right=$t(p.right,c.right),c.bottom=$t(p.bottom,c.bottom),c.left=Ve(p.left,c.left),c},pu(t,a,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Vy(e){const{width:t,height:n}=uu(e);return{width:t,height:n}}function By(e,t,n){const r=lt(t),o=at(t),s=n==="fixed",i=Gt(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const u=it(0);if(r||!r&&!s)if((pn(t)!=="body"||Vn(o))&&(a=Wr(t)),r){const m=Gt(t,!0,s,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}else o&&(u.x=Js(o));const c=o&&!r&&!s?fu(o,a):it(0),f=i.left+a.scrollLeft-u.x-c.x,p=i.top+a.scrollTop-u.y-c.y;return{x:f,y:p,width:i.width,height:i.height}}function Ys(e){return Qe(e).position==="static"}function hu(e,t){if(!lt(e)||Qe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return at(e)===n&&(n=n.ownerDocument.body),n}function mu(e,t){const n=Be(e);if(jr(e))return n;if(!lt(e)){let o=Rt(e);for(;o&&!gn(o);){if(Ze(o)&&!Ys(o))return o;o=Rt(o)}return n}let r=hu(e,t);for(;r&&Ay(r)&&Ys(r);)r=hu(r,t);return r&&gn(r)&&Ys(r)&&!Gs(r)?n:r||_y(e)||n}const zy=async function(e){const t=this.getOffsetParent||mu,n=this.getDimensions,r=await n(e.floating);return{reference:By(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Hy(e){return Qe(e).direction==="rtl"}const Uy={convertOffsetParentRelativeRectToViewportRelativeRect:Dy,getDocumentElement:at,getClippingRect:Ry,getOffsetParent:mu,getElementRects:zy,getClientRects:My,getDimensions:Vy,getScale:hn,isElement:Ze,isRTL:Hy};function jy(e,t){let n=null,r;const o=at(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:p,height:m}=e.getBoundingClientRect();if(a||t(),!p||!m)return;const g=Br(f),v=Br(o.clientWidth-(c+p)),h=Br(o.clientHeight-(f+m)),y=Br(c),b={rootMargin:-g+"px "+-v+"px "+-h+"px "+-y+"px",threshold:Ve(0,$t(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 Wy(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=Xs(e),f=o||s?[...c?Bn(c):[],...Bn(t)]:[];f.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const p=c&&a?jy(c,n):null;let m=-1,g=null;i&&(g=new ResizeObserver(w=>{let[b]=w;b&&b.target===c&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var S;(S=g)==null||S.observe(t)})),n()}),c&&!u&&g.observe(c),g.observe(t));let v,h=u?Gt(e):null;u&&y();function y(){const w=Gt(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)}),p==null||p(),(w=g)==null||w.disconnect(),g=null,u&&cancelAnimationFrame(v)}}const Gy=Ey,qy=Ny,Ky=xy,Xy=Py,Jy=Cy,vu=by,Yy=Ty,Zy=(e,t,n)=>{const r=new Map,o={platform:Uy,...n},s={...o.platform,_c:r};return wy(e,t,{...o,platform:s})};var Gr=typeof document<"u"?A.useLayoutEffect:A.useEffect;function qr(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(!qr(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)&&!qr(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function yu(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function wu(e,t){const n=yu(e);return Math.round(t*n)/n}function Zs(e){const t=d.useRef(e);return Gr(()=>{t.current=e}),t}function Qy(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,p]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=d.useState(r);qr(m,r)||g(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!==F.current&&(F.current=K,w(K))},[]),E=s||v,x=i||y,P=d.useRef(null),F=d.useRef(null),O=d.useRef(f),I=u!=null,D=Zs(u),q=Zs(o),k=Zs(c),z=d.useCallback(()=>{if(!P.current||!F.current)return;const K={placement:t,strategy:n,middleware:m};q.current&&(K.platform=q.current),Zy(P.current,F.current,K).then(Y=>{const le={...Y,isPositioned:k.current!==!1};R.current&&!qr(O.current,le)&&(O.current=le,Yn.flushSync(()=>{p(le)}))})},[m,t,n,q,k]);Gr(()=>{c===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,p(K=>({...K,isPositioned:!1})))},[c]);const R=d.useRef(!1);Gr(()=>(R.current=!0,()=>{R.current=!1}),[]),Gr(()=>{if(E&&(P.current=E),x&&(F.current=x),E&&x){if(D.current)return D.current(E,x,z);z()}},[E,x,z,D,I]);const J=d.useMemo(()=>({reference:P,floating:F,setReference:b,setFloating:S}),[b,S]),B=d.useMemo(()=>({reference:E,floating:x}),[E,x]),U=d.useMemo(()=>{const K={position:n,left:0,top:0};if(!B.floating)return K;const Y=wu(B.floating,f.x),le=wu(B.floating,f.y);return a?{...K,transform:"translate("+Y+"px, "+le+"px)",...yu(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Y,top:le}},[n,a,B.floating,f.x,f.y]);return d.useMemo(()=>({...f,update:z,refs:J,elements:B,floatingStyles:U}),[f,z,J,B,U])}const ew=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?vu({element:r.current,padding:o}).fn(n):{}:r?vu({element:r,padding:o}).fn(n):{}}}},tw=(e,t)=>({...Gy(e),options:[e,t]}),nw=(e,t)=>({...qy(e),options:[e,t]}),rw=(e,t)=>({...Yy(e),options:[e,t]}),ow=(e,t)=>({...Ky(e),options:[e,t]}),sw=(e,t)=>({...Xy(e),options:[e,t]}),iw=(e,t)=>({...Jy(e),options:[e,t]}),aw=(e,t)=>({...ew(e),options:[e,t]});var lw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],cw=lw.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Qt: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}},{}),uw="Arrow",bu=d.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return l.jsx(cw.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"})})});bu.displayName=uw;var dw=bu;function xu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function fw(...e){return t=>{let n=!1;const r=e.map(o=>{const s=xu(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():xu(e[o],null)}}}}function Cu(...e){return d.useCallback(fw(...e),e)}var pw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Su=pw.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Qt: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}},{}),Qs="Popper",[Eu,Nu]=Ot(Qs),[gw,Tu]=Eu(Qs),Pu=e=>{const{__scopePopper:t,children:n}=e,[r,o]=d.useState(null);return l.jsx(gw,{scope:t,anchor:r,onAnchorChange:o,children:n})};Pu.displayName=Qs;var Au="PopperAnchor",_u=d.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Tu(Au,n),i=d.useRef(null),a=Cu(t,i);return d.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:l.jsx(Su.div,{...o,ref:a})});_u.displayName=Au;var ei="PopperContent",[hw,mw]=Eu(ei),Fu=d.forwardRef((e,t)=>{var Ce,tt,je,nt,ft,Xt;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:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:v,...h}=e,y=Tu(ei,n),[w,b]=d.useState(null),S=Cu(t,Pe=>b(Pe)),[E,x]=d.useState(null),P=Ua(E),F=(P==null?void 0:P.width)??0,O=(P==null?void 0:P.height)??0,I=r+(s!=="center"?"-"+s:""),D=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},q=Array.isArray(c)?c:[c],k=q.length>0,z={padding:D,boundary:q.filter(yw),altBoundary:k},{refs:R,floatingStyles:J,placement:B,isPositioned:U,middlewareData:K}=Qy({strategy:"fixed",placement:I,whileElementsMounted:(...Pe)=>Wy(...Pe,{animationFrame:g==="always"}),elements:{reference:y.anchor},middleware:[tw({mainAxis:o+O,alignmentAxis:i}),u&&nw({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?rw():void 0,...z}),u&&ow({...z}),sw({...z,apply:({elements:Pe,rects:pt,availableWidth:Cn,availableHeight:Bt})=>{const{width:io,height:C}=pt.reference,N=Pe.floating.style;N.setProperty("--radix-popper-available-width",`${Cn}px`),N.setProperty("--radix-popper-available-height",`${Bt}px`),N.setProperty("--radix-popper-anchor-width",`${io}px`),N.setProperty("--radix-popper-anchor-height",`${C}px`)}}),E&&aw({element:E,padding:a}),ww({arrowWidth:F,arrowHeight:O}),m&&iw({strategy:"referenceHidden",...z})]}),[Y,le]=Mu(B),ue=Ae(v);Re(()=>{U&&(ue==null||ue())},[U,ue]);const Ee=(Ce=K.arrow)==null?void 0:Ce.x,Ie=(tt=K.arrow)==null?void 0:tt.y,Ue=((je=K.arrow)==null?void 0:je.centerOffset)!==0,[Nt,Se]=d.useState();return Re(()=>{w&&Se(window.getComputedStyle(w).zIndex)},[w]),l.jsx("div",{ref:R.setFloating,"data-radix-popper-content-wrapper":"",style:{...J,transform:U?J.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Nt,"--radix-popper-transform-origin":[(nt=K.transformOrigin)==null?void 0:nt.x,(ft=K.transformOrigin)==null?void 0:ft.y].join(" "),...((Xt=K.hide)==null?void 0:Xt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(hw,{scope:n,placedSide:Y,onArrowChange:x,arrowX:Ee,arrowY:Ie,shouldHideArrow:Ue,children:l.jsx(Su.div,{"data-side":Y,"data-align":le,...h,ref:S,style:{...h.style,animation:U?void 0:"none"}})})})});Fu.displayName=ei;var Ou="PopperArrow",vw={top:"bottom",right:"left",bottom:"top",left:"right"},Du=d.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=mw(Ou,r),i=vw[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(dw,{...o,ref:n,style:{...o.style,display:"block"}})})});Du.displayName=Ou;function yw(e){return e!==null}var ww=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]=Mu(n),p={start:"0%",center:"50%",end:"100%"}[f],m=(((w=o.arrow)==null?void 0:w.x)??0)+a/2,g=(((b=o.arrow)==null?void 0:b.y)??0)+u/2;let v="",h="";return c==="bottom"?(v=i?p:`${m}px`,h=`${-u}px`):c==="top"?(v=i?p:`${m}px`,h=`${r.floating.height+u}px`):c==="right"?(v=`${-u}px`,h=i?p:`${g}px`):c==="left"&&(v=`${r.floating.width+u}px`,h=i?p:`${g}px`),{data:{x:v,y:h}}}});function Mu(e){const[t,n="center"]=e.split("-");return[t,n]}var bw=Pu,xw=_u,Cw=Fu,Sw=Du,Ew="Portal",Iu=d.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=d.useState(!1);Re(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?uo.createPortal(l.jsx(Ln.div,{...r,ref:t}),i):null});Iu.displayName=Ew;function Nw(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var ti=e=>{const{present:t,children:n}=e,r=Tw(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=$n(r.ref,Pw(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};ti.displayName="Presence";function Tw(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=Nw(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=Kr(r.current);s.current=a==="mounted"?c:"none"},[a]),Re(()=>{const c=r.current,f=o.current;if(f!==e){const m=s.current,g=Kr(c);e?u("MOUNT"):g==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),Re(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,p=g=>{const h=Kr(r.current).includes(g.animationName);if(g.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=g=>{g.target===t&&(s.current=Kr(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:d.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Kr(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 Aw="VisuallyHidden",ku=d.forwardRef((e,t)=>l.jsx(Ln.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}}));ku.displayName=Aw;var _w=ku,[Xr,hC]=Ot("Tooltip",[Nu]),Jr=Nu(),$u="TooltipProvider",Fw=700,ni="tooltip.open",[Ow,ri]=Xr($u),Lu=e=>{const{__scopeTooltip:t,delayDuration:n=Fw,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(Ow,{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})};Lu.displayName=$u;var Yr="Tooltip",[Dw,zn]=Xr(Yr),Ru=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,u=ri(Yr,e.__scopeTooltip),c=Jr(t),[f,p]=d.useState(null),m=on(),g=d.useRef(0),v=i??u.disableHoverableContent,h=a??u.delayDuration,y=d.useRef(!1),[w=!1,b]=nn({prop:r,defaultProp:o,onChange:F=>{F?(u.onOpen(),document.dispatchEvent(new CustomEvent(ni))):u.onClose(),s==null||s(F)}}),S=d.useMemo(()=>w?y.current?"delayed-open":"instant-open":"closed",[w]),E=d.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y.current=!1,b(!0)},[b]),x=d.useCallback(()=>{window.clearTimeout(g.current),g.current=0,b(!1)},[b]),P=d.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{y.current=!0,b(!0),g.current=0},h)},[h,b]);return d.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),l.jsx(bw,{...c,children:l.jsx(Dw,{scope:t,contentId:m,open:w,stateAttribute:S,trigger:f,onTriggerChange:p,onTriggerEnter:d.useCallback(()=>{u.isOpenDelayed?P():E()},[u.isOpenDelayed,P,E]),onTriggerLeave:d.useCallback(()=>{v?x():(window.clearTimeout(g.current),g.current=0)},[x,v]),onOpen:E,onClose:x,disableHoverableContent:v,children:n})})};Ru.displayName=Yr;var oi="TooltipTrigger",Vu=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=zn(oi,n),s=ri(oi,n),i=Jr(n),a=d.useRef(null),u=$n(t,a,o.onTriggerChange),c=d.useRef(!1),f=d.useRef(!1),p=d.useCallback(()=>c.current=!1,[]);return d.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),l.jsx(xw,{asChild:!0,...i,children:l.jsx(Ln.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:bt(e.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:bt(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:bt(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:bt(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:bt(e.onBlur,o.onClose),onClick:bt(e.onClick,o.onClose)})})});Vu.displayName=oi;var si="TooltipPortal",[Mw,Iw]=Xr(si,{forceMount:void 0}),Bu=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=zn(si,t);return l.jsx(Mw,{scope:t,forceMount:n,children:l.jsx(ti,{present:n||s.open,children:l.jsx(Iu,{asChild:!0,container:o,children:r})})})};Bu.displayName=si;var mn="TooltipContent",zu=d.forwardRef((e,t)=>{const n=Iw(mn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=zn(mn,e.__scopeTooltip);return l.jsx(ti,{present:r||i.open,children:i.disableHoverableContent?l.jsx(Hu,{side:o,...s,ref:t}):l.jsx(kw,{side:o,...s,ref:t})})}),kw=d.forwardRef((e,t)=>{const n=zn(mn,e.__scopeTooltip),r=ri(mn,e.__scopeTooltip),o=d.useRef(null),s=$n(t,o),[i,a]=d.useState(null),{trigger:u,onClose:c}=n,f=o.current,{onPointerInTransitChange:p}=r,m=d.useCallback(()=>{a(null),p(!1)},[p]),g=d.useCallback((v,h)=>{const y=v.currentTarget,w={x:v.clientX,y:v.clientY},b=Vw(w,y.getBoundingClientRect()),S=Bw(w,b),E=zw(h.getBoundingClientRect()),x=Uw([...S,...E]);a(x),p(!0)},[p]);return d.useEffect(()=>()=>m(),[m]),d.useEffect(()=>{if(u&&f){const v=y=>g(y,f),h=y=>g(y,u);return u.addEventListener("pointerleave",v),f.addEventListener("pointerleave",h),()=>{u.removeEventListener("pointerleave",v),f.removeEventListener("pointerleave",h)}}},[u,f,g,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=!Hw(w,i);b?m():S&&(m(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[u,f,i,c,m]),l.jsx(Hu,{...e,ref:s})}),[$w,Lw]=Xr(Yr,{isInside:!1}),Hu=d.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,u=zn(mn,n),c=Jr(n),{onClose:f}=u;return d.useEffect(()=>(document.addEventListener(ni,f),()=>document.removeEventListener(ni,f)),[f]),d.useEffect(()=>{if(u.trigger){const p=m=>{const g=m.target;g!=null&&g.contains(u.trigger)&&f()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[u.trigger,f]),l.jsx(eu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:p=>p.preventDefault(),onDismiss:f,children:l.jsxs(Cw,{"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(Pa,{children:r}),l.jsx($w,{scope:n,isInside:!0,children:l.jsx(_w,{id:u.contentId,role:"tooltip",children:o||r})})]})})});zu.displayName=mn;var Uu="TooltipArrow",Rw=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Jr(n);return Lw(Uu,n).isInside?null:l.jsx(Sw,{...o,...r,ref:t})});Rw.displayName=Uu;function Vw(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 Bw(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 zw(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 Hw(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 Uw(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),jw(t)}function jw(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 Ww=Lu,Gw=Ru,qw=Vu,Kw=Bu,ju=zu;const vn=Ww,yn=Gw,wn=qw,qt=d.forwardRef(({className:e,sideOffset:t=4,...n},r)=>l.jsx(Kw,{children:l.jsx(ju,{ref:r,sideOffset:t,className:te("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})}));qt.displayName=ju.displayName;function Xw({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 Jw=d.forwardRef(Xw);var Yw=function(e){return function(t,n){var r=A.useRef(!1);e(function(){return function(){r.current=!1}},[]),e(function(){if(!r.current)r.current=!0;else return t()},n)}},Wu=function(e){return typeof e=="function"},Gu=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test";const Zw=Yw(A.useEffect);function qu(e){var t=A.useRef(e);return t.current=e,t}var Qw=function(e){Gu&&(Wu(e)||console.error("useUnmount expected parameter is a function, got ".concat(typeof e)));var t=qu(e);A.useEffect(function(){return function(){t.current()}},[])},Zr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function eb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function tb(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Ku=tb,nb=typeof Zr=="object"&&Zr&&Zr.Object===Object&&Zr,rb=nb,ob=rb,sb=typeof self=="object"&&self&&self.Object===Object&&self,ib=ob||sb||Function("return this")(),Xu=ib,ab=Xu,lb=function(){return ab.Date.now()},cb=lb,ub=/\s/;function db(e){for(var t=e.length;t--&&ub.test(e.charAt(t)););return t}var fb=db,pb=fb,gb=/^\s+/;function hb(e){return e&&e.slice(0,pb(e)+1).replace(gb,"")}var mb=hb,vb=Xu,yb=vb.Symbol,Ju=yb,Yu=Ju,Zu=Object.prototype,wb=Zu.hasOwnProperty,bb=Zu.toString,Hn=Yu?Yu.toStringTag:void 0;function xb(e){var t=wb.call(e,Hn),n=e[Hn];try{e[Hn]=void 0;var r=!0}catch{}var o=bb.call(e);return r&&(t?e[Hn]=n:delete e[Hn]),o}var Cb=xb,Sb=Object.prototype,Eb=Sb.toString;function Nb(e){return Eb.call(e)}var Tb=Nb,Qu=Ju,Pb=Cb,Ab=Tb,_b="[object Null]",Fb="[object Undefined]",ed=Qu?Qu.toStringTag:void 0;function Ob(e){return e==null?e===void 0?Fb:_b:ed&&ed in Object(e)?Pb(e):Ab(e)}var Db=Ob;function Mb(e){return e!=null&&typeof e=="object"}var Ib=Mb,kb=Db,$b=Ib,Lb="[object Symbol]";function Rb(e){return typeof e=="symbol"||$b(e)&&kb(e)==Lb}var Vb=Rb,Bb=mb,td=Ku,zb=Vb,nd=NaN,Hb=/^[-+]0x[0-9a-f]+$/i,Ub=/^0b[01]+$/i,jb=/^0o[0-7]+$/i,Wb=parseInt;function Gb(e){if(typeof e=="number")return e;if(zb(e))return nd;if(td(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=td(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Bb(e);var n=Ub.test(e);return n||jb.test(e)?Wb(e.slice(2),n?2:8):Hb.test(e)?nd:+e}var qb=Gb,Kb=Ku,ii=cb,rd=qb,Xb="Expected a function",Jb=Math.max,Yb=Math.min;function Zb(e,t,n){var r,o,s,i,a,u,c=0,f=!1,p=!1,m=!0;if(typeof e!="function")throw new TypeError(Xb);t=rd(t)||0,Kb(n)&&(f=!!n.leading,p="maxWait"in n,s=p?Jb(rd(n.maxWait)||0,t):s,m="trailing"in n?!!n.trailing:m);function g(P){var F=r,O=o;return r=o=void 0,c=P,i=e.apply(O,F),i}function v(P){return c=P,a=setTimeout(w,t),f?g(P):i}function h(P){var F=P-u,O=P-c,I=t-F;return p?Yb(I,s-O):I}function y(P){var F=P-u,O=P-c;return u===void 0||F>=t||F<0||p&&O>=s}function w(){var P=ii();if(y(P))return b(P);a=setTimeout(w,h(P))}function b(P){return a=void 0,m&&r?g(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(ii())}function x(){var P=ii(),F=y(P);if(r=arguments,o=this,u=P,F){if(a===void 0)return v(u);if(p)return clearTimeout(a),a=setTimeout(w,t),g(u)}return a===void 0&&(a=setTimeout(w,t)),i}return x.cancel=S,x.flush=E,x}var Qb=Zb;const ex=eb(Qb);function tx(){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}tx()||(global.Date=Date);function nx(e,t){var n;Gu&&(Wu(e)||console.error("useDebounceFn expected parameter is a function, got ".concat(typeof e)));var r=qu(e),o=(n=t==null?void 0:t.wait)!==null&&n!==void 0?n:1e3,s=A.useMemo(function(){return ex(function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];return r.current.apply(r,fl([],dl(i),!1))},o,t)},[]);return Qw(function(){s.cancel()}),{run:s,cancel:s.cancel,flush:s.flush}}function rx(e,t,n){var r=dl(A.useState({}),2),o=r[0],s=r[1],i=nx(function(){s({})},n).run;A.useEffect(function(){return i()},t),Zw(e,[o])}const ox=A.forwardRef(({onChange:e},t)=>{const n=A.useRef(null),[r,o]=A.useState("");return A.useImperativeHandle(t,()=>({setValue:s=>{var i;o(s),(i=n.current)==null||i.focus()}})),rx(()=>{e==null||e(r)},[r],{wait:300}),l.jsxs(l.Fragment,{children:[l.jsx(kt,{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(Jw,{className:"h-5 w-5"})})]})}),sx=({openDialogRename:e,setOpenDialogRename:t,apiBaseUrl:n,setFileToMove:r,fileToMove:o,refreshFiles:s,ignoreCache:i})=>{var b;const[a,u]=A.useState({}),[c,f]=A.useState(!1),[p,m]=A.useState(!1),[g,v]=A.useState(""),{toast:h}=Rr();A.useEffect(()=>{e&&y(g)},[g,e]);const y=async S=>{try{m(!0);const E=await oe.get(`${n}/api/list-s3-folders?prefix=${S}`);u(E==null?void 0:E.data)}catch{h({title:"Error",description:"Unable to load S3 folder list",variant:"destructive"})}finally{m(!1)}},w=async()=>{f(!0);try{const S=o.key;await oe.post(`${n}/api/move`,{oldPath:S,newPath:g}),i.current=!0,await s(),h({title:"Đã đổi tên",description:`Đã đổi tên thành công "${o.name}" thành "${g}"`}),t(!1),r(null),v("")}catch(S){console.error("Error renaming item:",S),h({title:"Lỗi",description:"Không thể đổi tên",variant:"destructive"})}finally{f(!1)}};return l.jsx(It,{open:e,onOpenChange:S=>{S||(t(!1),r(null),v(""))},children:l.jsxs(vt,{className:"max-h-[700px] pb-3 px-1 s3-explr-input-group max-w-5xl w-[90%] p-6 bg-white rounded-lg shadow-lg",children:[l.jsxs(yt,{className:"mb-4 w-full h-full",children:[l.jsx("nav",{className:"mb-4",children:l.jsxs("ul",{className:"flex items-center space-x-2 text-sm text-gray-600",children:[l.jsx("li",{className:"cursor-pointer hover:text-blue-600 transition-colors",onClick:()=>v(""),children:"Root"}),g.split("/").map((S,E,x)=>l.jsx("li",{className:"cursor-pointer hover:text-blue-600 transition-colors",onClick:()=>v(S==="Root"?"":x.slice(0,E+1).join("/")+"/"),children:S},E))]})}),l.jsxs(wt,{className:"text-xl font-semibold text-gray-800",children:["Di chuyển"," ",l.jsxs("span",{className:"text-sm text-gray-500",children:["( file Hoặc folder sẽ được di chuyển đến thư mục"," ",g===""?"Root":g," )"]})]}),l.jsx(Mn,{className:"text-gray-600 w-full h-[50dvh] max-h-[500px] overflow-hidden overflow-y-auto",children:p?l.jsx("div",{className:"flex justify-center items-center py-4",children:l.jsx("div",{className:"loader ease-linear rounded-full border-4 border-t-4 border-gray-200 h-12 w-12"})}):l.jsx("ul",{className:"space-y-2",children:(b=Object.keys(a))==null?void 0:b.map(S=>l.jsx("li",{className:"cursor-pointer hover:bg-gray-100 p-2 rounded transition-colors",onClick:()=>v(S),children:S},S))})})]}),l.jsxs(un,{className:"flex justify-end space-x-2",children:[l.jsx(ie,{variant:"outline",onClick:()=>t(!1),className:"px-4 py-2 rounded border border-gray-300 text-gray-700 hover:bg-gray-100 transition-colors",children:"Cancel"}),l.jsx(ie,{onClick:w,disabled:c,className:"s3-explr-crawl-btn",children:"Move"})]})]})})},_e={current:!1},od="crawl:jobs",bn="crawl:current_job",ix=e=>{const[t,n]=A.useState(null),[r,o]=A.useState(0);return A.useEffect(()=>{const s=localStorage.getItem(bn);if(s){const i=JSON.parse(s);n(i),i!=null&&i.startTime&&o(Math.floor((Date.now()-i.startTime)/1e3))}},[]),A.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]),A.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(bn,JSON.stringify(f)),(u.status==="completed"||u.status==="failed")&&setTimeout(()=>{n(null),localStorage.removeItem(bn)},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(bn,JSON.stringify(s)):localStorage.removeItem(bn)}}},ax=(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},Qr=(e,t)=>{const n=[],r=o=>{(e[o]||[]).forEach(i=>{n.push(i.key),i.isFolder&&r(i.key)})};return r(t),n},lx=(e,t)=>{const n=[];return(e[t]||[]).forEach(o=>{n.push(o.key),o.isFolder&&n.push(...Qr(e,o.key))}),n},cx=(e,t,n=[])=>{const[r,o]=A.useState({}),[s,i]=A.useState(!1),[a,u]=A.useState(null),c=A.useRef(t);A.useEffect(()=>{c.current=t},[t]);const f=async()=>{i(!0);try{const p=!_e.current;_e.current&&(_e.current=!1);const m=await oe.get(`${e}/api/files`,{params:{cache:p,displayPrefixes:JSON.stringify(n),prefix:c.current},timeout:3e5});o(m.data),u(null)}catch(p){u(p instanceof Error?p:new Error("Failed to fetch files"))}finally{i(!1)}};return A.useEffect(()=>{f()},[]),{data:r,isLoading:s,error:a,refetch:f}},Un=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||"")},ux=A.memo(({homeLabel:e="Kho tài liệu",apiBaseUrl:t="https://s3-explorer.cmcts1.studio.ai.vn",rootPrefix:n="",asSelector:r=!1,onSelected:o=a=>console.log("Đã chọn:",a),displayPrefixes:s,preSelectedFiles:i})=>{var Fd;const[a,u]=A.useState(""),[c,f]=A.useState(new Set),[p,m]=A.useState(n),[g,v]=A.useState(null),[h,y]=A.useState(!1),[w,b]=A.useState(""),[S,E]=A.useState(!1),[x,P]=A.useState(null),[F,O]=A.useState(null),[I,D]=A.useState(!1),[q,k]=A.useState(!1),[z,R]=A.useState(null),J=A.useRef(null),{toast:B}=Rr(),[U,K]=A.useState(null),[Y,le]=A.useState(null),[ue,Ee]=A.useState(""),[Ie,Ue]=A.useState(!1),[Nt,Se]=A.useState(!1),[Ce,tt]=A.useState(new Set),[je,nt]=A.useState(""),[ft,Xt]=A.useState(!1),[Pe,pt]=A.useState(!1),[Cn,Bt]=A.useState("rename"),[io,C]=A.useState(!1),[N,_]=A.useState(""),[H,V]=A.useState("1"),[L,X]=A.useState(!1),[se,me]=A.useState(!1),[ve,gt]=A.useState(!1),[ao,Sn]=A.useState(!1),{currentJob:ce,elapsedTime:En,setCurrentJob:Xn}=ix(t),bi=g||n,{data:ke,isLoading:xi,error:kx,refetch:We}=cx(t,bi,s);A.useEffect(()=>{const M=new Set(i);f(M)},[]),A.useEffect(()=>{ce!=null&&ce.status&&(ce.status.status==="completed"?(B({title:"Thu thập website hoàn tất",description:`Đã thu thập thành công ${ce.url} với ${ce.status.completed} trang`}),_e.current=!0,We()):ce.status.status==="failed"&&B({title:"Thu thập website thất bại",description:`Không thể thu thập ${ce.url}. Vui lòng thử lại.`,variant:"destructive"}))},[(Fd=ce==null?void 0:ce.status)==null?void 0:Fd.status]);const Nd=A.useMemo(()=>ke[p]||[],[ke,p]),Jt=A.useMemo(()=>a?ax(ke,a,p):Nd,[Nd,a,p,ke]),Jn=A.useMemo(()=>{const M={};return Jt.forEach(($,j)=>{c.has($.key)&&(M[j]=!0)}),M},[c,Jt]),$x=M=>{const $=Qr(ke,M);if($.length===0)return c.has(M)?"all":"none";const j=$.filter(G=>c.has(G)).length;return j===0?"none":j===$.length?"all":"partial"},lo=M=>{Sn(!0),v(M),m(M)};A.useEffect(()=>{ao&&(_e.current=!0,We().finally(()=>Sn(!1)))},[ao]);const Lx=async(M,$)=>{E(!0);try{const j=`${$}${M}/`;if((await oe.post(`${t}/api/create-folder`,{prefix:j})).status!==200){B({title:"Lỗi",description:"Không thể tạo thư mục",variant:"destructive"});return}_e.current=!0,await We(),B({title:"Đã tạo thư mục",description:`Đã tạo thành công thư mục "${M}"`}),b(""),y(!1)}catch(j){console.error("Error creating folder:",j),B({title:"Lỗi",description:"Không thể tạo thư mục",variant:"destructive"})}finally{E(!1)}},Td=async(M,$,j)=>{R(j),me(!0);try{let G=localStorage.getItem("dataLogin"),ee;try{G&&(G=JSON.parse(G),ee=G.user)}catch{G=null}if(ee&&(ee==null?void 0:ee.role)!=="MASTER_ADMIN"&&ug(M,B))return;const ae=new FormData;ae.append("prefix",$),Array.from(M).forEach(ge=>ae.append("files",ge)),ee!=null&&ee.id&&(console.log("🚀 ~ uploadFiles ~ user:",ee),ae.append("metadata",JSON.stringify({creator:ee.username,creatorId:ee.id,DataSource:"Tệp tải lên"}))),await oe.post(`${t}/api/upload`,ae,{headers:{"Content-Type":"multipart/form-data"}}),v($),_e.current=!0,await We()}catch(G){console.error("Lỗi tải lên:",G)}finally{R(null),me(!1)}},Rx=async M=>{var $;gt(!0);try{await oe.delete(`${t}/api/files`,{data:{paths:[M.key]}});const j=(($=M.key)==null?void 0:$.replace(/^(.*?)(\/.*)?$/,(G,ee,ae)=>!ae||ae==="/"?"":ee+"/"))||"";v(j),_e.current=!0,B({title:"Đã xóa tập tin",description:`Đã xóa thành công "${M.name}"`}),P(null)}catch(j){console.error("Error deleting file:",j),B({title:"Lỗi",description:"Không thể xóa tập tin",variant:"destructive"})}finally{gt(!1),await We()}},co=M=>{const $=new Set(c),j=typeof M=="function"?M(Jn):M;new Set(Object.keys(Jn).map(Number)).forEach(ee=>{const ae=Jt[ee];ae&&(j[ee]||($.delete(ae.key),ae.isFolder&&Qr(ke,ae.key).forEach(ge=>$.delete(ge))))}),Object.entries(j).forEach(([ee,ae])=>{const ge=parseInt(ee),Tt=Jt[ge];Tt&&ae&&($.add(Tt.key),Tt.isFolder&&Qr(ke,Tt.key).forEach(Si=>$.add(Si)))}),f($)},Vx=async()=>{var M;D(!0);try{const $=Array.from(c),j=$.map(ee=>Object.values(ke).flat().find(ae=>ae.key===ee)).filter(ee=>ee!==void 0);if(j.length===0){B({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:$}});const G=((M=j[0])==null?void 0:M.key.replace(/^(.*?)(\/.*)?$/,(ee,ae,ge)=>!ge||ge==="/"?"":ae+"/"))||"";v(G),_e.current=!0,We(),B({title:"Đã xóa tập tin",description:`Đã xóa thành công ${j.length} mục`}),k(!1),f(new Set)}catch($){console.error("Error deleting files:",$),B({title:"Lỗi",description:"Không thể xóa các tập tin đã chọn",variant:"destructive"})}finally{D(!1)}},Bx=async(M,$)=>{Se(!0);try{const j=M.key;let G;M.isFolder?G=j.split("/").slice(0,-2).join("/")+"/":G=j.substring(0,j.lastIndexOf("/")+1);const ee=G+$+(M.isFolder?"/":"");await oe.post(`${t}/api/rename`,{oldPath:j,newPath:ee}),_e.current=!0,await We(),B({title:"Đã đổi tên",description:`Đã đổi tên thành công "${M.name}" thành "${$}"`}),K(null),Ee(""),le(null)}catch(j){console.error("Error renaming item:",j),B({title:"Lỗi",description:"Không thể đổi tên",variant:"destructive"})}finally{Se(!1)}},Pd=async M=>{tt($=>new Set([...$,...M]));try{const $=await oe.post(`${t}/api/download`,{paths:M},{responseType:"blob"}),j=window.URL.createObjectURL($.data),G=document.createElement("a");G.href=j;const ee=$.headers["Content-Disposition"]||$.headers["content-disposition"],ae=ee==null?void 0:ee.match(/filename="(.+)"/),ge=ae?decodeURIComponent(ae[1]):"download.zip";G.setAttribute("download",ge),document.body.appendChild(G),G.click(),document.body.removeChild(G),window.URL.revokeObjectURL(j),B({title:"Bắt đầu tải xuống",description:`Đã bắt đầu tải xuống ${M.length} mục${M.length>1,""}`})}catch($){console.error("Error downloading files:",$),B({title:"Lỗi",description:"Không thể tải xuống tập tin",variant:"destructive"})}finally{tt($=>{const j=new Set($);return M.forEach(G=>j.delete(G)),j})}},Ad=p?p.replace(n,"").split("/").filter(Boolean):[],zx=()=>Array.from(c).map(M=>{var $;for(const j in ke){const G=($=ke[j])==null?void 0:$.find(ee=>ee.key===M);if(G)return G}return null}).filter(M=>M!==null),_d=A.useMemo(()=>{const M=[{id:"select",header:()=>{const $=lx(ke,p),j=$.length>0&&$.every(ee=>c.has(ee)),G=$.some(ee=>c.has(ee));return l.jsx(es,{checked:j?!0:G?"indeterminate":!1,onCheckedChange:ee=>{if(ee){const ae=Jt.reduce((ge,Tt,Si)=>(ge[Si]=!0,ge),{});co(ae)}else co({})},"aria-label":"Chọn tất cả"})},cell:({row:$})=>{const j=$.original,ee=j.isFolder?$x(j.key):c.has(j.key)?"all":"none";return l.jsx("div",{className:"flex items-center",children:l.jsx(es,{checked:ee==="partial"?"indeterminate":ee==="all",onCheckedChange:ae=>{const ge={...Jn};ae?ge[$.index]=!0:delete ge[$.index],co(ge)},"aria-label":"Chọn dòng"})})},enableSorting:!1},{id:"fileName",header:"Tên tập tin",accessorKey:"name",cell:({row:$})=>{const j=$.original,G=j.key.substring(0,j.key.lastIndexOf("/"))||"/",ee=a.trim()!==""&&G!==p,ae=G.split("/").filter(Boolean);return l.jsxs("div",{className:"flex flex-col",children:[l.jsxs("div",{className:`flex items-center gap-2 ${j.isFolder?"cursor-pointer hover:text-blue-600":""}`,onClick:()=>{j.isFolder&&lo(j.key)},children:[j.isFolder?l.jsx(fo,{className:"h-5 w-5 text-blue-500"}):null,j.name]}),ee&&l.jsxs("div",{className:"text-sm text-gray-500 flex items-center",children:[l.jsx(fo,{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:()=>{lo("")},children:"/"}),ae.map((ge,Tt)=>l.jsxs("span",{className:"flex items-center",children:[l.jsx("span",{className:"cursor-pointer hover:text-blue-600",onClick:()=>{lo(ae.slice(0,Tt+1).join("/")+"/")},children:ge}),Tt<ae.length-1&&l.jsx("span",{children:"/"})]},Tt))]})]})]})}}];return r||M.push({id:"size",header:"Kích thước",accessorKey:"size",cell:({getValue:$,row:j})=>{const G=$();return l.jsx("span",{children:j.original.isFolder?"-":Gg(G)})}},{id:"lastModified",header:"Sửa đổi lần cuối",accessorKey:"lastModified",cell:({row:$})=>{const j=$.original.lastModified;return l.jsx("span",{children:j.toLocaleString()})}},{id:"actions",header:"Hành động",accessorKey:"key",cell:({row:$})=>l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(vn,{children:l.jsxs(yn,{children:[l.jsx(wn,{asChild:!0,children:l.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>Pd([$.original.key]),className:"h-8 w-8 p-0",disabled:Ce.has($.original.key),children:Ce.has($.original.key)?l.jsx(ye,{className:"h-4 w-4 animate-spin"}):l.jsx(Ni,{className:"h-4 w-4"})})}),l.jsx(qt,{children:"Tải xuống"})]})}),l.jsx(vn,{children:l.jsxs(yn,{children:[l.jsx(wn,{asChild:!0,children:l.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>{K($.original),Ee($.original.name)},className:"h-8 w-8 p-0",children:l.jsx(Hd,{className:"h-4 w-4"})})}),l.jsx(qt,{children:"Đổi tên"})]})}),l.jsx(vn,{children:l.jsxs(yn,{children:[l.jsx(wn,{asChild:!0,children:l.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>{Ue(!0),O($.original)},className:"h-8 w-8 p-0",children:l.jsx(sg,{className:"h-4 w-4"})})}),l.jsx(qt,{children:"Di chuyển"})]})}),l.jsx(vn,{children:l.jsxs(yn,{children:[l.jsx(wn,{asChild:!0,children:l.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>P($.original),className:"h-8 w-8 p-0",children:l.jsx(Ti,{className:"h-4 w-4"})})}),l.jsx(qt,{children:"Xóa"})]})})]})}),M},[c,Jt,Jn,Ce,r]),Ci=Vi({data:Jt,columns:_d,state:{rowSelection:Jn},enableRowSelection:!0,onRowSelectionChange:co,getCoreRowModel:Ri()}),Hx=async M=>{var $,j;Xt(!0);try{if(Un(M)){const G=await oe.get(`${t}/api/read-text`,{params:{path:M.key}});nt(G.data.content)}try{const G=await oe.get(`${t}/api/read-json`,{params:{path:M.key+".metadata.json"}}),ee=((j=($=G==null?void 0:G.data)==null?void 0:$.content)==null?void 0:j.metadataAttributes)||null;return le({fullPath:U==null?void 0:U.key,...ee})}catch{return le("Lỗi phân tích siêu dữ liệu")}}catch(G){console.error("Error loading file content:",G),B({title:"Lỗi",description:"Không thể tải nội dung tập tin",variant:"destructive"})}finally{Xt(!1)}},Ux=async(M,$)=>{pt(!0);try{await oe.post(`${t}/api/modify-text`,{path:M.key,content:$}),B({title:"Đã lưu tập tin",description:"Nội dung tập tin đã được cập nhật thành công"}),_e.current=!0,await We(),K(null),nt(""),Bt("rename")}catch(j){console.error("Error saving file content:",j),B({title:"Lỗi",description:"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{pt(!1)}},jx=async M=>{pt(!0);try{console.log("🚀 ~ saveJsonFile ~ metadataForEdit:",Y),await oe.post(`${t}/api/modify-json`,{path:M.key+".metadata.json",content:{metadataAttributes:Y}}),B({title:"Đã lưu tập tin",description:"Nội dung tập tin đã được cập nhật thành công"}),_e.current=!0,await We(),K(null),nt(""),Bt("rename")}catch($){console.error("Error saving file content:",$),B({title:"Lỗi",description:"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{pt(!1)}};A.useEffect(()=>{U&&(U.isFolder||Hx(U),Bt("rename"))},[U]);const Wx=async(M,$)=>{var j;if(ce){B({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}X(!0);try{const{data:G}=await oe.post(`${t}/api/crawl`,{url:M,limit:$,prefix:p});if(G.id){Xn({id:G.id,url:M,limit:$,prefix:p,taskId:((j=G.task)==null?void 0:j.id)||""});const ee=localStorage.getItem(od),ae=ee?JSON.parse(ee):[];ae.some(ge=>ge.id===G.id)||(ae.unshift({url:M,id:G.id,limit:$,prefix:p,timestamp:Date.now()}),ae.length>20&&(ae.length=20),localStorage.setItem(od,JSON.stringify(ae))),B({title:"Bắt đầu thu thập website",description:`Đã thêm nhiệm vụ thu thập ${M} với giới hạn ${$}. Dữ liệu sẽ có sẵn sau khi thu thập hoàn tất.`}),C(!1),_(""),V("1")}}catch(G){console.error("Error crawling website:",G),B({title:"Lỗi",description:"Không thể bắt đầu thu thập website",variant:"destructive"})}finally{X(!1)}},Gx=async()=>{try{if(!(ce!=null&&ce.id))return;Xn(null),localStorage.removeItem(bn),B({title:"Đã dừng thu thập",description:`Đã dừng thu thập website ${ce.url}`})}catch(M){console.error("Error stopping job:",M),B({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(La,{className:"s3-explr-breadcrumb",children:l.jsxs(Ra,{className:"s3-explr-breadcrumb-list",children:[l.jsx(Xo,{className:"s3-explr-breadcrumb-item",children:l.jsx(Jo,{onClick:()=>{v(""),m(""),_e.current=!0,setTimeout(()=>{We()},0)},className:"flex items-center gap-1 cursor-pointer s3-explr-breadcrumb-home",children:e})}),Ad.map((M,$)=>l.jsxs(l.Fragment,{children:[l.jsx(Va,{className:"s3-explr-breadcrumb-separator"},`sep-${$}`),l.jsx(Xo,{className:"s3-explr-breadcrumb-item",children:l.jsx(Jo,{onClick:()=>lo(n+Ad.slice(0,$+1).join("/")+"/"),className:"cursor-pointer s3-explr-breadcrumb-link",children:M})},`item-${M}`)]}))]})}),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(ox,{ref:J,onChange:M=>u(M)})}),l.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>{v(p),_e.current=!0,We()},disabled:xi,className:"flex items-center gap-2 s3-explr-refresh-btn",children:[l.jsx(Md,{className:`h-4 w-4 s3-explr-refresh-icon ${xi?"animate-spin":""}`}),"Làm mới"]}),!r&&l.jsxs(l.Fragment,{children:[c.size>0&&l.jsxs(l.Fragment,{children:[l.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>Pd(Array.from(c)),disabled:Array.from(c).some(M=>Ce.has(M)),className:"flex items-center gap-2 s3-explr-download-selected-btn",children:[Array.from(c).some(M=>Ce.has(M))?l.jsx(ye,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}):l.jsx(Ni,{className:"h-4 w-4 s3-explr-download-icon"}),"Tải xuống đã chọn (",c.size,")"]}),l.jsxs(It,{open:q,onOpenChange:k,children:[l.jsx(Er,{asChild:!0,children:l.jsxs(ie,{variant:"destructive",size:"sm",className:"flex items-center gap-2 s3-explr-bulk-delete-btn",children:[l.jsx(Ti,{className:"h-4 w-4 s3-explr-trash-icon"}),"Xóa đã chọn (",c.size,")"]})}),l.jsxs(vt,{className:"s3-explr-dialog-content",children:[l.jsxs(yt,{className:"s3-explr-dialog-header",children:[l.jsx(wt,{className:"s3-explr-dialog-title",children:"Xác nhận xóa hàng loạt"}),l.jsxs(Mn,{className:"s3-explr-dialog-description",children:["Bạn có chắc chắn muốn xóa ",c.size," mục đã chọn? Hành động này không thể hoàn tác."]})]}),l.jsxs(un,{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:Vx,disabled:I,className:"s3-explr-confirm-delete-btn",children:I?l.jsxs(l.Fragment,{children:[l.jsx(ye,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa đã chọn"})]})]})]})]}),l.jsxs(It,{open:h,onOpenChange:y,children:[l.jsx(Er,{asChild:!0,children:l.jsxs(ie,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-new-folder-btn",disabled:!!s&&!p,children:[l.jsx(Ld,{className:"h-4 w-4 s3-explr-folder-plus-icon"}),"Thư mục mới"]})}),l.jsxs(vt,{className:"s3-explr-dialog-content",children:[l.jsx(yt,{className:"s3-explr-dialog-header",children:l.jsx(wt,{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(Wt,{htmlFor:"name",className:"s3-explr-label",children:"Tên thư mục"}),l.jsx(kt,{disabled:S,id:"name",value:w,onChange:M=>b(M.target.value),placeholder:"Nhập tên thư mục",className:"s3-explr-input"})]}),l.jsxs(ie,{onClick:()=>{w.trim()&&Lx(w,p)},disabled:S,className:"s3-explr-create-btn",children:[S&&l.jsx(ye,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),S?"Đ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 M=document.createElement("input");M.type="file",M.multiple=!0,M.onchange=$=>{const j=$.target.files;j&&Td(j,p,"files")},M.click()},disabled:z!==null||!!s&&!p,children:z==="files"?l.jsxs(l.Fragment,{children:[l.jsx(ye,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}),"Đang tải lên..."]}):l.jsxs(l.Fragment,{children:[l.jsx(kd,{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 M=document.createElement("input");M.type="file",M.multiple=!0,M.webkitdirectory=!0,M.onchange=$=>{const j=$.target.files;j&&Td(j,p,"folder")},M.click()},disabled:z!==null||!!s&&!p,children:z==="folder"?l.jsxs(l.Fragment,{children:[l.jsx(ye,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}),"Đang tải lên..."]}):l.jsxs(l.Fragment,{children:[l.jsx(fo,{className:"h-4 w-4 s3-explr-folder-icon"}),"Tải lên thư mục"]})}),ce?l.jsx(vn,{delayDuration:0,children:l.jsxs(yn,{children:[l.jsx(wn,{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(ye,{className:"h-4 w-4 animate-spin s3-explr-loader"}),ce.status?l.jsxs(l.Fragment,{children:["Đang thu thập (",ce.status.completed,"/",ce.status.total,") - ",Math.floor(En/60),":",String(En%60).padStart(2,"0")]}):"Đang thu thập..."]}),l.jsxs(ie,{variant:"destructive",size:"sm",onClick:()=>void Gx(),className:"flex items-center gap-2",children:[l.jsx("span",{className:"sr-only",children:"Dừng thu thập"}),l.jsx(jd,{className:"h-4 w-4"})]})]})}),ce.status&&l.jsx(qt,{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 ",ce.url]}),l.jsxs("p",{children:["Tiến độ: ",ce.status.completed,"/",ce.status.total," trang"]}),l.jsxs("p",{children:["Thời gian: ",Math.floor(En/60),":",String(En%60).padStart(2,"0")]}),l.jsxs("p",{children:["Trạng thái:"," ",ce.status.status==="scraping"?"Đang thu thập":ce.status.status==="completed"?"Hoàn thành":"Thất bại"]})]})})]})}):l.jsxs(It,{open:io,onOpenChange:C,children:[l.jsx(Er,{asChild:!0,children:l.jsxs(ie,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!!s&&!p,children:[l.jsx(Bd,{className:"h-4 w-4 s3-explr-globe-icon"}),"Thêm website"]})}),l.jsxs(vt,{className:"s3-explr-dialog-content",children:[l.jsxs(yt,{className:"s3-explr-dialog-header",children:[l.jsx(wt,{className:"s3-explr-dialog-title",children:"Thêm website"}),l.jsx(Mn,{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(Wt,{htmlFor:"websiteUrl",className:"s3-explr-label",children:"URL Website"}),l.jsx(kt,{id:"websiteUrl",value:N,onChange:M=>_(M.target.value),placeholder:"https://example.com",type:"url",disabled:L,className:"s3-explr-input"})]}),l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(Wt,{htmlFor:"crawlLimit",className:"s3-explr-label",children:"Giới hạn thu thập"}),l.jsx(kt,{id:"crawlLimit",value:H,onChange:M=>{const $=M.target.value;/^\d*$/.test($)&&V($)},placeholder:"1",type:"text",disabled:L,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(un,{className:"s3-explr-dialog-footer",children:[l.jsx(ie,{variant:"outline",onClick:()=>{C(!1),_(""),V("1")},disabled:L,className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(ie,{onClick:()=>{N.trim()&&Wx(N.trim(),parseInt(H)||1)},disabled:L||!N.trim(),className:"s3-explr-crawl-btn",children:L?l.jsxs(l.Fragment,{children:[l.jsx(ye,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang thu thập..."]}):"Bắt đầu thu thập"})]})]})]})]}),l.jsx(It,{open:!!x,onOpenChange:M=>!M&&P(null),children:l.jsxs(vt,{className:"s3-explr-dialog-content",children:[l.jsxs(yt,{className:"s3-explr-dialog-header",children:[l.jsx(wt,{className:"s3-explr-dialog-title",children:"Xác nhận xóa"}),l.jsxs(Mn,{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(un,{className:"s3-explr-dialog-footer",children:[l.jsx(ie,{variant:"outline",onClick:()=>P(null),className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(ie,{variant:"destructive",onClick:()=>Rx(x),disabled:ve,className:"s3-explr-confirm-delete-btn",children:ve?l.jsxs(l.Fragment,{children:[l.jsx(ye,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa"})]})]})}),l.jsx(It,{open:!!U,onOpenChange:M=>{M||(K(null),le(null),Ee(""),nt(""),Bt("rename"))},children:l.jsxs(vt,{className:"s3-explr-dialog-content max-w-5xl w-[90%]",children:[l.jsx(yt,{className:"s3-explr-dialog-header",children:l.jsx(wt,{className:"s3-explr-dialog-title",children:U!=null&&U.isFolder?"Đổi tên thư mục":Un(U)?"Quản lý tập tin":"Đổi tên tập tin"})}),U&&l.jsxs(bv,{value:Cn,onValueChange:M=>Bt(M),children:[l.jsxs(Sc,{"aria-checked":!Un(U),"aria-disabled":U.isFolder,className:"grid w-full grid-cols-3 aria-checked:grid-cols-2 aria-disabled:grid-cols-1",children:[l.jsx(Or,{value:"rename",children:"Đổi tên"}),!U.isFolder&&l.jsxs(l.Fragment,{children:[Un(U)&&l.jsx(Or,{value:"edit",children:"Sửa nội dung"}),l.jsx(Or,{value:"edit-metadata",children:"Sửa metadata file"})]})]}),l.jsx(Dr,{value:"rename",children:l.jsx("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:l.jsxs("div",{className:"h-[70dvh] min-h-[500px] overflow-hidden overflow-y-auto pb-3 px-1 s3-explr-input-group",children:[l.jsx(Wt,{htmlFor:"newName",className:"s3-explr-label",children:"Tên mới"}),l.jsx(kt,{id:"newName",value:ue,onChange:M=>Ee(M.target.value),placeholder:"Nhập tên mới",disabled:Nt,className:"s3-explr-input"})]})})}),!U.isFolder&&l.jsxs(l.Fragment,{children:[Un(U)&&l.jsx(Dr,{value:"edit",children:l.jsx("div",{className:"space-y-4 py-4",children:ft?l.jsx("div",{className:"flex items-center justify-center py-4",children:l.jsx(ye,{className:"h-6 w-6 animate-spin"})}):l.jsxs("div",{className:"h-[70dvh] min-h-[500px] overflow-hidden overflow-y-auto pb-3 px-1",children:[l.jsx(Wt,{htmlFor:"content",className:"s3-explr-label",children:"Nội dung tập tin"}),l.jsx(In,{id:"content",value:je,onChange:M=>nt(M.target.value),placeholder:"Nhập nội dung tập tin",className:"min-h-[200px] font-mono",disabled:Pe})]})})}),l.jsx(Dr,{value:"edit-metadata",children:l.jsx("div",{className:"space-y-4 py-4",children:ft?l.jsx("div",{className:"flex items-center justify-center py-4",children:l.jsx(ye,{className:"h-6 w-6 animate-spin"})}):l.jsx("div",{className:"h-[70dvh] min-h-[500px] overflow-hidden overflow-y-auto pb-3 px-1",children:Y&&typeof Y=="object"&&Object.entries(Y).map(([M,$])=>l.jsxs("div",{className:"pb-3 flex flex-col gap-2",children:[l.jsxs(Wt,{htmlFor:M,className:"s3-explr-label flex items-center gap-1",children:[lg[M]||M,jo(M)&&l.jsx(ig,{className:"h-[12px] w-[12px] text-red-500"})]}),cg(M)?l.jsx(In,{id:M,value:typeof $=="string"?$:JSON.stringify($),onChange:j=>{const G={...Y,[M]:j.target.value};le(G)},placeholder:"Nhập nội dung tập tin",className:"min-h-[200px] font-mono",disabled:Pe||jo(M)}):l.jsx(kt,{id:M,value:typeof $=="string"?$:JSON.stringify($),onChange:j=>{const G={...Y,[M]:j.target.value};le(G)},placeholder:"Nhập nội dung",className:"s3-explr-input",disabled:Pe||jo(M)})]},M))})})})]})]}),l.jsxs(un,{className:"s3-explr-dialog-footer",children:[l.jsx(ie,{variant:"outline",onClick:()=>{K(null),le(null),Ee(""),nt("")},className:"s3-explr-cancel-btn",children:"Hủy"}),Cn==="edit"?l.jsx(ie,{onClick:()=>U&&Ux(U,je),disabled:Pe||ft,className:"s3-explr-save-btn",children:Pe?l.jsxs(l.Fragment,{children:[l.jsx(ye,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang lưu..."]}):"Lưu thay đổi"}):Cn==="edit-metadata"?l.jsx(ie,{onClick:()=>Y&&typeof Y=="object"&&U&&jx(U),disabled:Pe||ft,className:"s3-explr-save-btn",children:Pe?l.jsxs(l.Fragment,{children:[l.jsx(ye,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang lưu..."]}):"Lưu thay đổi"}):l.jsx(ie,{onClick:()=>{ue.trim()&&U&&Bx(U,ue.trim())},disabled:Nt||!ue.trim()||ue.trim()===(U==null?void 0:U.name),className:"s3-explr-rename-btn",children:Nt?l.jsxs(l.Fragment,{children:[l.jsx(ye,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang đổi tên..."]}):"Đổi tên"})]})]})}),F&&Ie&&l.jsx(sx,{openDialogRename:Ie,setOpenDialogRename:Ue,apiBaseUrl:t,setFileToMove:O,fileToMove:F,refreshFiles:We,ignoreCache:_e})]})]}),kx&&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(Nr,{className:"s3-explr-table",children:[l.jsx(Tr,{className:"s3-explr-table-header",children:Ci.getHeaderGroups().map(M=>l.jsx(Ye,{className:"hover:bg-transparent s3-explr-header-row",children:M.headers.map($=>l.jsx(st,{className:"s3-explr-header-cell",children:$.isPlaceholder?null:nr($.column.columnDef.header,$.getContext())},$.id))},M.id))}),l.jsx(Pr,{className:"s3-explr-table-body",children:Ci.getRowModel().rows.length===0?l.jsx(Ye,{className:"s3-explr-empty-row",children:l.jsx(De,{colSpan:_d.length,className:"h-24 text-center s3-explr-empty-cell",children:a?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 "',a,'"']}):l.jsx("div",{className:"text-gray-500 s3-explr-empty-message",children:xi?"Đ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"})})}):Ci.getRowModel().rows.map(M=>l.jsx(Ye,{className:"h-12 s3-explr-row",children:M.getVisibleCells().map($=>l.jsx(De,{className:"align-middle s3-explr-cell",children:nr($.column.columnDef.cell,$.getContext())},$.id))},M.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:[c.size," ",(c.size===1,"tập tin")," đã chọn"]}),l.jsx(ie,{variant:"default",onClick:()=>o(zx()),disabled:c.size===0,className:"s3-explr-ok-btn",children:"OK"})]}),!r&&l.jsx(Jc,{})]})});var jn=e=>e.type==="checkbox",Kt=e=>e instanceof Date,Fe=e=>e==null;const sd=e=>typeof e=="object";var he=e=>!Fe(e)&&!Array.isArray(e)&&sd(e)&&!Kt(e),dx=e=>he(e)&&e.target?jn(e.target)?e.target.checked:e.target.value:e,fx=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,px=(e,t)=>e.has(fx(t)),gx=e=>{const t=e.constructor&&e.constructor.prototype;return he(t)&&t.hasOwnProperty("isPrototypeOf")},ai=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(!(ai&&(e instanceof Blob||r))&&(n||he(e)))if(t=n?[]:{},!n&&!gx(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=He(e[o]));else return e;return t}var eo=e=>Array.isArray(e)?e.filter(Boolean):[],pe=e=>e===void 0,W=(e,t,n)=>{if(!t||!he(e))return n;const r=eo(t.split(/[,[\].]+?/)).reduce((o,s)=>Fe(o)?o:o[s],e);return pe(r)||r===e?pe(e[t])?n:e[t]:r},ct=e=>typeof e=="boolean",li=e=>/^\w*$/.test(e),id=e=>eo(e.replace(/["|']|\]/g,"").split(/\.|\[/)),fe=(e,t,n)=>{let r=-1;const o=li(t)?[t]:id(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 ad={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},et={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},St={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};A.createContext(null);var hx=(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]!==et.all&&(t._proxyFormState[i]=!r||et.all),e[i]}});return o},Me=e=>he(e)&&!Object.keys(e).length,mx=(e,t,n,r)=>{n(e);const{name:o,...s}=e;return Me(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(i=>t[i]===et.all)},to=e=>Array.isArray(e)?e:[e];function vx(e){const t=A.useRef(e);t.current=e,A.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}var ut=e=>typeof e=="string",yx=(e,t,n,r,o)=>ut(e)?(r&&t.watch.add(e),W(n,e,o)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),W(n,s))):(r&&(t.watchAll=!0),n),wx=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},ld=e=>({isOnSubmit:!e||e===et.onSubmit,isOnBlur:e===et.onBlur,isOnChange:e===et.onChange,isOnAll:e===et.all,isOnTouch:e===et.onTouched}),cd=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Wn=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const s=W(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(Wn(a,t))break}else if(he(a)&&Wn(a,t))break}}};var bx=(e,t,n)=>{const r=to(W(e,n));return fe(r,"root",t[n]),fe(e,n,r),e},ci=e=>e.type==="file",dt=e=>typeof e=="function",no=e=>{if(!ai)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},ro=e=>ut(e),ui=e=>e.type==="radio",oo=e=>e instanceof RegExp;const ud={value:!1,isValid:!1},dd={value:!0,isValid:!0};var fd=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&&!pe(e[0].attributes.value)?pe(e[0].value)||e[0].value===""?dd:{value:e[0].value,isValid:!0}:dd:ud}return ud};const pd={isValid:!1,value:null};var gd=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,pd):pd;function hd(e,t,n="validate"){if(ro(e)||Array.isArray(e)&&e.every(ro)||ct(e)&&!e)return{type:n,message:ro(e)?e:"",ref:t}}var xn=e=>he(e)&&!oo(e)?e:{value:e,message:""},md=async(e,t,n,r,o)=>{const{ref:s,refs:i,required:a,maxLength:u,minLength:c,min:f,max:p,pattern:m,validate:g,name:v,valueAsNumber:h,mount:y,disabled:w}=e._f,b=W(t,v);if(!y||w)return{};const S=i?i[0]:s,E=k=>{r&&S.reportValidity&&(S.setCustomValidity(ct(k)?"":k||""),S.reportValidity())},x={},P=ui(s),F=jn(s),O=P||F,I=(h||ci(s))&&pe(s.value)&&pe(b)||no(s)&&s.value===""||b===""||Array.isArray(b)&&!b.length,D=wx.bind(null,v,n,x),q=(k,z,R,J=St.maxLength,B=St.minLength)=>{const U=k?z:R;x[v]={type:k?J:B,message:U,ref:s,...D(k?J:B,U)}};if(o?!Array.isArray(b)||!b.length:a&&(!O&&(I||Fe(b))||ct(b)&&!b||F&&!fd(i).isValid||P&&!gd(i).isValid)){const{value:k,message:z}=ro(a)?{value:!!a,message:a}:xn(a);if(k&&(x[v]={type:St.required,message:z,ref:S,...D(St.required,z)},!n))return E(z),x}if(!I&&(!Fe(f)||!Fe(p))){let k,z;const R=xn(p),J=xn(f);if(!Fe(b)&&!isNaN(b)){const B=s.valueAsNumber||b&&+b;Fe(R.value)||(k=B>R.value),Fe(J.value)||(z=B<J.value)}else{const B=s.valueAsDate||new Date(b),U=le=>new Date(new Date().toDateString()+" "+le),K=s.type=="time",Y=s.type=="week";ut(R.value)&&b&&(k=K?U(b)>U(R.value):Y?b>R.value:B>new Date(R.value)),ut(J.value)&&b&&(z=K?U(b)<U(J.value):Y?b<J.value:B<new Date(J.value))}if((k||z)&&(q(!!k,R.message,J.message,St.max,St.min),!n))return E(x[v].message),x}if((u||c)&&!I&&(ut(b)||o&&Array.isArray(b))){const k=xn(u),z=xn(c),R=!Fe(k.value)&&b.length>+k.value,J=!Fe(z.value)&&b.length<+z.value;if((R||J)&&(q(R,k.message,z.message),!n))return E(x[v].message),x}if(m&&!I&&ut(b)){const{value:k,message:z}=xn(m);if(oo(k)&&!b.match(k)&&(x[v]={type:St.pattern,message:z,ref:s,...D(St.pattern,z)},!n))return E(z),x}if(g){if(dt(g)){const k=await g(b,t),z=hd(k,S);if(z&&(x[v]={...z,...D(St.validate,z.message)},!n))return E(z.message),x}else if(he(g)){let k={};for(const z in g){if(!Me(k)&&!n)break;const R=hd(await g[z](b,t),S,z);R&&(k={...R,...D(z,R.message)},E(R.message),n&&(x[v]=k))}if(!Me(k)&&(x[v]={ref:S,...k},!n))return x}}return E(!0),x};function xx(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=pe(e)?r++:e[t[r++]];return e}function Cx(e){for(const t in e)if(e.hasOwnProperty(t)&&!pe(e[t]))return!1;return!0}function xe(e,t){const n=Array.isArray(t)?t:li(t)?[t]:id(t),r=n.length===1?e:xx(e,n),o=n.length-1,s=n[o];return r&&delete r[s],o!==0&&(he(r)&&Me(r)||Array.isArray(r)&&Cx(r))&&xe(e,n.slice(0,-1)),e}var di=()=>{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=[]}}},fi=e=>Fe(e)||!sd(e);function Vt(e,t){if(fi(e)||fi(t))return e===t;if(Kt(e)&&Kt(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(Kt(s)&&Kt(i)||he(s)&&he(i)||Array.isArray(s)&&Array.isArray(i)?!Vt(s,i):s!==i)return!1}}return!0}var vd=e=>e.type==="select-multiple",Sx=e=>ui(e)||jn(e),pi=e=>no(e)&&e.isConnected,yd=e=>{for(const t in e)if(dt(e[t]))return!0;return!1};function so(e,t={}){const n=Array.isArray(e);if(he(e)||n)for(const r in e)Array.isArray(e[r])||he(e[r])&&!yd(e[r])?(t[r]=Array.isArray(e[r])?[]:{},so(e[r],t[r])):Fe(e[r])||(t[r]=!0);return t}function wd(e,t,n){const r=Array.isArray(e);if(he(e)||r)for(const o in e)Array.isArray(e[o])||he(e[o])&&!yd(e[o])?pe(t)||fi(n[o])?n[o]=Array.isArray(e[o])?so(e[o],[]):{...so(e[o])}:wd(e[o],Fe(t)?{}:t[o],n[o]):n[o]=!Vt(e[o],t[o]);return n}var Gn=(e,t)=>wd(e,t,so(t)),bd=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>pe(e)?e:t?e===""?NaN:e&&+e:n&&ut(e)?new Date(e):r?r(e):e;function gi(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return ci(t)?t.files:ui(t)?gd(e.refs).value:vd(t)?[...t.selectedOptions].map(({value:n})=>n):jn(t)?fd(e.refs).value:bd(pe(t.value)?e.ref.value:t.value,e)}var Ex=(e,t,n,r)=>{const o={};for(const s of e){const i=W(t,s);i&&fe(o,s,i._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},qn=e=>pe(e)?e:oo(e)?e.source:he(e)?oo(e.value)?e.value.source:e.value:e;const xd="AsyncFunction";var Nx=e=>!!e&&!!e.validate&&!!(dt(e.validate)&&e.validate.constructor.name===xd||he(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===xd)),Tx=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Cd(e,t,n){const r=W(e,n);if(r||li(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const s=o.join("."),i=W(t,s),a=W(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 Px=(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,Ax=(e,t)=>!eo(W(e,t)).length&&xe(e,t);const _x={mode:et.onSubmit,reValidateMode:et.onChange,shouldFocusError:!0};function Fx(e={}){let t={..._x,...e},n={submitCount:0,isDirty:!1,isLoading:dt(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)?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},p={values:di(),array:di(),state:di()},m=ld(t.mode),g=ld(t.reValidateMode),v=t.criteriaMode===et.all,h=C=>N=>{clearTimeout(c),c=setTimeout(C,N)},y=async C=>{if(!t.disabled&&(f.isValid||C)){const N=t.resolver?Me((await O()).errors):await D(r,!0);N!==n.isValid&&p.state.next({isValid:N})}},w=(C,N)=>{!t.disabled&&(f.isValidating||f.validatingFields)&&((C||Array.from(a.mount)).forEach(_=>{_&&(N?fe(n.validatingFields,_,N):xe(n.validatingFields,_))}),p.state.next({validatingFields:n.validatingFields,isValidating:!Me(n.validatingFields)}))},b=(C,N=[],_,H,V=!0,L=!0)=>{if(H&&_&&!t.disabled){if(i.action=!0,L&&Array.isArray(W(r,C))){const X=_(W(r,C),H.argA,H.argB);V&&fe(r,C,X)}if(L&&Array.isArray(W(n.errors,C))){const X=_(W(n.errors,C),H.argA,H.argB);V&&fe(n.errors,C,X),Ax(n.errors,C)}if(f.touchedFields&&L&&Array.isArray(W(n.touchedFields,C))){const X=_(W(n.touchedFields,C),H.argA,H.argB);V&&fe(n.touchedFields,C,X)}f.dirtyFields&&(n.dirtyFields=Gn(o,s)),p.state.next({name:C,isDirty:k(C,N),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else fe(s,C,N)},S=(C,N)=>{fe(n.errors,C,N),p.state.next({errors:n.errors})},E=C=>{n.errors=C,p.state.next({errors:n.errors,isValid:!1})},x=(C,N,_,H)=>{const V=W(r,C);if(V){const L=W(s,C,pe(_)?W(o,C):_);pe(L)||H&&H.defaultChecked||N?fe(s,C,N?L:gi(V._f)):J(C,L),i.mount&&y()}},P=(C,N,_,H,V)=>{let L=!1,X=!1;const se={name:C};if(!t.disabled){const me=!!(W(r,C)&&W(r,C)._f&&W(r,C)._f.disabled);if(!_||H){f.isDirty&&(X=n.isDirty,n.isDirty=se.isDirty=k(),L=X!==se.isDirty);const ve=me||Vt(W(o,C),N);X=!!(!me&&W(n.dirtyFields,C)),ve||me?xe(n.dirtyFields,C):fe(n.dirtyFields,C,!0),se.dirtyFields=n.dirtyFields,L=L||f.dirtyFields&&X!==!ve}if(_){const ve=W(n.touchedFields,C);ve||(fe(n.touchedFields,C,_),se.touchedFields=n.touchedFields,L=L||f.touchedFields&&ve!==_)}L&&V&&p.state.next(se)}return L?se:{}},F=(C,N,_,H)=>{const V=W(n.errors,C),L=f.isValid&&ct(N)&&n.isValid!==N;if(t.delayError&&_?(u=h(()=>S(C,_)),u(t.delayError)):(clearTimeout(c),u=null,_?fe(n.errors,C,_):xe(n.errors,C)),(_?!Vt(V,_):V)||!Me(H)||L){const X={...H,...L&&ct(N)?{isValid:N}:{},errors:n.errors,name:C};n={...n,...X},p.state.next(X)}},O=async C=>{w(C,!0);const N=await t.resolver(s,t.context,Ex(C||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return w(C),N},I=async C=>{const{errors:N}=await O(C);if(C)for(const _ of C){const H=W(N,_);H?fe(n.errors,_,H):xe(n.errors,_)}else n.errors=N;return N},D=async(C,N,_={valid:!0})=>{for(const H in C){const V=C[H];if(V){const{_f:L,...X}=V;if(L){const se=a.array.has(L.name),me=V._f&&Nx(V._f);me&&f.validatingFields&&w([H],!0);const ve=await md(V,s,v,t.shouldUseNativeValidation&&!N,se);if(me&&f.validatingFields&&w([H]),ve[L.name]&&(_.valid=!1,N))break;!N&&(W(ve,L.name)?se?bx(n.errors,ve,L.name):fe(n.errors,L.name,ve[L.name]):xe(n.errors,L.name))}!Me(X)&&await D(X,N,_)}}return _.valid},q=()=>{for(const C of a.unMount){const N=W(r,C);N&&(N._f.refs?N._f.refs.every(_=>!pi(_)):!pi(N._f.ref))&&Se(C)}a.unMount=new Set},k=(C,N)=>!t.disabled&&(C&&N&&fe(s,C,N),!Vt(ue(),o)),z=(C,N,_)=>yx(C,a,{...i.mount?s:pe(N)?o:ut(C)?{[C]:N}:N},_,N),R=C=>eo(W(i.mount?s:o,C,t.shouldUnregister?W(o,C,[]):[])),J=(C,N,_={})=>{const H=W(r,C);let V=N;if(H){const L=H._f;L&&(!L.disabled&&fe(s,C,bd(N,L)),V=no(L.ref)&&Fe(N)?"":N,vd(L.ref)?[...L.ref.options].forEach(X=>X.selected=V.includes(X.value)):L.refs?jn(L.ref)?L.refs.length>1?L.refs.forEach(X=>(!X.defaultChecked||!X.disabled)&&(X.checked=Array.isArray(V)?!!V.find(se=>se===X.value):V===X.value)):L.refs[0]&&(L.refs[0].checked=!!V):L.refs.forEach(X=>X.checked=X.value===V):ci(L.ref)?L.ref.value="":(L.ref.value=V,L.ref.type||p.values.next({name:C,values:{...s}})))}(_.shouldDirty||_.shouldTouch)&&P(C,V,_.shouldTouch,_.shouldDirty,!0),_.shouldValidate&&le(C)},B=(C,N,_)=>{for(const H in N){const V=N[H],L=`${C}.${H}`,X=W(r,L);(a.array.has(C)||he(V)||X&&!X._f)&&!Kt(V)?B(L,V,_):J(L,V,_)}},U=(C,N,_={})=>{const H=W(r,C),V=a.array.has(C),L=He(N);fe(s,C,L),V?(p.array.next({name:C,values:{...s}}),(f.isDirty||f.dirtyFields)&&_.shouldDirty&&p.state.next({name:C,dirtyFields:Gn(o,s),isDirty:k(C,L)})):H&&!H._f&&!Fe(L)?B(C,L,_):J(C,L,_),cd(C,a)&&p.state.next({...n}),p.values.next({name:i.mount?C:void 0,values:{...s}})},K=async C=>{i.mount=!0;const N=C.target;let _=N.name,H=!0;const V=W(r,_),L=()=>N.type?gi(V._f):dx(C),X=se=>{H=Number.isNaN(se)||Kt(se)&&isNaN(se.getTime())||Vt(se,W(s,_,se))};if(V){let se,me;const ve=L(),gt=C.type===ad.BLUR||C.type===ad.FOCUS_OUT,ao=!Tx(V._f)&&!t.resolver&&!W(n.errors,_)&&!V._f.deps||Px(gt,W(n.touchedFields,_),n.isSubmitted,g,m),Sn=cd(_,a,gt);fe(s,_,ve),gt?(V._f.onBlur&&V._f.onBlur(C),u&&u(0)):V._f.onChange&&V._f.onChange(C);const ce=P(_,ve,gt,!1),En=!Me(ce)||Sn;if(!gt&&p.values.next({name:_,type:C.type,values:{...s}}),ao)return f.isValid&&(t.mode==="onBlur"?gt&&y():y()),En&&p.state.next({name:_,...Sn?{}:ce});if(!gt&&Sn&&p.state.next({...n}),t.resolver){const{errors:Xn}=await O([_]);if(X(ve),H){const bi=Cd(n.errors,r,_),ke=Cd(Xn,r,bi.name||_);se=ke.error,_=ke.name,me=Me(Xn)}}else w([_],!0),se=(await md(V,s,v,t.shouldUseNativeValidation))[_],w([_]),X(ve),H&&(se?me=!1:f.isValid&&(me=await D(r,!0)));H&&(V._f.deps&&le(V._f.deps),F(_,me,se,ce))}},Y=(C,N)=>{if(W(n.errors,N)&&C.focus)return C.focus(),1},le=async(C,N={})=>{let _,H;const V=to(C);if(t.resolver){const L=await I(pe(C)?C:V);_=Me(L),H=C?!V.some(X=>W(L,X)):_}else C?(H=(await Promise.all(V.map(async L=>{const X=W(r,L);return await D(X&&X._f?{[L]:X}:X)}))).every(Boolean),!(!H&&!n.isValid)&&y()):H=_=await D(r);return p.state.next({...!ut(C)||f.isValid&&_!==n.isValid?{}:{name:C},...t.resolver||!C?{isValid:_}:{},errors:n.errors}),N.shouldFocus&&!H&&Wn(r,Y,C?V:a.mount),H},ue=C=>{const N={...i.mount?s:o};return pe(C)?N:ut(C)?W(N,C):C.map(_=>W(N,_))},Ee=(C,N)=>({invalid:!!W((N||n).errors,C),isDirty:!!W((N||n).dirtyFields,C),error:W((N||n).errors,C),isValidating:!!W(n.validatingFields,C),isTouched:!!W((N||n).touchedFields,C)}),Ie=C=>{C&&to(C).forEach(N=>xe(n.errors,N)),p.state.next({errors:C?n.errors:{}})},Ue=(C,N,_)=>{const H=(W(r,C,{_f:{}})._f||{}).ref,V=W(n.errors,C)||{},{ref:L,message:X,type:se,...me}=V;fe(n.errors,C,{...me,...N,ref:H}),p.state.next({name:C,errors:n.errors,isValid:!1}),_&&_.shouldFocus&&H&&H.focus&&H.focus()},Nt=(C,N)=>dt(C)?p.values.subscribe({next:_=>C(z(void 0,N),_)}):z(C,N,!0),Se=(C,N={})=>{for(const _ of C?to(C):a.mount)a.mount.delete(_),a.array.delete(_),N.keepValue||(xe(r,_),xe(s,_)),!N.keepError&&xe(n.errors,_),!N.keepDirty&&xe(n.dirtyFields,_),!N.keepTouched&&xe(n.touchedFields,_),!N.keepIsValidating&&xe(n.validatingFields,_),!t.shouldUnregister&&!N.keepDefaultValue&&xe(o,_);p.values.next({values:{...s}}),p.state.next({...n,...N.keepDirty?{isDirty:k()}:{}}),!N.keepIsValid&&y()},Ce=({disabled:C,name:N,field:_,fields:H,value:V})=>{if(ct(C)&&i.mount||C){const L=C?void 0:pe(V)?gi(_?_._f:W(H,N)._f):V;(C||!C&&!pe(L))&&fe(s,N,L),P(N,L,!1,!1,!0)}},tt=(C,N={})=>{let _=W(r,C);const H=ct(N.disabled)||ct(t.disabled);return fe(r,C,{..._||{},_f:{..._&&_._f?_._f:{ref:{name:C}},name:C,mount:!0,...N}}),a.mount.add(C),_?Ce({field:_,disabled:ct(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:qn(N.min),max:qn(N.max),minLength:qn(N.minLength),maxLength:qn(N.maxLength),pattern:qn(N.pattern)}:{},name:C,onChange:K,onBlur:K,ref:V=>{if(V){tt(C,N),_=W(r,C);const L=pe(V.value)&&V.querySelectorAll&&V.querySelectorAll("input,select,textarea")[0]||V,X=Sx(L),se=_._f.refs||[];if(X?se.find(me=>me===L):L===_._f.ref)return;fe(r,C,{_f:{..._._f,...X?{refs:[...se.filter(pi),L,...Array.isArray(W(o,C))?[{}]:[]],ref:{type:L.type,name:C}}:{ref:L}}}),x(C,!1,void 0,L)}else _=W(r,C,{}),_._f&&(_._f.mount=!1),(t.shouldUnregister||N.shouldUnregister)&&!(px(a.array,C)&&i.action)&&a.unMount.add(C)}}},je=()=>t.shouldFocusError&&Wn(r,Y,a.mount),nt=C=>{ct(C)&&(p.state.next({disabled:C}),Wn(r,(N,_)=>{const H=W(r,_);H&&(N.disabled=H._f.disabled||C,Array.isArray(H._f.refs)&&H._f.refs.forEach(V=>{V.disabled=H._f.disabled||C}))},0,!1))},ft=(C,N)=>async _=>{let H;if(_&&(_.preventDefault&&_.preventDefault(),_.persist&&_.persist()),t.disabled){N&&await N({...n.errors},_);return}let V=He(s);if(p.state.next({isSubmitting:!0}),t.resolver){const{errors:L,values:X}=await O();n.errors=L,V=X}else await D(r);if(xe(n.errors,"root"),Me(n.errors)){p.state.next({errors:{}});try{await C(V,_)}catch(L){H=L}}else N&&await N({...n.errors},_),je(),setTimeout(je);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Me(n.errors)&&!H,submitCount:n.submitCount+1,errors:n.errors}),H)throw H},Xt=(C,N={})=>{W(r,C)&&(pe(N.defaultValue)?U(C,He(W(o,C))):(U(C,N.defaultValue),fe(o,C,He(N.defaultValue))),N.keepTouched||xe(n.touchedFields,C),N.keepDirty||(xe(n.dirtyFields,C),n.isDirty=N.defaultValue?k(C,He(W(o,C))):k()),N.keepError||(xe(n.errors,C),f.isValid&&y()),p.state.next({...n}))},Pe=(C,N={})=>{const _=C?He(C):o,H=He(_),V=Me(C),L=V?o:H;if(N.keepDefaultValues||(o=_),!N.keepValues){if(N.keepDirtyValues){const X=new Set([...a.mount,...Object.keys(Gn(o,s))]);for(const se of Array.from(X))W(n.dirtyFields,se)?fe(L,se,W(s,se)):U(se,W(L,se))}else{if(ai&&pe(C))for(const X of a.mount){const se=W(r,X);if(se&&se._f){const me=Array.isArray(se._f.refs)?se._f.refs[0]:se._f.ref;if(no(me)){const ve=me.closest("form");if(ve){ve.reset();break}}}}r={}}s=t.shouldUnregister?N.keepDefaultValues?He(o):{}:He(L),p.array.next({values:{...L}}),p.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,p.state.next({submitCount:N.keepSubmitCount?n.submitCount:0,isDirty:V?!1:N.keepDirty?n.isDirty:!!(N.keepDefaultValues&&!Vt(C,o)),isSubmitted:N.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:V?{}:N.keepDirtyValues?N.keepDefaultValues&&s?Gn(o,s):n.dirtyFields:N.keepDefaultValues&&C?Gn(o,C):N.keepDirty?n.dirtyFields:{},touchedFields:N.keepTouched?n.touchedFields:{},errors:N.keepErrors?n.errors:{},isSubmitSuccessful:N.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},pt=(C,N)=>Pe(dt(C)?C(s):C,N);return{control:{register:tt,unregister:Se,getFieldState:Ee,handleSubmit:ft,setError:Ue,_executeSchema:O,_getWatch:z,_getDirty:k,_updateValid:y,_removeUnmounted:q,_updateFieldArray:b,_updateDisabledField:Ce,_getFieldArray:R,_reset:Pe,_resetDefaultValues:()=>dt(t.defaultValues)&&t.defaultValues().then(C=>{pt(C,t.resetOptions),p.state.next({isLoading:!1})}),_updateFormState:C=>{n={...n,...C}},_disableForm:nt,_subjects:p,_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:le,register:tt,handleSubmit:ft,watch:Nt,setValue:U,getValues:ue,reset:pt,resetField:Xt,clearErrors:Ie,unregister:Se,setError:Ue,setFocus:(C,N={})=>{const _=W(r,C),H=_&&_._f;if(H){const V=H.refs?H.refs[0]:H.ref;V.focus&&(V.focus(),N.shouldSelect&&dt(V.select)&&V.select())}},getFieldState:Ee}}function Ox(e={}){const t=A.useRef(),n=A.useRef(),[r,o]=A.useState({isDirty:!1,isValidating:!1,isLoading:dt(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:dt(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...Fx(e),formState:r});const s=t.current.control;return s._options=e,vx({subject:s._subjects.state,next:i=>{mx(i,s._proxyFormState,s._updateFormState)&&o({...s._formState})}}),A.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),A.useEffect(()=>{if(s._proxyFormState.isDirty){const i=s._getDirty();i!==r.isDirty&&s._subjects.state.next({isDirty:i})}},[s,r.isDirty]),A.useEffect(()=>{e.values&&!Vt(e.values,n.current)?(s._reset(e.values,s._options.resetOptions),n.current=e.values,o(i=>({...i}))):s._resetDefaultValues()},[e.values,s]),A.useEffect(()=>{e.errors&&s._setErrors(e.errors)},[e.errors,s]),A.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()}),A.useEffect(()=>{e.shouldUnregister&&s._subjects.values.next({values:s._getWatch()})},[e.shouldUnregister,s]),A.useMemo(()=>({...t.current,formState:hx(r,s)}),[r,s])}const Sd=({className:e,children:t,content:n,side:r})=>{const[o,s]=A.useState(!1);return l.jsx(vn,{delayDuration:0,children:l.jsxs(yn,{open:o,children:[l.jsx(wn,{asChild:!0,children:l.jsx("button",{type:"button",className:te("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(qt,{side:r,className:n?"":"hidden",children:l.jsx("span",{className:"inline-block",children:n})})]})})},hi=({className:e,...t})=>l.jsx("nav",{role:"navigation","aria-label":"pagination",className:te("mx-auto flex w-full justify-center",e),...t});hi.displayName="Pagination";const mi=d.forwardRef(({className:e,...t},n)=>l.jsx("ul",{ref:n,className:te("flex flex-row items-center gap-1",e),...t}));mi.displayName="PaginationContent";const Et=d.forwardRef(({className:e,...t},n)=>l.jsx("li",{ref:n,className:te("",e),...t}));Et.displayName="PaginationItem";const Kn=({className:e,isActive:t,size:n="icon",...r})=>l.jsx("a",{"aria-current":t?"page":void 0,className:te(Ha({variant:t?"outline":"ghost",size:n}),e),...r});Kn.displayName="PaginationLink";const vi=({className:e,...t})=>l.jsxs(Kn,{"aria-label":"Go to previous page",size:"default",className:te("gap-1 pl-2.5",e),...t,children:[l.jsx(ng,{className:"h-4 w-4"}),l.jsx("span",{children:"Previous"})]});vi.displayName="PaginationPrevious";const yi=({className:e,...t})=>l.jsxs(Kn,{"aria-label":"Go to next page",size:"default",className:te("gap-1 pr-2.5",e),...t,children:[l.jsx("span",{children:"Next"}),l.jsx(Na,{className:"h-4 w-4"})]});yi.displayName="PaginationNext";const wi=({className:e,...t})=>l.jsxs("span",{"aria-hidden":!0,className:te("flex h-9 w-9 items-center justify-center",e),...t,children:[l.jsx(rg,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"More pages"})]});wi.displayName="PaginationEllipsis";const Dx=(e,t)=>{const[n,r]=A.useState(e);return A.useEffect(()=>{const o=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(o)}},[e,t]),n},Mx=({apiBaseUrl:e="https://s3-explorer.cmcts1.studio.ai.vn"})=>{var P,F;const[t,n]=A.useState([]),[r,o]=A.useState(!1),[s,i]=A.useState([]),[a,u]=A.useState(1),[c,f]=A.useState(1),[p,m]=A.useState(null),[g,v]=A.useState(""),h=Dx(g,500),y=O=>{const I=O.match(/\d{6}/);if(!I)return{month:"",year:""};const D=I[0],q=D.substring(0,2),k=D.substring(2);return{month:q,year:k}},w=O=>O.map(D=>{let q=(D==null?void 0:D.month)||"",k=(D==null?void 0:D.year)||"";if((!q||!k)&&(D!=null&&D.file_name)){const z=y(D.file_name);q=q||z.month,k=k||z.year}return{id:D==null?void 0:D.id,prefix:(D==null?void 0:D.prefix)||"",model:(D==null?void 0:D.model)||"",fileName:(D==null?void 0:D.file_name)||"",code:(D==null?void 0:D.stock_id)||"",month:q,year:k,content:(D==null?void 0:D.text_summary)||"",status:(D==null?void 0:D.status)||"",note:(D==null?void 0:D.note)||"",lastUpdate:D==null?void 0:D.updated_at,stock_id:D==null?void 0:D.stock_id}}),b=O=>{if(!(O!=null&&O.data))return[];const I=w(O==null?void 0:O.data);n(I),f(O.pagination.totalPages)},S=async(O=1,I=15)=>{m(O),o(!0);try{const D=await oe.get(`${e}/api/latest-summaries`,{params:{page:O,limit:I,search:g}});(D==null?void 0:D.status)===200?b(D.data):console.error(D)}catch(D){console.error("Error fetching data:",D)}finally{m(null),o(!1)}};A.useEffect(()=>{h&&u(1),S(a)},[a,h]);const E=A.useMemo(()=>[{id:"code",header:"Mã",accessorKey:"code",cell:({row:I})=>l.jsx("span",{className:"flex flex-col",children:I.original.code})},{id:"month",header:"Tháng",accessorKey:"month",cell:({row:I})=>{const D=I.original.month,q=I.original.year;return l.jsx("span",{className:"flex flex-col",children:`${D.toString().padStart(2,"0")}/${q}`})}},{id:"content",header:"Nội dung",accessorKey:"content",cell:({row:I})=>{const D=I.getValue("content");return l.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[30dvw]",children:D})}},{id:"status",header:"Trạng thái",accessorKey:"status",cell:({row:I})=>{const q=I.original.status!=="unpublish";return l.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0 text-[10px] font-bold ${q?"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:q?"PUBLISHED":"UNPUBLISHED"})}},{id:"note",header:"Ghi chú",accessorKey:"note",cell:({row:I})=>l.jsx(Sd,{content:l.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:I.original.note}),children:l.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[20dvw]",children:I.original.note})})},{id:"last-update",header:"Cập nhật",accessorKey:"last-update",cell:({row:I})=>{const D=new Date(I.original.lastUpdate),q=D.getDate(),k=D.getMonth()+1,z=`ngày ${q} tháng ${k}`;return l.jsx("span",{className:"flex flex-col",children:z})}},{accessorKey:"actions",header:()=>l.jsx("div",{className:"font-medium text-right",children:"Hành động"}),cell:({row:I})=>{const[D,q]=A.useState(!1),[k,z]=A.useState(!1),[R,J]=A.useState(!1),{handleSubmit:B,register:U,reset:K}=Ox(),Y=I.original.id,le=I.getValue("status"),ue=I.getValue("content"),[Ee,Ie]=A.useState(!1),Ue=async()=>{try{Ie(!0);const Se=le==="unpublish"?"published":"unpublish",Ce=await oe.patch(`${e}/api/toggle-publish/${Y}`,{id:Y,typeAction:"update",status:le,idInput:Y,stock_id:I.original.stock_id,prefix:I.original.prefix,model:I.original.model,summary_result:I.original.content,note:I.original.note});Ce.status===200?n(tt=>tt.map(je=>je.id===Y?{...je,status:Se}:je)):console.error("Failed to toggle publish status:",Ce)}catch(Se){console.error("Error toggling publish status:",Se)}finally{Ie(!1)}},Nt=async Se=>{q(!0);try{const Ce=await oe.patch(`${e}/api/update-summary`,{note:Se.note,text_summary:Se.content,id:Y});Ce.status===200?(await S(a),z(!1)):console.error("Failed to update summary:",Ce)}catch(Ce){console.error("Error updating summary:",Ce)}return q(!1)};return l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsx(ie,{variant:"outline",size:"sm",onClick:()=>J(!0),className:"px-2 py-0.5 h-7",children:l.jsx(og,{className:"h-4 w-4"})}),l.jsx(It,{open:R,onOpenChange:J,children:l.jsxs(vt,{className:"max-w-3xl max-h-[80vh]",children:[l.jsx(yt,{children:l.jsx(wt,{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:ue})})]})}),l.jsxs(It,{open:k,onOpenChange:Se=>{z(Se),Se?K({content:I.original.content,note:I.original.note}):K()},children:[l.jsx(Er,{asChild:!0,children:l.jsx(ie,{variant:"outline",size:"sm",onClick:()=>z(!0),className:"px-2 py-0.5 h-7",children:"Sửa"})}),l.jsx(vt,{className:"rounded-lg sm:px-3 h-[calc(100dvh-200px)] min-w-[calc(100dvw-112px)]",children:l.jsxs(yt,{className:"flex flex-col gap-3",children:[l.jsx(wt,{className:"max-sm:hidden text-center",children:"Sửa summary"}),l.jsxs("form",{className:"flex flex-col gap-3 h-full justify-between",onSubmit:B(Nt),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(In,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:I.original.answer||"",rows:10,...U("content")})]}),l.jsxs("div",{className:"flex flex-col items-start",children:[l.jsx("span",{children:"Ghi chú:"}),l.jsx(In,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:I.original.note||"",rows:1,...U("note")})]})]}),l.jsx("div",{className:"flex justify-end",children:l.jsx(ie,{disabled:D,type:"submit",variant:"default",children:D?l.jsx(ye,{className:"h-4 w-4 animate-spin"}):"Ok"})})]})]})})]}),l.jsx(ie,{variant:"outline",size:"sm",onClick:Ue,disabled:Ee,className:"w-[70px] px-2 py-0.5 h-7",children:Ee?l.jsx(ye,{className:"h-4 w-4 animate-spin"}):le==="unpublish"?"Publish":"Unpublish"})]})}}],[]),x=Vi({data:t,columns:E,state:{columnFilters:s},enableRowSelection:!0,onColumnFiltersChange:i,getFilteredRowModel:Ef(),getCoreRowModel:Ri()});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(kt,{placeholder:"Tìm kiếm theo mã...",value:g,onChange:O=>v(O.target.value),className:"pr-8"}),g&&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(Uo,{className:"h-4 w-4"})})]})}),l.jsx("div",{className:"rounded-md border s3-explr-table-container",children:l.jsxs(Nr,{className:"s3-explr-table",children:[l.jsx(Tr,{className:"s3-explr-table-header",children:x.getHeaderGroups().map(O=>l.jsx(Ye,{className:"hover:bg-transparent s3-explr-header-row",children:O.headers.map(I=>l.jsx(st,{className:"s3-explr-header-cell",children:I.isPlaceholder?null:nr(I.column.columnDef.header,I.getContext())},I.id))},O.id))}),l.jsx(Pr,{className:"s3-explr-table-body",children:r?l.jsx(Ye,{children:l.jsx(De,{colSpan:E.length,className:"h-24 text-center",children:"Đang tải dữ liệu..."})}):(P=x.getRowModel().rows)!=null&&P.length?(F=x.getRowModel().rows)==null?void 0:F.map(O=>l.jsx(Ye,{className:"h-12 s3-explr-row",children:O.getVisibleCells().map(I=>l.jsx(De,{className:"align-middle s3-explr-cell",children:nr(I.column.columnDef.cell,I.getContext())},I.id))},O.id)):l.jsx(Ye,{children:l.jsx(De,{colSpan:E.length,className:"h-24 text-center",children:"Không có kết quả."})})})]})}),l.jsx("div",{className:"mt-4",children:l.jsx(hi,{children:l.jsxs(mi,{children:[l.jsx(Et,{children:l.jsx(vi,{onClick:()=>u(O=>Math.max(1,O-1)),className:a===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:c},(O,I)=>I+1).filter(O=>O===1||O===c||Math.abs(O-a)<=1).map((O,I,D)=>l.jsxs(l.Fragment,{children:[I>0&&D[I-1]!==O-1&&l.jsx(Et,{children:l.jsx(wi,{})},O+"..."),l.jsx(Et,{children:l.jsx(Kn,{onClick:()=>u(O),isActive:a===O,className:`cursor-pointer ${r?"pointer-events-none":""}`,children:p===O?l.jsx(ye,{className:"h-4 w-4 animate-spin"}):O})},O)]})),l.jsx(Et,{children:l.jsx(yi,{onClick:()=>u(O=>Math.min(c,O+1)),className:a===c||p!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})})]})},Ed=10,Ix=A.memo(({apiBaseUrl:e="https://s3-explorer.cmcts1.studio.ai.vn"})=>{const[t,n]=A.useState(1),[r,o]=A.useState([]),[s,i]=A.useState({total:0,page:1,limit:Ed,totalPages:1}),[a,u]=A.useState(!0),[c,f]=A.useState(null),[p,m]=A.useState(new Set),{toast:g}=Rr(),[v,h]=A.useState(!1),y=async x=>{try{f(x);const P=await oe.get(`${e}/api/jobs`,{params:{page:x.toString(),limit:Ed.toString()}});o(P.data.data),i(P.data.pagination)}catch{g({variant:"destructive",title:"Error",description:"Failed to fetch jobs. Please try again."})}finally{f(null),u(!1)}};A.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}),g({title:"Job Restarted",description:`Job ${x} has been successfully restarted.`}),y(t)}catch{g({variant:"destructive",title:"Retry Failed",description:`Failed to restart job ${x}. Please try again.`})}finally{m(P=>{const F=new Set(P);return F.delete(x.toString()),F})}},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),F=(x%60).toFixed(0);return`${P}m ${F}s`};return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[l.jsx(eg,{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(ag,{className:`h-4 w-4 ${v?"animate-spin":""}`})})]}),l.jsx("div",{className:"rounded-md border",children:l.jsxs(Nr,{children:[l.jsx(Tr,{children:l.jsxs(Ye,{children:[l.jsx(st,{children:"ID"}),l.jsx(st,{children:"Tên Công Việc"}),l.jsx(st,{children:"Thời Gian Bắt Đầu"}),l.jsx(st,{children:"Thời Gian Cập Nhật"}),l.jsx(st,{children:"Thời Gian Thực Thi"}),l.jsx(st,{children:"Trạng Thái"}),l.jsx(st,{children:"Thao Tác"})]})}),l.jsx(Pr,{children:a&&r.length===0?l.jsx(Ye,{children:l.jsx(De,{colSpan:7,className:"text-center py-4",children:l.jsx(ye,{className:"w-6 h-6 animate-spin mx-auto"})})}):r.map(x=>{var P,F;return l.jsxs(Ye,{children:[l.jsx(De,{className:"!w-[100px]",children:x.id}),l.jsx(De,{className:"font-medium",children:(P=x.job_name)==null?void 0:P.replace("Upload file","Summary")}),l.jsx(De,{className:"!w-[200px]",children:S(x.created_at)}),l.jsx(De,{className:"!w-[200px]",children:S(x.updated_at)}),l.jsx(De,{className:"!w-[150px]",children:E(x.execution_time_seconds)}),l.jsx(De,{className:"!w-[200px]",children:l.jsx(Sd,{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]
|
|
147
|
-
${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":(F=x.status)==null?void 0:F.toUpperCase()})})}),l.jsx(
|
|
151
|
+
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},Dm="DialogDescriptionWarning",Mm=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Gl(Dm).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},Im=Dl,km=Il,$m=$l,ql=Ll,Kl=Rl,Xl=Bl,Jl=zl,Lm=jl;const Mt=Im,Pr=km,Rm=$m,Yl=d.forwardRef(({className:e,...t},n)=>l.jsx(ql,{ref:n,className:ee("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}));Yl.displayName=ql.displayName;const yt=d.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(Rm,{children:[l.jsx(Yl,{}),l.jsxs(Kl,{ref:r,className:ee("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(Lm,{className:ee("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(Qo,{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"})]})]})]}));yt.displayName=Kl.displayName;const wt=({className:e,...t})=>l.jsx("div",{className:ee("s3-explr-ui-dialog-header flex flex-col space-y-1.5 text-center sm:text-left",e),...t});wt.displayName="DialogHeader";const fn=({className:e,...t})=>l.jsx("div",{className:ee("s3-explr-ui-dialog-footer flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});fn.displayName="DialogFooter";const bt=d.forwardRef(({className:e,...t},n)=>l.jsx(Xl,{ref:n,className:ee("s3-explr-ui-dialog-title text-lg font-semibold leading-none tracking-tight",e),...t}));bt.displayName=Xl.displayName;const kn=d.forwardRef(({className:e,...t},n)=>l.jsx(Jl,{ref:n,className:ee("s3-explr-ui-dialog-description text-sm text-muted-foreground",e),...t}));kn.displayName=Jl.displayName;const It=d.forwardRef(({className:e,type:t,...n},r)=>l.jsx("input",{type:t,className:ee("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}));It.displayName="Input";var Vm="Label",Zl=d.forwardRef((e,t)=>l.jsx(we.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())}}));Zl.displayName=Vm;var Ql=Zl;const Bm=as("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"}}),Gt=d.forwardRef(({className:e,variant:t,size:n,...r},o)=>l.jsx(Ql,{ref:o,className:ee(Bm({variant:t,size:n}),e),...r}));Gt.displayName=Ql.displayName;const Ar=({className:e,...t})=>l.jsx("nav",{role:"navigation","aria-label":"pagination",className:ee("mx-auto flex w-full justify-center",e),...t});Ar.displayName="Pagination";const _r=d.forwardRef(({className:e,...t},n)=>l.jsx("ul",{ref:n,className:ee("flex flex-row items-center gap-1",e),...t}));_r.displayName="PaginationContent";const Ye=d.forwardRef(({className:e,...t},n)=>l.jsx("li",{ref:n,className:ee("",e),...t}));Ye.displayName="PaginationItem";const pn=({className:e,isActive:t,size:n="icon",...r})=>l.jsx("a",{"aria-current":t?"page":void 0,className:ee(Ga({variant:t?"outline":"ghost",size:n}),e),...r});pn.displayName="PaginationLink";const Fr=({className:e,...t})=>l.jsxs(pn,{"aria-label":"Go to previous page",size:"default",className:ee("gap-1 pl-2.5",e),...t,children:[l.jsx(lg,{className:"h-4 w-4"}),l.jsx("span",{children:"Previous"})]});Fr.displayName="PaginationPrevious";const Or=({className:e,...t})=>l.jsxs(pn,{"aria-label":"Go to next page",size:"default",className:ee("gap-1 pr-2.5",e),...t,children:[l.jsx("span",{children:"Next"}),l.jsx(_a,{className:"h-4 w-4"})]});Or.displayName="PaginationNext";const Dr=({className:e,...t})=>l.jsxs("span",{"aria-hidden":!0,className:ee("flex h-9 w-9 items-center justify-center",e),...t,children:[l.jsx(cg,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"More pages"})]});Dr.displayName="PaginationEllipsis";const Mr=d.forwardRef(({className:e,...t},n)=>l.jsx("div",{className:ee("relative w-full overflow-auto","s3-explr-ui-table-container"),children:l.jsx("table",{ref:n,className:ee("w-full caption-bottom text-sm","s3-explr-ui-table",e),...t})}));Mr.displayName="Table";const Ir=d.forwardRef(({className:e,...t},n)=>l.jsx("thead",{ref:n,className:ee("[&_tr]:border-b","s3-explr-ui-table-header",e),...t}));Ir.displayName="TableHeader";const kr=d.forwardRef(({className:e,...t},n)=>l.jsx("tbody",{ref:n,className:ee("[&_tr:last-child]:border-0","s3-explr-ui-table-body",e),...t}));kr.displayName="TableBody";const Hm=d.forwardRef(({className:e,...t},n)=>l.jsx("tfoot",{ref:n,className:ee("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0","s3-explr-ui-table-footer",e),...t}));Hm.displayName="TableFooter";const Ze=d.forwardRef(({className:e,...t},n)=>l.jsx("tr",{ref:n,className:ee("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted","s3-explr-ui-table-row",e),...t}));Ze.displayName="TableRow";const it=d.forwardRef(({className:e,...t},n)=>l.jsx("th",{ref:n,className:ee("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}));it.displayName="TableHead";const Ie=d.forwardRef(({className:e,...t},n)=>l.jsx("td",{ref:n,className:ee("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]","s3-explr-ui-table-cell",e),...t}));Ie.displayName="TableCell";const zm=d.forwardRef(({className:e,...t},n)=>l.jsx("caption",{ref:n,className:ee("mt-4 text-sm text-muted-foreground","s3-explr-ui-table-caption",e),...t}));zm.displayName="TableCaption";function Ps(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 gn(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 ec(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function As(...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)}}}}function _s(...e){return d.useCallback(As(...e),e)}var Fs=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(jm);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(Os,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Os,{...r,ref:t,children:n})});Fs.displayName="Slot";var Os=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Gm(n);return d.cloneElement(n,{...Wm(r,n.props),ref:t?As(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Os.displayName="SlotClone";var Um=({children:e})=>l.jsx(l.Fragment,{children:e});function jm(e){return d.isValidElement(e)&&e.type===Um}function Wm(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 Gm(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 qm(e){const t=e+"CollectionProvider",[n,r]=Ft(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:v,children:h}=p,y=P.useRef(null),w=P.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:w,collectionRef:y,children:h})};i.displayName=t;const a=e+"CollectionSlot",u=P.forwardRef((p,v)=>{const{scope:h,children:y}=p,w=s(a,h),b=_s(v,w.collectionRef);return l.jsx(Fs,{ref:b,children:y})});u.displayName=a;const c=e+"CollectionItemSlot",f="data-radix-collection-item",g=P.forwardRef((p,v)=>{const{scope:h,children:y,...w}=p,b=P.useRef(null),S=_s(v,b),E=s(c,h);return P.useEffect(()=>(E.itemMap.set(b,{ref:b,...w}),()=>void E.itemMap.delete(b))),l.jsx(Fs,{[f]:"",ref:S,children:y})});g.displayName=c;function m(p){const v=s(e+"CollectionConsumer",p);return P.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 tc=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Xm);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})});tc.displayName="Slot";var Ds=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Ym(n);return d.cloneElement(n,{...Jm(r,n.props),ref:t?As(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Ds.displayName="SlotClone";var Km=({children:e})=>l.jsx(l.Fragment,{children:e});function Xm(e){return d.isValidElement(e)&&e.type===Km}function Jm(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 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)}var Zm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],nc=Zm.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}},{}),Qm=d.createContext(void 0);function rc(e){const t=d.useContext(Qm);return e||t||"ltr"}var Ms="rovingFocusGroup.onEntryFocus",ev={bubbles:!1,cancelable:!0},$r="RovingFocusGroup",[Is,oc,tv]=qm($r),[nv,sc]=Ft($r,[tv]),[rv,ov]=nv($r),ic=d.forwardRef((e,t)=>l.jsx(Is.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Is.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(sv,{...e,ref:t})})}));ic.displayName=$r;var sv=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=_s(t,m),v=rc(s),[h=null,y]=on({prop:i,defaultProp:a,onChange:u}),[w,b]=d.useState(!1),S=Ae(c),E=oc(n),x=d.useRef(!1),[A,F]=d.useState(0);return d.useEffect(()=>{const O=m.current;if(O)return O.addEventListener(Ms,S),()=>O.removeEventListener(Ms,S)},[S]),l.jsx(rv,{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(()=>F(O=>O+1),[]),onFocusableItemRemove:d.useCallback(()=>F(O=>O-1),[]),children:l.jsx(nc.div,{tabIndex:w||A===0?-1:0,"data-orientation":r,...g,ref:p,style:{outline:"none",...e.style},onMouseDown:gn(e.onMouseDown,()=>{x.current=!0}),onFocus:gn(e.onFocus,O=>{const k=!x.current;if(O.target===O.currentTarget&&k&&!w){const M=new CustomEvent(Ms,ev);if(O.currentTarget.dispatchEvent(M),!M.defaultPrevented){const q=E().filter(K=>K.focusable),$=q.find(K=>K.active),U=q.find(K=>K.id===h),X=[$,U,...q].filter(Boolean).map(K=>K.ref.current);cc(X,f)}}x.current=!1}),onBlur:gn(e.onBlur,()=>b(!1))})})}),ac="RovingFocusGroupItem",lc=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,...i}=e,a=an(),u=s||a,c=ov(ac,n),f=c.currentTabStopId===u,g=oc(n),{onFocusableItemAdd:m,onFocusableItemRemove:p}=c;return d.useEffect(()=>{if(r)return m(),()=>p()},[r,m,p]),l.jsx(Is.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:l.jsx(nc.span,{tabIndex:f?0:-1,"data-orientation":c.orientation,...i,ref:t,onMouseDown:gn(e.onMouseDown,v=>{r?c.onItemFocus(u):v.preventDefault()}),onFocus:gn(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:gn(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const h=lv(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?cv(w,b+1):w.slice(b+1)}setTimeout(()=>cc(w))}})})})});lc.displayName=ac;var iv={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function av(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function lv(e,t,n){const r=av(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return iv[r]}function cc(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function cv(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var uv=ic,dv=lc;function uc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function fv(...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 pv(...e){return d.useCallback(fv(...e),e)}function gv(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var dc=e=>{const{present:t,children:n}=e,r=hv(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=pv(r.ref,mv(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};dc.displayName="Presence";function hv(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=gv(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=Lr(r.current);s.current=a==="mounted"?c:"none"},[a]),Re(()=>{const c=r.current,f=o.current;if(f!==e){const m=s.current,p=Lr(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]),Re(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,g=p=>{const h=Lr(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=Lr(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 Lr(e){return(e==null?void 0:e.animationName)||"none"}function mv(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 fc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function vv(...e){return t=>{let n=!1;const r=e.map(o=>{const s=fc(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():fc(e[o],null)}}}}var pc=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(wv);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(ks,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(ks,{...r,ref:t,children:n})});pc.displayName="Slot";var ks=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=xv(n);return d.cloneElement(n,{...bv(r,n.props),ref:t?vv(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});ks.displayName="SlotClone";var yv=({children:e})=>l.jsx(l.Fragment,{children:e});function wv(e){return d.isValidElement(e)&&e.type===yv}function bv(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 xv(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 Cv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Rr=Cv.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?pc: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}},{}),$s="Tabs",[Sv,wC]=Ft($s,[sc]),gc=sc(),[Ev,Ls]=Sv($s),hc=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:a,activationMode:u="automatic",...c}=e,f=rc(a),[g,m]=on({prop:r,onChange:o,defaultProp:s});return l.jsx(Ev,{scope:n,baseId:an(),value:g,onValueChange:m,orientation:i,dir:f,activationMode:u,children:l.jsx(Rr.div,{dir:f,"data-orientation":i,...c,ref:t})})});hc.displayName=$s;var mc="TabsList",vc=d.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,s=Ls(mc,n),i=gc(n);return l.jsx(uv,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:r,children:l.jsx(Rr.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});vc.displayName=mc;var yc="TabsTrigger",wc=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...s}=e,i=Ls(yc,n),a=gc(n),u=Cc(i.baseId,r),c=Sc(i.baseId,r),f=r===i.value;return l.jsx(dv,{asChild:!0,...a,focusable:!o,active:f,children:l.jsx(Rr.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:Ps(e.onMouseDown,g=>{!o&&g.button===0&&g.ctrlKey===!1?i.onValueChange(r):g.preventDefault()}),onKeyDown:Ps(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&i.onValueChange(r)}),onFocus:Ps(e.onFocus,()=>{const g=i.activationMode!=="manual";!f&&!o&&g&&i.onValueChange(r)})})})});wc.displayName=yc;var bc="TabsContent",xc=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:s,...i}=e,a=Ls(bc,n),u=Cc(a.baseId,r),c=Sc(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(dc,{present:o||f,children:({present:m})=>l.jsx(Rr.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})})});xc.displayName=bc;function Cc(e,t){return`${e}-trigger-${t}`}function Sc(e,t){return`${e}-content-${t}`}var Nv=hc,Ec=vc,Nc=wc,Tc=xc;const Tv=Nv,Pc=d.forwardRef(({className:e,...t},n)=>l.jsx(Ec,{ref:n,className:ee("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Pc.displayName=Ec.displayName;const Vr=d.forwardRef(({className:e,...t},n)=>l.jsx(Nc,{ref:n,className:ee("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}));Vr.displayName=Nc.displayName;const Br=d.forwardRef(({className:e,...t},n)=>l.jsx(Tc,{ref:n,className:ee("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Br.displayName=Tc.displayName;const $n=d.forwardRef(({className:e,...t},n)=>l.jsx("textarea",{className:ee("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}));$n.displayName="Textarea";function Pv(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,Av(o,...t)]}function Av(...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 Rs=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Fv);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})});Rs.displayName="Slot";var Vs=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Dv(n);return d.cloneElement(n,{...Ov(r,n.props),ref:t?vr(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Vs.displayName="SlotClone";var _v=({children:e})=>l.jsx(l.Fragment,{children:e});function Fv(e){return d.isValidElement(e)&&e.type===_v}function Ov(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 Dv(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]=Pv(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:v,children:h}=p,y=P.useRef(null),w=P.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:w,collectionRef:y,children:h})};i.displayName=t;const a=e+"CollectionSlot",u=P.forwardRef((p,v)=>{const{scope:h,children:y}=p,w=s(a,h),b=Ue(v,w.collectionRef);return l.jsx(Rs,{ref:b,children:y})});u.displayName=a;const c=e+"CollectionItemSlot",f="data-radix-collection-item",g=P.forwardRef((p,v)=>{const{scope:h,children:y,...w}=p,b=P.useRef(null),S=Ue(v,b),E=s(c,h);return P.useEffect(()=>(E.itemMap.set(b,{ref:b,...w}),()=>void E.itemMap.delete(b))),l.jsx(Rs,{[f]:"",ref:S,children:y})});g.displayName=c;function m(p){const v=s(e+"CollectionConsumer",p);return P.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 Iv="VisuallyHidden",Bs=d.forwardRef((e,t)=>l.jsx(we.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}}));Bs.displayName=Iv;var Hs="ToastProvider",[zs,kv,$v]=Mv("Toast"),[Ac,bC]=Ft("Toast",[$v]),[Lv,Hr]=Ac(Hs),_c=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 \`${Hs}\`. Expected non-empty \`string\`.`),l.jsx(zs.Provider,{scope:t,children:l.jsx(Lv,{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})})};_c.displayName=Hs;var Fc="ToastViewport",Rv=["F8"],Us="toast.viewportPause",js="toast.viewportResume",Oc=d.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=Rv,label:o="Notifications ({hotkey})",...s}=e,i=Hr(Fc,n),a=kv(n),u=d.useRef(null),c=d.useRef(null),f=d.useRef(null),g=d.useRef(null),m=Ue(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 A=new CustomEvent(Us);w.dispatchEvent(A),i.isClosePausedRef.current=!0}},S=()=>{if(i.isClosePausedRef.current){const A=new CustomEvent(js);w.dispatchEvent(A),i.isClosePausedRef.current=!1}},E=A=>{!y.contains(A.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,...Yv(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,A,F;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"}),U=$.findIndex(L=>L===O);qs($.slice(U+1))?b.preventDefault():k?(A=c.current)==null||A.focus():(F=f.current)==null||F.focus()}};return y.addEventListener("keydown",w),()=>y.removeEventListener("keydown",w)}},[a,h]),l.jsxs(Ph,{ref:u,role:"region","aria-label":o.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&l.jsx(Ws,{ref:c,onFocusFromOutsideViewport:()=>{const y=h({tabbingDirection:"forwards"});qs(y)}}),l.jsx(zs.Slot,{scope:n,children:l.jsx(we.ol,{tabIndex:-1,...s,ref:m})}),v&&l.jsx(Ws,{ref:f,onFocusFromOutsideViewport:()=>{const y=h({tabbingDirection:"backwards"});qs(y)}})]})});Oc.displayName=Fc;var Dc="ToastFocusProxy",Ws=d.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,s=Hr(Dc,n);return l.jsx(Bs,{"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()}})});Ws.displayName=Dc;var zr="Toast",Vv="toast.swipeStart",Bv="toast.swipeMove",Hv="toast.swipeCancel",zv="toast.swipeEnd",Mc=d.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:s,...i}=e,[a=!0,u]=on({prop:r,defaultProp:o,onChange:s});return l.jsx(sn,{present:n||a,children:l.jsx(Wv,{open:a,...i,ref:t,onClose:()=>u(!1),onPause:Ae(e.onPause),onResume:Ae(e.onResume),onSwipeStart:ye(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ye(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:ye(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:ye(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)})})})});Mc.displayName=zr;var[Uv,jv]=Ac(zr,{onClose(){}}),Wv=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=Hr(zr,n),[y,w]=d.useState(null),b=Ue(t,L=>w(L)),S=d.useRef(null),E=d.useRef(null),x=o||h.duration,A=d.useRef(0),F=d.useRef(x),O=d.useRef(0),{onToastAdd:k,onToastRemove:M}=h,q=Ae(()=>{var X;(y==null?void 0:y.contains(document.activeElement))&&((X=h.viewport)==null||X.focus()),i()}),$=d.useCallback(L=>{!L||L===1/0||(window.clearTimeout(O.current),A.current=new Date().getTime(),O.current=window.setTimeout(q,L))},[q]);d.useEffect(()=>{const L=h.viewport;if(L){const X=()=>{$(F.current),c==null||c()},K=()=>{const te=new Date().getTime()-A.current;F.current=F.current-te,window.clearTimeout(O.current),u==null||u()};return L.addEventListener(Us,K),L.addEventListener(js,X),()=>{L.removeEventListener(Us,K),L.removeEventListener(js,X)}}},[h.viewport,x,u,c,$]),d.useEffect(()=>{s&&!h.isClosePausedRef.current&&$(x)},[s,x,h.isClosePausedRef,$]),d.useEffect(()=>(k(),()=>M()),[k,M]);const U=d.useMemo(()=>y?Bc(y):null,[y]);return h.viewport?l.jsxs(l.Fragment,{children:[U&&l.jsx(Gv,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:U}),l.jsx(Uv,{scope:n,onClose:q,children:er.createPortal(l.jsx(zs.ItemSlot,{scope:n,children:l.jsx(Th,{asChild:!0,onEscapeKeyDown:ye(a,()=>{h.isFocusedToastEscapeKeyDownRef.current||q(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:l.jsx(we.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:ye(e.onKeyDown,L=>{L.key==="Escape"&&(a==null||a(L.nativeEvent),L.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,q()))}),onPointerDown:ye(e.onPointerDown,L=>{L.button===0&&(S.current={x:L.clientX,y:L.clientY})}),onPointerMove:ye(e.onPointerMove,L=>{if(!S.current)return;const X=L.clientX-S.current.x,K=L.clientY-S.current.y,te=!!E.current,H=["left","right"].includes(h.swipeDirection),j=["left","up"].includes(h.swipeDirection)?Math.min:Math.max,le=H?j(0,X):0,ce=H?0:j(0,K),xe=L.pointerType==="touch"?10:2,Ee={x:le,y:ce},Fe={originalEvent:L,delta:Ee};te?(E.current=Ee,Ur(Bv,g,Fe,{discrete:!1})):Hc(Ee,h.swipeDirection,xe)?(E.current=Ee,Ur(Vv,f,Fe,{discrete:!1}),L.target.setPointerCapture(L.pointerId)):(Math.abs(X)>xe||Math.abs(K)>xe)&&(S.current=null)}),onPointerUp:ye(e.onPointerUp,L=>{const X=E.current,K=L.target;if(K.hasPointerCapture(L.pointerId)&&K.releasePointerCapture(L.pointerId),E.current=null,S.current=null,X){const te=L.currentTarget,H={originalEvent:L,delta:X};Hc(X,h.swipeDirection,h.swipeThreshold)?Ur(zv,p,H,{discrete:!0}):Ur(Hv,m,H,{discrete:!0}),te.addEventListener("click",j=>j.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),Gv=e=>{const{__scopeToast:t,children:n,...r}=e,o=Hr(zr,t),[s,i]=d.useState(!1),[a,u]=d.useState(!1);return Xv(()=>i(!0)),d.useEffect(()=>{const c=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:l.jsx(hs,{asChild:!0,children:l.jsx(Bs,{...r,children:s&&l.jsxs(l.Fragment,{children:[o.label," ",n]})})})},qv="ToastTitle",Ic=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(we.div,{...r,ref:t})});Ic.displayName=qv;var Kv="ToastDescription",kc=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(we.div,{...r,ref:t})});kc.displayName=Kv;var $c="ToastAction",Lc=d.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?l.jsx(Vc,{altText:n,asChild:!0,children:l.jsx(Gs,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${$c}\`. Expected non-empty \`string\`.`),null)});Lc.displayName=$c;var Rc="ToastClose",Gs=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=jv(Rc,n);return l.jsx(Vc,{asChild:!0,children:l.jsx(we.button,{type:"button",...r,ref:t,onClick:ye(e.onClick,o.onClose)})})});Gs.displayName=Rc;var Vc=d.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return l.jsx(we.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function Bc(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),Jv(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(...Bc(r))}}),t}function Ur(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?Xa(o,s):o.dispatchEvent(s)}var Hc=(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 Xv(e=()=>{}){const t=Ae(e);Re(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function Jv(e){return e.nodeType===e.ELEMENT_NODE}function Yv(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 qs(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var Zv=_c,zc=Oc,Uc=Mc,jc=Ic,Wc=kc,Gc=Lc,qc=Gs;const Qv=Zv,Kc=d.forwardRef(({className:e,...t},n)=>l.jsx(zc,{ref:n,className:ee("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=zc.displayName;const ey=as("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"}}),Xc=d.forwardRef(({className:e,variant:t,...n},r)=>l.jsx(Uc,{ref:r,className:ee(ey({variant:t}),e),...n}));Xc.displayName=Uc.displayName;const ty=d.forwardRef(({className:e,...t},n)=>l.jsx(Gc,{ref:n,className:ee("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}));ty.displayName=Gc.displayName;const Jc=d.forwardRef(({className:e,...t},n)=>l.jsx(qc,{ref:n,className:ee("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(Qo,{className:"s3-explr-ui-toast-close-icon h-4 w-4"})}));Jc.displayName=qc.displayName;const Yc=d.forwardRef(({className:e,...t},n)=>l.jsx(jc,{ref:n,className:ee("s3-explr-ui-toast-title text-sm font-semibold [&+div]:text-xs",e),...t}));Yc.displayName=jc.displayName;const Zc=d.forwardRef(({className:e,...t},n)=>l.jsx(Wc,{ref:n,className:ee("s3-explr-ui-toast-description text-sm opacity-90",e),...t}));Zc.displayName=Wc.displayName;const ny=1,ry=1e6;let Ks=0;function oy(){return Ks=(Ks+1)%Number.MAX_SAFE_INTEGER,Ks.toString()}const Xs=new Map,Qc=e=>{if(Xs.has(e))return;const t=setTimeout(()=>{Xs.delete(e),Ln({type:"REMOVE_TOAST",toastId:e})},ry);Xs.set(e,t)},sy=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,ny)};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?Qc(n):e.toasts.forEach(r=>{Qc(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)}}},jr=[];let Wr={toasts:[]};function Ln(e){Wr=sy(Wr,e),jr.forEach(t=>{t(Wr)})}function iy({...e}){const t=oy(),n=o=>Ln({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>Ln({type:"DISMISS_TOAST",toastId:t});return Ln({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function Gr(){const[e,t]=d.useState(Wr);return d.useEffect(()=>(jr.push(t),()=>{const n=jr.indexOf(t);n>-1&&jr.splice(n,1)}),[e]),{...e,toast:iy,dismiss:n=>Ln({type:"DISMISS_TOAST",toastId:n})}}function eu(){const{toasts:e}=Gr();return l.jsxs(Qv,{children:[e.map(function({id:t,title:n,description:r,action:o,...s}){return l.jsxs(Xc,{...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(Yc,{className:"s3-explr-ui-toast-title",children:n}),r&&l.jsx(Zc,{className:"s3-explr-ui-toast-description",children:r})]}),o&&l.jsx("div",{className:"s3-explr-ui-toast-action",children:o}),l.jsx(Jc,{className:"s3-explr-ui-toast-close"})]},t)}),l.jsx(Kc,{className:"s3-explr-ui-toast-viewport"})]})}function xt(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 tu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ay(...e){return t=>{let n=!1;const r=e.map(o=>{const s=tu(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():tu(e[o],null)}}}}function Rn(...e){return d.useCallback(ay(...e),e)}var ly=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Vn=ly.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?tn: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 cy(e,t){e&&er.flushSync(()=>e.dispatchEvent(t))}var uy="DismissableLayer",Js="dismissableLayer.update",dy="dismissableLayer.pointerDownOutside",fy="dismissableLayer.focusOutside",nu,ru=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ou=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...u}=e,c=d.useContext(ru),[f,g]=d.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=d.useState({}),v=Rn(t,F=>g(F)),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=hy(F=>{const O=F.target,k=[...c.branches].some(M=>M.contains(O));!E||k||(o==null||o(F),i==null||i(F),F.defaultPrevented||a==null||a())},m),A=my(F=>{const O=F.target;[...c.branches].some(M=>M.contains(O))||(s==null||s(F),i==null||i(F),F.defaultPrevented||a==null||a())},m);return tl(F=>{b===c.layers.size-1&&(r==null||r(F),!F.defaultPrevented&&a&&(F.preventDefault(),a()))},m),d.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(nu=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),su(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=nu)}},[f,m,n,c]),d.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),su())},[f,c]),d.useEffect(()=>{const F=()=>p({});return document.addEventListener(Js,F),()=>document.removeEventListener(Js,F)},[]),l.jsx(Vn.div,{...u,ref:v,style:{pointerEvents:S?E?"auto":"none":void 0,...e.style},onFocusCapture:xt(e.onFocusCapture,A.onFocusCapture),onBlurCapture:xt(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:xt(e.onPointerDownCapture,x.onPointerDownCapture)})});ou.displayName=uy;var py="DismissableLayerBranch",gy=d.forwardRef((e,t)=>{const n=d.useContext(ru),r=d.useRef(null),o=Rn(t,r);return d.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(Vn.div,{...e,ref:o})});gy.displayName=py;function hy(e,t=globalThis==null?void 0:globalThis.document){const n=Ae(e),r=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let u=function(){iu(dy,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 my(e,t=globalThis==null?void 0:globalThis.document){const n=Ae(e),r=d.useRef(!1);return d.useEffect(()=>{const o=s=>{s.target&&!r.current&&iu(fy,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 su(){const e=new CustomEvent(Js);document.dispatchEvent(e)}function iu(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?cy(o,s):o.dispatchEvent(s)}const vy=["top","right","bottom","left"],kt=Math.min,Ve=Math.max,qr=Math.round,Kr=Math.floor,at=e=>({x:e,y:e}),yy={left:"right",right:"left",bottom:"top",top:"bottom"},wy={start:"end",end:"start"};function Ys(e,t,n){return Ve(e,kt(t,n))}function Ct(e,t){return typeof e=="function"?e(t):e}function St(e){return e.split("-")[0]}function hn(e){return e.split("-")[1]}function Zs(e){return e==="x"?"y":"x"}function Qs(e){return e==="y"?"height":"width"}function $t(e){return["top","bottom"].includes(St(e))?"y":"x"}function ei(e){return Zs($t(e))}function by(e,t,n){n===void 0&&(n=!1);const r=hn(e),o=ei(e),s=Qs(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Xr(i)),[i,Xr(i)]}function xy(e){const t=Xr(e);return[ti(e),t,ti(t)]}function ti(e){return e.replace(/start|end/g,t=>wy[t])}function Cy(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 Sy(e,t,n,r){const o=hn(e);let s=Cy(St(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(ti)))),s}function Xr(e){return e.replace(/left|right|bottom|top/g,t=>yy[t])}function Ey(e){return{top:0,right:0,bottom:0,left:0,...e}}function au(e){return typeof e!="number"?Ey(e):{top:e,right:e,bottom:e,left:e}}function Jr(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 lu(e,t,n){let{reference:r,floating:o}=e;const s=$t(t),i=ei(t),a=Qs(i),u=St(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(hn(t)){case"start":p[i]-=m*(n&&c?-1:1);break;case"end":p[i]+=m*(n&&c?-1:1);break}return p}const Ny=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}=lu(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}=lu(c,m,u)),h=-1)}return{x:f,y:g,placement:m,strategy:o,middlewareData:p}};async function Bn(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}=Ct(t,e),v=au(p),y=a[m?g==="floating"?"reference":"floating":g],w=Jr(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=Jr(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 Ty=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}=Ct(e,t)||{};if(c==null)return{};const g=au(f),m={x:n,y:r},p=ei(o),v=Qs(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],A=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let F=A?A[S]:0;(!F||!await(i.isElement==null?void 0:i.isElement(A)))&&(F=a.floating[S]||s.floating[v]);const O=E/2-x/2,k=F/2-h[v]/2-1,M=kt(g[w],k),q=kt(g[b],k),$=M,U=F-h[v]-q,L=F/2-h[v]/2+O,X=Ys($,L,U),K=!u.arrow&&hn(o)!=null&&L!==X&&s.reference[v]/2-(L<$?M:q)-h[v]/2<0,te=K?L<$?L-$:L-U:0;return{[p]:m[p]+te,data:{[p]:X,centerOffset:L-X-te,...K&&{alignmentOffset:te}},reset:K}}}),Py=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}=Ct(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=St(o),b=$t(a),S=St(a)===a,E=await(u.isRTL==null?void 0:u.isRTL(c.floating)),x=m||(S||!h?[Xr(a)]:xy(a)),A=v!=="none";!m&&A&&x.push(...Sy(a,h,v,E));const F=[a,...x],O=await Bn(t,y),k=[];let M=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&k.push(O[w]),g){const L=by(o,i,E);k.push(O[L[0]],O[L[1]])}if(M=[...M,{placement:o,overflows:k}],!k.every(L=>L<=0)){var q,$;const L=(((q=s.flip)==null?void 0:q.index)||0)+1,X=F[L];if(X)return{data:{index:L,overflows:M},reset:{placement:X}};let K=($=M.filter(te=>te.overflows[0]<=0).sort((te,H)=>te.overflows[1]-H.overflows[1])[0])==null?void 0:$.placement;if(!K)switch(p){case"bestFit":{var U;const te=(U=M.filter(H=>{if(A){const j=$t(H.placement);return j===b||j==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(j=>j>0).reduce((j,le)=>j+le,0)]).sort((H,j)=>H[1]-j[1])[0])==null?void 0:U[0];te&&(K=te);break}case"initialPlacement":K=a;break}if(o!==K)return{reset:{placement:K}}}return{}}}};function cu(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function uu(e){return vy.some(t=>e[t]>=0)}const Ay=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Ct(e,t);switch(r){case"referenceHidden":{const s=await Bn(t,{...o,elementContext:"reference"}),i=cu(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:uu(i)}}}case"escaped":{const s=await Bn(t,{...o,altBoundary:!0}),i=cu(s,n.floating);return{data:{escapedOffsets:i,escaped:uu(i)}}}default:return{}}}}};async function _y(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=St(n),a=hn(n),u=$t(n)==="y",c=["left","top"].includes(i)?-1:1,f=s&&u?-1:1,g=Ct(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 Fy=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 _y(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}}}}},Oy=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}=Ct(e,t),c={x:n,y:r},f=await Bn(t,u),g=$t(St(o)),m=Zs(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=Ys(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=Ys(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}}}}}},Dy=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}=Ct(e,t),f={x:n,y:r},g=$t(o),m=Zs(g);let p=f[m],v=f[g];const h=Ct(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(St(o)),x=s.reference[g]-s.floating[S]+(E&&((w=i.offset)==null?void 0:w[g])||0)+(E?0:y.crossAxis),A=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>A&&(v=A)}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}=Ct(e,t),f=await Bn(t,c),g=St(o),m=hn(o),p=$t(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=kt(h-f[y],b),x=kt(v-f[w],S),A=!t.middlewareData.shift;let F=E,O=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(F=b),A&&!m){const M=Ve(f.left,0),q=Ve(f.right,0),$=Ve(f.top,0),U=Ve(f.bottom,0);p?O=v-2*(M!==0||q!==0?M+q:Ve(f.left,f.right)):F=h-2*($!==0||U!==0?$+U:Ve(f.top,f.bottom))}await u({...t,availableWidth:O,availableHeight:F});const k=await i.getDimensions(a.floating);return v!==k.width||h!==k.height?{reset:{rects:!0}}:{}}}};function Yr(){return typeof window<"u"}function mn(e){return du(e)?(e.nodeName||"").toLowerCase():"#document"}function Be(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function lt(e){var t;return(t=(du(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function du(e){return Yr()?e instanceof Node||e instanceof Be(e).Node:!1}function Qe(e){return Yr()?e instanceof Element||e instanceof Be(e).Element:!1}function ct(e){return Yr()?e instanceof HTMLElement||e instanceof Be(e).HTMLElement:!1}function fu(e){return!Yr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Be(e).ShadowRoot}function Hn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=et(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Iy(e){return["table","td","th"].includes(mn(e))}function Zr(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function ni(e){const t=ri(),n=Qe(e)?et(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 ky(e){let t=Lt(e);for(;ct(t)&&!vn(t);){if(ni(t))return t;if(Zr(t))return null;t=Lt(t)}return null}function ri(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function vn(e){return["html","body","#document"].includes(mn(e))}function et(e){return Be(e).getComputedStyle(e)}function Qr(e){return Qe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Lt(e){if(mn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||fu(e)&&e.host||lt(e);return fu(t)?t.host:t}function pu(e){const t=Lt(e);return vn(t)?e.ownerDocument?e.ownerDocument.body:e.body:ct(t)&&Hn(t)?t:pu(t)}function zn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=pu(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Be(o);if(s){const a=oi(i);return t.concat(i,i.visualViewport||[],Hn(o)?o:[],a&&n?zn(a):[])}return t.concat(o,zn(o,[],n))}function oi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gu(e){const t=et(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ct(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=qr(n)!==s||qr(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function si(e){return Qe(e)?e:e.contextElement}function yn(e){const t=si(e);if(!ct(t))return at(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=gu(t);let i=(s?qr(n.width):n.width)/r,a=(s?qr(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const $y=at(0);function hu(e){const t=Be(e);return!ri()||!t.visualViewport?$y:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ly(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Be(e)?!1:t}function qt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=si(e);let i=at(1);t&&(r?Qe(r)&&(i=yn(r)):i=yn(e));const a=Ly(s,n,r)?hu(s):at(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=Be(s),p=r&&Qe(r)?Be(r):r;let v=m,h=oi(v);for(;h&&r&&p!==v;){const y=yn(h),w=h.getBoundingClientRect(),b=et(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=Be(h),h=oi(v)}}return Jr({width:f,height:g,x:u,y:c})}function ii(e,t){const n=Qr(e).scrollLeft;return t?t.left+n:qt(lt(e)).left+n}function mu(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:ii(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function Ry(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=lt(r),a=t?Zr(t.floating):!1;if(r===i||a&&s)return n;let u={scrollLeft:0,scrollTop:0},c=at(1);const f=at(0),g=ct(r);if((g||!g&&!s)&&((mn(r)!=="body"||Hn(i))&&(u=Qr(r)),ct(r))){const p=qt(r);c=yn(r),f.x=p.x+r.clientLeft,f.y=p.y+r.clientTop}const m=i&&!g&&!s?mu(i,u,!0):at(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 Vy(e){return Array.from(e.getClientRects())}function By(e){const t=lt(e),n=Qr(e),r=e.ownerDocument.body,o=Ve(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Ve(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+ii(e);const a=-n.scrollTop;return et(r).direction==="rtl"&&(i+=Ve(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function Hy(e,t){const n=Be(e),r=lt(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=ri();(!c||c&&t==="fixed")&&(a=o.offsetLeft,u=o.offsetTop)}return{width:s,height:i,x:a,y:u}}function zy(e,t){const n=qt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=ct(e)?yn(e):at(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 vu(e,t,n){let r;if(t==="viewport")r=Hy(e,n);else if(t==="document")r=By(lt(e));else if(Qe(t))r=zy(t,n);else{const o=hu(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Jr(r)}function yu(e,t){const n=Lt(e);return n===t||!Qe(n)||vn(n)?!1:et(n).position==="fixed"||yu(n,t)}function Uy(e,t){const n=t.get(e);if(n)return n;let r=zn(e,[],!1).filter(a=>Qe(a)&&mn(a)!=="body"),o=null;const s=et(e).position==="fixed";let i=s?Lt(e):e;for(;Qe(i)&&!vn(i);){const a=et(i),u=ni(i);!u&&a.position==="fixed"&&(o=null),(s?!u&&!o:!u&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Hn(i)&&!u&&yu(e,i))?r=r.filter(f=>f!==i):o=a,i=Lt(i)}return t.set(e,r),r}function jy(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Zr(t)?[]:Uy(t,this._c):[].concat(n),r],a=i[0],u=i.reduce((c,f)=>{const g=vu(t,f,o);return c.top=Ve(g.top,c.top),c.right=kt(g.right,c.right),c.bottom=kt(g.bottom,c.bottom),c.left=Ve(g.left,c.left),c},vu(t,a,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Wy(e){const{width:t,height:n}=gu(e);return{width:t,height:n}}function Gy(e,t,n){const r=ct(t),o=lt(t),s=n==="fixed",i=qt(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const u=at(0);if(r||!r&&!s)if((mn(t)!=="body"||Hn(o))&&(a=Qr(t)),r){const m=qt(t,!0,s,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}else o&&(u.x=ii(o));const c=o&&!r&&!s?mu(o,a):at(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 ai(e){return et(e).position==="static"}function wu(e,t){if(!ct(e)||et(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return lt(e)===n&&(n=n.ownerDocument.body),n}function bu(e,t){const n=Be(e);if(Zr(e))return n;if(!ct(e)){let o=Lt(e);for(;o&&!vn(o);){if(Qe(o)&&!ai(o))return o;o=Lt(o)}return n}let r=wu(e,t);for(;r&&Iy(r)&&ai(r);)r=wu(r,t);return r&&vn(r)&&ai(r)&&!ni(r)?n:r||ky(e)||n}const qy=async function(e){const t=this.getOffsetParent||bu,n=this.getDimensions,r=await n(e.floating);return{reference:Gy(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ky(e){return et(e).direction==="rtl"}const Xy={convertOffsetParentRelativeRectToViewportRelativeRect:Ry,getDocumentElement:lt,getClippingRect:jy,getOffsetParent:bu,getElementRects:qy,getClientRects:Vy,getDimensions:Wy,getScale:yn,isElement:Qe,isRTL:Ky};function Jy(e,t){let n=null,r;const o=lt(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=Kr(f),v=Kr(o.clientWidth-(c+g)),h=Kr(o.clientHeight-(f+m)),y=Kr(c),b={rootMargin:-p+"px "+-v+"px "+-h+"px "+-y+"px",threshold:Ve(0,kt(1,u))||1};let S=!0;function E(x){const A=x[0].intersectionRatio;if(A!==u){if(!S)return i();A?i(!1,A):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 Yy(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=si(e),f=o||s?[...c?zn(c):[],...zn(t)]:[];f.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const g=c&&a?Jy(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?qt(e):null;u&&y();function y(){const w=qt(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 Zy=Fy,Qy=Oy,ew=Py,tw=My,nw=Ay,xu=Ty,rw=Dy,ow=(e,t,n)=>{const r=new Map,o={platform:Xy,...n},s={...o.platform,_c:r};return Ny(e,t,{...o,platform:s})};var eo=typeof document<"u"?P.useLayoutEffect:P.useEffect;function to(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(!to(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)&&!to(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Cu(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Su(e,t){const n=Cu(e);return Math.round(t*n)/n}function li(e){const t=d.useRef(e);return eo(()=>{t.current=e}),t}function sw(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);to(m,r)||p(r);const[v,h]=d.useState(null),[y,w]=d.useState(null),b=d.useCallback(H=>{H!==A.current&&(A.current=H,h(H))},[]),S=d.useCallback(H=>{H!==F.current&&(F.current=H,w(H))},[]),E=s||v,x=i||y,A=d.useRef(null),F=d.useRef(null),O=d.useRef(f),k=u!=null,M=li(u),q=li(o),$=li(c),U=d.useCallback(()=>{if(!A.current||!F.current)return;const H={placement:t,strategy:n,middleware:m};q.current&&(H.platform=q.current),ow(A.current,F.current,H).then(j=>{const le={...j,isPositioned:$.current!==!1};L.current&&!to(O.current,le)&&(O.current=le,er.flushSync(()=>{g(le)}))})},[m,t,n,q,$]);eo(()=>{c===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,g(H=>({...H,isPositioned:!1})))},[c]);const L=d.useRef(!1);eo(()=>(L.current=!0,()=>{L.current=!1}),[]),eo(()=>{if(E&&(A.current=E),x&&(F.current=x),E&&x){if(M.current)return M.current(E,x,U);U()}},[E,x,U,M,k]);const X=d.useMemo(()=>({reference:A,floating:F,setReference:b,setFloating:S}),[b,S]),K=d.useMemo(()=>({reference:E,floating:x}),[E,x]),te=d.useMemo(()=>{const H={position:n,left:0,top:0};if(!K.floating)return H;const j=Su(K.floating,f.x),le=Su(K.floating,f.y);return a?{...H,transform:"translate("+j+"px, "+le+"px)",...Cu(K.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:j,top:le}},[n,a,K.floating,f.x,f.y]);return d.useMemo(()=>({...f,update:U,refs:X,elements:K,floatingStyles:te}),[f,U,X,K,te])}const iw=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?xu({element:r.current,padding:o}).fn(n):{}:r?xu({element:r,padding:o}).fn(n):{}}}},aw=(e,t)=>({...Zy(e),options:[e,t]}),lw=(e,t)=>({...Qy(e),options:[e,t]}),cw=(e,t)=>({...rw(e),options:[e,t]}),uw=(e,t)=>({...ew(e),options:[e,t]}),dw=(e,t)=>({...tw(e),options:[e,t]}),fw=(e,t)=>({...nw(e),options:[e,t]}),pw=(e,t)=>({...iw(e),options:[e,t]});var gw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],hw=gw.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?tn: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}},{}),mw="Arrow",Eu=d.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return l.jsx(hw.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"})})});Eu.displayName=mw;var vw=Eu;function Nu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function yw(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Nu(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():Nu(e[o],null)}}}}function Tu(...e){return d.useCallback(yw(...e),e)}var ww=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Pu=ww.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?tn: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}},{}),ci="Popper",[Au,_u]=Ft(ci),[bw,Fu]=Au(ci),Ou=e=>{const{__scopePopper:t,children:n}=e,[r,o]=d.useState(null);return l.jsx(bw,{scope:t,anchor:r,onAnchorChange:o,children:n})};Ou.displayName=ci;var Du="PopperAnchor",Mu=d.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Fu(Du,n),i=d.useRef(null),a=Tu(t,i);return d.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:l.jsx(Pu.div,{...o,ref:a})});Mu.displayName=Du;var ui="PopperContent",[xw,Cw]=Au(ui),Iu=d.forwardRef((e,t)=>{var Ne,nt,Oe,Jt,Bt,rt;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=Fu(ui,n),[w,b]=d.useState(null),S=Tu(t,He=>b(He)),[E,x]=d.useState(null),A=qa(E),F=(A==null?void 0:A.width)??0,O=(A==null?void 0:A.height)??0,k=r+(s!=="center"?"-"+s:""),M=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},q=Array.isArray(c)?c:[c],$=q.length>0,U={padding:M,boundary:q.filter(Ew),altBoundary:$},{refs:L,floatingStyles:X,placement:K,isPositioned:te,middlewareData:H}=sw({strategy:"fixed",placement:k,whileElementsMounted:(...He)=>Yy(...He,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[aw({mainAxis:o+O,alignmentAxis:i}),u&&lw({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?cw():void 0,...U}),u&&uw({...U}),dw({...U,apply:({elements:He,rects:Ht,availableWidth:pt,availableHeight:Yt})=>{const{width:Nn,height:C}=Ht.reference,N=He.floating.style;N.setProperty("--radix-popper-available-width",`${pt}px`),N.setProperty("--radix-popper-available-height",`${Yt}px`),N.setProperty("--radix-popper-anchor-width",`${Nn}px`),N.setProperty("--radix-popper-anchor-height",`${C}px`)}}),E&&pw({element:E,padding:a}),Nw({arrowWidth:F,arrowHeight:O}),m&&fw({strategy:"referenceHidden",...U})]}),[j,le]=Lu(K),ce=Ae(v);Re(()=>{te&&(ce==null||ce())},[te,ce]);const xe=(Ne=H.arrow)==null?void 0:Ne.x,Ee=(nt=H.arrow)==null?void 0:nt.y,Fe=((Oe=H.arrow)==null?void 0:Oe.centerOffset)!==0,[Vt,Se]=d.useState();return Re(()=>{w&&Se(window.getComputedStyle(w).zIndex)},[w]),l.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...X,transform:te?X.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Vt,"--radix-popper-transform-origin":[(Jt=H.transformOrigin)==null?void 0:Jt.x,(Bt=H.transformOrigin)==null?void 0:Bt.y].join(" "),...((rt=H.hide)==null?void 0:rt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(xw,{scope:n,placedSide:j,onArrowChange:x,arrowX:xe,arrowY:Ee,shouldHideArrow:Fe,children:l.jsx(Pu.div,{"data-side":j,"data-align":le,...h,ref:S,style:{...h.style,animation:te?void 0:"none"}})})})});Iu.displayName=ui;var ku="PopperArrow",Sw={top:"bottom",right:"left",bottom:"top",left:"right"},$u=d.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=Cw(ku,r),i=Sw[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(vw,{...o,ref:n,style:{...o.style,display:"block"}})})});$u.displayName=ku;function Ew(e){return e!==null}var Nw=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]=Lu(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 Lu(e){const[t,n="center"]=e.split("-");return[t,n]}var Tw=Ou,Pw=Mu,Aw=Iu,_w=$u,Fw="Portal",Ru=d.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=d.useState(!1);Re(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?bo.createPortal(l.jsx(Vn.div,{...r,ref:t}),i):null});Ru.displayName=Fw;function Ow(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var di=e=>{const{present:t,children:n}=e,r=Dw(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=Rn(r.ref,Mw(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};di.displayName="Presence";function Dw(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=Ow(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=no(r.current);s.current=a==="mounted"?c:"none"},[a]),Re(()=>{const c=r.current,f=o.current;if(f!==e){const m=s.current,p=no(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]),Re(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,g=p=>{const h=no(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=no(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 no(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 Iw="VisuallyHidden",Vu=d.forwardRef((e,t)=>l.jsx(Vn.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}}));Vu.displayName=Iw;var kw=Vu,[ro,xC]=Ft("Tooltip",[_u]),oo=_u(),Bu="TooltipProvider",$w=700,fi="tooltip.open",[Lw,pi]=ro(Bu),Hu=e=>{const{__scopeTooltip:t,delayDuration:n=$w,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(Lw,{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})};Hu.displayName=Bu;var so="Tooltip",[Rw,Un]=ro(so),zu=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,u=pi(so,e.__scopeTooltip),c=oo(t),[f,g]=d.useState(null),m=an(),p=d.useRef(0),v=i??u.disableHoverableContent,h=a??u.delayDuration,y=d.useRef(!1),[w=!1,b]=on({prop:r,defaultProp:o,onChange:F=>{F?(u.onOpen(),document.dispatchEvent(new CustomEvent(fi))):u.onClose(),s==null||s(F)}}),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]),A=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(Tw,{...c,children:l.jsx(Rw,{scope:t,contentId:m,open:w,stateAttribute:S,trigger:f,onTriggerChange:g,onTriggerEnter:d.useCallback(()=>{u.isOpenDelayed?A():E()},[u.isOpenDelayed,A,E]),onTriggerLeave:d.useCallback(()=>{v?x():(window.clearTimeout(p.current),p.current=0)},[x,v]),onOpen:E,onClose:x,disableHoverableContent:v,children:n})})};zu.displayName=so;var gi="TooltipTrigger",Uu=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Un(gi,n),s=pi(gi,n),i=oo(n),a=d.useRef(null),u=Rn(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(Pw,{asChild:!0,...i,children:l.jsx(Vn.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:xt(e.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:xt(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:xt(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:xt(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:xt(e.onBlur,o.onClose),onClick:xt(e.onClick,o.onClose)})})});Uu.displayName=gi;var hi="TooltipPortal",[Vw,Bw]=ro(hi,{forceMount:void 0}),ju=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=Un(hi,t);return l.jsx(Vw,{scope:t,forceMount:n,children:l.jsx(di,{present:n||s.open,children:l.jsx(Ru,{asChild:!0,container:o,children:r})})})};ju.displayName=hi;var wn="TooltipContent",Wu=d.forwardRef((e,t)=>{const n=Bw(wn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=Un(wn,e.__scopeTooltip);return l.jsx(di,{present:r||i.open,children:i.disableHoverableContent?l.jsx(Gu,{side:o,...s,ref:t}):l.jsx(Hw,{side:o,...s,ref:t})})}),Hw=d.forwardRef((e,t)=>{const n=Un(wn,e.__scopeTooltip),r=pi(wn,e.__scopeTooltip),o=d.useRef(null),s=Rn(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=Ww(w,y.getBoundingClientRect()),S=Gw(w,b),E=qw(h.getBoundingClientRect()),x=Xw([...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=!Kw(w,i);b?m():S&&(m(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[u,f,i,c,m]),l.jsx(Gu,{...e,ref:s})}),[zw,Uw]=ro(so,{isInside:!1}),Gu=d.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,u=Un(wn,n),c=oo(n),{onClose:f}=u;return d.useEffect(()=>(document.addEventListener(fi,f),()=>document.removeEventListener(fi,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(ou,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:g=>g.preventDefault(),onDismiss:f,children:l.jsxs(Aw,{"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(Oa,{children:r}),l.jsx(zw,{scope:n,isInside:!0,children:l.jsx(kw,{id:u.contentId,role:"tooltip",children:o||r})})]})})});Wu.displayName=wn;var qu="TooltipArrow",jw=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=oo(n);return Uw(qu,n).isInside?null:l.jsx(_w,{...o,...r,ref:t})});jw.displayName=qu;function Ww(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 Gw(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 qw(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 Kw(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 Xw(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),Jw(t)}function Jw(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 Yw=Hu,Zw=zu,Qw=Uu,eb=ju,Ku=Wu;const bn=Yw,xn=Zw,Cn=Qw,Kt=d.forwardRef(({className:e,sideOffset:t=4,...n},r)=>l.jsx(eb,{children:l.jsx(Ku,{ref:r,sideOffset:t,className:ee("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})}));Kt.displayName=Ku.displayName;function tb({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 nb=d.forwardRef(tb);var rb=function(e){return function(t,n){var r=P.useRef(!1);e(function(){return function(){r.current=!1}},[]),e(function(){if(!r.current)r.current=!0;else return t()},n)}},Xu=function(e){return typeof e=="function"},Ju=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test";const ob=rb(P.useEffect);function Yu(e){var t=P.useRef(e);return t.current=e,t}var sb=function(e){Ju&&(Xu(e)||console.error("useUnmount expected parameter is a function, got ".concat(typeof e)));var t=Yu(e);P.useEffect(function(){return function(){t.current()}},[])},io=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ib(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ab(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Zu=ab,lb=typeof io=="object"&&io&&io.Object===Object&&io,cb=lb,ub=cb,db=typeof self=="object"&&self&&self.Object===Object&&self,fb=ub||db||Function("return this")(),Qu=fb,pb=Qu,gb=function(){return pb.Date.now()},hb=gb,mb=/\s/;function vb(e){for(var t=e.length;t--&&mb.test(e.charAt(t)););return t}var yb=vb,wb=yb,bb=/^\s+/;function xb(e){return e&&e.slice(0,wb(e)+1).replace(bb,"")}var Cb=xb,Sb=Qu,Eb=Sb.Symbol,ed=Eb,td=ed,nd=Object.prototype,Nb=nd.hasOwnProperty,Tb=nd.toString,jn=td?td.toStringTag:void 0;function Pb(e){var t=Nb.call(e,jn),n=e[jn];try{e[jn]=void 0;var r=!0}catch{}var o=Tb.call(e);return r&&(t?e[jn]=n:delete e[jn]),o}var Ab=Pb,_b=Object.prototype,Fb=_b.toString;function Ob(e){return Fb.call(e)}var Db=Ob,rd=ed,Mb=Ab,Ib=Db,kb="[object Null]",$b="[object Undefined]",od=rd?rd.toStringTag:void 0;function Lb(e){return e==null?e===void 0?$b:kb:od&&od in Object(e)?Mb(e):Ib(e)}var Rb=Lb;function Vb(e){return e!=null&&typeof e=="object"}var Bb=Vb,Hb=Rb,zb=Bb,Ub="[object Symbol]";function jb(e){return typeof e=="symbol"||zb(e)&&Hb(e)==Ub}var Wb=jb,Gb=Cb,sd=Zu,qb=Wb,id=NaN,Kb=/^[-+]0x[0-9a-f]+$/i,Xb=/^0b[01]+$/i,Jb=/^0o[0-7]+$/i,Yb=parseInt;function Zb(e){if(typeof e=="number")return e;if(qb(e))return id;if(sd(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=sd(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Gb(e);var n=Xb.test(e);return n||Jb.test(e)?Yb(e.slice(2),n?2:8):Kb.test(e)?id:+e}var Qb=Zb,ex=Zu,mi=hb,ad=Qb,tx="Expected a function",nx=Math.max,rx=Math.min;function ox(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(tx);t=ad(t)||0,ex(n)&&(f=!!n.leading,g="maxWait"in n,s=g?nx(ad(n.maxWait)||0,t):s,m="trailing"in n?!!n.trailing:m);function p(A){var F=r,O=o;return r=o=void 0,c=A,i=e.apply(O,F),i}function v(A){return c=A,a=setTimeout(w,t),f?p(A):i}function h(A){var F=A-u,O=A-c,k=t-F;return g?rx(k,s-O):k}function y(A){var F=A-u,O=A-c;return u===void 0||F>=t||F<0||g&&O>=s}function w(){var A=mi();if(y(A))return b(A);a=setTimeout(w,h(A))}function b(A){return a=void 0,m&&r?p(A):(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(mi())}function x(){var A=mi(),F=y(A);if(r=arguments,o=this,u=A,F){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 sx=ox;const ix=ib(sx);function ax(){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}ax()||(global.Date=Date);function lx(e,t){var n;Ju&&(Xu(e)||console.error("useDebounceFn expected parameter is a function, got ".concat(typeof e)));var r=Yu(e),o=(n=t==null?void 0:t.wait)!==null&&n!==void 0?n:1e3,s=P.useMemo(function(){return ix(function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];return r.current.apply(r,ml([],hl(i),!1))},o,t)},[]);return sb(function(){s.cancel()}),{run:s,cancel:s.cancel,flush:s.flush}}function cx(e,t,n){var r=hl(P.useState({}),2),o=r[0],s=r[1],i=lx(function(){s({})},n).run;P.useEffect(function(){return i()},t),ob(e,[o])}const ux=P.forwardRef(({onChange:e},t)=>{const n=P.useRef(null),[r,o]=P.useState("");return P.useImperativeHandle(t,()=>({setValue:s=>{var i;o(s),(i=n.current)==null||i.focus()}})),cx(()=>{e==null||e(r)},[r],{wait:300}),l.jsxs(l.Fragment,{children:[l.jsx(It,{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(nb,{className:"h-5 w-5"})})]})}),dx=({openDialogRename:e,setOpenDialogRename:t,apiBaseUrl:n,setFileToMove:r,fileToMove:o,refreshFiles:s,ignoreCache:i})=>{var b;const[a,u]=P.useState({}),[c,f]=P.useState(!1),[g,m]=P.useState(!1),[p,v]=P.useState(""),{toast:h}=Gr();P.useEffect(()=>{e&&y(p)},[p,e]);const y=async S=>{try{m(!0);const E=await se.get(`${n}/api/list-s3-folders?prefix=${S}`);u(E==null?void 0:E.data)}catch{h({title:"Error",description:"Unable to load S3 folder list",variant:"destructive"})}finally{m(!1)}},w=async()=>{f(!0);try{const S=o.key;await se.post(`${n}/api/move`,{oldPath:S,newPath:p}),i.current=!0,await s(),h({title:"Đã đổi tên",description:`Đã đổi tên thành công "${o.name}" thành "${p}"`}),t(!1),r(null),v("")}catch(S){console.error("Error renaming item:",S),h({title:"Lỗi",description:"Không thể đổi tên",variant:"destructive"})}finally{f(!1)}};return l.jsx(Mt,{open:e,onOpenChange:S=>{S||(t(!1),r(null),v(""))},children:l.jsxs(yt,{className:"max-h-[700px] pb-3 px-1 s3-explr-input-group max-w-5xl w-[90%] p-6 bg-white rounded-lg shadow-lg",children:[l.jsxs(wt,{className:"mb-4 w-full h-full",children:[l.jsx("nav",{className:"mb-4",children:l.jsxs("ul",{className:"flex items-center space-x-2 text-sm text-gray-600",children:[l.jsx("li",{className:"cursor-pointer hover:text-blue-600 transition-colors",onClick:()=>v(""),children:"Root"}),p.split("/").map((S,E,x)=>l.jsx("li",{className:"cursor-pointer hover:text-blue-600 transition-colors",onClick:()=>v(S==="Root"?"":x.slice(0,E+1).join("/")+"/"),children:S},E))]})}),l.jsxs(bt,{className:"text-xl font-semibold text-gray-800",children:["Di chuyển"," ",l.jsxs("span",{className:"text-sm text-gray-500",children:["( file Hoặc folder sẽ được di chuyển đến thư mục"," ",p===""?"Root":p," )"]})]}),l.jsx(kn,{className:"text-gray-600 w-full h-[50dvh] max-h-[500px] overflow-hidden overflow-y-auto",children:g?l.jsx("div",{className:"flex justify-center items-center py-4",children:l.jsx("div",{className:"loader ease-linear rounded-full border-4 border-t-4 border-gray-200 h-12 w-12"})}):l.jsx("ul",{className:"space-y-2",children:(b=Object.keys(a))==null?void 0:b.map(S=>l.jsx("li",{className:"cursor-pointer hover:bg-gray-100 p-2 rounded transition-colors",onClick:()=>v(S),children:S},S))})})]}),l.jsxs(fn,{className:"flex justify-end space-x-2",children:[l.jsx(ie,{variant:"outline",onClick:()=>t(!1),className:"px-4 py-2 rounded border border-gray-300 text-gray-700 hover:bg-gray-100 transition-colors",children:"Cancel"}),l.jsx(ie,{onClick:w,disabled:c,className:"s3-explr-crawl-btn",children:"Move"})]})]})})},je={current:!1},ld="crawl:jobs",Sn="crawl:current_job",fx=e=>{const[t,n]=P.useState(null),[r,o]=P.useState(0);return P.useEffect(()=>{const s=localStorage.getItem(Sn);if(s){const i=JSON.parse(s);n(i),i!=null&&i.startTime&&o(Math.floor((Date.now()-i.startTime)/1e3))}},[]),P.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]),P.useEffect(()=>{if(!(t!=null&&t.id))return;const s=async()=>{try{const u=(await se.get(`${e}/api/crawl/${t.id}?taskId=${t.taskId}`)).data;n(c=>{if(!c)return null;const f={...c,status:u};return localStorage.setItem(Sn,JSON.stringify(f)),(u.status==="completed"||u.status==="failed")&&setTimeout(()=>{n(null),localStorage.removeItem(Sn)},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(Sn,JSON.stringify(s)):localStorage.removeItem(Sn)}}},ao=(e,t)=>{const n=[],r=o=>{(e[o]||[]).forEach(i=>{n.push(i.key),i.isFolder&&r(i.key)})};return r(t),n},px=(e,t)=>{const n=[];return(e[t]||[]).forEach(o=>{n.push(o.key),o.isFolder&&n.push(...ao(e,o.key))}),n},gx=(e,t,n=[],r,o,s)=>{const[i,a]=P.useState({}),[u,c]=P.useState(!1),[f,g]=P.useState(null),[m,p]=P.useState(0),v=P.useRef(t);P.useEffect(()=>{v.current=t},[t]);const h=async()=>{c(!0);try{const w=await se.get(`${e}/api/files`,{params:{cache:!1,displayPrefixes:JSON.stringify(n),prefix:v.current},timeout:3e5});a(w.data),g(null)}catch(w){g(w instanceof Error?w:new Error("Failed to fetch files"))}finally{c(!1),p(0),s("")}};P.useEffect(()=>{h()},[]);const y=async w=>{var b,S;try{if(!w)return;c(!0);const E=await se.get(`${e}/api/search-db?query=${w}&rootPrefix=${t}&offset=${(o-1)*20}&limit=20`,{timeout:3e5});return a({[t]:((b=E==null?void 0:E.data)==null?void 0:b.result)||[]}),p(((S=E==null?void 0:E.data)==null?void 0:S.estimatedTotalHits)||0),E}catch(E){g(E instanceof Error?E:new Error("Failed to fetch files"))}finally{c(!1)}};return P.useEffect(()=>{!r&&!u&&h(),r&&!u&&y(r)},[r,o]),{data:i,isLoading:u,error:f,estimatedTotalHits:m,refetch:h}},Wn=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||"")},hx=P.memo(({homeLabel:e="Kho tài liệu",apiBaseUrl:t="http://localhost:3002",rootPrefix:n="",asSelector:r=!1,onSelected:o=a=>console.log("Đã chọn:",a),displayPrefixes:s,preSelectedFiles:i})=>{var kd;const[a,u]=P.useState([]),[c,f]=P.useState(""),[g,m]=P.useState(new Set),[p,v]=P.useState(n),[h,y]=P.useState(null),[w,b]=P.useState(!1),[S,E]=P.useState(""),[x,A]=P.useState(!1),[F,O]=P.useState(null),[k,M]=P.useState(null),[q,$]=P.useState(!1),[U,L]=P.useState(!1),[X,K]=P.useState(null),te=P.useRef(null),{toast:H}=Gr(),[j,le]=P.useState(null),[ce,xe]=P.useState(null),[Ee,Fe]=P.useState(""),[Vt,Se]=P.useState(!1),[Ne,nt]=P.useState(!1),[Oe,Jt]=P.useState(new Set),[Bt,rt]=P.useState(""),[He,Ht]=P.useState(!1),[pt,Yt]=P.useState(!1),[Nn,C]=P.useState("rename"),[N,_]=P.useState(!1),[z,B]=P.useState(""),[R,J]=P.useState("1"),[ne,me]=P.useState(!1),[Ce,gt]=P.useState(!1),[ho,Tn]=P.useState(!1),[De,Jn]=P.useState(1),[Yn,mo]=P.useState(!1),{currentJob:ue,elapsedTime:vo,setCurrentJob:_d}=fx(t),Bx=h||n,{data:ht,isLoading:Ni,error:Hx,estimatedTotalHits:Zn,refetch:Ge}=gx(t,Bx,s,c,De,f);P.useEffect(()=>{const D=new Set(i);m(D)},[]),P.useEffect(()=>{ue!=null&&ue.status&&(ue.status.status==="completed"?(H({title:"Thu thập website hoàn tất",description:`Đã thu thập thành công ${ue.url} với ${ue.status.completed} trang`}),je.current=!0,Ge()):ue.status.status==="failed"&&H({title:"Thu thập website thất bại",description:`Không thể thu thập ${ue.url}. Vui lòng thử lại.`,variant:"destructive"}))},[(kd=ue==null?void 0:ue.status)==null?void 0:kd.status]);const Fd=P.useMemo(()=>ht[p]||[],[ht,p]),Zt=P.useMemo(()=>Fd,[Fd,p,ht]),Qn=P.useMemo(()=>{const D={};return Zt.forEach((I,V)=>{g.has(I.key)&&(D[V]=!0)}),D},[g,Zt]),zx=D=>{const I=ao(ht,D);if(I.length===0)return g.has(D)?"all":"none";const V=I.filter(G=>g.has(G)).length;return V===0?"none":V===I.length?"all":"partial"},yo=D=>{p!==D&&(mo(!0),y(D),v(D),m(new Set))};P.useEffect(()=>{Yn&&(je.current=!0,Ge().finally(()=>mo(!1)))},[Yn]);const Ux=async(D,I)=>{A(!0);try{const V=`${I}${D}/`;if((await se.post(`${t}/api/create-folder`,{prefix:V})).status!==200){H({title:"Lỗi",description:"Không thể tạo thư mục",variant:"destructive"});return}je.current=!0,await Ge(),H({title:"Đã tạo thư mục",description:`Đã tạo thành công thư mục "${D}"`}),E(""),b(!1)}catch(V){console.error("Error creating folder:",V),H({title:"Lỗi",description:"Không thể tạo thư mục",variant:"destructive"})}finally{A(!1)}},Od=async(D,I,V)=>{K(V),gt(!0);try{let G=localStorage.getItem("dataLogin"),Q;try{G&&(G=JSON.parse(G),Q=G.user)}catch{G=null}if(Q&&(Q==null?void 0:Q.role)!=="MASTER_ADMIN"&&mg(D,H))return;const ae=new FormData;ae.append("prefix",I),Array.from(D).forEach(ge=>ae.append("files",ge)),Q!=null&&Q.id&&(console.log("🚀 ~ uploadFiles ~ user:",Q),ae.append("metadata",JSON.stringify({creator:Q.username,creatorId:Q.id,DataSource:"Tệp tải lên"}))),await se.post(`${t}/api/upload`,ae,{headers:{"Content-Type":"multipart/form-data"}}),f(""),y(I),je.current=!0}catch(G){console.error("Lỗi tải lên:",G)}finally{setTimeout(async()=>{K(null),await Ge(),gt(!1)},500)}},jx=async D=>{var I;Tn(!0);try{await se.delete(`${t}/api/files`,{data:{paths:[D.key]}});const V=((I=D.key)==null?void 0:I.replace(/^(.*?)(\/.*)?$/,(G,Q,ae)=>!ae||ae==="/"?"":Q+"/"))||"";y(V),je.current=!0,H({title:"Đã xóa tập tin",description:`Đã xóa thành công "${D.name}"`}),O(null)}catch(V){console.error("Error deleting file:",V),H({title:"Lỗi",description:"Không thể xóa tập tin",variant:"destructive"})}finally{Tn(!1),await Ge()}},wo=D=>{const I=new Set(g),V=typeof D=="function"?D(Qn):D;new Set(Object.keys(Qn).map(Number)).forEach(Q=>{const ae=Zt[Q];ae&&(V[Q]||(I.delete(ae.key),ae.isFolder&&ao(ht,ae.key).forEach(ge=>I.delete(ge))))}),Object.entries(V).forEach(([Q,ae])=>{const ge=parseInt(Q),Nt=Zt[ge];Nt&&ae&&(I.add(Nt.key),Nt.isFolder&&ao(ht,Nt.key).forEach(Pi=>I.add(Pi)))}),m(I)},Wx=async()=>{var D;$(!0);try{const I=Array.from(g),V=I.map(Q=>Object.values(ht).flat().find(ae=>ae.key===Q)).filter(Q=>Q!==void 0);if(V.length===0){H({title:"Lỗi",description:"Không có tập tin nào được chọn để xóa",variant:"destructive"});return}await se.delete(`${t}/api/files`,{data:{paths:I}});const G=((D=V[0])==null?void 0:D.key.replace(/^(.*?)(\/.*)?$/,(Q,ae,ge)=>!ge||ge==="/"?"":ae+"/"))||"";y(G),je.current=!0,Ge(),H({title:"Đã xóa tập tin",description:`Đã xóa thành công ${V.length} mục`}),L(!1),m(new Set)}catch(I){console.error("Error deleting files:",I),H({title:"Lỗi",description:"Không thể xóa các tập tin đã chọn",variant:"destructive"})}finally{$(!1)}},Gx=async(D,I)=>{nt(!0);try{const V=D.key;let G;D.isFolder?G=V.split("/").slice(0,-2).join("/")+"/":G=V.substring(0,V.lastIndexOf("/")+1);const Q=G+I+(D.isFolder?"/":"");await se.post(`${t}/api/rename`,{oldPath:V,newPath:Q}),je.current=!0,await Ge(),H({title:"Đã đổi tên",description:`Đã đổi tên thành công "${D.name}" thành "${I}"`}),le(null),Fe(""),xe(null)}catch(V){console.error("Error renaming item:",V),H({title:"Lỗi",description:"Không thể đổi tên",variant:"destructive"})}finally{nt(!1)}},Dd=async D=>{Jt(I=>new Set([...I,...D]));try{const I=await se.post(`${t}/api/download`,{paths:D},{responseType:"blob"}),V=window.URL.createObjectURL(I.data),G=document.createElement("a");G.href=V;const Q=I.headers["Content-Disposition"]||I.headers["content-disposition"],ae=Q==null?void 0:Q.match(/filename="(.+)"/),ge=ae?decodeURIComponent(ae[1]):"download.zip";G.setAttribute("download",ge),document.body.appendChild(G),G.click(),document.body.removeChild(G),window.URL.revokeObjectURL(V),H({title:"Bắt đầu tải xuống",description:`Đã bắt đầu tải xuống ${D.length} mục${D.length>1,""}`})}catch(I){console.error("Error downloading files:",I),H({title:"Lỗi",description:"Không thể tải xuống tập tin",variant:"destructive"})}finally{Jt(I=>{const V=new Set(I);return D.forEach(G=>V.delete(G)),V})}},Md=p?p.replace(n,"").split("/").filter(Boolean):[],qx=()=>Array.from(g).map(D=>{var I;for(const V in ht){const G=(I=ht[V])==null?void 0:I.find(Q=>Q.key===D);if(G)return G}return null}).filter(D=>D!==null),Id=P.useMemo(()=>{const D=[{id:"select",header:()=>{const I=px(ht,p),V=I.length>0&&I.every(Q=>g.has(Q)),G=I.some(Q=>g.has(Q));return l.jsx(us,{checked:V?!0:G?"indeterminate":!1,onCheckedChange:Q=>{if(Q){const ae=Zt.reduce((ge,Nt,Pi)=>(ge[Pi]=!0,ge),{});wo(ae)}else wo({})},"aria-label":"Chọn tất cả"})},cell:({row:I})=>{const V=I.original,Q=V.isFolder?zx(V.key):g.has(V.key)?"all":"none";return l.jsx("div",{className:"flex items-center",children:l.jsx(us,{checked:Q==="partial"?"indeterminate":Q==="all",onCheckedChange:ae=>{const ge={...Qn};ae?ge[I.index]=!0:delete ge[I.index],wo(ge)},"aria-label":"Chọn dòng"})})},enableSorting:!1},{id:"fileName",header:({column:I})=>l.jsxs(ie,{variant:"ghost",onClick:()=>I.toggleSorting(I.getIsSorted()==="asc"),children:["Tên tập tin",l.jsx(Zo,{})]}),accessorKey:"name",cell:({row:I})=>{const V=I.original,G=V.key.substring(0,V.key.lastIndexOf("/"))||"/",Q=c.trim()!==""&&G!==p,ae=G.split("/").filter(Boolean);return l.jsxs("div",{className:"flex flex-col",children:[l.jsxs("div",{className:`flex items-center gap-2 ${V.isFolder?"cursor-pointer hover:text-blue-600":""}`,onClick:()=>{V.isFolder&&(m(new Set),yo(V.key))},children:[V.isFolder?l.jsx(xo,{className:"h-5 w-5 text-blue-500"}):null,V.name]}),Q&&l.jsxs("div",{className:"text-sm text-gray-500 flex items-center",children:[l.jsx(xo,{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:()=>{yo("")},children:"/"}),ae.map((ge,Nt)=>l.jsxs("span",{className:"flex items-center",children:[l.jsx("span",{className:"cursor-pointer hover:text-blue-600",onClick:()=>{yo(ae.slice(0,Nt+1).join("/")+"/")},children:ge}),Nt<ae.length-1&&l.jsx("span",{children:"/"})]},Nt))]})]})]})}}];return r||D.push({id:"size",header:({column:I})=>l.jsxs(ie,{variant:"ghost",onClick:()=>I.toggleSorting(I.getIsSorted()==="asc"),children:["Kích thước",l.jsx(Zo,{})]}),accessorKey:"size",cell:({getValue:I,row:V})=>{const G=I();return l.jsx("span",{children:V.original.isFolder?"-":Zg(G)})}},{id:"lastModified",header:({column:I})=>l.jsxs(ie,{variant:"ghost",onClick:()=>I.toggleSorting(I.getIsSorted()==="asc"),children:["Sửa đổi lần cuối",l.jsx(Zo,{})]}),accessorKey:"lastModified",cell:({row:I})=>{const V=I.original.lastModified;return l.jsx("span",{children:V.toLocaleString()})}},{id:"actions",header:()=>l.jsx("span",{children:"Hành động"}),accessorKey:"key",cell:({row:I})=>l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(bn,{children:l.jsxs(xn,{children:[l.jsx(Cn,{asChild:!0,children:l.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>Dd([I.original.key]),className:"h-8 w-8 p-0",disabled:Oe.has(I.original.key),children:Oe.has(I.original.key)?l.jsx(ve,{className:"h-4 w-4 animate-spin"}):l.jsx(_i,{className:"h-4 w-4"})})}),l.jsx(Kt,{children:"Tải xuống"})]})}),l.jsx(bn,{children:l.jsxs(xn,{children:[l.jsx(Cn,{asChild:!0,children:l.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>{le(I.original),Fe(I.original.name)},className:"h-8 w-8 p-0",children:l.jsx(qd,{className:"h-4 w-4"})})}),l.jsx(Kt,{children:"Đổi tên"})]})}),l.jsx(bn,{children:l.jsxs(xn,{children:[l.jsx(Cn,{asChild:!0,children:l.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>{Se(!0),M(I.original)},className:"h-8 w-8 p-0",children:l.jsx(dg,{className:"h-4 w-4"})})}),l.jsx(Kt,{children:"Di chuyển"})]})}),l.jsx(bn,{children:l.jsxs(xn,{children:[l.jsx(Cn,{asChild:!0,children:l.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>O(I.original),className:"h-8 w-8 p-0",children:l.jsx(Fi,{className:"h-4 w-4"})})}),l.jsx(Kt,{children:"Xóa"})]})})]})}),D},[g,Zt,Qn,Oe,r]),Ti=Ui({data:Zt,columns:Id,state:{rowSelection:Qn,sorting:a},onSortingChange:u,enableRowSelection:!0,onRowSelectionChange:wo,getCoreRowModel:zi(),getSortedRowModel:Ff()}),Kx=async D=>{var I,V;Ht(!0);try{if(Wn(D)){const G=await se.get(`${t}/api/read-text`,{params:{path:D.key}});rt(G.data.content)}try{const G=await se.get(`${t}/api/read-json`,{params:{path:D.key+".metadata.json"}}),Q=((V=(I=G==null?void 0:G.data)==null?void 0:I.content)==null?void 0:V.metadataAttributes)||null;return xe({fullPath:j==null?void 0:j.key,...Q})}catch{return xe("Lỗi phân tích siêu dữ liệu")}}catch(G){console.error("Error loading file content:",G),H({title:"Lỗi",description:"Không thể tải nội dung tập tin",variant:"destructive"})}finally{Ht(!1)}},Xx=async(D,I)=>{Yt(!0);try{await se.post(`${t}/api/modify-text`,{path:D.key,content:I}),H({title:"Đã lưu tập tin",description:"Nội dung tập tin đã được cập nhật thành công"}),je.current=!0,await Ge(),le(null),rt(""),C("rename")}catch(V){console.error("Error saving file content:",V),H({title:"Lỗi",description:"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{Yt(!1)}},Jx=async D=>{Yt(!0);try{console.log("🚀 ~ saveJsonFile ~ metadataForEdit:",ce),await se.post(`${t}/api/modify-json`,{path:D.key+".metadata.json",content:{metadataAttributes:ce}}),H({title:"Đã lưu tập tin",description:"Nội dung tập tin đã được cập nhật thành công"}),je.current=!0,await Ge(),le(null),rt(""),C("rename")}catch(I){console.error("Error saving file content:",I),H({title:"Lỗi",description:"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{Yt(!1)}};P.useEffect(()=>{j&&(j.isFolder||Kx(j),C("rename"))},[j]);const Yx=async(D,I)=>{var V;if(ue){H({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}me(!0);try{const{data:G}=await se.post(`${t}/api/crawl`,{url:D,limit:I,prefix:p});if(G.id){_d({id:G.id,url:D,limit:I,prefix:p,taskId:((V=G.task)==null?void 0:V.id)||""});const Q=localStorage.getItem(ld),ae=Q?JSON.parse(Q):[];ae.some(ge=>ge.id===G.id)||(ae.unshift({url:D,id:G.id,limit:I,prefix:p,timestamp:Date.now()}),ae.length>20&&(ae.length=20),localStorage.setItem(ld,JSON.stringify(ae))),H({title:"Bắt đầu thu thập website",description:`Đã thêm nhiệm vụ thu thập ${D} với giới hạn ${I}. Dữ liệu sẽ có sẵn sau khi thu thập hoàn tất.`}),_(!1),B(""),J("1")}}catch(G){console.error("Error crawling website:",G),H({title:"Lỗi",description:"Không thể bắt đầu thu thập website",variant:"destructive"})}finally{me(!1)}},Zx=async()=>{try{if(!(ue!=null&&ue.id))return;_d(null),localStorage.removeItem(Sn),H({title:"Đã dừng thu thập",description:`Đã dừng thu thập website ${ue.url}`})}catch(D){console.error("Error stopping job:",D),H({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(Ha,{className:"s3-explr-breadcrumb",children:l.jsxs(za,{className:"s3-explr-breadcrumb-list",children:[l.jsx(ss,{className:"s3-explr-breadcrumb-item",children:l.jsx(is,{onClick:()=>{p!==""&&m(new Set),y(""),v(""),je.current=!0,setTimeout(()=>{Ge()},0)},className:"flex items-center gap-1 cursor-pointer s3-explr-breadcrumb-home",children:e})}),Md.map((D,I)=>l.jsxs(l.Fragment,{children:[l.jsx(Ua,{className:"s3-explr-breadcrumb-separator"},`sep-${I}`),l.jsx(ss,{className:"s3-explr-breadcrumb-item",children:l.jsx(is,{onClick:()=>yo(n+Md.slice(0,I+1).join("/")+"/"),className:"cursor-pointer s3-explr-breadcrumb-link",children:D})},`item-${D}`)]}))]})}),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(ux,{ref:te,onChange:D=>f(D)})}),l.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>{y(p),je.current=!0,Ge()},disabled:Ni,className:"flex items-center gap-2 s3-explr-refresh-btn",children:[l.jsx(Rd,{className:`h-4 w-4 s3-explr-refresh-icon ${Ni?"animate-spin":""}`}),"Làm mới"]}),!r&&l.jsxs(l.Fragment,{children:[g.size>0&&l.jsxs(l.Fragment,{children:[l.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>Dd(Array.from(g)),disabled:Array.from(g).some(D=>Oe.has(D)),className:"flex items-center gap-2 s3-explr-download-selected-btn",children:[Array.from(g).some(D=>Oe.has(D))?l.jsx(ve,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}):l.jsx(_i,{className:"h-4 w-4 s3-explr-download-icon"}),"Tải xuống đã chọn (",g.size,")"]}),l.jsxs(Mt,{open:U,onOpenChange:L,children:[l.jsx(Pr,{asChild:!0,children:l.jsxs(ie,{variant:"destructive",size:"sm",className:"flex items-center gap-2 s3-explr-bulk-delete-btn",children:[l.jsx(Fi,{className:"h-4 w-4 s3-explr-trash-icon"}),"Xóa đã chọn (",g.size,")"]})}),l.jsxs(yt,{className:"s3-explr-dialog-content",children:[l.jsxs(wt,{className:"s3-explr-dialog-header",children:[l.jsx(bt,{className:"s3-explr-dialog-title",children:"Xác nhận xóa hàng loạt"}),l.jsxs(kn,{className:"s3-explr-dialog-description",children:["Bạn có chắc chắn muốn xóa ",g.size," mục đã chọn? Hành động này không thể hoàn tác."]})]}),l.jsxs(fn,{className:"s3-explr-dialog-footer",children:[l.jsx(ie,{variant:"outline",onClick:()=>L(!1),className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(ie,{variant:"destructive",onClick:Wx,disabled:q,className:"s3-explr-confirm-delete-btn",children:q?l.jsxs(l.Fragment,{children:[l.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa đã chọn"})]})]})]})]}),l.jsxs(Mt,{open:w,onOpenChange:b,children:[l.jsx(Pr,{asChild:!0,children:l.jsxs(ie,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-new-folder-btn",disabled:!!s&&!p,children:[l.jsx(zd,{className:"h-4 w-4 s3-explr-folder-plus-icon"}),"Thư mục mới"]})}),l.jsxs(yt,{className:"s3-explr-dialog-content",children:[l.jsx(wt,{className:"s3-explr-dialog-header",children:l.jsx(bt,{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(Gt,{htmlFor:"name",className:"s3-explr-label",children:"Tên thư mục"}),l.jsx(It,{disabled:x,id:"name",value:S,onChange:D=>E(D.target.value),placeholder:"Nhập tên thư mục",className:"s3-explr-input"})]}),l.jsxs(ie,{onClick:()=>{S.trim()&&Ux(S,p)},disabled:x,className:"s3-explr-create-btn",children:[x&&l.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),x?"Đ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 D=document.createElement("input");D.type="file",D.multiple=!0,D.onchange=I=>{const V=I.target.files;V&&Od(V,p,"files")},D.click()},disabled:X!==null||!!s&&!p,children:X==="files"?l.jsxs(l.Fragment,{children:[l.jsx(ve,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}),"Đang tải lên..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Bd,{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 D=document.createElement("input");D.type="file",D.multiple=!0,D.webkitdirectory=!0,D.onchange=I=>{const V=I.target.files;V&&Od(V,p,"folder")},D.click()},disabled:X!==null||!!s&&!p,children:X==="folder"?l.jsxs(l.Fragment,{children:[l.jsx(ve,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}),"Đang tải lên..."]}):l.jsxs(l.Fragment,{children:[l.jsx(xo,{className:"h-4 w-4 s3-explr-folder-icon"}),"Tải lên thư mục"]})}),ue?l.jsx(bn,{delayDuration:0,children:l.jsxs(xn,{children:[l.jsx(Cn,{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(ve,{className:"h-4 w-4 animate-spin s3-explr-loader"}),ue.status?l.jsxs(l.Fragment,{children:["Đang thu thập (",ue.status.completed,"/",ue.status.total,") - ",Math.floor(vo/60),":",String(vo%60).padStart(2,"0")]}):"Đang thu thập..."]}),l.jsxs(ie,{variant:"destructive",size:"sm",onClick:()=>void Zx(),className:"flex items-center gap-2",children:[l.jsx("span",{className:"sr-only",children:"Dừng thu thập"}),l.jsx(Xd,{className:"h-4 w-4"})]})]})}),ue.status&&l.jsx(Kt,{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 ",ue.url]}),l.jsxs("p",{children:["Tiến độ: ",ue.status.completed,"/",ue.status.total," trang"]}),l.jsxs("p",{children:["Thời gian: ",Math.floor(vo/60),":",String(vo%60).padStart(2,"0")]}),l.jsxs("p",{children:["Trạng thái:"," ",ue.status.status==="scraping"?"Đang thu thập":ue.status.status==="completed"?"Hoàn thành":"Thất bại"]})]})})]})}):l.jsxs(Mt,{open:N,onOpenChange:_,children:[l.jsx(Pr,{asChild:!0,children:l.jsxs(ie,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!!s&&!p,children:[l.jsx(Wd,{className:"h-4 w-4 s3-explr-globe-icon"}),"Thêm website"]})}),l.jsxs(yt,{className:"s3-explr-dialog-content",children:[l.jsxs(wt,{className:"s3-explr-dialog-header",children:[l.jsx(bt,{className:"s3-explr-dialog-title",children:"Thêm website"}),l.jsx(kn,{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(Gt,{htmlFor:"websiteUrl",className:"s3-explr-label",children:"URL Website"}),l.jsx(It,{id:"websiteUrl",value:z,onChange:D=>B(D.target.value),placeholder:"https://example.com",type:"url",disabled:ne,className:"s3-explr-input"})]}),l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(Gt,{htmlFor:"crawlLimit",className:"s3-explr-label",children:"Giới hạn thu thập"}),l.jsx(It,{id:"crawlLimit",value:R,onChange:D=>{const I=D.target.value;/^\d*$/.test(I)&&J(I)},placeholder:"1",type:"text",disabled:ne,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(fn,{className:"s3-explr-dialog-footer",children:[l.jsx(ie,{variant:"outline",onClick:()=>{_(!1),B(""),J("1")},disabled:ne,className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(ie,{onClick:()=>{z.trim()&&Yx(z.trim(),parseInt(R)||1)},disabled:ne||!z.trim(),className:"s3-explr-crawl-btn",children:ne?l.jsxs(l.Fragment,{children:[l.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang thu thập..."]}):"Bắt đầu thu thập"})]})]})]})]}),l.jsx(Mt,{open:!!F,onOpenChange:D=>!D&&O(null),children:l.jsxs(yt,{className:"s3-explr-dialog-content",children:[l.jsxs(wt,{className:"s3-explr-dialog-header",children:[l.jsx(bt,{className:"s3-explr-dialog-title",children:"Xác nhận xóa"}),l.jsxs(kn,{className:"s3-explr-dialog-description",children:["Bạn có chắc chắn muốn xóa ",F==null?void 0:F.name,"? Hành động này không thể hoàn tác."]})]}),l.jsxs(fn,{className:"s3-explr-dialog-footer",children:[l.jsx(ie,{variant:"outline",onClick:()=>O(null),className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(ie,{variant:"destructive",onClick:()=>jx(F),disabled:ho,className:"s3-explr-confirm-delete-btn",children:ho?l.jsxs(l.Fragment,{children:[l.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa"})]})]})}),l.jsx(Mt,{open:!!j,onOpenChange:D=>{D||(le(null),xe(null),Fe(""),rt(""),C("rename"))},children:l.jsxs(yt,{className:"s3-explr-dialog-content max-w-5xl w-[90%]",children:[l.jsx(wt,{className:"s3-explr-dialog-header",children:l.jsx(bt,{className:"s3-explr-dialog-title",children:j!=null&&j.isFolder?"Đổi tên thư mục":Wn(j)?"Quản lý tập tin":"Đổi tên tập tin"})}),j&&l.jsxs(Tv,{value:Nn,onValueChange:D=>C(D),children:[l.jsxs(Pc,{"aria-checked":!Wn(j),"aria-disabled":j.isFolder,className:"grid w-full grid-cols-3 aria-checked:grid-cols-2 aria-disabled:grid-cols-1",children:[l.jsx(Vr,{value:"rename",children:"Đổi tên"}),!j.isFolder&&l.jsxs(l.Fragment,{children:[Wn(j)&&l.jsx(Vr,{value:"edit",children:"Sửa nội dung"}),l.jsx(Vr,{value:"edit-metadata",children:"Sửa metadata file"})]})]}),l.jsx(Br,{value:"rename",children:l.jsx("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:l.jsxs("div",{className:"h-[70dvh] min-h-[500px] overflow-hidden overflow-y-auto pb-3 px-1 s3-explr-input-group",children:[l.jsx(Gt,{htmlFor:"newName",className:"s3-explr-label",children:"Tên mới"}),l.jsx(It,{id:"newName",value:Ee,onChange:D=>Fe(D.target.value),placeholder:"Nhập tên mới",disabled:Ne,className:"s3-explr-input"})]})})}),!j.isFolder&&l.jsxs(l.Fragment,{children:[Wn(j)&&l.jsx(Br,{value:"edit",children:l.jsx("div",{className:"space-y-4 py-4",children:He?l.jsx("div",{className:"flex items-center justify-center py-4",children:l.jsx(ve,{className:"h-6 w-6 animate-spin"})}):l.jsxs("div",{className:"h-[70dvh] min-h-[500px] overflow-hidden overflow-y-auto pb-3 px-1",children:[l.jsx(Gt,{htmlFor:"content",className:"s3-explr-label",children:"Nội dung tập tin"}),l.jsx($n,{id:"content",value:Bt,onChange:D=>rt(D.target.value),placeholder:"Nhập nội dung tập tin",className:"min-h-[200px] font-mono",disabled:pt})]})})}),l.jsx(Br,{value:"edit-metadata",children:l.jsx("div",{className:"space-y-4 py-4",children:He?l.jsx("div",{className:"flex items-center justify-center py-4",children:l.jsx(ve,{className:"h-6 w-6 animate-spin"})}):l.jsx("div",{className:"h-[70dvh] min-h-[500px] overflow-hidden overflow-y-auto pb-3 px-1",children:ce&&typeof ce=="object"&&Object.entries(ce).map(([D,I])=>l.jsxs("div",{className:"pb-3 flex flex-col gap-2",children:[l.jsxs(Gt,{htmlFor:D,className:"s3-explr-label flex items-center gap-1",children:[gg[D]||D,es(D)&&l.jsx(fg,{className:"h-[12px] w-[12px] text-red-500"})]}),hg(D)?l.jsx($n,{id:D,value:typeof I=="string"?I:JSON.stringify(I),onChange:V=>{const G={...ce,[D]:V.target.value};xe(G)},placeholder:"Nhập nội dung tập tin",className:"min-h-[200px] font-mono",disabled:pt||es(D)}):l.jsx(It,{id:D,value:typeof I=="string"?I:JSON.stringify(I),onChange:V=>{const G={...ce,[D]:V.target.value};xe(G)},placeholder:"Nhập nội dung",className:"s3-explr-input",disabled:pt||es(D)})]},D))})})})]})]}),l.jsxs(fn,{className:"s3-explr-dialog-footer",children:[l.jsx(ie,{variant:"outline",onClick:()=>{le(null),xe(null),Fe(""),rt("")},className:"s3-explr-cancel-btn",children:"Hủy"}),Nn==="edit"?l.jsx(ie,{onClick:()=>j&&Xx(j,Bt),disabled:pt||He,className:"s3-explr-save-btn",children:pt?l.jsxs(l.Fragment,{children:[l.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang lưu..."]}):"Lưu thay đổi"}):Nn==="edit-metadata"?l.jsx(ie,{onClick:()=>ce&&typeof ce=="object"&&j&&Jx(j),disabled:pt||He,className:"s3-explr-save-btn",children:pt?l.jsxs(l.Fragment,{children:[l.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang lưu..."]}):"Lưu thay đổi"}):l.jsx(ie,{onClick:()=>{Ee.trim()&&j&&Gx(j,Ee.trim())},disabled:Ne||!Ee.trim()||Ee.trim()===(j==null?void 0:j.name),className:"s3-explr-rename-btn",children:Ne?l.jsxs(l.Fragment,{children:[l.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang đổi tên..."]}):"Đổi tên"})]})]})}),k&&Vt&&l.jsx(dx,{openDialogRename:Vt,setOpenDialogRename:Se,apiBaseUrl:t,setFileToMove:M,fileToMove:k,refreshFiles:Ge,ignoreCache:je})]})]}),Hx&&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(Ir,{className:"s3-explr-table-header",children:Ti.getHeaderGroups().map(D=>l.jsx(Ze,{className:"hover:bg-transparent s3-explr-header-row",children:D.headers.map(I=>l.jsx(it,{className:"s3-explr-header-cell",children:I.isPlaceholder?null:sr(I.column.columnDef.header,I.getContext())},I.id))},D.id))}),l.jsx(kr,{className:"s3-explr-table-body",children:Ti.getRowModel().rows.length===0?l.jsx(Ze,{className:"s3-explr-empty-row",children:l.jsx(Ie,{colSpan:Id.length,className:"h-24 text-center s3-explr-empty-cell",children:c?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 "',c,'"']}):l.jsx("div",{className:"text-gray-500 s3-explr-empty-message",children:Ni?"Đ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"})})}):Ti.getRowModel().rows.map(D=>l.jsx(Ze,{className:"h-12 s3-explr-row",children:D.getVisibleCells().map(I=>l.jsx(Ie,{className:"align-middle s3-explr-cell",children:sr(I.column.columnDef.cell,I.getContext())},I.id))},D.id))})]})}),c&&Zn!==0&&l.jsx(l.Fragment,{children:l.jsx(Ar,{children:l.jsxs(_r,{children:[l.jsx(Fr,{onClick:()=>Jn(D=>Math.max(D-1,1)),"aria-disabled":De===1,className:"cursor-pointer aria-disabled:pointer-events-none"}),Array.from({length:Math.ceil(Zn/20)},(D,I)=>{const V=I+1,G=Math.ceil(Zn/20);return G>7&&!(V===1||V===G||V>=De-1&&V<=De+1)?V===De-2&&De>4||V===De+2&&De<G-3?l.jsx(Dr,{className:"pointer-events-none",children:"..."},I):null:l.jsx(Ye,{className:"cursor-pointer",children:l.jsx(pn,{isActive:De===V,onClick:()=>Jn(V),className:`${De===V?"bg-blue-500 text-white":"bg-white text-black"} hover:bg-blue-100`,children:V})},I)}),l.jsx(Ye,{children:l.jsx(Or,{onClick:()=>Jn(D=>Math.min(D+1,Math.ceil(Zn/20))),"aria-disabled":De===Math.ceil(Zn/20),className:"cursor-pointer aria-disabled:pointer-events-none"})})]})})}),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:[g.size," ",(g.size===1,"tập tin")," đã chọn"]}),l.jsx(ie,{variant:"default",onClick:()=>o(qx()),disabled:g.size===0,className:"s3-explr-ok-btn",children:"OK"})]}),!r&&l.jsx(eu,{})]})});var Gn=e=>e.type==="checkbox",Xt=e=>e instanceof Date,_e=e=>e==null;const cd=e=>typeof e=="object";var he=e=>!_e(e)&&!Array.isArray(e)&&cd(e)&&!Xt(e),mx=e=>he(e)&&e.target?Gn(e.target)?e.target.checked:e.target.value:e,vx=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,yx=(e,t)=>e.has(vx(t)),wx=e=>{const t=e.constructor&&e.constructor.prototype;return he(t)&&t.hasOwnProperty("isPrototypeOf")},vi=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function We(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(!(vi&&(e instanceof Blob||r))&&(n||he(e)))if(t=n?[]:{},!n&&!wx(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=We(e[o]));else return e;return t}var lo=e=>Array.isArray(e)?e.filter(Boolean):[],pe=e=>e===void 0,W=(e,t,n)=>{if(!t||!he(e))return n;const r=lo(t.split(/[,[\].]+?/)).reduce((o,s)=>_e(o)?o:o[s],e);return pe(r)||r===e?pe(e[t])?n:e[t]:r},ut=e=>typeof e=="boolean",yi=e=>/^\w*$/.test(e),ud=e=>lo(e.replace(/["|']|\]/g,"").split(/\.|\[/)),fe=(e,t,n)=>{let r=-1;const o=yi(t)?[t]:ud(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 dd={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},tt={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Et={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};P.createContext(null);var bx=(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]!==tt.all&&(t._proxyFormState[i]=!r||tt.all),e[i]}});return o},ke=e=>he(e)&&!Object.keys(e).length,xx=(e,t,n,r)=>{n(e);const{name:o,...s}=e;return ke(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(i=>t[i]===tt.all)},co=e=>Array.isArray(e)?e:[e];function Cx(e){const t=P.useRef(e);t.current=e,P.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}var dt=e=>typeof e=="string",Sx=(e,t,n,r,o)=>dt(e)?(r&&t.watch.add(e),W(n,e,o)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),W(n,s))):(r&&(t.watchAll=!0),n),Ex=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},fd=e=>({isOnSubmit:!e||e===tt.onSubmit,isOnBlur:e===tt.onBlur,isOnChange:e===tt.onChange,isOnAll:e===tt.all,isOnTouch:e===tt.onTouched}),pd=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const qn=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const s=W(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(qn(a,t))break}else if(he(a)&&qn(a,t))break}}};var Nx=(e,t,n)=>{const r=co(W(e,n));return fe(r,"root",t[n]),fe(e,n,r),e},wi=e=>e.type==="file",ft=e=>typeof e=="function",uo=e=>{if(!vi)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},fo=e=>dt(e),bi=e=>e.type==="radio",po=e=>e instanceof RegExp;const gd={value:!1,isValid:!1},hd={value:!0,isValid:!0};var md=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&&!pe(e[0].attributes.value)?pe(e[0].value)||e[0].value===""?hd:{value:e[0].value,isValid:!0}:hd:gd}return gd};const vd={isValid:!1,value:null};var yd=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,vd):vd;function wd(e,t,n="validate"){if(fo(e)||Array.isArray(e)&&e.every(fo)||ut(e)&&!e)return{type:n,message:fo(e)?e:"",ref:t}}var En=e=>he(e)&&!po(e)?e:{value:e,message:""},bd=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=W(t,v);if(!y||w)return{};const S=i?i[0]:s,E=$=>{r&&S.reportValidity&&(S.setCustomValidity(ut($)?"":$||""),S.reportValidity())},x={},A=bi(s),F=Gn(s),O=A||F,k=(h||wi(s))&&pe(s.value)&&pe(b)||uo(s)&&s.value===""||b===""||Array.isArray(b)&&!b.length,M=Ex.bind(null,v,n,x),q=($,U,L,X=Et.maxLength,K=Et.minLength)=>{const te=$?U:L;x[v]={type:$?X:K,message:te,ref:s,...M($?X:K,te)}};if(o?!Array.isArray(b)||!b.length:a&&(!O&&(k||_e(b))||ut(b)&&!b||F&&!md(i).isValid||A&&!yd(i).isValid)){const{value:$,message:U}=fo(a)?{value:!!a,message:a}:En(a);if($&&(x[v]={type:Et.required,message:U,ref:S,...M(Et.required,U)},!n))return E(U),x}if(!k&&(!_e(f)||!_e(g))){let $,U;const L=En(g),X=En(f);if(!_e(b)&&!isNaN(b)){const K=s.valueAsNumber||b&&+b;_e(L.value)||($=K>L.value),_e(X.value)||(U=K<X.value)}else{const K=s.valueAsDate||new Date(b),te=le=>new Date(new Date().toDateString()+" "+le),H=s.type=="time",j=s.type=="week";dt(L.value)&&b&&($=H?te(b)>te(L.value):j?b>L.value:K>new Date(L.value)),dt(X.value)&&b&&(U=H?te(b)<te(X.value):j?b<X.value:K<new Date(X.value))}if(($||U)&&(q(!!$,L.message,X.message,Et.max,Et.min),!n))return E(x[v].message),x}if((u||c)&&!k&&(dt(b)||o&&Array.isArray(b))){const $=En(u),U=En(c),L=!_e($.value)&&b.length>+$.value,X=!_e(U.value)&&b.length<+U.value;if((L||X)&&(q(L,$.message,U.message),!n))return E(x[v].message),x}if(m&&!k&&dt(b)){const{value:$,message:U}=En(m);if(po($)&&!b.match($)&&(x[v]={type:Et.pattern,message:U,ref:s,...M(Et.pattern,U)},!n))return E(U),x}if(p){if(ft(p)){const $=await p(b,t),U=wd($,S);if(U&&(x[v]={...U,...M(Et.validate,U.message)},!n))return E(U.message),x}else if(he(p)){let $={};for(const U in p){if(!ke($)&&!n)break;const L=wd(await p[U](b,t),S,U);L&&($={...L,...M(U,L.message)},E(L.message),n&&(x[v]=$))}if(!ke($)&&(x[v]={ref:S,...$},!n))return x}}return E(!0),x};function Tx(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=pe(e)?r++:e[t[r++]];return e}function Px(e){for(const t in e)if(e.hasOwnProperty(t)&&!pe(e[t]))return!1;return!0}function be(e,t){const n=Array.isArray(t)?t:yi(t)?[t]:ud(t),r=n.length===1?e:Tx(e,n),o=n.length-1,s=n[o];return r&&delete r[s],o!==0&&(he(r)&&ke(r)||Array.isArray(r)&&Px(r))&&be(e,n.slice(0,-1)),e}var xi=()=>{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=[]}}},Ci=e=>_e(e)||!cd(e);function Rt(e,t){if(Ci(e)||Ci(t))return e===t;if(Xt(e)&&Xt(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(Xt(s)&&Xt(i)||he(s)&&he(i)||Array.isArray(s)&&Array.isArray(i)?!Rt(s,i):s!==i)return!1}}return!0}var xd=e=>e.type==="select-multiple",Ax=e=>bi(e)||Gn(e),Si=e=>uo(e)&&e.isConnected,Cd=e=>{for(const t in e)if(ft(e[t]))return!0;return!1};function go(e,t={}){const n=Array.isArray(e);if(he(e)||n)for(const r in e)Array.isArray(e[r])||he(e[r])&&!Cd(e[r])?(t[r]=Array.isArray(e[r])?[]:{},go(e[r],t[r])):_e(e[r])||(t[r]=!0);return t}function Sd(e,t,n){const r=Array.isArray(e);if(he(e)||r)for(const o in e)Array.isArray(e[o])||he(e[o])&&!Cd(e[o])?pe(t)||Ci(n[o])?n[o]=Array.isArray(e[o])?go(e[o],[]):{...go(e[o])}:Sd(e[o],_e(t)?{}:t[o],n[o]):n[o]=!Rt(e[o],t[o]);return n}var Kn=(e,t)=>Sd(e,t,go(t)),Ed=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>pe(e)?e:t?e===""?NaN:e&&+e:n&&dt(e)?new Date(e):r?r(e):e;function Ei(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return wi(t)?t.files:bi(t)?yd(e.refs).value:xd(t)?[...t.selectedOptions].map(({value:n})=>n):Gn(t)?md(e.refs).value:Ed(pe(t.value)?e.ref.value:t.value,e)}var _x=(e,t,n,r)=>{const o={};for(const s of e){const i=W(t,s);i&&fe(o,s,i._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},Xn=e=>pe(e)?e:po(e)?e.source:he(e)?po(e.value)?e.value.source:e.value:e;const Nd="AsyncFunction";var Fx=e=>!!e&&!!e.validate&&!!(ft(e.validate)&&e.validate.constructor.name===Nd||he(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Nd)),Ox=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Td(e,t,n){const r=W(e,n);if(r||yi(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const s=o.join("."),i=W(t,s),a=W(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 Dx=(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)=>!lo(W(e,t)).length&&be(e,t);const Ix={mode:tt.onSubmit,reValidateMode:tt.onChange,shouldFocusError:!0};function kx(e={}){let t={...Ix,...e},n={submitCount:0,isDirty:!1,isLoading:ft(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)?We(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:We(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:xi(),array:xi(),state:xi()},m=fd(t.mode),p=fd(t.reValidateMode),v=t.criteriaMode===tt.all,h=C=>N=>{clearTimeout(c),c=setTimeout(C,N)},y=async C=>{if(!t.disabled&&(f.isValid||C)){const N=t.resolver?ke((await O()).errors):await M(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(_=>{_&&(N?fe(n.validatingFields,_,N):be(n.validatingFields,_))}),g.state.next({validatingFields:n.validatingFields,isValidating:!ke(n.validatingFields)}))},b=(C,N=[],_,z,B=!0,R=!0)=>{if(z&&_&&!t.disabled){if(i.action=!0,R&&Array.isArray(W(r,C))){const J=_(W(r,C),z.argA,z.argB);B&&fe(r,C,J)}if(R&&Array.isArray(W(n.errors,C))){const J=_(W(n.errors,C),z.argA,z.argB);B&&fe(n.errors,C,J),Mx(n.errors,C)}if(f.touchedFields&&R&&Array.isArray(W(n.touchedFields,C))){const J=_(W(n.touchedFields,C),z.argA,z.argB);B&&fe(n.touchedFields,C,J)}f.dirtyFields&&(n.dirtyFields=Kn(o,s)),g.state.next({name:C,isDirty:$(C,N),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else fe(s,C,N)},S=(C,N)=>{fe(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,_,z)=>{const B=W(r,C);if(B){const R=W(s,C,pe(_)?W(o,C):_);pe(R)||z&&z.defaultChecked||N?fe(s,C,N?R:Ei(B._f)):X(C,R),i.mount&&y()}},A=(C,N,_,z,B)=>{let R=!1,J=!1;const ne={name:C};if(!t.disabled){const me=!!(W(r,C)&&W(r,C)._f&&W(r,C)._f.disabled);if(!_||z){f.isDirty&&(J=n.isDirty,n.isDirty=ne.isDirty=$(),R=J!==ne.isDirty);const Ce=me||Rt(W(o,C),N);J=!!(!me&&W(n.dirtyFields,C)),Ce||me?be(n.dirtyFields,C):fe(n.dirtyFields,C,!0),ne.dirtyFields=n.dirtyFields,R=R||f.dirtyFields&&J!==!Ce}if(_){const Ce=W(n.touchedFields,C);Ce||(fe(n.touchedFields,C,_),ne.touchedFields=n.touchedFields,R=R||f.touchedFields&&Ce!==_)}R&&B&&g.state.next(ne)}return R?ne:{}},F=(C,N,_,z)=>{const B=W(n.errors,C),R=f.isValid&&ut(N)&&n.isValid!==N;if(t.delayError&&_?(u=h(()=>S(C,_)),u(t.delayError)):(clearTimeout(c),u=null,_?fe(n.errors,C,_):be(n.errors,C)),(_?!Rt(B,_):B)||!ke(z)||R){const J={...z,...R&&ut(N)?{isValid:N}:{},errors:n.errors,name:C};n={...n,...J},g.state.next(J)}},O=async C=>{w(C,!0);const N=await t.resolver(s,t.context,_x(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 _ of C){const z=W(N,_);z?fe(n.errors,_,z):be(n.errors,_)}else n.errors=N;return N},M=async(C,N,_={valid:!0})=>{for(const z in C){const B=C[z];if(B){const{_f:R,...J}=B;if(R){const ne=a.array.has(R.name),me=B._f&&Fx(B._f);me&&f.validatingFields&&w([z],!0);const Ce=await bd(B,s,v,t.shouldUseNativeValidation&&!N,ne);if(me&&f.validatingFields&&w([z]),Ce[R.name]&&(_.valid=!1,N))break;!N&&(W(Ce,R.name)?ne?Nx(n.errors,Ce,R.name):fe(n.errors,R.name,Ce[R.name]):be(n.errors,R.name))}!ke(J)&&await M(J,N,_)}}return _.valid},q=()=>{for(const C of a.unMount){const N=W(r,C);N&&(N._f.refs?N._f.refs.every(_=>!Si(_)):!Si(N._f.ref))&&Se(C)}a.unMount=new Set},$=(C,N)=>!t.disabled&&(C&&N&&fe(s,C,N),!Rt(ce(),o)),U=(C,N,_)=>Sx(C,a,{...i.mount?s:pe(N)?o:dt(C)?{[C]:N}:N},_,N),L=C=>lo(W(i.mount?s:o,C,t.shouldUnregister?W(o,C,[]):[])),X=(C,N,_={})=>{const z=W(r,C);let B=N;if(z){const R=z._f;R&&(!R.disabled&&fe(s,C,Ed(N,R)),B=uo(R.ref)&&_e(N)?"":N,xd(R.ref)?[...R.ref.options].forEach(J=>J.selected=B.includes(J.value)):R.refs?Gn(R.ref)?R.refs.length>1?R.refs.forEach(J=>(!J.defaultChecked||!J.disabled)&&(J.checked=Array.isArray(B)?!!B.find(ne=>ne===J.value):B===J.value)):R.refs[0]&&(R.refs[0].checked=!!B):R.refs.forEach(J=>J.checked=J.value===B):wi(R.ref)?R.ref.value="":(R.ref.value=B,R.ref.type||g.values.next({name:C,values:{...s}})))}(_.shouldDirty||_.shouldTouch)&&A(C,B,_.shouldTouch,_.shouldDirty,!0),_.shouldValidate&&le(C)},K=(C,N,_)=>{for(const z in N){const B=N[z],R=`${C}.${z}`,J=W(r,R);(a.array.has(C)||he(B)||J&&!J._f)&&!Xt(B)?K(R,B,_):X(R,B,_)}},te=(C,N,_={})=>{const z=W(r,C),B=a.array.has(C),R=We(N);fe(s,C,R),B?(g.array.next({name:C,values:{...s}}),(f.isDirty||f.dirtyFields)&&_.shouldDirty&&g.state.next({name:C,dirtyFields:Kn(o,s),isDirty:$(C,R)})):z&&!z._f&&!_e(R)?K(C,R,_):X(C,R,_),pd(C,a)&&g.state.next({...n}),g.values.next({name:i.mount?C:void 0,values:{...s}})},H=async C=>{i.mount=!0;const N=C.target;let _=N.name,z=!0;const B=W(r,_),R=()=>N.type?Ei(B._f):mx(C),J=ne=>{z=Number.isNaN(ne)||Xt(ne)&&isNaN(ne.getTime())||Rt(ne,W(s,_,ne))};if(B){let ne,me;const Ce=R(),gt=C.type===dd.BLUR||C.type===dd.FOCUS_OUT,ho=!Ox(B._f)&&!t.resolver&&!W(n.errors,_)&&!B._f.deps||Dx(gt,W(n.touchedFields,_),n.isSubmitted,p,m),Tn=pd(_,a,gt);fe(s,_,Ce),gt?(B._f.onBlur&&B._f.onBlur(C),u&&u(0)):B._f.onChange&&B._f.onChange(C);const De=A(_,Ce,gt,!1),Jn=!ke(De)||Tn;if(!gt&&g.values.next({name:_,type:C.type,values:{...s}}),ho)return f.isValid&&(t.mode==="onBlur"?gt&&y():y()),Jn&&g.state.next({name:_,...Tn?{}:De});if(!gt&&Tn&&g.state.next({...n}),t.resolver){const{errors:Yn}=await O([_]);if(J(Ce),z){const mo=Td(n.errors,r,_),ue=Td(Yn,r,mo.name||_);ne=ue.error,_=ue.name,me=ke(Yn)}}else w([_],!0),ne=(await bd(B,s,v,t.shouldUseNativeValidation))[_],w([_]),J(Ce),z&&(ne?me=!1:f.isValid&&(me=await M(r,!0)));z&&(B._f.deps&&le(B._f.deps),F(_,me,ne,De))}},j=(C,N)=>{if(W(n.errors,N)&&C.focus)return C.focus(),1},le=async(C,N={})=>{let _,z;const B=co(C);if(t.resolver){const R=await k(pe(C)?C:B);_=ke(R),z=C?!B.some(J=>W(R,J)):_}else C?(z=(await Promise.all(B.map(async R=>{const J=W(r,R);return await M(J&&J._f?{[R]:J}:J)}))).every(Boolean),!(!z&&!n.isValid)&&y()):z=_=await M(r);return g.state.next({...!dt(C)||f.isValid&&_!==n.isValid?{}:{name:C},...t.resolver||!C?{isValid:_}:{},errors:n.errors}),N.shouldFocus&&!z&&qn(r,j,C?B:a.mount),z},ce=C=>{const N={...i.mount?s:o};return pe(C)?N:dt(C)?W(N,C):C.map(_=>W(N,_))},xe=(C,N)=>({invalid:!!W((N||n).errors,C),isDirty:!!W((N||n).dirtyFields,C),error:W((N||n).errors,C),isValidating:!!W(n.validatingFields,C),isTouched:!!W((N||n).touchedFields,C)}),Ee=C=>{C&&co(C).forEach(N=>be(n.errors,N)),g.state.next({errors:C?n.errors:{}})},Fe=(C,N,_)=>{const z=(W(r,C,{_f:{}})._f||{}).ref,B=W(n.errors,C)||{},{ref:R,message:J,type:ne,...me}=B;fe(n.errors,C,{...me,...N,ref:z}),g.state.next({name:C,errors:n.errors,isValid:!1}),_&&_.shouldFocus&&z&&z.focus&&z.focus()},Vt=(C,N)=>ft(C)?g.values.subscribe({next:_=>C(U(void 0,N),_)}):U(C,N,!0),Se=(C,N={})=>{for(const _ of C?co(C):a.mount)a.mount.delete(_),a.array.delete(_),N.keepValue||(be(r,_),be(s,_)),!N.keepError&&be(n.errors,_),!N.keepDirty&&be(n.dirtyFields,_),!N.keepTouched&&be(n.touchedFields,_),!N.keepIsValidating&&be(n.validatingFields,_),!t.shouldUnregister&&!N.keepDefaultValue&&be(o,_);g.values.next({values:{...s}}),g.state.next({...n,...N.keepDirty?{isDirty:$()}:{}}),!N.keepIsValid&&y()},Ne=({disabled:C,name:N,field:_,fields:z,value:B})=>{if(ut(C)&&i.mount||C){const R=C?void 0:pe(B)?Ei(_?_._f:W(z,N)._f):B;(C||!C&&!pe(R))&&fe(s,N,R),A(N,R,!1,!1,!0)}},nt=(C,N={})=>{let _=W(r,C);const z=ut(N.disabled)||ut(t.disabled);return fe(r,C,{..._||{},_f:{..._&&_._f?_._f:{ref:{name:C}},name:C,mount:!0,...N}}),a.mount.add(C),_?Ne({field:_,disabled:ut(N.disabled)?N.disabled:t.disabled,name:C,value:N.value}):x(C,!0,N.value),{...z?{disabled:N.disabled||t.disabled}:{},...t.progressive?{required:!!N.required,min:Xn(N.min),max:Xn(N.max),minLength:Xn(N.minLength),maxLength:Xn(N.maxLength),pattern:Xn(N.pattern)}:{},name:C,onChange:H,onBlur:H,ref:B=>{if(B){nt(C,N),_=W(r,C);const R=pe(B.value)&&B.querySelectorAll&&B.querySelectorAll("input,select,textarea")[0]||B,J=Ax(R),ne=_._f.refs||[];if(J?ne.find(me=>me===R):R===_._f.ref)return;fe(r,C,{_f:{..._._f,...J?{refs:[...ne.filter(Si),R,...Array.isArray(W(o,C))?[{}]:[]],ref:{type:R.type,name:C}}:{ref:R}}}),x(C,!1,void 0,R)}else _=W(r,C,{}),_._f&&(_._f.mount=!1),(t.shouldUnregister||N.shouldUnregister)&&!(yx(a.array,C)&&i.action)&&a.unMount.add(C)}}},Oe=()=>t.shouldFocusError&&qn(r,j,a.mount),Jt=C=>{ut(C)&&(g.state.next({disabled:C}),qn(r,(N,_)=>{const z=W(r,_);z&&(N.disabled=z._f.disabled||C,Array.isArray(z._f.refs)&&z._f.refs.forEach(B=>{B.disabled=z._f.disabled||C}))},0,!1))},Bt=(C,N)=>async _=>{let z;if(_&&(_.preventDefault&&_.preventDefault(),_.persist&&_.persist()),t.disabled){N&&await N({...n.errors},_);return}let B=We(s);if(g.state.next({isSubmitting:!0}),t.resolver){const{errors:R,values:J}=await O();n.errors=R,B=J}else await M(r);if(be(n.errors,"root"),ke(n.errors)){g.state.next({errors:{}});try{await C(B,_)}catch(R){z=R}}else N&&await N({...n.errors},_),Oe(),setTimeout(Oe);if(g.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ke(n.errors)&&!z,submitCount:n.submitCount+1,errors:n.errors}),z)throw z},rt=(C,N={})=>{W(r,C)&&(pe(N.defaultValue)?te(C,We(W(o,C))):(te(C,N.defaultValue),fe(o,C,We(N.defaultValue))),N.keepTouched||be(n.touchedFields,C),N.keepDirty||(be(n.dirtyFields,C),n.isDirty=N.defaultValue?$(C,We(W(o,C))):$()),N.keepError||(be(n.errors,C),f.isValid&&y()),g.state.next({...n}))},He=(C,N={})=>{const _=C?We(C):o,z=We(_),B=ke(C),R=B?o:z;if(N.keepDefaultValues||(o=_),!N.keepValues){if(N.keepDirtyValues){const J=new Set([...a.mount,...Object.keys(Kn(o,s))]);for(const ne of Array.from(J))W(n.dirtyFields,ne)?fe(R,ne,W(s,ne)):te(ne,W(R,ne))}else{if(vi&&pe(C))for(const J of a.mount){const ne=W(r,J);if(ne&&ne._f){const me=Array.isArray(ne._f.refs)?ne._f.refs[0]:ne._f.ref;if(uo(me)){const Ce=me.closest("form");if(Ce){Ce.reset();break}}}}r={}}s=t.shouldUnregister?N.keepDefaultValues?We(o):{}:We(R),g.array.next({values:{...R}}),g.values.next({values:{...R}})}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&&!Rt(C,o)),isSubmitted:N.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:B?{}:N.keepDirtyValues?N.keepDefaultValues&&s?Kn(o,s):n.dirtyFields:N.keepDefaultValues&&C?Kn(o,C):N.keepDirty?n.dirtyFields:{},touchedFields:N.keepTouched?n.touchedFields:{},errors:N.keepErrors?n.errors:{},isSubmitSuccessful:N.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Ht=(C,N)=>He(ft(C)?C(s):C,N);return{control:{register:nt,unregister:Se,getFieldState:xe,handleSubmit:Bt,setError:Fe,_executeSchema:O,_getWatch:U,_getDirty:$,_updateValid:y,_removeUnmounted:q,_updateFieldArray:b,_updateDisabledField:Ne,_getFieldArray:L,_reset:He,_resetDefaultValues:()=>ft(t.defaultValues)&&t.defaultValues().then(C=>{Ht(C,t.resetOptions),g.state.next({isLoading:!1})}),_updateFormState:C=>{n={...n,...C}},_disableForm:Jt,_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:le,register:nt,handleSubmit:Bt,watch:Vt,setValue:te,getValues:ce,reset:Ht,resetField:rt,clearErrors:Ee,unregister:Se,setError:Fe,setFocus:(C,N={})=>{const _=W(r,C),z=_&&_._f;if(z){const B=z.refs?z.refs[0]:z.ref;B.focus&&(B.focus(),N.shouldSelect&&ft(B.select)&&B.select())}},getFieldState:xe}}function $x(e={}){const t=P.useRef(),n=P.useRef(),[r,o]=P.useState({isDirty:!1,isValidating:!1,isLoading:ft(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:ft(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...kx(e),formState:r});const s=t.current.control;return s._options=e,Cx({subject:s._subjects.state,next:i=>{xx(i,s._proxyFormState,s._updateFormState)&&o({...s._formState})}}),P.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),P.useEffect(()=>{if(s._proxyFormState.isDirty){const i=s._getDirty();i!==r.isDirty&&s._subjects.state.next({isDirty:i})}},[s,r.isDirty]),P.useEffect(()=>{e.values&&!Rt(e.values,n.current)?(s._reset(e.values,s._options.resetOptions),n.current=e.values,o(i=>({...i}))):s._resetDefaultValues()},[e.values,s]),P.useEffect(()=>{e.errors&&s._setErrors(e.errors)},[e.errors,s]),P.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()}),P.useEffect(()=>{e.shouldUnregister&&s._subjects.values.next({values:s._getWatch()})},[e.shouldUnregister,s]),P.useMemo(()=>({...t.current,formState:bx(r,s)}),[r,s])}const Pd=({className:e,children:t,content:n,side:r})=>{const[o,s]=P.useState(!1);return l.jsx(bn,{delayDuration:0,children:l.jsxs(xn,{open:o,children:[l.jsx(Cn,{asChild:!0,children:l.jsx("button",{type:"button",className:ee("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(Kt,{side:r,className:n?"":"hidden",children:l.jsx("span",{className:"inline-block",children:n})})]})})},Lx=(e,t)=>{const[n,r]=P.useState(e);return P.useEffect(()=>{const o=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(o)}},[e,t]),n},Rx=({apiBaseUrl:e="http://localhost:3002"})=>{var A,F;const[t,n]=P.useState([]),[r,o]=P.useState(!1),[s,i]=P.useState([]),[a,u]=P.useState(1),[c,f]=P.useState(1),[g,m]=P.useState(null),[p,v]=P.useState(""),h=Lx(p,500),y=O=>{const k=O.match(/\d{6}/);if(!k)return{month:"",year:""};const M=k[0],q=M.substring(0,2),$=M.substring(2);return{month:q,year:$}},w=O=>O.map(M=>{let q=(M==null?void 0:M.month)||"",$=(M==null?void 0:M.year)||"";if((!q||!$)&&(M!=null&&M.file_name)){const U=y(M.file_name);q=q||U.month,$=$||U.year}return{id:M==null?void 0:M.id,prefix:(M==null?void 0:M.prefix)||"",model:(M==null?void 0:M.model)||"",fileName:(M==null?void 0:M.file_name)||"",code:(M==null?void 0:M.stock_id)||"",month:q,year:$,content:(M==null?void 0:M.text_summary)||"",status:(M==null?void 0:M.status)||"",note:(M==null?void 0:M.note)||"",lastUpdate:M==null?void 0:M.updated_at,stock_id:M==null?void 0:M.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 M=await se.get(`${e}/api/latest-summaries`,{params:{page:O,limit:k,search:p}});(M==null?void 0:M.status)===200?b(M.data):console.error(M)}catch(M){console.error("Error fetching data:",M)}finally{m(null),o(!1)}};P.useEffect(()=>{h&&u(1),S(a)},[a,h]);const E=P.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 M=k.original.month,q=k.original.year;return l.jsx("span",{className:"flex flex-col",children:`${M.toString().padStart(2,"0")}/${q}`})}},{id:"content",header:"Nội dung",accessorKey:"content",cell:({row:k})=>{const M=k.getValue("content");return l.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[30dvw]",children:M})}},{id:"status",header:"Trạng thái",accessorKey:"status",cell:({row:k})=>{const q=k.original.status!=="unpublish";return l.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0 text-[10px] font-bold ${q?"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:q?"PUBLISHED":"UNPUBLISHED"})}},{id:"note",header:"Ghi chú",accessorKey:"note",cell:({row:k})=>l.jsx(Pd,{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 M=new Date(k.original.lastUpdate),q=M.getDate(),$=M.getMonth()+1,U=`ngày ${q} tháng ${$}`;return l.jsx("span",{className:"flex flex-col",children:U})}},{accessorKey:"actions",header:()=>l.jsx("div",{className:"font-medium text-right",children:"Hành động"}),cell:({row:k})=>{const[M,q]=P.useState(!1),[$,U]=P.useState(!1),[L,X]=P.useState(!1),{handleSubmit:K,register:te,reset:H}=$x(),j=k.original.id,le=k.getValue("status"),ce=k.getValue("content"),[xe,Ee]=P.useState(!1),Fe=async()=>{try{Ee(!0);const Se=le==="unpublish"?"published":"unpublish",Ne=await se.patch(`${e}/api/toggle-publish/${j}`,{id:j,typeAction:"update",status:le,idInput:j,stock_id:k.original.stock_id,prefix:k.original.prefix,model:k.original.model,summary_result:k.original.content,note:k.original.note});Ne.status===200?n(nt=>nt.map(Oe=>Oe.id===j?{...Oe,status:Se}:Oe)):console.error("Failed to toggle publish status:",Ne)}catch(Se){console.error("Error toggling publish status:",Se)}finally{Ee(!1)}},Vt=async Se=>{q(!0);try{const Ne=await se.patch(`${e}/api/update-summary`,{note:Se.note,text_summary:Se.content,id:j});Ne.status===200?(await S(a),U(!1)):console.error("Failed to update summary:",Ne)}catch(Ne){console.error("Error updating summary:",Ne)}return q(!1)};return l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsx(ie,{variant:"outline",size:"sm",onClick:()=>X(!0),className:"px-2 py-0.5 h-7",children:l.jsx(ug,{className:"h-4 w-4"})}),l.jsx(Mt,{open:L,onOpenChange:X,children:l.jsxs(yt,{className:"max-w-3xl max-h-[80vh]",children:[l.jsx(wt,{children:l.jsx(bt,{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:ce})})]})}),l.jsxs(Mt,{open:$,onOpenChange:Se=>{U(Se),Se?H({content:k.original.content,note:k.original.note}):H()},children:[l.jsx(Pr,{asChild:!0,children:l.jsx(ie,{variant:"outline",size:"sm",onClick:()=>U(!0),className:"px-2 py-0.5 h-7",children:"Sửa"})}),l.jsx(yt,{className:"rounded-lg sm:px-3 h-[calc(100dvh-200px)] min-w-[calc(100dvw-112px)]",children:l.jsxs(wt,{className:"flex flex-col gap-3",children:[l.jsx(bt,{className:"max-sm:hidden text-center",children:"Sửa summary"}),l.jsxs("form",{className:"flex flex-col gap-3 h-full justify-between",onSubmit:K(Vt),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($n,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:k.original.answer||"",rows:10,...te("content")})]}),l.jsxs("div",{className:"flex flex-col items-start",children:[l.jsx("span",{children:"Ghi chú:"}),l.jsx($n,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:k.original.note||"",rows:1,...te("note")})]})]}),l.jsx("div",{className:"flex justify-end",children:l.jsx(ie,{disabled:M,type:"submit",variant:"default",children:M?l.jsx(ve,{className:"h-4 w-4 animate-spin"}):"Ok"})})]})]})})]}),l.jsx(ie,{variant:"outline",size:"sm",onClick:Fe,disabled:xe,className:"w-[70px] px-2 py-0.5 h-7",children:xe?l.jsx(ve,{className:"h-4 w-4 animate-spin"}):le==="unpublish"?"Publish":"Unpublish"})]})}}],[]),x=Ui({data:t,columns:E,state:{columnFilters:s},enableRowSelection:!0,onColumnFiltersChange:i,getFilteredRowModel:_f(),getCoreRowModel:zi()});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(It,{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(Qo,{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(Ir,{className:"s3-explr-table-header",children:x.getHeaderGroups().map(O=>l.jsx(Ze,{className:"hover:bg-transparent s3-explr-header-row",children:O.headers.map(k=>l.jsx(it,{className:"s3-explr-header-cell",children:k.isPlaceholder?null:sr(k.column.columnDef.header,k.getContext())},k.id))},O.id))}),l.jsx(kr,{className:"s3-explr-table-body",children:r?l.jsx(Ze,{children:l.jsx(Ie,{colSpan:E.length,className:"h-24 text-center",children:"Đang tải dữ liệu..."})}):(A=x.getRowModel().rows)!=null&&A.length?(F=x.getRowModel().rows)==null?void 0:F.map(O=>l.jsx(Ze,{className:"h-12 s3-explr-row",children:O.getVisibleCells().map(k=>l.jsx(Ie,{className:"align-middle s3-explr-cell",children:sr(k.column.columnDef.cell,k.getContext())},k.id))},O.id)):l.jsx(Ze,{children:l.jsx(Ie,{colSpan:E.length,className:"h-24 text-center",children:"Không có kết quả."})})})]})}),l.jsx("div",{className:"mt-4",children:l.jsx(Ar,{children:l.jsxs(_r,{children:[l.jsx(Ye,{children:l.jsx(Fr,{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,M)=>l.jsxs(l.Fragment,{children:[k>0&&M[k-1]!==O-1&&l.jsx(Ye,{children:l.jsx(Dr,{})},O+"..."),l.jsx(Ye,{children:l.jsx(pn,{onClick:()=>u(O),isActive:a===O,className:`cursor-pointer ${r?"pointer-events-none":""}`,children:g===O?l.jsx(ve,{className:"h-4 w-4 animate-spin"}):O})},O)]})),l.jsx(Ye,{children:l.jsx(Or,{onClick:()=>u(O=>Math.min(c,O+1)),className:a===c||g!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})})]})},Ad=10,Vx=P.memo(({apiBaseUrl:e="http://localhost:3002"})=>{const[t,n]=P.useState(1),[r,o]=P.useState([]),[s,i]=P.useState({total:0,page:1,limit:Ad,totalPages:1}),[a,u]=P.useState(!0),[c,f]=P.useState(null),[g,m]=P.useState(new Set),{toast:p}=Gr(),[v,h]=P.useState(!1),y=async x=>{try{f(x);const A=await se.get(`${e}/api/jobs`,{params:{page:x.toString(),limit:Ad.toString()}});o(A.data.data),i(A.data.pagination)}catch{p({variant:"destructive",title:"Error",description:"Failed to fetch jobs. Please try again."})}finally{f(null),u(!1)}};P.useEffect(()=>{y(t)},[t,e]);const w=async x=>{m(A=>new Set(A).add(x.toString()));try{await se.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(A=>{const F=new Set(A);return F.delete(x.toString()),F})}},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 A=Math.floor(x/60),F=(x%60).toFixed(0);return`${A}m ${F}s`};return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[l.jsx(ig,{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(pg,{className:`h-4 w-4 ${v?"animate-spin":""}`})})]}),l.jsx("div",{className:"rounded-md border",children:l.jsxs(Mr,{children:[l.jsx(Ir,{children:l.jsxs(Ze,{children:[l.jsx(it,{children:"ID"}),l.jsx(it,{children:"Tên Công Việc"}),l.jsx(it,{children:"Thời Gian Bắt Đầu"}),l.jsx(it,{children:"Thời Gian Cập Nhật"}),l.jsx(it,{children:"Thời Gian Thực Thi"}),l.jsx(it,{children:"Trạng Thái"}),l.jsx(it,{children:"Thao Tác"})]})}),l.jsx(kr,{children:a&&r.length===0?l.jsx(Ze,{children:l.jsx(Ie,{colSpan:7,className:"text-center py-4",children:l.jsx(ve,{className:"w-6 h-6 animate-spin mx-auto"})})}):r.map(x=>{var A,F;return l.jsxs(Ze,{children:[l.jsx(Ie,{className:"!w-[100px]",children:x.id}),l.jsx(Ie,{className:"font-medium",children:(A=x.job_name)==null?void 0:A.replace("Upload file","Summary")}),l.jsx(Ie,{className:"!w-[200px]",children:S(x.created_at)}),l.jsx(Ie,{className:"!w-[200px]",children:S(x.updated_at)}),l.jsx(Ie,{className:"!w-[150px]",children:E(x.execution_time_seconds)}),l.jsx(Ie,{className:"!w-[200px]",children:l.jsx(Pd,{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]
|
|
152
|
+
${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":(F=x.status)==null?void 0:F.toUpperCase()})})}),l.jsx(Ie,{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(ve,{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(Ar,{children:l.jsxs(_r,{children:[l.jsx(Ye,{children:l.jsx(Fr,{onClick:()=>n(x=>Math.max(1,x-1)),className:t===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:s.totalPages},(x,A)=>A+1).filter(x=>x===1||x===s.totalPages||Math.abs(x-t)<=1).map((x,A,F)=>l.jsxs(l.Fragment,{children:[A>0&&F[A-1]!==x-1&&l.jsx(Ye,{children:l.jsx(Dr,{})},x+"..."),l.jsx(Ye,{children:l.jsx(pn,{onClick:()=>n(x),isActive:t===x,className:`cursor-pointer ${c!==null?"pointer-events-none":""}`,children:c===x?l.jsx(ve,{className:"h-4 w-4 animate-spin"}):x})},x)]})),l.jsx(Ye,{children:l.jsx(Or,{onClick:()=>n(x=>Math.min(s.totalPages,x+1)),className:t===s.totalPages||c!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})}),l.jsx(eu,{})]})});qe.Job=Vx,qe.S3Explorer=hx,qe.Summary=Rx,Object.defineProperty(qe,Symbol.toStringTag,{value:"Module"})});
|
|
148
153
|
//# sourceMappingURL=s3-explorer.umd.cjs.map
|