diff --git a/frontend-components/tables/src/components/Table/index.tsx b/frontend-components/tables/src/components/Table/index.tsx index 40b8bacdd7d..e948185ece6 100644 --- a/frontend-components/tables/src/components/Table/index.tsx +++ b/frontend-components/tables/src/components/Table/index.tsx @@ -159,8 +159,8 @@ export default function Table({ //@ts-ignore const getColumnWidth = (rows, accessor, headerText) => { - const maxWidth = 180; - const magicSpacing = 5; + const maxWidth = 200; + const magicSpacing = 12; const cellLength = Math.max( //@ts-ignore ...rows.map((row) => getCellWidth(row, accessor)), @@ -473,7 +473,7 @@ export default function Table({ {table.getHeaderGroups().map((headerGroup, idx) => ( diff --git a/openbb_terminal/core/plots/table.html b/openbb_terminal/core/plots/table.html index 78aad801e92..98161f92834 100644 --- a/openbb_terminal/core/plots/table.html +++ b/openbb_terminal/core/plots/table.html @@ -291,7 +291,7 @@ Add a component higher in the tree to provide a loading `),s.bookType=="fods"?l.push(""):l.push(""),l.join("")}}();function qw(e,t){if(t.bookType=="fods")return Yg(e,t);var r=kd(),n="",i=[],o=[];return n="mimetype",De(r,n,"application/vnd.oasis.opendocument.spreadsheet"),n="content.xml",De(r,n,Yg(e,t)),i.push([n,"text/xml"]),o.push([n,"ContentFile"]),n="styles.xml",De(r,n,C6(e,t)),i.push([n,"text/xml"]),o.push([n,"StylesFile"]),n="meta.xml",De(r,n,at+cw()),i.push([n,"text/xml"]),o.push([n,"MetadataFile"]),n="manifest.rdf",De(r,n,M3(o)),i.push([n,"application/rdf+xml"]),n="META-INF/manifest.xml",De(r,n,$3(i)),r}/*! sheetjs (C) 2013-present SheetJS -- http://sheetjs.com */function Xl(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function A6(e){return typeof TextEncoder<"u"?new TextEncoder().encode(e):yr(jr(e))}function R6(e,t){e:for(var r=0;r<=e.length-t.length;++r){for(var n=0;n>7,e[t+14]|=(n&127)<<1;for(var o=0;i>=1;++o,i/=256)e[t+o]=i&255;e[t+15]|=r>=0?0:128}function Wa(e,t){var r=t?t[0]:0,n=e[r]&127;e:if(e[r++]>=128&&(n|=(e[r]&127)<<7,e[r++]<128||(n|=(e[r]&127)<<14,e[r++]<128)||(n|=(e[r]&127)<<21,e[r++]<128)||(n+=(e[r]&127)*Math.pow(2,28),++r,e[r++]<128)||(n+=(e[r]&127)*Math.pow(2,35),++r,e[r++]<128)||(n+=(e[r]&127)*Math.pow(2,42),++r,e[r++]<128)))break e;return t&&(t[0]=r),n}function Le(e){var t=new Uint8Array(7);t[0]=e&127;var r=1;e:if(e>127){if(t[r-1]|=128,t[r]=e>>7&127,++r,e<=16383||(t[r-1]|=128,t[r]=e>>14&127,++r,e<=2097151)||(t[r-1]|=128,t[r]=e>>21&127,++r,e<=268435455)||(t[r-1]|=128,t[r]=e/256>>>21&127,++r,e<=34359738367)||(t[r-1]|=128,t[r]=e/65536>>>21&127,++r,e<=4398046511103))break e;t[r-1]|=128,t[r]=e/16777216>>>21&127,++r}return t.slice(0,r)}function so(e){var t=0,r=e[t]&127;e:if(e[t++]>=128){if(r|=(e[t]&127)<<7,e[t++]<128||(r|=(e[t]&127)<<14,e[t++]<128)||(r|=(e[t]&127)<<21,e[t++]<128))break e;r|=(e[t]&127)<<28}return r}function st(e){for(var t=[],r=[0];r[0]=128;);s=e.slice(l,r[0])}break;case 5:a=4,s=e.slice(r[0],r[0]+a),r[0]+=a;break;case 1:a=8,s=e.slice(r[0],r[0]+a),r[0]+=a;break;case 2:a=Wa(e,r),s=e.slice(r[0],r[0]+a),r[0]+=a;break;case 3:case 4:default:throw new Error("PB Type ".concat(o," for Field ").concat(i," at offset ").concat(n))}var u={data:s,type:o};t[i]==null?t[i]=[u]:t[i].push(u)}return t}function pt(e){var t=[];return e.forEach(function(r,n){r.forEach(function(i){i.data&&(t.push(Le(n*8+i.type)),i.type==2&&t.push(Le(i.data.length)),t.push(i.data))})}),Mn(t)}function mr(e){for(var t,r=[],n=[0];n[0]>>0>0),r.push(a)}return r}function bi(e){var t=[];return e.forEach(function(r){var n=[];n[1]=[{data:Le(r.id),type:0}],n[2]=[],r.merge!=null&&(n[3]=[{data:Le(+!!r.merge),type:0}]);var i=[];r.messages.forEach(function(a){i.push(a.data),a.meta[3]=[{type:0,data:Le(a.data.length)}],n[2].push({data:pt(a.meta),type:2})});var o=pt(n);t.push(Le(o.length)),t.push(o),i.forEach(function(a){return t.push(a)})}),Mn(t)}function F6(e,t){if(e!=0)throw new Error("Unexpected Snappy chunk type ".concat(e));for(var r=[0],n=Wa(t,r),i=[];r[0]>2;if(a<60)++a;else{var s=a-59;a=t[r[0]],s>1&&(a|=t[r[0]+1]<<8),s>2&&(a|=t[r[0]+2]<<16),s>3&&(a|=t[r[0]+3]<<24),a>>>=0,a++,r[0]+=s}i.push(t.slice(r[0],r[0]+a)),r[0]+=a;continue}else{var l=0,u=0;if(o==1?(u=(t[r[0]]>>2&7)+4,l=(t[r[0]++]&224)<<3,l|=t[r[0]++]):(u=(t[r[0]++]>>2)+1,o==2?(l=t[r[0]]|t[r[0]+1]<<8,r[0]+=2):(l=(t[r[0]]|t[r[0]+1]<<8|t[r[0]+2]<<16|t[r[0]+3]<<24)>>>0,r[0]+=4)),i=[Mn(i)],l==0)throw new Error("Invalid offset 0");if(l>i[0].length)throw new Error("Invalid offset beyond length");if(u>=l)for(i.push(i[0].slice(-l)),u-=l;u>=i[i.length-1].length;)i.push(i[i.length-1]),u-=i[i.length-1].length;i.push(i[0].slice(-l,-l+u))}}var c=Mn(i);if(c.length!=n)throw new Error("Unexpected length: ".concat(c.length," != ").concat(n));return c}function vr(e){for(var t=[],r=0;r>8&255]))):n<=16777216?(a+=4,t.push(new Uint8Array([248,n-1&255,n-1>>8&255,n-1>>16&255]))):n<=4294967296&&(a+=5,t.push(new Uint8Array([252,n-1&255,n-1>>8&255,n-1>>16&255,n-1>>>24&255]))),t.push(e.slice(r,r+n)),a+=n,i[0]=0,i[1]=a&255,i[2]=a>>8&255,i[3]=a>>16&255,r+=n}return Mn(t)}function Lc(e,t){var r=new Uint8Array(32),n=Xl(r),i=12,o=0;switch(r[0]=5,e.t){case"n":r[1]=2,O6(r,i,e.v),o|=1,i+=16;break;case"b":r[1]=6,n.setFloat64(i,e.v?1:0,!0),o|=2,i+=8;break;case"s":if(t.indexOf(e.v)==-1)throw new Error("Value ".concat(e.v," missing from SST!"));r[1]=3,n.setUint32(i,t.indexOf(e.v),!0),o|=8,i+=4;break;default:throw"unsupported cell type "+e.t}return n.setUint32(8,o,!0),r.slice(0,i)}function Bc(e,t){var r=new Uint8Array(32),n=Xl(r),i=12,o=0;switch(r[0]=3,e.t){case"n":r[2]=2,n.setFloat64(i,e.v,!0),o|=32,i+=8;break;case"b":r[2]=6,n.setFloat64(i,e.v?1:0,!0),o|=32,i+=8;break;case"s":if(t.indexOf(e.v)==-1)throw new Error("Value ".concat(e.v," missing from SST!"));r[2]=3,n.setUint32(i,t.indexOf(e.v),!0),o|=16,i+=4;break;default:throw"unsupported cell type "+e.t}return n.setUint32(4,o,!0),r.slice(0,i)}function un(e){var t=st(e);return Wa(t[1][0].data)}function D6(e,t,r){var n,i,o,a;if(!((n=e[6])!=null&&n[0])||!((i=e[7])!=null&&i[0]))throw"Mutation only works on post-BNC storages!";var s=((a=(o=e[8])==null?void 0:o[0])==null?void 0:a.data)&&so(e[8][0].data)>0||!1;if(s)throw"Math only works with normal offsets";for(var l=0,u=Xl(e[7][0].data),c=0,f=[],d=Xl(e[4][0].data),h=0,m=[],p=0;p1&&console.error("The Numbers writer currently writes only the first table");var n=er(r["!ref"]);n.s.r=n.s.c=0;var i=!1;n.e.c>9&&(i=!0,n.e.c=9),n.e.r>49&&(i=!0,n.e.r=49),i&&console.error("The Numbers writer is currently limited to ".concat(ot(n)));var o=Kl(r,{range:n,header:1}),a=["~Sh33tJ5~"];o.forEach(function(M){return M.forEach(function(N){typeof N=="string"&&a.push(N)})});var s={},l=[],u=Ve.read(t.numbers,{type:"base64"});u.FileIndex.map(function(M,N){return[M,u.FullPaths[N]]}).forEach(function(M){var N=M[0],F=M[1];if(N.type==2&&N.name.match(/\.iwa/)){var V=N.content,Y=vr(V),J=mr(Y);J.forEach(function(W){l.push(W.id),s[W.id]={deps:[],location:F,type:so(W.messages[0].meta[1][0].data)}})}}),l.sort(function(M,N){return M-N});var c=l.filter(function(M){return M>1}).map(function(M){return[M,Le(M)]});u.FileIndex.map(function(M,N){return[M,u.FullPaths[N]]}).forEach(function(M){var N=M[0];if(M[1],!!N.name.match(/\.iwa/)){var F=mr(vr(N.content));F.forEach(function(V){V.messages.forEach(function(Y){c.forEach(function(J){V.messages.some(function(W){return so(W.meta[1][0].data)!=11006&&R6(W.data,J[1])})&&s[J[0]].deps.push(V.id)})})})}});for(var f=Ve.find(u,s[1].location),d=mr(vr(f.content)),h,m=0;m-1,i=sw();qd(t=t||{});var o=kd(),a="",s=0;if(t.cellXfs=[],Vn(t.cellXfs,{},{revssf:{General:0}}),e.Props||(e.Props={}),a="docProps/core.xml",De(o,a,fw(e.Props,t)),i.coreprops.push(a),Be(t.rels,2,a,ke.CORE_PROPS),a="docProps/app.xml",!(e.Props&&e.Props.SheetNames))if(!e.Workbook||!e.Workbook.Sheets)e.Props.SheetNames=e.SheetNames;else{for(var l=[],u=0;u0&&(a="docProps/custom.xml",De(o,a,pw(e.Custprops)),i.custprops.push(a),Be(t.rels,4,a,ke.CUST_PROPS)),s=1;s<=e.SheetNames.length;++s){var c={"!id":{}},f=e.Sheets[e.SheetNames[s-1]],d=(f||{})["!type"]||"sheet";switch(d){case"chart":default:a="xl/worksheets/sheet"+s+"."+r,De(o,a,MD(s-1,a,t,e,c)),i.sheets.push(a),Be(t.wbrels,-1,"worksheets/sheet"+s+"."+r,ke.WS[0])}if(f){var h=f["!comments"],m=!1,p="";h&&h.length>0&&(p="xl/comments"+s+"."+r,De(o,p,UD(h,p)),i.comments.push(p),Be(c,-1,"../comments"+s+"."+r,ke.CMNT),m=!0),f["!legacy"]&&m&&De(o,"xl/drawings/vmlDrawing"+s+".vml",Dw(s,f["!comments"])),delete f["!comments"],delete f["!legacy"]}c["!id"].rId1&&De(o,uw(a),oo(c))}return t.Strings!=null&&t.Strings.length>0&&(a="xl/sharedStrings."+r,De(o,a,BD(t.Strings,a,t)),i.strs.push(a),Be(t.wbrels,-1,"sharedStrings."+r,ke.SST)),a="xl/workbook."+r,De(o,a,ND(e,a)),i.workbooks.push(a),Be(t.rels,1,a,ke.WB),a="xl/theme/theme1.xml",De(o,a,Ow(e.Themes,t)),i.themes.push(a),Be(t.wbrels,-1,"theme/theme1.xml",ke.THEME),a="xl/styles."+r,De(o,a,LD(e,a,t)),i.styles.push(a),Be(t.wbrels,-1,"styles."+r,ke.STY),e.vbaraw&&n&&(a="xl/vbaProject.bin",De(o,a,e.vbaraw),i.vba.push(a),Be(t.wbrels,-1,"vbaProject.bin",ke.VBA)),a="xl/metadata."+r,De(o,a,HD(a)),i.metadata.push(a),Be(t.wbrels,-1,"metadata."+r,ke.XLMETA),De(o,"[Content_Types].xml",lw(i,t)),De(o,"_rels/.rels",oo(t.rels)),De(o,"xl/_rels/workbook."+r+".rels",oo(t.wbrels)),delete t.revssf,delete t.ssf,o}function $6(e,t){Gi=1024,e&&!e.SSF&&(e.SSF=Xt(rt)),e&&e.SSF&&(Su(),Eu(e.SSF),t.revssf=_u(e.SSF),t.revssf[e.SSF[65535]]=0,t.ssf=e.SSF),t.rels={},t.wbrels={},t.Strings=[],t.Strings.Count=0,t.Strings.Unique=0,Ea?t.revStrings=new Map:(t.revStrings={},t.revStrings.foo=[],delete t.revStrings.foo);var r="xml",n=Iw.indexOf(t.bookType)>-1,i=sw();qd(t=t||{});var o=kd(),a="",s=0;if(t.cellXfs=[],Vn(t.cellXfs,{},{revssf:{General:0}}),e.Props||(e.Props={}),a="docProps/core.xml",De(o,a,fw(e.Props,t)),i.coreprops.push(a),Be(t.rels,2,a,ke.CORE_PROPS),a="docProps/app.xml",!(e.Props&&e.Props.SheetNames))if(!e.Workbook||!e.Workbook.Sheets)e.Props.SheetNames=e.SheetNames;else{for(var l=[],u=0;u0&&(a="docProps/custom.xml",De(o,a,pw(e.Custprops)),i.custprops.push(a),Be(t.rels,4,a,ke.CUST_PROPS));var c=["SheetJ5"];for(t.tcid=0,s=1;s<=e.SheetNames.length;++s){var f={"!id":{}},d=e.Sheets[e.SheetNames[s-1]],h=(d||{})["!type"]||"sheet";switch(h){case"chart":default:a="xl/worksheets/sheet"+s+"."+r,De(o,a,Hw(s-1,t,e,f)),i.sheets.push(a),Be(t.wbrels,-1,"worksheets/sheet"+s+"."+r,ke.WS[0])}if(d){var m=d["!comments"],p=!1,g="";if(m&&m.length>0){var v=!1;m.forEach(function(w){w[1].forEach(function(y){y.T==!0&&(v=!0)})}),v&&(g="xl/threadedComments/threadedComment"+s+"."+r,De(o,g,dR(m,c,t)),i.threadedcomments.push(g),Be(f,-1,"../threadedComments/threadedComment"+s+"."+r,ke.TCMNT)),g="xl/comments"+s+"."+r,De(o,g,Pw(m)),i.comments.push(g),Be(f,-1,"../comments"+s+"."+r,ke.CMNT),p=!0}d["!legacy"]&&p&&De(o,"xl/drawings/vmlDrawing"+s+".vml",Dw(s,d["!comments"])),delete d["!comments"],delete d["!legacy"]}f["!id"].rId1&&De(o,uw(a),oo(f))}return t.Strings!=null&&t.Strings.length>0&&(a="xl/sharedStrings."+r,De(o,a,Sw(t.Strings,t)),i.strs.push(a),Be(t.wbrels,-1,"sharedStrings."+r,ke.SST)),a="xl/workbook."+r,De(o,a,zw(e)),i.workbooks.push(a),Be(t.rels,1,a,ke.WB),a="xl/theme/theme1.xml",De(o,a,Ow(e.Themes,t)),i.themes.push(a),Be(t.wbrels,-1,"theme/theme1.xml",ke.THEME),a="xl/styles."+r,De(o,a,Aw(e,t)),i.styles.push(a),Be(t.wbrels,-1,"styles."+r,ke.STY),e.vbaraw&&n&&(a="xl/vbaProject.bin",De(o,a,e.vbaraw),i.vba.push(a),Be(t.wbrels,-1,"vbaProject.bin",ke.VBA)),a="xl/metadata."+r,De(o,a,Fw()),i.metadata.push(a),Be(t.wbrels,-1,"metadata."+r,ke.XLMETA),c.length>1&&(a="xl/persons/person.xml",De(o,a,hR(c)),i.people.push(a),Be(t.wbrels,-1,"persons/person.xml",ke.PEOPLE)),De(o,"[Content_Types].xml",lw(i,t)),De(o,"_rels/.rels",oo(t.rels)),De(o,"xl/_rels/workbook."+r+".rels",oo(t.wbrels)),delete t.revssf,delete t.ssf,o}function N6(e,t){var r="";switch((t||{}).type||"base64"){case"buffer":return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]];case"base64":r=rn(e.slice(0,12));break;case"binary":r=e;break;case"array":return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]];default:throw new Error("Unrecognized type "+(t&&t.type||"undefined"))}return[r.charCodeAt(0),r.charCodeAt(1),r.charCodeAt(2),r.charCodeAt(3),r.charCodeAt(4),r.charCodeAt(5),r.charCodeAt(6),r.charCodeAt(7)]}function Qw(e,t){switch(t.type){case"base64":case"binary":break;case"buffer":case"array":t.type="";break;case"file":return ns(t.file,Ve.write(e,{type:Me?"buffer":""}));case"string":throw new Error("'string' output type invalid for '"+t.bookType+"' files");default:throw new Error("Unrecognized type "+t.type)}return Ve.write(e,t)}function M6(e,t){var r=Xt(t||{}),n=b6(e,r);return L6(n,r)}function L6(e,t){var r={},n=Me?"nodebuffer":typeof Uint8Array<"u"?"array":"string";if(t.compression&&(r.compression="DEFLATE"),t.password)r.type=n;else switch(t.type){case"base64":r.type="base64";break;case"binary":r.type="string";break;case"string":throw new Error("'string' output type invalid for '"+t.bookType+"' files");case"buffer":case"file":r.type=n;break;default:throw new Error("Unrecognized type "+t.type)}var i=e.FullPaths?Ve.write(e,{fileType:"zip",type:{nodebuffer:"buffer",string:"binary"}[r.type]||r.type,compression:!!t.compression}):e.generate(r);if(typeof Deno<"u"&&typeof i=="string"){if(t.type=="binary"||t.type=="base64")return i;i=new Uint8Array(yu(i))}return t.password&&typeof encrypt_agile<"u"?Qw(encrypt_agile(i,t.password),t):t.type==="file"?ns(t.file,i):t.type=="string"?va(i):i}function B6(e,t){var r=t||{},n=t6(e,r);return Qw(n,r)}function Or(e,t,r){r||(r="");var n=r+e;switch(t.type){case"base64":return Ua(jr(n));case"binary":return jr(n);case"string":return e;case"file":return ns(t.file,n,"utf8");case"buffer":return Me?ln(n,"utf8"):typeof TextEncoder<"u"?new TextEncoder().encode(n):Or(n,{type:"binary"}).split("").map(function(i){return i.charCodeAt(0)})}throw new Error("Unrecognized type "+t.type)}function U6(e,t){switch(t.type){case"base64":return Ua(e);case"binary":return e;case"string":return e;case"file":return ns(t.file,e,"binary");case"buffer":return Me?ln(e,"binary"):e.split("").map(function(r){return r.charCodeAt(0)})}throw new Error("Unrecognized type "+t.type)}function Vs(e,t){switch(t.type){case"string":case"base64":case"binary":for(var r="",n=0;n0&&(i=0);var f=yt(l.s.r),d=[],h=[],m=0,p=0,g=Array.isArray(e),v=l.s.r,w=0,y={};g&&!e[v]&&(e[v]=[]);var E=u.skipHidden&&e["!cols"]||[],b=u.skipHidden&&e["!rows"]||[];for(w=l.s.c;w<=l.e.c;++w)if(!(E[w]||{}).hidden)switch(d[w]=Rt(w),r=g?e[v][w]:e[d[w]+f],n){case 1:o[w]=w-l.s.c;break;case 2:o[w]=d[w];break;case 3:o[w]=u.header[w-l.s.c];break;default:if(r==null&&(r={w:"__EMPTY",t:"s"}),s=a=nn(r,null,u),p=y[a]||0,!p)y[a]=1;else{do s=a+"_"+p++;while(y[s]);y[a]=p,y[s]=1}o[w]=s}for(v=l.s.r+i;v<=l.e.r;++v)if(!(b[v]||{}).hidden){var k=W6(e,l,v,d,n,o,g,u);(k.isempty===!1||(n===1?u.blankrows!==!1:u.blankrows))&&(h[m++]=k.row)}return h.length=m,h}var qg=/"/g;function z6(e,t,r,n,i,o,a,s){for(var l=!0,u=[],c="",f=yt(r),d=t.s.c;d<=t.e.c;++d)if(n[d]){var h=s.dense?(e[r]||[])[d]:e[n[d]+f];if(h==null)c="";else if(h.v!=null){l=!1,c=""+(s.rawNumbers&&h.t=="n"?h.v:nn(h,null,s));for(var m=0,p=0;m!==c.length;++m)if((p=c.charCodeAt(m))===i||p===o||p===34||s.forceQuotes){c='"'+c.replace(qg,'""')+'"';break}c=="ID"&&(c='"ID"')}else h.f!=null&&!h.F?(l=!1,c="="+h.f,c.indexOf(",")>=0&&(c='"'+c.replace(qg,'""')+'"')):c="";u.push(c)}return s.blankrows===!1&&l?null:u.join(a)}function Qd(e,t){var r=[],n=t??{};if(e==null||e["!ref"]==null)return"";var i=Xe(e["!ref"]),o=n.FS!==void 0?n.FS:",",a=o.charCodeAt(0),s=n.RS!==void 0?n.RS:` `,l=s.charCodeAt(0),u=new RegExp((o=="|"?"\\|":o)+"+$"),c="",f=[];n.dense=Array.isArray(e);for(var d=n.skipHidden&&e["!cols"]||[],h=n.skipHidden&&e["!rows"]||[],m=i.s.c;m<=i.e.c;++m)(d[m]||{}).hidden||(f[m]=Rt(m));for(var p=0,g=i.s.r;g<=i.e.r;++g)(h[g]||{}).hidden||(c=z6(e,i,g,f,a,l,o,n),c!=null&&(n.strip&&(c=c.replace(u,"")),(c||n.blankrows!==!1)&&r.push((p++?s:"")+c)));return delete n.dense,r.join("")}function Jw(e,t){t||(t={}),t.FS=" ",t.RS=` `;var r=Qd(e,t);return r}function G6(e){var t="",r,n="";if(e==null||e["!ref"]==null)return[];var i=Xe(e["!ref"]),o="",a=[],s,l=[],u=Array.isArray(e);for(s=i.s.c;s<=i.e.c;++s)a[s]=Rt(s);for(var c=i.s.r;c<=i.e.r;++c)for(o=yt(c),s=i.s.c;s<=i.e.c;++s)if(t=a[s]+o,r=u?(e[c]||[])[s]:e[t],n="",r!==void 0){if(r.F!=null){if(t=r.F,!r.f)continue;n=r.f,t.indexOf(":")==-1&&(t=t+":"+t)}if(r.f!=null)n=r.f;else{if(r.t=="z")continue;if(r.t=="n"&&r.v!=null)n=""+r.v;else if(r.t=="b")n=r.v?"TRUE":"FALSE";else if(r.w!==void 0)n="'"+r.w;else{if(r.v===void 0)continue;r.t=="s"?n="'"+r.v:n=""+r.v}}l[l.length]=t+"="+n}return l}function e2(e,t,r){var n=r||{},i=+!n.skipHeader,o=e||{},a=0,s=0;if(o&&n.origin!=null)if(typeof n.origin=="number")a=n.origin;else{var l=typeof n.origin=="string"?ft(n.origin):n.origin;a=l.r,s=l.c}var u,c={s:{c:0,r:0},e:{c:s,r:a+t.length-1+i}};if(o["!ref"]){var f=Xe(o["!ref"]);c.e.c=Math.max(c.e.c,f.e.c),c.e.r=Math.max(c.e.r,f.e.r),a==-1&&(a=f.e.r+1,c.e.r=a+t.length-1+i)}else a==-1&&(a=0,c.e.r=t.length-1+i);var d=n.header||[],h=0;t.forEach(function(p,g){St(p).forEach(function(v){(h=d.indexOf(v))==-1&&(d[h=d.length]=v);var w=p[v],y="z",E="",b=He({c:s+h,r:a+g+i});u=za(o,b),w&&typeof w=="object"&&!(w instanceof Date)?o[b]=w:(typeof w=="number"?y="n":typeof w=="boolean"?y="b":typeof w=="string"?y="s":w instanceof Date?(y="d",n.cellDates||(y="n",w=jt(w)),E=n.dateNF||rt[14]):w===null&&n.nullError&&(y="e",w=0),u?(u.t=y,u.v=w,delete u.w,delete u.R,E&&(u.z=E)):o[b]=u={t:y,v:w},E&&(u.z=E))})}),c.e.c=Math.max(c.e.c,s+d.length-1);var m=yt(a);if(i)for(h=0;h=0&&e.SheetNames.length>t)return t;throw new Error("Cannot find sheet # "+t)}else if(typeof t=="string"){var r=e.SheetNames.indexOf(t);if(r>-1)return r;throw new Error("Cannot find sheet name |"+t+"|")}else throw new Error("Cannot find sheet |"+t+"|")}function K6(){return{SheetNames:[],Sheets:{}}}function Y6(e,t,r,n){var i=1;if(!r)for(;i<=65535&&e.SheetNames.indexOf(r="Sheet"+i)!=-1;++i,r=void 0);if(!r||e.SheetNames.length>=65535)throw new Error("Too many worksheets");if(n&&e.SheetNames.indexOf(r)>=0){var o=r.match(/(^.*?)(\d+)$/);i=o&&+o[2]||0;var a=o&&o[1]||r;for(++i;i<=65535&&e.SheetNames.indexOf(r=a+i)!=-1;++i);}if(Ww(r),e.SheetNames.indexOf(r)>=0)throw new Error("Worksheet with name |"+r+"| already exists!");return e.SheetNames.push(r),e.Sheets[r]=t,r}function q6(e,t,r){e.Workbook||(e.Workbook={}),e.Workbook.Sheets||(e.Workbook.Sheets=[]);var n=X6(e,t);switch(e.Workbook.Sheets[n]||(e.Workbook.Sheets[n]={}),r){case 0:case 1:case 2:break;default:throw new Error("Bad sheet visibility setting "+r)}e.Workbook.Sheets[n].Hidden=r}function Q6(e,t){return e.z=t,e}function t2(e,t,r){return t?(e.l={Target:t},r&&(e.l.Tooltip=r)):delete e.l,e}function Z6(e,t,r){return t2(e,"#"+t,r)}function J6(e,t,r){e.c||(e.c=[]),e.c.push({t,a:r||"SheetJS"})}function eP(e,t,r,n){for(var i=typeof t!="string"?t:Xe(t),o=typeof t=="string"?t:ot(t),a=i.s.r;a<=i.e.r;++a)for(var s=i.s.c;s<=i.e.c;++s){var l=za(e,a,s);l.t="n",l.F=o,delete l.v,a==i.s.r&&s==i.s.c&&(l.f=r,n&&(l.D=!0))}return e}var Uc={encode_col:Rt,encode_row:yt,encode_cell:He,encode_range:ot,decode_col:Ud,decode_row:Bd,split_cell:p3,decode_cell:ft,decode_range:er,format_cell:nn,sheet_add_aoa:tw,sheet_add_json:e2,sheet_add_dom:Kw,aoa_to_sheet:Ro,json_to_sheet:j6,table_to_sheet:Yw,table_to_book:_6,sheet_to_csv:Qd,sheet_to_txt:Jw,sheet_to_json:Kl,sheet_to_html:Xw,sheet_to_formulae:G6,sheet_to_row_object_array:Kl,sheet_get_cell:za,book_new:K6,book_append_sheet:Y6,book_set_sheet_visibility:q6,cell_set_number_format:Q6,cell_set_hyperlink:t2,cell_set_internal_link:Z6,cell_add_comment:J6,sheet_set_array_formula:eP,consts:{SHEET_VISIBLE:0,SHEET_HIDDEN:1,SHEET_VERY_HIDDEN:2}};function t0(e){if(typeof e=="string"){const t=e.replace(/[^a-zA-Z]/g,"").trim(),r=["","K","M","B","T"].indexOf(t.replace(/\s/g,""));e=Number(e.replace(/[^0-9.]/g,"").trim())*Math.pow(10,r*3)}return e}function tP(e,t){var r;if(typeof e=="string"&&(e=Number(t0(e))),e%1!==0){const n=Math.max(2,((r=e.toString().split(".")[1])==null?void 0:r.length)||0),i=Math.min(4,n);if(e<5)return e.toFixed(i)||0;e=Number(e.toFixed(2))}if((e>1e5||e<-1e5)&&!n2(t||"")){const n=Math.min(4,Math.floor(Math.log10(Math.abs(e))/3)),i=["","K","M","B","T"][n];return`${(e/10**(n*3)).toFixed(3).replace(/\.?0+$/,"")} ${i}`}return e>1e3||e<-1e3?r2(e):e}function r2(e){if(e>1e3||e<-1e3){const t=e.toString().split("."),r=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),n=t[1]?`.${t[1]}`:"";return`${r}${n}`}return e}function Yl(e){return["date","day","time","timestamp","year"].some(t=>e==null?void 0:e.toLowerCase().includes(t))}function n2(e){return["price","open","close"].some(t=>e==null?void 0:e.toLowerCase().includes(t))}function ji(e,t){const r=window.document.getElementById("loading"),n=window.document.getElementById("loading_text");return new Promise(i=>{t?r.classList.remove("show"):(n.innerHTML=e,r.classList.add("show"));const o=setInterval(function(){(t?!r.classList.contains("show"):r.classList.contains("show"))&&(clearInterval(o),i(!0))},.01)})}function rP(e,t){if(e===t)return!0;if(e==null||t==null||(e==null?void 0:e.length)!==(t==null?void 0:t.length))return!1;for(let r=0;r<(e==null?void 0:e.length);++r)if(e[r]!==t[r])return!1;return!0}const nP=(e,t,r,n)=>{const i=n4(e.getValue(t),r);return n(i),i},iP=async({fileHandle:e,blob:t})=>{e&&await oP({fileHandle:e,blob:t})},oP=async({fileHandle:e,blob:t})=>{const r=await e.createWritable();await r.write(t),await r.close()},aP=[{description:"PNG Image",accept:{"image/png":[".png"]}},{description:"JPEG Image",accept:{"image/jpeg":[".jpeg"]}}],i2=({filename:e,is_image:t})=>{try{if("showSaveFilePicker"in window){const r={suggestedName:e,types:t?aP:[{description:"CSV File",accept:{"image/csv":[".csv"]}}],excludeAcceptAllOption:!0};return showSaveFilePicker(r)}}catch(r){console.error(r)}return new Promise(r=>{r(null)})},o2=(e,t,r)=>{try{if(r===null)throw new Error("Cannot access filesystem");iP({fileHandle:r,blob:e})}catch(n){console.error("oops, something went wrong!",n);const i=URL.createObjectURL(e),o=document.createElement("a");o.setAttribute("href",i),o.setAttribute("download",t),o.style.visibility="hidden",document.body.appendChild(o),o.click(),document.body.removeChild(o)}return new Promise(n=>{n(!0)})};async function Qg(e,t,r,n){const i=t,o=r.map(u=>i.map(c=>u[c])),a=[i,...o];if(e==="csv"){const u=a.map(d=>d.join(",")).join(` -`),c=new Blob([u],{type:"text/csv;charset=utf-8;"}),f=`${window.title}.csv`;try{const d=await i2({filename:f});let h="csv";d!==null&&(h=d.name.split(".").pop()),await ji(`Saving ${h.toUpperCase()}`),r0(async function(){o2(c,f,d).then(async function(){await new Promise(m=>setTimeout(m,1500)),await ji("",!0),d||n(!0)})},2)()}catch(d){console.error(d)}return}const s=Uc.book_new(),l=Uc.aoa_to_sheet(a);Uc.book_append_sheet(s,l,"Sheet1"),await ji("Saving XLSX"),r0(async function(){await new Promise(u=>setTimeout(u,1500)),V6(s,`${window.title}.xlsx`),await ji("",!0),n==null||n(!0)},2)()}async function sP(e,t){const r=document.getElementById(e),n=`${window.title}.png`;try{const i=await i2({filename:n,is_image:!0});let o="png";i!==null&&(o=i.name.split(".").pop()),await ji(`Saving ${o.toUpperCase()}`),r0(async function(){c4.toBlob(r).then(function(a){o2(a,n,i).then(async function(){await new Promise(s=>setTimeout(s,1500)),await ji("",!0),i||t(!0)})})},2)()}catch(i){console.error(i)}}const r0=(e,t)=>{let r;return function(){const n=this,i=arguments;clearTimeout(r),r=setTimeout(()=>e.apply(n,i),t)}},ql=({title:e,titleId:t,...r})=>X("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,...r,children:X("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})});function Zg(e,[t,r]){return Math.min(r,Math.max(t,e))}function Ou(e){const t=e+"CollectionProvider",[r,n]=sn(t),[i,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),a=h=>{const{scope:m,children:p}=h,g=ir.useRef(null),v=ir.useRef(new Map).current;return ir.createElement(i,{scope:m,itemMap:v,collectionRef:g},p)},s=e+"CollectionSlot",l=ir.forwardRef((h,m)=>{const{scope:p,children:g}=h,v=o(s,p),w=We(m,v.collectionRef);return ir.createElement(oi,{ref:w},g)}),u=e+"CollectionItemSlot",c="data-radix-collection-item",f=ir.forwardRef((h,m)=>{const{scope:p,children:g,...v}=h,w=ir.useRef(null),y=We(m,w),E=o(u,p);return ir.useEffect(()=>(E.itemMap.set(w,{ref:w,...v}),()=>void E.itemMap.delete(w))),ir.createElement(oi,{[c]:"",ref:y},g)});function d(h){const m=o(e+"CollectionConsumer",h);return ir.useCallback(()=>{const g=m.collectionRef.current;if(!g)return[];const v=Array.from(g.querySelectorAll(`[${c}]`));return Array.from(m.itemMap.values()).sort((E,b)=>v.indexOf(E.ref.current)-v.indexOf(b.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:a,Slot:l,ItemSlot:f},d,n]}const lP=x.createContext(void 0);function Zd(e){const t=x.useContext(lP);return e||t||"ltr"}function Do(e){return e.split("-")[1]}function Jd(e){return e==="y"?"height":"width"}function Zr(e){return e.split("-")[0]}function _i(e){return["top","bottom"].includes(Zr(e))?"x":"y"}function Jg(e,t,r){let{reference:n,floating:i}=e;const o=n.x+n.width/2-i.width/2,a=n.y+n.height/2-i.height/2,s=_i(t),l=Jd(s),u=n[l]/2-i[l]/2,c=s==="x";let f;switch(Zr(t)){case"top":f={x:o,y:n.y-i.height};break;case"bottom":f={x:o,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:a};break;case"left":f={x:n.x-i.width,y:a};break;default:f={x:n.x,y:n.y}}switch(Do(t)){case"start":f[s]-=u*(r&&c?-1:1);break;case"end":f[s]+=u*(r&&c?-1:1)}return f}const uP=async(e,t,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:a}=r,s=o.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:f}=Jg(u,n,l),d=n,h={},m=0;for(let p=0;p({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:i,rects:o,platform:a,elements:s}=t,{element:l,padding:u=0}=on(e,t)||{};if(l==null)return{};const c=a2(u),f={x:r,y:n},d=_i(i),h=Jd(d),m=await a.getDimensions(l),p=d==="y",g=p?"top":"left",v=p?"bottom":"right",w=p?"clientHeight":"clientWidth",y=o.reference[h]+o.reference[d]-f[d]-o.floating[h],E=f[d]-o.reference[d],b=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l));let k=b?b[w]:0;k&&await(a.isElement==null?void 0:a.isElement(b))||(k=s.floating[w]||o.floating[h]);const _=y/2-E/2,C=k/2-m[h]/2-1,A=ja(c[g],C),L=ja(c[v],C),B=A,U=k-m[h]-L,H=k/2-m[h]/2+_,G=n0(B,H,U),ee=Do(i)!=null&&H!=G&&o.reference[h]/2-(He.concat(t,t+"-start",t+"-end"),[]);const cP={left:"right",right:"left",bottom:"top",top:"bottom"};function Zl(e){return e.replace(/left|right|bottom|top/g,t=>cP[t])}function fP(e,t,r){r===void 0&&(r=!1);const n=Do(e),i=_i(e),o=Jd(i);let a=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Zl(a)),{main:a,cross:Zl(a)}}const dP={start:"end",end:"start"};function Hc(e){return e.replace(/start|end/g,t=>dP[t])}const hP=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r;const{placement:n,middlewareData:i,rects:o,initialPlacement:a,platform:s,elements:l}=t,{mainAxis:u=!0,crossAxis:c=!0,fallbackPlacements:f,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...p}=on(e,t),g=Zr(n),v=Zr(a)===a,w=await(s.isRTL==null?void 0:s.isRTL(l.floating)),y=f||(v||!m?[Zl(a)]:function(B){const U=Zl(B);return[Hc(B),U,Hc(U)]}(a));f||h==="none"||y.push(...function(B,U,H,G){const ee=Do(B);let ae=function(he,Te,oe){const ye=["left","right"],te=["right","left"],O=["top","bottom"],M=["bottom","top"];switch(he){case"top":case"bottom":return oe?Te?te:ye:Te?ye:te;case"left":case"right":return Te?O:M;default:return[]}}(Zr(B),H==="start",G);return ee&&(ae=ae.map(he=>he+"-"+ee),U&&(ae=ae.concat(ae.map(Hc)))),ae}(a,m,h,w));const E=[a,...y],b=await Ga(t,p),k=[];let _=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&k.push(b[g]),c){const{main:B,cross:U}=fP(n,o,w);k.push(b[B],b[U])}if(_=[..._,{placement:n,overflows:k}],!k.every(B=>B<=0)){var C,A;const B=(((C=i.flip)==null?void 0:C.index)||0)+1,U=E[B];if(U)return{data:{index:B,overflows:_},reset:{placement:U}};let H=(A=_.filter(G=>G.overflows[0]<=0).sort((G,ee)=>G.overflows[1]-ee.overflows[1])[0])==null?void 0:A.placement;if(!H)switch(d){case"bestFit":{var L;const G=(L=_.map(ee=>[ee.placement,ee.overflows.filter(ae=>ae>0).reduce((ae,he)=>ae+he,0)]).sort((ee,ae)=>ee[1]-ae[1])[0])==null?void 0:L[0];G&&(H=G);break}case"initialPlacement":H=a}if(n!==H)return{reset:{placement:H}}}return{}}}};function t1(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function r1(e){return s2.some(t=>e[t]>=0)}const pP=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...i}=on(e,t);switch(n){case"referenceHidden":{const o=t1(await Ga(t,{...i,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:r1(o)}}}case"escaped":{const o=t1(await Ga(t,{...i,altBoundary:!0}),r.floating);return{data:{escapedOffsets:o,escaped:r1(o)}}}default:return{}}}}},gP=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:r,y:n}=t,i=await async function(o,a){const{placement:s,platform:l,elements:u}=o,c=await(l.isRTL==null?void 0:l.isRTL(u.floating)),f=Zr(s),d=Do(s),h=_i(s)==="x",m=["left","top"].includes(f)?-1:1,p=c&&h?-1:1,g=on(a,o);let{mainAxis:v,crossAxis:w,alignmentAxis:y}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...g};return d&&typeof y=="number"&&(w=d==="end"?-1*y:y),h?{x:w*p,y:v*m}:{x:v*m,y:w*p}}(t,e);return{x:r+i.x,y:n+i.y,data:i}}}};function l2(e){return e==="x"?"y":"x"}const mP=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:g=>{let{x:v,y:w}=g;return{x:v,y:w}}},...l}=on(e,t),u={x:r,y:n},c=await Ga(t,l),f=_i(Zr(i)),d=l2(f);let h=u[f],m=u[d];if(o){const g=f==="y"?"bottom":"right";h=n0(h+c[f==="y"?"top":"left"],h,h-c[g])}if(a){const g=d==="y"?"bottom":"right";m=n0(m+c[d==="y"?"top":"left"],m,m-c[g])}const p=s.fn({...t,[f]:h,[d]:m});return{...p,data:{x:p.x-r,y:p.y-n}}}}},vP=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=on(e,t),c={x:r,y:n},f=_i(i),d=l2(f);let h=c[f],m=c[d];const p=on(s,t),g=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const y=f==="y"?"height":"width",E=o.reference[f]-o.floating[y]+g.mainAxis,b=o.reference[f]+o.reference[y]-g.mainAxis;hb&&(h=b)}if(u){var v,w;const y=f==="y"?"width":"height",E=["top","left"].includes(Zr(i)),b=o.reference[d]-o.floating[y]+(E&&((v=a.offset)==null?void 0:v[d])||0)+(E?0:g.crossAxis),k=o.reference[d]+o.reference[y]+(E?0:((w=a.offset)==null?void 0:w[d])||0)-(E?g.crossAxis:0);mk&&(m=k)}return{[f]:h,[d]:m}}}},xP=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:r,rects:n,platform:i,elements:o}=t,{apply:a=()=>{},...s}=on(e,t),l=await Ga(t,s),u=Zr(r),c=Do(r),f=_i(r)==="x",{width:d,height:h}=n.floating;let m,p;u==="top"||u==="bottom"?(m=u,p=c===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(p=u,m=c==="end"?"top":"bottom");const g=h-l[m],v=d-l[p],w=!t.middlewareData.shift;let y=g,E=v;if(f){const k=d-l.left-l.right;E=c||w?ja(v,k):k}else{const k=h-l.top-l.bottom;y=c||w?ja(g,k):k}if(w&&!c){const k=jn(l.left,0),_=jn(l.right,0),C=jn(l.top,0),A=jn(l.bottom,0);f?E=d-2*(k!==0||_!==0?k+_:jn(l.left,l.right)):y=h-2*(C!==0||A!==0?C+A:jn(l.top,l.bottom))}await a({...t,availableWidth:E,availableHeight:y});const b=await i.getDimensions(o.floating);return d!==b.width||h!==b.height?{reset:{rects:!0}}:{}}}};function Zt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Nr(e){return Zt(e).getComputedStyle(e)}function u2(e){return e instanceof Zt(e).Node}function Ln(e){return u2(e)?(e.nodeName||"").toLowerCase():"#document"}function Cr(e){return e instanceof HTMLElement||e instanceof Zt(e).HTMLElement}function n1(e){return typeof ShadowRoot<"u"&&(e instanceof Zt(e).ShadowRoot||e instanceof ShadowRoot)}function Xa(e){const{overflow:t,overflowX:r,overflowY:n,display:i}=Nr(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(i)}function wP(e){return["table","td","th"].includes(Ln(e))}function i0(e){const t=eh(),r=Nr(e);return r.transform!=="none"||r.perspective!=="none"||!!r.containerType&&r.containerType!=="normal"||!t&&!!r.backdropFilter&&r.backdropFilter!=="none"||!t&&!!r.filter&&r.filter!=="none"||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function eh(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Fu(e){return["html","body","#document"].includes(Ln(e))}const o0=Math.min,lo=Math.max,Jl=Math.round,Ws=Math.floor,Bn=e=>({x:e,y:e});function c2(e){const t=Nr(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const i=Cr(e),o=i?e.offsetWidth:r,a=i?e.offsetHeight:n,s=Jl(r)!==o||Jl(n)!==a;return s&&(r=o,n=a),{width:r,height:n,$:s}}function Jr(e){return e instanceof Element||e instanceof Zt(e).Element}function th(e){return Jr(e)?e:e.contextElement}function uo(e){const t=th(e);if(!Cr(t))return Bn(1);const r=t.getBoundingClientRect(),{width:n,height:i,$:o}=c2(t);let a=(o?Jl(r.width):r.width)/n,s=(o?Jl(r.height):r.height)/i;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const yP=Bn(0);function f2(e){const t=Zt(e);return eh()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:yP}function ui(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const i=e.getBoundingClientRect(),o=th(e);let a=Bn(1);t&&(n?Jr(n)&&(a=uo(n)):a=uo(e));const s=function(d,h,m){return h===void 0&&(h=!1),!(!m||h&&m!==Zt(d))&&h}(o,r,n)?f2(o):Bn(0);let l=(i.left+s.x)/a.x,u=(i.top+s.y)/a.y,c=i.width/a.x,f=i.height/a.y;if(o){const d=Zt(o),h=n&&Jr(n)?Zt(n):n;let m=d.frameElement;for(;m&&n&&h!==d;){const p=uo(m),g=m.getBoundingClientRect(),v=getComputedStyle(m),w=g.left+(m.clientLeft+parseFloat(v.paddingLeft))*p.x,y=g.top+(m.clientTop+parseFloat(v.paddingTop))*p.y;l*=p.x,u*=p.y,c*=p.x,f*=p.y,l+=w,u+=y,m=Zt(m).frameElement}}return Ql({width:c,height:f,x:l,y:u})}function Du(e){return Jr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function en(e){var t;return(t=(u2(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function d2(e){return ui(en(e)).left+Du(e).scrollLeft}function vo(e){if(Ln(e)==="html")return e;const t=e.assignedSlot||e.parentNode||n1(e)&&e.host||en(e);return n1(t)?t.host:t}function h2(e){const t=vo(e);return Fu(t)?e.ownerDocument?e.ownerDocument.body:e.body:Cr(t)&&Xa(t)?t:h2(t)}function eu(e,t){var r;t===void 0&&(t=[]);const n=h2(e),i=n===((r=e.ownerDocument)==null?void 0:r.body),o=Zt(n);return i?t.concat(o,o.visualViewport||[],Xa(n)?n:[]):t.concat(n,eu(n))}function i1(e,t,r){let n;if(t==="viewport")n=function(i,o){const a=Zt(i),s=en(i),l=a.visualViewport;let u=s.clientWidth,c=s.clientHeight,f=0,d=0;if(l){u=l.width,c=l.height;const h=eh();(!h||h&&o==="fixed")&&(f=l.offsetLeft,d=l.offsetTop)}return{width:u,height:c,x:f,y:d}}(e,r);else if(t==="document")n=function(i){const o=en(i),a=Du(i),s=i.ownerDocument.body,l=lo(o.scrollWidth,o.clientWidth,s.scrollWidth,s.clientWidth),u=lo(o.scrollHeight,o.clientHeight,s.scrollHeight,s.clientHeight);let c=-a.scrollLeft+d2(i);const f=-a.scrollTop;return Nr(s).direction==="rtl"&&(c+=lo(o.clientWidth,s.clientWidth)-l),{width:l,height:u,x:c,y:f}}(en(e));else if(Jr(t))n=function(i,o){const a=ui(i,!0,o==="fixed"),s=a.top+i.clientTop,l=a.left+i.clientLeft,u=Cr(i)?uo(i):Bn(1);return{width:i.clientWidth*u.x,height:i.clientHeight*u.y,x:l*u.x,y:s*u.y}}(t,r);else{const i=f2(e);n={...t,x:t.x-i.x,y:t.y-i.y}}return Ql(n)}function p2(e,t){const r=vo(e);return!(r===t||!Jr(r)||Fu(r))&&(Nr(r).position==="fixed"||p2(r,t))}function EP(e,t,r){const n=Cr(t),i=en(t),o=r==="fixed",a=ui(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=Bn(0);if(n||!n&&!o)if((Ln(t)!=="body"||Xa(i))&&(s=Du(t)),Cr(t)){const u=ui(t,!0,o,t);l.x=u.x+t.clientLeft,l.y=u.y+t.clientTop}else i&&(l.x=d2(i));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function o1(e,t){return Cr(e)&&Nr(e).position!=="fixed"?t?t(e):e.offsetParent:null}function a1(e,t){const r=Zt(e);if(!Cr(e))return r;let n=o1(e,t);for(;n&&wP(n)&&Nr(n).position==="static";)n=o1(n,t);return n&&(Ln(n)==="html"||Ln(n)==="body"&&Nr(n).position==="static"&&!i0(n))?r:n||function(i){let o=vo(i);for(;Cr(o)&&!Fu(o);){if(i0(o))return o;o=vo(o)}return null}(e)||r}const SP={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:r,strategy:n}=e;const i=Cr(r),o=en(r);if(r===o)return t;let a={scrollLeft:0,scrollTop:0},s=Bn(1);const l=Bn(0);if((i||!i&&n!=="fixed")&&((Ln(r)!=="body"||Xa(o))&&(a=Du(r)),Cr(r))){const u=ui(r);s=uo(r),l.x=u.x+r.clientLeft,l.y=u.y+r.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-a.scrollLeft*s.x+l.x,y:t.y*s.y-a.scrollTop*s.y+l.y}},getDocumentElement:en,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e;const o=[...r==="clippingAncestors"?function(l,u){const c=u.get(l);if(c)return c;let f=eu(l).filter(p=>Jr(p)&&Ln(p)!=="body"),d=null;const h=Nr(l).position==="fixed";let m=h?vo(l):l;for(;Jr(m)&&!Fu(m);){const p=Nr(m),g=i0(m);g||p.position!=="fixed"||(d=null),(h?!g&&!d:!g&&p.position==="static"&&d&&["absolute","fixed"].includes(d.position)||Xa(m)&&!g&&p2(l,m))?f=f.filter(v=>v!==m):d=p,m=vo(m)}return u.set(l,f),f}(t,this._c):[].concat(r),n],a=o[0],s=o.reduce((l,u)=>{const c=i1(t,u,i);return l.top=lo(c.top,l.top),l.right=o0(c.right,l.right),l.bottom=o0(c.bottom,l.bottom),l.left=lo(c.left,l.left),l},i1(t,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:a1,getElementRects:async function(e){let{reference:t,floating:r,strategy:n}=e;const i=this.getOffsetParent||a1,o=this.getDimensions;return{reference:EP(t,await i(r),n),floating:{x:0,y:0,...await o(r)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){return c2(e)},getScale:uo,isElement:Jr,isRTL:function(e){return getComputedStyle(e).direction==="rtl"}};function _P(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,u=th(e),c=i||o?[...u?eu(u):[],...eu(t)]:[];c.forEach(g=>{i&&g.addEventListener("scroll",r,{passive:!0}),o&&g.addEventListener("resize",r)});const f=u&&s?function(g,v){let w,y=null;const E=en(g);function b(){clearTimeout(w),y&&y.disconnect(),y=null}return function k(_,C){_===void 0&&(_=!1),C===void 0&&(C=1),b();const{left:A,top:L,width:B,height:U}=g.getBoundingClientRect();if(_||v(),!B||!U)return;const H={rootMargin:-Ws(L)+"px "+-Ws(E.clientWidth-(A+B))+"px "+-Ws(E.clientHeight-(L+U))+"px "+-Ws(A)+"px",threshold:lo(0,o0(1,C))||1};let G=!0;function ee(ae){const he=ae[0].intersectionRatio;if(he!==C){if(!G)return k();he?k(!1,he):w=setTimeout(()=>{k(!1,1e-7)},100)}G=!1}try{y=new IntersectionObserver(ee,{...H,root:E.ownerDocument})}catch{y=new IntersectionObserver(ee,H)}y.observe(g)}(!0),b}(u,r):null;let d,h=-1,m=null;a&&(m=new ResizeObserver(g=>{let[v]=g;v&&v.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{m&&m.observe(t)})),r()}),u&&!l&&m.observe(u),m.observe(t));let p=l?ui(e):null;return l&&function g(){const v=ui(e);!p||v.x===p.x&&v.y===p.y&&v.width===p.width&&v.height===p.height||r(),p=v,d=requestAnimationFrame(g)}(),r(),()=>{c.forEach(g=>{i&&g.removeEventListener("scroll",r),o&&g.removeEventListener("resize",r)}),f&&f(),m&&m.disconnect(),m=null,l&&cancelAnimationFrame(d)}}const TP=(e,t,r)=>{const n=new Map,i={platform:SP,...r},o={...i.platform,_c:n};return uP(e,t,{...i,platform:o})},CP=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:i}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?e1({element:n.current,padding:i}).fn(r):{}:n?e1({element:n,padding:i}).fn(r):{}}}};var ll=typeof document<"u"?x.useLayoutEffect:x.useEffect;function tu(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 r,n,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!tu(e[n],t[n]))return!1;return!0}if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,i[n]))return!1;for(n=r;n--!==0;){const o=i[n];if(!(o==="_owner"&&e.$$typeof)&&!tu(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function g2(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function s1(e,t){const r=g2(e);return Math.round(t*r)/r}function l1(e){const t=x.useRef(e);return ll(()=>{t.current=e}),t}function AP(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[c,f]=x.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[d,h]=x.useState(n);tu(d,n)||h(n);const[m,p]=x.useState(null),[g,v]=x.useState(null),w=x.useCallback(ae=>{ae!=k.current&&(k.current=ae,p(ae))},[p]),y=x.useCallback(ae=>{ae!==_.current&&(_.current=ae,v(ae))},[v]),E=o||m,b=a||g,k=x.useRef(null),_=x.useRef(null),C=x.useRef(c),A=l1(l),L=l1(i),B=x.useCallback(()=>{if(!k.current||!_.current)return;const ae={placement:t,strategy:r,middleware:d};L.current&&(ae.platform=L.current),TP(k.current,_.current,ae).then(he=>{const Te={...he,isPositioned:!0};U.current&&!tu(C.current,Te)&&(C.current=Te,gi.flushSync(()=>{f(Te)}))})},[d,t,r,L]);ll(()=>{u===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,f(ae=>({...ae,isPositioned:!1})))},[u]);const U=x.useRef(!1);ll(()=>(U.current=!0,()=>{U.current=!1}),[]),ll(()=>{if(E&&(k.current=E),b&&(_.current=b),E&&b){if(A.current)return A.current(E,b,B);B()}},[E,b,B,A]);const H=x.useMemo(()=>({reference:k,floating:_,setReference:w,setFloating:y}),[w,y]),G=x.useMemo(()=>({reference:E,floating:b}),[E,b]),ee=x.useMemo(()=>{const ae={position:r,left:0,top:0};if(!G.floating)return ae;const he=s1(G.floating,c.x),Te=s1(G.floating,c.y);return s?{...ae,transform:"translate("+he+"px, "+Te+"px)",...g2(G.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:he,top:Te}},[r,s,G.floating,c.x,c.y]);return x.useMemo(()=>({...c,update:B,refs:H,elements:G,floatingStyles:ee}),[c,B,H,G,ee])}function RP(e){const[t,r]=x.useState(void 0);return Mt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,s=u.blockSize}else a=e.offsetWidth,s=e.offsetHeight;r({width:a,height:s})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}const m2="Popper",[v2,Pu]=sn(m2),[OP,x2]=v2(m2),FP=e=>{const{__scopePopper:t,children:r}=e,[n,i]=x.useState(null);return x.createElement(OP,{scope:t,anchor:n,onAnchorChange:i},r)},DP="PopperAnchor",PP=x.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...i}=e,o=x2(DP,r),a=x.useRef(null),s=We(t,a);return x.useEffect(()=>{o.onAnchorChange((n==null?void 0:n.current)||a.current)}),n?null:x.createElement(Ie.div,ge({},i,{ref:s}))}),w2="PopperContent",[IP,r$]=v2(w2),bP=x.forwardRef((e,t)=>{var r,n,i,o,a,s,l,u;const{__scopePopper:c,side:f="bottom",sideOffset:d=0,align:h="center",alignOffset:m=0,arrowPadding:p=0,collisionBoundary:g=[],collisionPadding:v=0,sticky:w="partial",hideWhenDetached:y=!1,avoidCollisions:E=!0,onPlaced:b,...k}=e,_=x2(w2,c),[C,A]=x.useState(null),L=We(t,ie=>A(ie)),[B,U]=x.useState(null),H=RP(B),G=(r=H==null?void 0:H.width)!==null&&r!==void 0?r:0,ee=(n=H==null?void 0:H.height)!==null&&n!==void 0?n:0,ae=f+(h!=="center"?"-"+h:""),he=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},Te=Array.isArray(g)?g:[g],oe=Te.length>0,ye={padding:he,boundary:Te.filter(kP),altBoundary:oe},{refs:te,floatingStyles:O,placement:M,isPositioned:N,middlewareData:F}=AP({strategy:"fixed",placement:ae,whileElementsMounted:_P,elements:{reference:_.anchor},middleware:[gP({mainAxis:d+ee,alignmentAxis:m}),E&&mP({mainAxis:!0,crossAxis:!1,limiter:w==="partial"?vP():void 0,...ye}),E&&hP({...ye}),xP({...ye,apply:({elements:ie,rects:$e,availableWidth:Pe,availableHeight:ve})=>{const{width:Pt,height:Bt}=$e.reference,Ne=ie.floating.style;Ne.setProperty("--radix-popper-available-width",`${Pe}px`),Ne.setProperty("--radix-popper-available-height",`${ve}px`),Ne.setProperty("--radix-popper-anchor-width",`${Pt}px`),Ne.setProperty("--radix-popper-anchor-height",`${Bt}px`)}}),B&&CP({element:B,padding:p}),$P({arrowWidth:G,arrowHeight:ee}),y&&pP({strategy:"referenceHidden"})]}),[V,Y]=y2(M),J=Dt(b);Mt(()=>{N&&(J==null||J())},[N,J]);const W=(i=F.arrow)===null||i===void 0?void 0:i.x,Q=(o=F.arrow)===null||o===void 0?void 0:o.y,le=((a=F.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[me,_e]=x.useState();return Mt(()=>{C&&_e(window.getComputedStyle(C).zIndex)},[C]),x.createElement("div",{ref:te.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:N?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:me,"--radix-popper-transform-origin":[(s=F.transformOrigin)===null||s===void 0?void 0:s.x,(l=F.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},x.createElement(IP,{scope:c,placedSide:V,onArrowChange:U,arrowX:W,arrowY:Q,shouldHideArrow:le},x.createElement(Ie.div,ge({"data-side":V,"data-align":Y},k,{ref:L,style:{...k.style,animation:N?void 0:"none",opacity:(u=F.hide)!==null&&u!==void 0&&u.referenceHidden?0:void 0}}))))});function kP(e){return e!==null}const $P=e=>({name:"transformOrigin",options:e,fn(t){var r,n,i,o,a;const{placement:s,rects:l,middlewareData:u}=t,f=((r=u.arrow)===null||r===void 0?void 0:r.centerOffset)!==0,d=f?0:e.arrowWidth,h=f?0:e.arrowHeight,[m,p]=y2(s),g={start:"0%",center:"50%",end:"100%"}[p],v=((n=(i=u.arrow)===null||i===void 0?void 0:i.x)!==null&&n!==void 0?n:0)+d/2,w=((o=(a=u.arrow)===null||a===void 0?void 0:a.y)!==null&&o!==void 0?o:0)+h/2;let y="",E="";return m==="bottom"?(y=f?g:`${v}px`,E=`${-h}px`):m==="top"?(y=f?g:`${v}px`,E=`${l.floating.height+h}px`):m==="right"?(y=`${-h}px`,E=f?g:`${w}px`):m==="left"&&(y=`${l.floating.width+h}px`,E=f?g:`${w}px`),{data:{x:y,y:E}}}});function y2(e){const[t,r="center"]=e.split("-");return[t,r]}const E2=FP,S2=PP,_2=bP;function NP(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}const rh=x.forwardRef((e,t)=>x.createElement(Ie.span,ge({},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}}))),MP=[" ","Enter","ArrowUp","ArrowDown"],LP=[" ","Enter"],Iu="Select",[bu,ku,BP]=Ou(Iu),[Po,n$]=sn(Iu,[BP,Pu]),nh=Pu(),[UP,Ti]=Po(Iu),[HP,VP]=Po(Iu),WP=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:i,onOpenChange:o,value:a,defaultValue:s,onValueChange:l,dir:u,name:c,autoComplete:f,disabled:d,required:h}=e,m=nh(t),[p,g]=x.useState(null),[v,w]=x.useState(null),[y,E]=x.useState(!1),b=Zd(u),[k=!1,_]=go({prop:n,defaultProp:i,onChange:o}),[C,A]=go({prop:a,defaultProp:s,onChange:l}),L=x.useRef(null),B=p?!!p.closest("form"):!0,[U,H]=x.useState(new Set),G=Array.from(U).map(ee=>ee.props.value).join(";");return x.createElement(E2,m,x.createElement(UP,{required:h,scope:t,trigger:p,onTriggerChange:g,valueNode:v,onValueNodeChange:w,valueNodeHasChildren:y,onValueNodeHasChildrenChange:E,contentId:Kr(),value:C,onValueChange:A,open:k,onOpenChange:_,dir:b,triggerPointerDownPosRef:L,disabled:d},x.createElement(bu.Provider,{scope:t},x.createElement(HP,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(ee=>{H(ae=>new Set(ae).add(ee))},[]),onNativeOptionRemove:x.useCallback(ee=>{H(ae=>{const he=new Set(ae);return he.delete(ee),he})},[])},r)),B?x.createElement(R2,{key:G,"aria-hidden":!0,required:h,tabIndex:-1,name:c,autoComplete:f,value:C,onChange:ee=>A(ee.target.value),disabled:d},C===void 0?x.createElement("option",{value:""}):null,Array.from(U)):null))},zP="SelectTrigger",GP=x.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...i}=e,o=nh(r),a=Ti(zP,r),s=a.disabled||n,l=We(t,a.onTriggerChange),u=ku(r),[c,f,d]=O2(m=>{const p=u().filter(w=>!w.disabled),g=p.find(w=>w.value===a.value),v=F2(p,m,g);v!==void 0&&a.onValueChange(v.value)}),h=()=>{s||(a.onOpenChange(!0),d())};return x.createElement(S2,ge({asChild:!0},o),x.createElement(Ie.button,ge({type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":a.value===void 0?"":void 0},i,{ref:l,onClick:Se(i.onClick,m=>{m.currentTarget.focus()}),onPointerDown:Se(i.onPointerDown,m=>{const p=m.target;p.hasPointerCapture(m.pointerId)&&p.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&(h(),a.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)},m.preventDefault())}),onKeyDown:Se(i.onKeyDown,m=>{const p=c.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&f(m.key),!(p&&m.key===" ")&&MP.includes(m.key)&&(h(),m.preventDefault())})})))}),jP="SelectValue",XP=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:i,children:o,placeholder:a,...s}=e,l=Ti(jP,r),{onValueNodeHasChildrenChange:u}=l,c=o!==void 0,f=We(t,l.onValueNodeChange);return Mt(()=>{u(c)},[u,c]),x.createElement(Ie.span,ge({},s,{ref:f,style:{pointerEvents:"none"}}),l.value===void 0&&a!==void 0?a:o)}),KP=x.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...i}=e;return x.createElement(Ie.span,ge({"aria-hidden":!0},i,{ref:t}),n||"▼")}),YP=e=>x.createElement(vu,ge({asChild:!0},e)),xo="SelectContent",qP=x.forwardRef((e,t)=>{const r=Ti(xo,e.__scopeSelect),[n,i]=x.useState();if(Mt(()=>{i(new DocumentFragment)},[]),!r.open){const o=n;return o?gi.createPortal(x.createElement(T2,{scope:e.__scopeSelect},x.createElement(bu.Slot,{scope:e.__scopeSelect},x.createElement("div",null,e.children))),o):null}return x.createElement(QP,ge({},e,{ref:t}))}),Hr=10,[T2,Ci]=Po(xo),QP=x.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:a,side:s,sideOffset:l,align:u,alignOffset:c,arrowPadding:f,collisionBoundary:d,collisionPadding:h,sticky:m,hideWhenDetached:p,avoidCollisions:g,...v}=e,w=Ti(xo,r),[y,E]=x.useState(null),[b,k]=x.useState(null),_=We(t,Y=>E(Y)),[C,A]=x.useState(null),[L,B]=x.useState(null),U=ku(r),[H,G]=x.useState(!1),ee=x.useRef(!1);x.useEffect(()=>{if(y)return _d(y)},[y]),Ed();const ae=x.useCallback(Y=>{const[J,...W]=U().map(me=>me.ref.current),[Q]=W.slice(-1),le=document.activeElement;for(const me of Y)if(me===le||(me==null||me.scrollIntoView({block:"nearest"}),me===J&&b&&(b.scrollTop=0),me===Q&&b&&(b.scrollTop=b.scrollHeight),me==null||me.focus(),document.activeElement!==le))return},[U,b]),he=x.useCallback(()=>ae([C,y]),[ae,C,y]);x.useEffect(()=>{H&&he()},[H,he]);const{onOpenChange:Te,triggerPointerDownPosRef:oe}=w;x.useEffect(()=>{if(y){let Y={x:0,y:0};const J=Q=>{var le,me,_e,ie;Y={x:Math.abs(Math.round(Q.pageX)-((le=(me=oe.current)===null||me===void 0?void 0:me.x)!==null&&le!==void 0?le:0)),y:Math.abs(Math.round(Q.pageY)-((_e=(ie=oe.current)===null||ie===void 0?void 0:ie.y)!==null&&_e!==void 0?_e:0))}},W=Q=>{Y.x<=10&&Y.y<=10?Q.preventDefault():y.contains(Q.target)||Te(!1),document.removeEventListener("pointermove",J),oe.current=null};return oe.current!==null&&(document.addEventListener("pointermove",J),document.addEventListener("pointerup",W,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",W,{capture:!0})}}},[y,Te,oe]),x.useEffect(()=>{const Y=()=>Te(!1);return window.addEventListener("blur",Y),window.addEventListener("resize",Y),()=>{window.removeEventListener("blur",Y),window.removeEventListener("resize",Y)}},[Te]);const[ye,te]=O2(Y=>{const J=U().filter(le=>!le.disabled),W=J.find(le=>le.ref.current===document.activeElement),Q=F2(J,Y,W);Q&&setTimeout(()=>Q.ref.current.focus())}),O=x.useCallback((Y,J,W)=>{const Q=!ee.current&&!W;(w.value!==void 0&&w.value===J||Q)&&(A(Y),Q&&(ee.current=!0))},[w.value]),M=x.useCallback(()=>y==null?void 0:y.focus(),[y]),N=x.useCallback((Y,J,W)=>{const Q=!ee.current&&!W;(w.value!==void 0&&w.value===J||Q)&&B(Y)},[w.value]),F=n==="popper"?u1:ZP,V=F===u1?{side:s,sideOffset:l,align:u,alignOffset:c,arrowPadding:f,collisionBoundary:d,collisionPadding:h,sticky:m,hideWhenDetached:p,avoidCollisions:g}:{};return x.createElement(T2,{scope:r,content:y,viewport:b,onViewportChange:k,itemRefCallback:O,selectedItem:C,onItemLeave:M,itemTextRefCallback:N,focusSelectedItem:he,selectedItemText:L,position:n,isPositioned:H,searchRef:ye},x.createElement(Sd,{as:oi,allowPinchZoom:!0},x.createElement(yd,{asChild:!0,trapped:w.open,onMountAutoFocus:Y=>{Y.preventDefault()},onUnmountAutoFocus:Se(i,Y=>{var J;(J=w.trigger)===null||J===void 0||J.focus({preventScroll:!0}),Y.preventDefault()})},x.createElement(mu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:Y=>Y.preventDefault(),onDismiss:()=>w.onOpenChange(!1)},x.createElement(F,ge({role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:Y=>Y.preventDefault()},v,V,{onPlaced:()=>G(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:Se(v.onKeyDown,Y=>{const J=Y.ctrlKey||Y.altKey||Y.metaKey;if(Y.key==="Tab"&&Y.preventDefault(),!J&&Y.key.length===1&&te(Y.key),["ArrowUp","ArrowDown","Home","End"].includes(Y.key)){let Q=U().filter(le=>!le.disabled).map(le=>le.ref.current);if(["ArrowUp","End"].includes(Y.key)&&(Q=Q.slice().reverse()),["ArrowUp","ArrowDown"].includes(Y.key)){const le=Y.target,me=Q.indexOf(le);Q=Q.slice(me+1)}setTimeout(()=>ae(Q)),Y.preventDefault()}})}))))))}),ZP=x.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...i}=e,o=Ti(xo,r),a=Ci(xo,r),[s,l]=x.useState(null),[u,c]=x.useState(null),f=We(t,_=>c(_)),d=ku(r),h=x.useRef(!1),m=x.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:v,focusSelectedItem:w}=a,y=x.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&u&&p&&g&&v){const _=o.trigger.getBoundingClientRect(),C=u.getBoundingClientRect(),A=o.valueNode.getBoundingClientRect(),L=v.getBoundingClientRect();if(o.dir!=="rtl"){const le=L.left-C.left,me=A.left-le,_e=_.left-me,ie=_.width+_e,$e=Math.max(ie,C.width),Pe=window.innerWidth-Hr,ve=Zg(me,[Hr,Pe-$e]);s.style.minWidth=ie+"px",s.style.left=ve+"px"}else{const le=C.right-L.right,me=window.innerWidth-A.right-le,_e=window.innerWidth-_.right-me,ie=_.width+_e,$e=Math.max(ie,C.width),Pe=window.innerWidth-Hr,ve=Zg(me,[Hr,Pe-$e]);s.style.minWidth=ie+"px",s.style.right=ve+"px"}const B=d(),U=window.innerHeight-Hr*2,H=p.scrollHeight,G=window.getComputedStyle(u),ee=parseInt(G.borderTopWidth,10),ae=parseInt(G.paddingTop,10),he=parseInt(G.borderBottomWidth,10),Te=parseInt(G.paddingBottom,10),oe=ee+ae+H+Te+he,ye=Math.min(g.offsetHeight*5,oe),te=window.getComputedStyle(p),O=parseInt(te.paddingTop,10),M=parseInt(te.paddingBottom,10),N=_.top+_.height/2-Hr,F=U-N,V=g.offsetHeight/2,Y=g.offsetTop+V,J=ee+ae+Y,W=oe-J;if(J<=N){const le=g===B[B.length-1].ref.current;s.style.bottom="0px";const me=u.clientHeight-p.offsetTop-p.offsetHeight,_e=Math.max(F,V+(le?M:0)+me+he),ie=J+_e;s.style.height=ie+"px"}else{const le=g===B[0].ref.current;s.style.top="0px";const _e=Math.max(N,ee+p.offsetTop+(le?O:0)+V)+W;s.style.height=_e+"px",p.scrollTop=J-N+p.offsetTop}s.style.margin=`${Hr}px 0`,s.style.minHeight=ye+"px",s.style.maxHeight=U+"px",n==null||n(),requestAnimationFrame(()=>h.current=!0)}},[d,o.trigger,o.valueNode,s,u,p,g,v,o.dir,n]);Mt(()=>y(),[y]);const[E,b]=x.useState();Mt(()=>{u&&b(window.getComputedStyle(u).zIndex)},[u]);const k=x.useCallback(_=>{_&&m.current===!0&&(y(),w==null||w(),m.current=!1)},[y,w]);return x.createElement(JP,{scope:r,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:k},x.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E}},x.createElement(Ie.div,ge({},i,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}}))))}),u1=x.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:i=Hr,...o}=e,a=nh(r);return x.createElement(_2,ge({},a,o,{ref:t,align:n,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[JP,ih]=Po(xo,{}),c1="SelectViewport",eI=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=Ci(c1,r),o=ih(c1,r),a=We(t,i.onViewportChange),s=x.useRef(0);return x.createElement(x.Fragment,null,x.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),x.createElement(bu.Slot,{scope:r},x.createElement(Ie.div,ge({"data-radix-select-viewport":"",role:"presentation"},n,{ref:a,style:{position:"relative",flex:1,overflow:"auto",...n.style},onScroll:Se(n.onScroll,l=>{const u=l.currentTarget,{contentWrapper:c,shouldExpandOnScrollRef:f}=o;if(f!=null&&f.current&&c){const d=Math.abs(s.current-u.scrollTop);if(d>0){const h=window.innerHeight-Hr*2,m=parseFloat(c.style.minHeight),p=parseFloat(c.style.height),g=Math.max(m,p);if(g0?y:0,c.style.justifyContent="flex-end")}}}s.current=u.scrollTop})}))))}),tI="SelectGroup",[rI,nI]=Po(tI),iI=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=Kr();return x.createElement(rI,{scope:r,id:i},x.createElement(Ie.div,ge({role:"group","aria-labelledby":i},n,{ref:t})))}),oI="SelectLabel",aI=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=nI(oI,r);return x.createElement(Ie.div,ge({id:i.id},n,{ref:t}))}),a0="SelectItem",[sI,C2]=Po(a0),lI=x.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:i=!1,textValue:o,...a}=e,s=Ti(a0,r),l=Ci(a0,r),u=s.value===n,[c,f]=x.useState(o??""),[d,h]=x.useState(!1),m=We(t,v=>{var w;return(w=l.itemRefCallback)===null||w===void 0?void 0:w.call(l,v,n,i)}),p=Kr(),g=()=>{i||(s.onValueChange(n),s.onOpenChange(!1))};return x.createElement(sI,{scope:r,value:n,disabled:i,textId:p,isSelected:u,onItemTextChange:x.useCallback(v=>{f(w=>{var y;return w||((y=v==null?void 0:v.textContent)!==null&&y!==void 0?y:"").trim()})},[])},x.createElement(bu.ItemSlot,{scope:r,value:n,disabled:i,textValue:c},x.createElement(Ie.div,ge({role:"option","aria-labelledby":p,"data-highlighted":d?"":void 0,"aria-selected":u&&d,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1},a,{ref:m,onFocus:Se(a.onFocus,()=>h(!0)),onBlur:Se(a.onBlur,()=>h(!1)),onPointerUp:Se(a.onPointerUp,g),onPointerMove:Se(a.onPointerMove,v=>{if(i){var w;(w=l.onItemLeave)===null||w===void 0||w.call(l)}else v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Se(a.onPointerLeave,v=>{if(v.currentTarget===document.activeElement){var w;(w=l.onItemLeave)===null||w===void 0||w.call(l)}}),onKeyDown:Se(a.onKeyDown,v=>{var w;((w=l.searchRef)===null||w===void 0?void 0:w.current)!==""&&v.key===" "||(LP.includes(v.key)&&g(),v.key===" "&&v.preventDefault())})}))))}),zs="SelectItemText",uI=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:i,...o}=e,a=Ti(zs,r),s=Ci(zs,r),l=C2(zs,r),u=VP(zs,r),[c,f]=x.useState(null),d=We(t,v=>f(v),l.onItemTextChange,v=>{var w;return(w=s.itemTextRefCallback)===null||w===void 0?void 0:w.call(s,v,l.value,l.disabled)}),h=c==null?void 0:c.textContent,m=x.useMemo(()=>x.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},h),[l.disabled,l.value,h]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=u;return Mt(()=>(p(m),()=>g(m)),[p,g,m]),x.createElement(x.Fragment,null,x.createElement(Ie.span,ge({id:l.textId},o,{ref:d})),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?gi.createPortal(o.children,a.valueNode):null)}),cI="SelectItemIndicator",fI=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return C2(cI,r).isSelected?x.createElement(Ie.span,ge({"aria-hidden":!0},n,{ref:t})):null}),f1="SelectScrollUpButton",dI=x.forwardRef((e,t)=>{const r=Ci(f1,e.__scopeSelect),n=ih(f1,e.__scopeSelect),[i,o]=x.useState(!1),a=We(t,n.onScrollButtonChange);return Mt(()=>{if(r.viewport&&r.isPositioned){let u=function(){const c=l.scrollTop>0;o(c)};var s=u;const l=r.viewport;return u(),l.addEventListener("scroll",u),()=>l.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),i?x.createElement(A2,ge({},e,{ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=r;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}})):null}),d1="SelectScrollDownButton",hI=x.forwardRef((e,t)=>{const r=Ci(d1,e.__scopeSelect),n=ih(d1,e.__scopeSelect),[i,o]=x.useState(!1),a=We(t,n.onScrollButtonChange);return Mt(()=>{if(r.viewport&&r.isPositioned){let u=function(){const c=l.scrollHeight-l.clientHeight,f=Math.ceil(l.scrollTop)l.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),i?x.createElement(A2,ge({},e,{ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=r;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}})):null}),A2=x.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...i}=e,o=Ci("SelectScrollButton",r),a=x.useRef(null),s=ku(r),l=x.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return x.useEffect(()=>()=>l(),[l]),Mt(()=>{var u;const c=s().find(f=>f.ref.current===document.activeElement);c==null||(u=c.ref.current)===null||u===void 0||u.scrollIntoView({block:"nearest"})},[s]),x.createElement(Ie.div,ge({"aria-hidden":!0},i,{ref:t,style:{flexShrink:0,...i.style},onPointerDown:Se(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(n,50))}),onPointerMove:Se(i.onPointerMove,()=>{var u;(u=o.onItemLeave)===null||u===void 0||u.call(o),a.current===null&&(a.current=window.setInterval(n,50))}),onPointerLeave:Se(i.onPointerLeave,()=>{l()})}))}),R2=x.forwardRef((e,t)=>{const{value:r,...n}=e,i=x.useRef(null),o=We(t,i),a=NP(r);return x.useEffect(()=>{const s=i.current,l=window.HTMLSelectElement.prototype,c=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==r&&c){const f=new Event("change",{bubbles:!0});c.call(s,r),s.dispatchEvent(f)}},[a,r]),x.createElement(rh,{asChild:!0},x.createElement("select",ge({},n,{ref:o,defaultValue:r})))});R2.displayName="BubbleSelect";function O2(e){const t=Dt(e),r=x.useRef(""),n=x.useRef(0),i=x.useCallback(a=>{const s=r.current+a;t(s),function l(u){r.current=u,window.clearTimeout(n.current),u!==""&&(n.current=window.setTimeout(()=>l(""),1e3))}(s)},[t]),o=x.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,i,o]}function F2(e,t,r){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=pI(e,Math.max(o,0));i.length===1&&(a=a.filter(u=>u!==r));const l=a.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==r?l:void 0}function pI(e,t){return e.map((r,n)=>e[(t+n)%e.length])}const gI=WP,mI=GP,vI=XP,xI=KP,wI=YP,yI=qP,EI=eI,Vc=iI,h1=aI,SI=lI,_I=uI,TI=fI,CI=dI,AI=hI;function oh(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,o;for(o=0;o=0)&&(r[i]=e[i]);return r}var RI=["color"],OI=x.forwardRef(function(e,t){var r=e.color,n=r===void 0?"currentColor":r,i=oh(e,RI);return x.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),x.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))}),FI=["color"],s0=x.forwardRef(function(e,t){var r=e.color,n=r===void 0?"currentColor":r,i=oh(e,FI);return x.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),x.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))}),DI=["color"],PI=x.forwardRef(function(e,t){var r=e.color,n=r===void 0?"currentColor":r,i=oh(e,DI);return x.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),x.createElement("path",{d:"M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))});const Xi=({value:e,onChange:t,label:r="Select",placeholder:n="Select a fruit…",groups:i,labelType:o="col"})=>{const a=(i==null?void 0:i.length)===1;return Ce(gI,{value:e,onValueChange:t,children:[Ce(Vc,{className:kt("flex gap-1",{"flex-row items-center gap-2":o==="row","flex-col":o==="col"}),children:[X(h1,{className:"whitespace-nowrap",children:r}),Ce(mI,{className:"justify-between bg-white text-black dark:text-white dark:bg-grey-900 whitespace-nowrap h-[36px] border-[1.5px] border-grey-700 rounded p-3 inline-flex items-center leading-none gap-[5px] shadow-[0_2px_10px] shadow-black/10 focus:shadow-[0_0_0_2px] focus:shadow-black data-[placeholder]:text-white outline-none","aria-label":r,children:[X(vI,{placeholder:n}),X(xI,{children:X(s0,{})})]})]}),X(wI,{children:Ce(yI,{className:"z-50 bg-white/80 dark:bg-grey-900/80 backdrop-filter backdrop-blur overflow-hidden border-[1.5px] border-grey-700 rounded p-3 shadow-[0px_10px_38px_-10px_rgba(22,_23,_24,_0.35),0px_10px_20px_-15px_rgba(22,_23,_24,_0.2)]",children:[X(CI,{className:"flex items-center justify-center h-[25px] cursor-default dark:text-white text-black",children:X(PI,{})}),X(EI,{className:"p-[5px]",children:a?X(Vc,{children:i[0].items.map(s=>X(p1,{value:s.value,disabled:s.disabled,children:s.label}))}):i.map((s,l)=>Ce(Vc,{children:[X(h1,{className:"text-xs leading-[25px]",children:s.label}),s.items.map(u=>X(p1,{value:u.value,disabled:u.disabled,children:u.label},u.value))]},s.label))}),X(AI,{className:"flex items-center justify-center h-[25px] cursor-default dark:text-white text-black",children:X(s0,{})})]})})]})},p1=x.forwardRef(({children:e,className:t,...r},n)=>Ce(SI,{className:kt("text-[13px] leading-none rounded-[3px] flex items-center h-[25px] pr-[35px] pl-[25px] relative select-none data-[disabled]:text-grey-400 data-[disabled]:pointer-events-none data-[highlighted]:outline-none data-[highlighted]:bg-grey-600 data-[highlighted]:text-white text-black dark:text-white",t),...r,ref:n,children:[X(_I,{children:e}),X(TI,{className:"absolute left-0 w-[25px] inline-flex items-center justify-center",children:X(OI,{})})]})),D2="ToastProvider",[ah,II,bI]=Ou("Toast"),[P2,i$]=sn("Toast",[bI]),[kI,$u]=P2(D2),I2=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:i="right",swipeThreshold:o=50,children:a}=e,[s,l]=x.useState(null),[u,c]=x.useState(0),f=x.useRef(!1),d=x.useRef(!1);return x.createElement(ah.Provider,{scope:t},x.createElement(kI,{scope:t,label:r,duration:n,swipeDirection:i,swipeThreshold:o,toastCount:u,viewport:s,onViewportChange:l,onToastAdd:x.useCallback(()=>c(h=>h+1),[]),onToastRemove:x.useCallback(()=>c(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:d},a))};I2.propTypes={label(e){if(e.label&&typeof e.label=="string"&&!e.label.trim()){const t=`Invalid prop \`label\` supplied to \`${D2}\`. Expected non-empty \`string\`.`;return new Error(t)}return null}};const $I="ToastViewport",NI=["F8"],l0="toast.viewportPause",u0="toast.viewportResume",MI=x.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=NI,label:i="Notifications ({hotkey})",...o}=e,a=$u($I,r),s=II(r),l=x.useRef(null),u=x.useRef(null),c=x.useRef(null),f=x.useRef(null),d=We(t,f,a.onViewportChange),h=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),m=a.toastCount>0;x.useEffect(()=>{const g=v=>{var w;n.every(E=>v[E]||v.code===E)&&((w=f.current)===null||w===void 0||w.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[n]),x.useEffect(()=>{const g=l.current,v=f.current;if(m&&g&&v){const w=()=>{if(!a.isClosePausedRef.current){const k=new CustomEvent(l0);v.dispatchEvent(k),a.isClosePausedRef.current=!0}},y=()=>{if(a.isClosePausedRef.current){const k=new CustomEvent(u0);v.dispatchEvent(k),a.isClosePausedRef.current=!1}},E=k=>{!g.contains(k.relatedTarget)&&y()},b=()=>{g.contains(document.activeElement)||y()};return g.addEventListener("focusin",w),g.addEventListener("focusout",E),g.addEventListener("pointermove",w),g.addEventListener("pointerleave",b),window.addEventListener("blur",w),window.addEventListener("focus",y),()=>{g.removeEventListener("focusin",w),g.removeEventListener("focusout",E),g.removeEventListener("pointermove",w),g.removeEventListener("pointerleave",b),window.removeEventListener("blur",w),window.removeEventListener("focus",y)}}},[m,a.isClosePausedRef]);const p=x.useCallback(({tabbingDirection:g})=>{const w=s().map(y=>{const E=y.ref.current,b=[E,...e5(E)];return g==="forwards"?b:b.reverse()});return(g==="forwards"?w.reverse():w).flat()},[s]);return x.useEffect(()=>{const g=f.current;if(g){const v=w=>{const y=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!y){const C=document.activeElement,A=w.shiftKey;if(w.target===g&&A){var b;(b=u.current)===null||b===void 0||b.focus();return}const U=p({tabbingDirection:A?"backwards":"forwards"}),H=U.findIndex(G=>G===C);if(Wc(U.slice(H+1)))w.preventDefault();else{var k,_;A?(k=u.current)===null||k===void 0||k.focus():(_=c.current)===null||_===void 0||_.focus()}}};return g.addEventListener("keydown",v),()=>g.removeEventListener("keydown",v)}},[s,p]),x.createElement(s_,{ref:l,role:"region","aria-label":i.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:m?void 0:"none"}},m&&x.createElement(g1,{ref:u,onFocusFromOutsideViewport:()=>{const g=p({tabbingDirection:"forwards"});Wc(g)}}),x.createElement(ah.Slot,{scope:r},x.createElement(Ie.ol,ge({tabIndex:-1},o,{ref:d}))),m&&x.createElement(g1,{ref:c,onFocusFromOutsideViewport:()=>{const g=p({tabbingDirection:"backwards"});Wc(g)}}))}),LI="ToastFocusProxy",g1=x.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...i}=e,o=$u(LI,r);return x.createElement(rh,ge({"aria-hidden":!0,tabIndex:0},i,{ref:t,style:{position:"fixed"},onFocus:a=>{var s;const l=a.relatedTarget;!((s=o.viewport)!==null&&s!==void 0&&s.contains(l))&&n()}}))}),Nu="Toast",BI="toast.swipeStart",UI="toast.swipeMove",HI="toast.swipeCancel",VI="toast.swipeEnd",WI=x.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:i,onOpenChange:o,...a}=e,[s=!0,l]=go({prop:n,defaultProp:i,onChange:o});return x.createElement(mi,{present:r||s},x.createElement(b2,ge({open:s},a,{ref:t,onClose:()=>l(!1),onPause:Dt(e.onPause),onResume:Dt(e.onResume),onSwipeStart:Se(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Se(e.onSwipeMove,u=>{const{x:c,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:Se(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Se(e.onSwipeEnd,u=>{const{x:c,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),l(!1)})})))}),[zI,GI]=P2(Nu,{onClose(){}}),b2=x.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:i,open:o,onClose:a,onEscapeKeyDown:s,onPause:l,onResume:u,onSwipeStart:c,onSwipeMove:f,onSwipeCancel:d,onSwipeEnd:h,...m}=e,p=$u(Nu,r),[g,v]=x.useState(null),w=We(t,G=>v(G)),y=x.useRef(null),E=x.useRef(null),b=i||p.duration,k=x.useRef(0),_=x.useRef(b),C=x.useRef(0),{onToastAdd:A,onToastRemove:L}=p,B=Dt(()=>{var G;(g==null?void 0:g.contains(document.activeElement))&&((G=p.viewport)===null||G===void 0||G.focus()),a()}),U=x.useCallback(G=>{!G||G===1/0||(window.clearTimeout(C.current),k.current=new Date().getTime(),C.current=window.setTimeout(B,G))},[B]);x.useEffect(()=>{const G=p.viewport;if(G){const ee=()=>{U(_.current),u==null||u()},ae=()=>{const he=new Date().getTime()-k.current;_.current=_.current-he,window.clearTimeout(C.current),l==null||l()};return G.addEventListener(l0,ae),G.addEventListener(u0,ee),()=>{G.removeEventListener(l0,ae),G.removeEventListener(u0,ee)}}},[p.viewport,b,l,u,U]),x.useEffect(()=>{o&&!p.isClosePausedRef.current&&U(b)},[o,b,p.isClosePausedRef,U]),x.useEffect(()=>(A(),()=>L()),[A,L]);const H=x.useMemo(()=>g?N2(g):null,[g]);return p.viewport?x.createElement(x.Fragment,null,H&&x.createElement(jI,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0},H),x.createElement(zI,{scope:r,onClose:B},gi.createPortal(x.createElement(ah.ItemSlot,{scope:r},x.createElement(a_,{asChild:!0,onEscapeKeyDown:Se(s,()=>{p.isFocusedToastEscapeKeyDownRef.current||B(),p.isFocusedToastEscapeKeyDownRef.current=!1})},x.createElement(Ie.li,ge({role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":p.swipeDirection},m,{ref:w,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Se(e.onKeyDown,G=>{G.key==="Escape"&&(s==null||s(G.nativeEvent),G.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,B()))}),onPointerDown:Se(e.onPointerDown,G=>{G.button===0&&(y.current={x:G.clientX,y:G.clientY})}),onPointerMove:Se(e.onPointerMove,G=>{if(!y.current)return;const ee=G.clientX-y.current.x,ae=G.clientY-y.current.y,he=!!E.current,Te=["left","right"].includes(p.swipeDirection),oe=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,ye=Te?oe(0,ee):0,te=Te?0:oe(0,ae),O=G.pointerType==="touch"?10:2,M={x:ye,y:te},N={originalEvent:G,delta:M};he?(E.current=M,Gs(UI,f,N,{discrete:!1})):m1(M,p.swipeDirection,O)?(E.current=M,Gs(BI,c,N,{discrete:!1}),G.target.setPointerCapture(G.pointerId)):(Math.abs(ee)>O||Math.abs(ae)>O)&&(y.current=null)}),onPointerUp:Se(e.onPointerUp,G=>{const ee=E.current,ae=G.target;if(ae.hasPointerCapture(G.pointerId)&&ae.releasePointerCapture(G.pointerId),E.current=null,y.current=null,ee){const he=G.currentTarget,Te={originalEvent:G,delta:ee};m1(ee,p.swipeDirection,p.swipeThreshold)?Gs(VI,h,Te,{discrete:!0}):Gs(HI,d,Te,{discrete:!0}),he.addEventListener("click",oe=>oe.preventDefault(),{once:!0})}})})))),p.viewport))):null});b2.propTypes={type(e){if(e.type&&!["foreground","background"].includes(e.type)){const t=`Invalid prop \`type\` supplied to \`${Nu}\`. Expected \`foreground | background\`.`;return new Error(t)}return null}};const jI=e=>{const{__scopeToast:t,children:r,...n}=e,i=$u(Nu,t),[o,a]=x.useState(!1),[s,l]=x.useState(!1);return ZI(()=>a(!0)),x.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),s?null:x.createElement(vu,{asChild:!0},x.createElement(rh,n,o&&x.createElement(x.Fragment,null,i.label," ",r)))},XI=x.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return x.createElement(Ie.div,ge({},n,{ref:t}))}),KI=x.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return x.createElement(Ie.div,ge({},n,{ref:t}))}),YI="ToastAction",qI=x.forwardRef((e,t)=>{const{altText:r,...n}=e;return r?x.createElement($2,{altText:r,asChild:!0},x.createElement(k2,ge({},n,{ref:t}))):null});qI.propTypes={altText(e){return e.altText?null:new Error(`Missing prop \`altText\` expected on \`${YI}\``)}};const QI="ToastClose",k2=x.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,i=GI(QI,r);return x.createElement($2,{asChild:!0},x.createElement(Ie.button,ge({type:"button"},n,{ref:t,onClick:Se(e.onClick,i.onClose)})))}),$2=x.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...i}=e;return x.createElement(Ie.div,ge({"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0},i,{ref:t}))});function N2(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),JI(n)){const i=n.ariaHidden||n.hidden||n.style.display==="none",o=n.dataset.radixToastAnnounceExclude==="";if(!i)if(o){const a=n.dataset.radixToastAnnounceAlt;a&&t.push(a)}else t.push(...N2(n))}}),t}function Gs(e,t,r,{discrete:n}){const i=r.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?wd(i,o):i.dispatchEvent(o)}const m1=(e,t,r=0)=>{const n=Math.abs(e.x),i=Math.abs(e.y),o=n>i;return t==="left"||t==="right"?o&&n>r:!o&&i>r};function ZI(e=()=>{}){const t=Dt(e);Mt(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function JI(e){return e.nodeType===e.ELEMENT_NODE}function e5(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Wc(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}const t5=I2,r5=MI,n5=WI,i5=XI,o5=KI,a5=k2,s5=({title:e,titleId:t,...r})=>Ce("svg",{viewBox:"0 0 18 18",width:18,height:18,fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":t,...r,children:[e?X("title",{id:t,children:e}):null,X("path",{d:"M9 16.5a7.5 7.5 0 1 0 0-15 7.5 7.5 0 0 0 0 15ZM11.25 6.75l-4.5 4.5M6.75 6.75l4.5 4.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]}),l5=({title:e,titleId:t,...r})=>Ce("svg",{viewBox:"0 0 24 24",width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":t,...r,children:[e?X("title",{id:t,children:e}):null,X("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10ZM12 16v-4M12 8h.01",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]}),u5=({title:e,titleId:t,...r})=>Ce("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":t,...r,children:[e?X("title",{id:t,children:e}):null,X("path",{d:"M16.5 8.31V9a7.5 7.5 0 1 1-4.447-6.855",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),X("path",{d:"M16.5 3 9 10.508l-2.25-2.25",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]}),c5=({title:e,titleId:t,...r})=>Ce("svg",{viewBox:"0 0 18 18",width:18,height:18,fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":t,...r,children:[e?X("title",{id:t,children:e}):null,X("path",{d:"M7.718 2.895 1.366 13.5a1.5 1.5 0 0 0 1.282 2.25h12.705a1.5 1.5 0 0 0 1.283-2.25L10.283 2.895a1.5 1.5 0 0 0-2.565 0v0ZM9 6.75v3M9 12.75h.008",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]}),f5=({toast:e,open:t,setOpen:r})=>Ce(t5,{children:[Ce(n5,{open:t,onOpenChange:n=>{e.preventClose||r(n)},className:kt("z-50 fixed bottom-4 md:left-1/2 md:-translate-x-[50%] inset-x-4 w-auto shadow-lg md:max-w-[658px] duration-300","radix-state-open:animate-fade-in","radix-state-closed:animate-toast-hide","radix-swipe-end:animate-toast-swipe-out","translate-x-radix-toast-swipe-move-x","radix-swipe-cancel:translate-x-0 radix-swipe-cancel:duration-200 radix-swipe-cancel:ease-[ease]","px-[40px] md:px-[58px] py-6 flex flex-col border rounded-[4px]",{"bg-green-100 text-green-600 border-green-600":e.status==="success","bg-red-200 text-red-600 border-red-600":e.status==="error","bg-blue-100 text-blue-700 border-blue-600":e.status==="info","bg-orange-200 text-orange-600 border-orange-600":e.status==="warning"},{"h-[72px]":!e.description}),children:[e.status==="success"?X(u5,{className:"absolute left-[8px] md:left-[25px] top-[25px]"}):e.status==="warning"?X(c5,{className:"absolute left-[8px] md:left-[25px] top-[25px]"}):e.status==="error"?X(s5,{className:"absolute left-[8px] md:left-[25px] top-[25px]"}):X(l5,{className:"absolute left-[8px] md:left-[25px] top-[25px]"}),X(i5,{className:"text-grey-900 font-bold text-sm",children:e.title}),e.description&&X(o5,{className:"mt-2 text-[10px] md:text-xs text-grey-800",children:e.description}),X(a5,{className:"absolute top-7 right-5 md:right-7",children:X(ql,{className:"w-4 h-4 text-grey-900"})})]}),X(r5,{})]}),zc="rovingFocusGroup.onEntryFocus",d5={bubbles:!1,cancelable:!0},sh="RovingFocusGroup",[c0,M2,h5]=Ou(sh),[p5,L2]=sn(sh,[h5]),[g5,m5]=p5(sh),v5=x.forwardRef((e,t)=>x.createElement(c0.Provider,{scope:e.__scopeRovingFocusGroup},x.createElement(c0.Slot,{scope:e.__scopeRovingFocusGroup},x.createElement(x5,ge({},e,{ref:t}))))),x5=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,...c}=e,f=x.useRef(null),d=We(t,f),h=Zd(o),[m=null,p]=go({prop:a,defaultProp:s,onChange:l}),[g,v]=x.useState(!1),w=Dt(u),y=M2(r),E=x.useRef(!1),[b,k]=x.useState(0);return x.useEffect(()=>{const _=f.current;if(_)return _.addEventListener(zc,w),()=>_.removeEventListener(zc,w)},[w]),x.createElement(g5,{scope:r,orientation:n,dir:h,loop:i,currentTabStopId:m,onItemFocus:x.useCallback(_=>p(_),[p]),onItemShiftTab:x.useCallback(()=>v(!0),[]),onFocusableItemAdd:x.useCallback(()=>k(_=>_+1),[]),onFocusableItemRemove:x.useCallback(()=>k(_=>_-1),[])},x.createElement(Ie.div,ge({tabIndex:g||b===0?-1:0,"data-orientation":n},c,{ref:d,style:{outline:"none",...e.style},onMouseDown:Se(e.onMouseDown,()=>{E.current=!0}),onFocus:Se(e.onFocus,_=>{const C=!E.current;if(_.target===_.currentTarget&&C&&!g){const A=new CustomEvent(zc,d5);if(_.currentTarget.dispatchEvent(A),!A.defaultPrevented){const L=y().filter(ee=>ee.focusable),B=L.find(ee=>ee.active),U=L.find(ee=>ee.id===m),G=[B,U,...L].filter(Boolean).map(ee=>ee.ref.current);B2(G)}}E.current=!1}),onBlur:Se(e.onBlur,()=>v(!1))})))}),w5="RovingFocusGroupItem",y5=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:o,...a}=e,s=Kr(),l=o||s,u=m5(w5,r),c=u.currentTabStopId===l,f=M2(r),{onFocusableItemAdd:d,onFocusableItemRemove:h}=u;return x.useEffect(()=>{if(n)return d(),()=>h()},[n,d,h]),x.createElement(c0.ItemSlot,{scope:r,id:l,focusable:n,active:i},x.createElement(Ie.span,ge({tabIndex:c?0:-1,"data-orientation":u.orientation},a,{ref:t,onMouseDown:Se(e.onMouseDown,m=>{n?u.onItemFocus(l):m.preventDefault()}),onFocus:Se(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:Se(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){u.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const p=_5(m,u.orientation,u.dir);if(p!==void 0){m.preventDefault();let v=f().filter(w=>w.focusable).map(w=>w.ref.current);if(p==="last")v.reverse();else if(p==="prev"||p==="next"){p==="prev"&&v.reverse();const w=v.indexOf(m.currentTarget);v=u.loop?T5(v,w+1):v.slice(w+1)}setTimeout(()=>B2(v))}})})))}),E5={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function S5(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function _5(e,t,r){const n=S5(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return E5[n]}function B2(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function T5(e,t){return e.map((r,n)=>e[(t+n)%e.length])}const C5=v5,A5=y5,R5=["Enter"," "],O5=["ArrowDown","PageUp","Home"],U2=["ArrowUp","PageDown","End"],F5=[...O5,...U2],Mu="Menu",[f0,D5,P5]=Ou(Mu),[Ai,Lu]=sn(Mu,[P5,Pu,L2]),lh=Pu(),H2=L2(),[I5,ls]=Ai(Mu),[b5,uh]=Ai(Mu),k5=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:i,onOpenChange:o,modal:a=!0}=e,s=lh(t),[l,u]=x.useState(null),c=x.useRef(!1),f=Dt(o),d=Zd(i);return x.useEffect(()=>{const h=()=>{c.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>c.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),x.createElement(E2,s,x.createElement(I5,{scope:t,open:r,onOpenChange:f,content:l,onContentChange:u},x.createElement(b5,{scope:t,onClose:x.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:c,dir:d,modal:a},n)))},$5=x.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,i=lh(r);return x.createElement(S2,ge({},i,n,{ref:t}))}),V2="MenuPortal",[N5,M5]=Ai(V2,{forceMount:void 0}),L5=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:i}=e,o=ls(V2,t);return x.createElement(N5,{scope:t,forceMount:r},x.createElement(mi,{present:r||o.open},x.createElement(vu,{asChild:!0,container:i},n)))},On="MenuContent",[B5,W2]=Ai(On),U5=x.forwardRef((e,t)=>{const r=M5(On,e.__scopeMenu),{forceMount:n=r.forceMount,...i}=e,o=ls(On,e.__scopeMenu),a=uh(On,e.__scopeMenu);return x.createElement(f0.Provider,{scope:e.__scopeMenu},x.createElement(mi,{present:n||o.open},x.createElement(f0.Slot,{scope:e.__scopeMenu},a.modal?x.createElement(H5,ge({},i,{ref:t})):x.createElement(V5,ge({},i,{ref:t})))))}),H5=x.forwardRef((e,t)=>{const r=ls(On,e.__scopeMenu),n=x.useRef(null),i=We(t,n);return x.useEffect(()=>{const o=n.current;if(o)return _d(o)},[]),x.createElement(z2,ge({},e,{ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Se(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)}))}),V5=x.forwardRef((e,t)=>{const r=ls(On,e.__scopeMenu);return x.createElement(z2,ge({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)}))}),z2=x.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:f,onInteractOutside:d,onDismiss:h,disableOutsideScroll:m,...p}=e,g=ls(On,r),v=uh(On,r),w=lh(r),y=H2(r),E=D5(r),[b,k]=x.useState(null),_=x.useRef(null),C=We(t,_,g.onContentChange),A=x.useRef(0),L=x.useRef(""),B=x.useRef(0),U=x.useRef(null),H=x.useRef("right"),G=x.useRef(0),ee=m?Sd:x.Fragment,ae=m?{as:oi,allowPinchZoom:!0}:void 0,he=oe=>{var ye,te;const O=L.current+oe,M=E().filter(W=>!W.disabled),N=document.activeElement,F=(ye=M.find(W=>W.ref.current===N))===null||ye===void 0?void 0:ye.textValue,V=M.map(W=>W.textValue),Y=J5(V,O,F),J=(te=M.find(W=>W.textValue===Y))===null||te===void 0?void 0:te.ref.current;(function W(Q){L.current=Q,window.clearTimeout(A.current),Q!==""&&(A.current=window.setTimeout(()=>W(""),1e3))})(O),J&&setTimeout(()=>J.focus())};x.useEffect(()=>()=>window.clearTimeout(A.current),[]),Ed();const Te=x.useCallback(oe=>{var ye,te;return H.current===((ye=U.current)===null||ye===void 0?void 0:ye.side)&&tb(oe,(te=U.current)===null||te===void 0?void 0:te.area)},[]);return x.createElement(B5,{scope:r,searchRef:L,onItemEnter:x.useCallback(oe=>{Te(oe)&&oe.preventDefault()},[Te]),onItemLeave:x.useCallback(oe=>{var ye;Te(oe)||((ye=_.current)===null||ye===void 0||ye.focus(),k(null))},[Te]),onTriggerLeave:x.useCallback(oe=>{Te(oe)&&oe.preventDefault()},[Te]),pointerGraceTimerRef:B,onPointerGraceIntentChange:x.useCallback(oe=>{U.current=oe},[])},x.createElement(ee,ae,x.createElement(yd,{asChild:!0,trapped:i,onMountAutoFocus:Se(o,oe=>{var ye;oe.preventDefault(),(ye=_.current)===null||ye===void 0||ye.focus()}),onUnmountAutoFocus:a},x.createElement(mu,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:f,onInteractOutside:d,onDismiss:h},x.createElement(C5,ge({asChild:!0},y,{dir:v.dir,orientation:"vertical",loop:n,currentTabStopId:b,onCurrentTabStopIdChange:k,onEntryFocus:Se(l,oe=>{v.isUsingKeyboardRef.current||oe.preventDefault()})}),x.createElement(_2,ge({role:"menu","aria-orientation":"vertical","data-state":q5(g.open),"data-radix-menu-content":"",dir:v.dir},w,p,{ref:C,style:{outline:"none",...p.style},onKeyDown:Se(p.onKeyDown,oe=>{const te=oe.target.closest("[data-radix-menu-content]")===oe.currentTarget,O=oe.ctrlKey||oe.altKey||oe.metaKey,M=oe.key.length===1;te&&(oe.key==="Tab"&&oe.preventDefault(),!O&&M&&he(oe.key));const N=_.current;if(oe.target!==N||!F5.includes(oe.key))return;oe.preventDefault();const V=E().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);U2.includes(oe.key)&&V.reverse(),Q5(V)}),onBlur:Se(e.onBlur,oe=>{oe.currentTarget.contains(oe.target)||(window.clearTimeout(A.current),L.current="")}),onPointerMove:Se(e.onPointerMove,h0(oe=>{const ye=oe.target,te=G.current!==oe.clientX;if(oe.currentTarget.contains(ye)&&te){const O=oe.clientX>G.current?"right":"left";H.current=O,G.current=oe.clientX}}))})))))))}),W5=x.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return x.createElement(Ie.div,ge({role:"group"},n,{ref:t}))}),z5=x.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return x.createElement(Ie.div,ge({},n,{ref:t}))}),d0="MenuItem",v1="menu.itemSelect",G5=x.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...i}=e,o=x.useRef(null),a=uh(d0,e.__scopeMenu),s=W2(d0,e.__scopeMenu),l=We(t,o),u=x.useRef(!1),c=()=>{const f=o.current;if(!r&&f){const d=new CustomEvent(v1,{bubbles:!0,cancelable:!0});f.addEventListener(v1,h=>n==null?void 0:n(h),{once:!0}),wd(f,d),d.defaultPrevented?u.current=!1:a.onClose()}};return x.createElement(j5,ge({},i,{ref:l,disabled:r,onClick:Se(e.onClick,c),onPointerDown:f=>{var d;(d=e.onPointerDown)===null||d===void 0||d.call(e,f),u.current=!0},onPointerUp:Se(e.onPointerUp,f=>{var d;u.current||(d=f.currentTarget)===null||d===void 0||d.click()}),onKeyDown:Se(e.onKeyDown,f=>{const d=s.searchRef.current!=="";r||d&&f.key===" "||R5.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})}))}),j5=x.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:i,...o}=e,a=W2(d0,r),s=H2(r),l=x.useRef(null),u=We(t,l),[c,f]=x.useState(!1),[d,h]=x.useState("");return x.useEffect(()=>{const m=l.current;if(m){var p;h(((p=m.textContent)!==null&&p!==void 0?p:"").trim())}},[o.children]),x.createElement(f0.ItemSlot,{scope:r,disabled:n,textValue:i??d},x.createElement(A5,ge({asChild:!0},s,{focusable:!n}),x.createElement(Ie.div,ge({role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0},o,{ref:u,onPointerMove:Se(e.onPointerMove,h0(m=>{n?a.onItemLeave(m):(a.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus())})),onPointerLeave:Se(e.onPointerLeave,h0(m=>a.onItemLeave(m))),onFocus:Se(e.onFocus,()=>f(!0)),onBlur:Se(e.onBlur,()=>f(!1))}))))}),X5="MenuRadioGroup";Ai(X5,{value:void 0,onValueChange:()=>{}});const K5="MenuItemIndicator";Ai(K5,{checked:!1});const Y5="MenuSub";Ai(Y5);function q5(e){return e?"open":"closed"}function Q5(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function Z5(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function J5(e,t,r){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=Z5(e,Math.max(o,0));i.length===1&&(a=a.filter(u=>u!==r));const l=a.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==r?l:void 0}function eb(e,t){const{x:r,y:n}=e;let i=!1;for(let o=0,a=t.length-1;on!=c>n&&r<(u-s)*(n-l)/(c-l)+s&&(i=!i)}return i}function tb(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return eb(r,t)}function h0(e){return t=>t.pointerType==="mouse"?e(t):void 0}const G2=k5,j2=$5,X2=L5,K2=U5,rb=W5,nb=z5,ib=G5,Y2="ContextMenu",[ob,o$]=sn(Y2,[Lu]),Bu=Lu(),[ab,q2]=ob(Y2),sb=e=>{const{__scopeContextMenu:t,children:r,onOpenChange:n,dir:i,modal:o=!0}=e,[a,s]=x.useState(!1),l=Bu(t),u=Dt(n),c=x.useCallback(f=>{s(f),u(f)},[u]);return x.createElement(ab,{scope:t,open:a,onOpenChange:c,modal:o},x.createElement(G2,ge({},l,{dir:i,open:a,onOpenChange:c,modal:o}),r))},lb="ContextMenuTrigger",ub=x.forwardRef((e,t)=>{const{__scopeContextMenu:r,disabled:n=!1,...i}=e,o=q2(lb,r),a=Bu(r),s=x.useRef({x:0,y:0}),l=x.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...s.current})}),u=x.useRef(0),c=x.useCallback(()=>window.clearTimeout(u.current),[]),f=d=>{s.current={x:d.clientX,y:d.clientY},o.onOpenChange(!0)};return x.useEffect(()=>c,[c]),x.useEffect(()=>void(n&&c()),[n,c]),x.createElement(x.Fragment,null,x.createElement(j2,ge({},a,{virtualRef:l})),x.createElement(Ie.span,ge({"data-state":o.open?"open":"closed","data-disabled":n?"":void 0},i,{ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:n?e.onContextMenu:Se(e.onContextMenu,d=>{c(),f(d),d.preventDefault()}),onPointerDown:n?e.onPointerDown:Se(e.onPointerDown,js(d=>{c(),u.current=window.setTimeout(()=>f(d),700)})),onPointerMove:n?e.onPointerMove:Se(e.onPointerMove,js(c)),onPointerCancel:n?e.onPointerCancel:Se(e.onPointerCancel,js(c)),onPointerUp:n?e.onPointerUp:Se(e.onPointerUp,js(c))})))}),cb=e=>{const{__scopeContextMenu:t,...r}=e,n=Bu(t);return x.createElement(X2,ge({},n,r))},fb="ContextMenuContent",db=x.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,i=q2(fb,r),o=Bu(r),a=x.useRef(!1);return x.createElement(K2,ge({},o,n,{ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:s=>{var l;(l=e.onCloseAutoFocus)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&a.current&&s.preventDefault(),a.current=!1},onInteractOutside:s=>{var l;(l=e.onInteractOutside)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&!i.modal&&(a.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))});function js(e){return t=>t.pointerType!=="mouse"?e(t):void 0}const hb=sb,pb=ub,gb=cb,mb=db,Q2=x.createContext({dragDropManager:void 0});function rr(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var x1=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Gc=function(){return Math.random().toString(36).substring(7).split("").join(".")},w1={INIT:"@@redux/INIT"+Gc(),REPLACE:"@@redux/REPLACE"+Gc(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Gc()}};function vb(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Z2(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(rr(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(rr(1));return r(Z2)(e,t)}if(typeof e!="function")throw new Error(rr(2));var i=e,o=t,a=[],s=a,l=!1;function u(){s===a&&(s=a.slice())}function c(){if(l)throw new Error(rr(3));return o}function f(p){if(typeof p!="function")throw new Error(rr(4));if(l)throw new Error(rr(5));var g=!0;return u(),s.push(p),function(){if(g){if(l)throw new Error(rr(6));g=!1,u();var w=s.indexOf(p);s.splice(w,1),a=null}}}function d(p){if(!vb(p))throw new Error(rr(7));if(typeof p.type>"u")throw new Error(rr(8));if(l)throw new Error(rr(9));try{l=!0,o=i(o,p)}finally{l=!1}for(var g=a=s,v=0;vn&&n[i]?n[i]:r||null,e)}function yb(e,t){return e.filter(r=>r!==t)}function J2(e){return typeof e=="object"}function Eb(e,t){const r=new Map,n=o=>{r.set(o,r.has(o)?r.get(o)+1:1)};e.forEach(n),t.forEach(n);const i=[];return r.forEach((o,a)=>{o===1&&i.push(a)}),i}function Sb(e,t){return e.filter(r=>t.indexOf(r)>-1)}const ch="dnd-core/INIT_COORDS",Uu="dnd-core/BEGIN_DRAG",fh="dnd-core/PUBLISH_DRAG_SOURCE",Hu="dnd-core/HOVER",Vu="dnd-core/DROP",Wu="dnd-core/END_DRAG";function y1(e,t){return{type:ch,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const _b={type:ch,payload:{clientOffset:null,sourceClientOffset:null}};function Tb(e){return function(r=[],n={publishSource:!0}){const{publishSource:i=!0,clientOffset:o,getSourceClientOffset:a}=n,s=e.getMonitor(),l=e.getRegistry();e.dispatch(y1(o)),Cb(r,s,l);const u=Ob(r,s);if(u==null){e.dispatch(_b);return}let c=null;if(o){if(!a)throw new Error("getSourceClientOffset must be defined");Ab(a),c=a(u)}e.dispatch(y1(o,c));const d=l.getSource(u).beginDrag(s,u);if(d==null)return;Rb(d),l.pinSource(u);const h=l.getSourceType(u);return{type:Uu,payload:{itemType:h,item:d,sourceId:u,clientOffset:o||null,sourceClientOffset:c||null,isSourcePublic:!!i}}}}function Cb(e,t,r){Fe(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(n){Fe(r.getSource(n),"Expected sourceIds to be registered.")})}function Ab(e){Fe(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function Rb(e){Fe(J2(e),"Item must be an object.")}function Ob(e,t){let r=null;for(let n=e.length-1;n>=0;n--)if(t.canDragSource(e[n])){r=e[n];break}return r}function Fb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Db(e){for(var t=1;t{const l=bb(a,s,i,n),u={type:Vu,payload:{dropResult:Db({},r,l)}};e.dispatch(u)})}}function Ib(e){Fe(e.isDragging(),"Cannot call drop while not dragging."),Fe(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function bb(e,t,r,n){const i=r.getTarget(e);let o=i?i.drop(n,e):void 0;return kb(o),typeof o>"u"&&(o=t===0?{}:n.getDropResult()),o}function kb(e){Fe(typeof e>"u"||J2(e),"Drop result must either be an object or undefined.")}function $b(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function Nb(e){return function(){const r=e.getMonitor(),n=e.getRegistry();Mb(r);const i=r.getSourceId();return i!=null&&(n.getSource(i,!0).endDrag(r,i),n.unpinSource()),{type:Wu}}}function Mb(e){Fe(e.isDragging(),"Cannot call endDrag while not dragging.")}function p0(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function Lb(e){return function(r,{clientOffset:n}={}){Bb(r);const i=r.slice(0),o=e.getMonitor(),a=e.getRegistry(),s=o.getItemType();return Hb(i,a,s),Ub(i,o,a),Vb(i,o,a),{type:Hu,payload:{targetIds:i,clientOffset:n||null}}}}function Bb(e){Fe(Array.isArray(e),"Expected targetIds to be an array.")}function Ub(e,t,r){Fe(t.isDragging(),"Cannot call hover while not dragging."),Fe(!t.didDrop(),"Cannot call hover after drop.");for(let n=0;n=0;n--){const i=e[n],o=t.getTargetType(i);p0(o,r)||e.splice(n,1)}}function Vb(e,t,r){e.forEach(function(n){r.getTarget(n).hover(t,n)})}function Wb(e){return function(){if(e.getMonitor().isDragging())return{type:fh}}}function zb(e){return{beginDrag:Tb(e),publishDragSource:Wb(e),hover:Lb(e),drop:Pb(e),endDrag:Nb(e)}}class Gb{receiveBackend(t){this.backend=t}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const t=this,{dispatch:r}=this.store;function n(o){return(...a)=>{const s=o.apply(t,a);typeof s<"u"&&r(s)}}const i=zb(this);return Object.keys(i).reduce((o,a)=>{const s=i[a];return o[a]=n(s),o},{})}dispatch(t){this.store.dispatch(t)}constructor(t,r){this.isSetUp=!1,this.handleRefCountChange=()=>{const n=this.store.getState().refCount>0;this.backend&&(n&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!n&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}}function jb(e,t){return{x:e.x+t.x,y:e.y+t.y}}function ey(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Xb(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:n}=e;return!t||!r||!n?null:ey(jb(t,n),r)}function Kb(e){const{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:ey(t,r)}const Sa=[],dh=[];Sa.__IS_NONE__=!0;dh.__IS_ALL__=!0;function Yb(e,t){return e===Sa?!1:e===dh||typeof t>"u"?!0:Sb(t,e).length>0}class qb{subscribeToStateChange(t,r={}){const{handlerIds:n}=r;Fe(typeof t=="function","listener must be a function."),Fe(typeof n>"u"||Array.isArray(n),"handlerIds, when specified, must be an array of strings.");let i=this.store.getState().stateId;const o=()=>{const a=this.store.getState(),s=a.stateId;try{s===i||s===i+1&&!Yb(a.dirtyHandlerIds,n)||t()}finally{i=s}};return this.store.subscribe(o)}subscribeToOffsetChange(t){Fe(typeof t=="function","listener must be a function.");let r=this.store.getState().dragOffset;const n=()=>{const i=this.store.getState().dragOffset;i!==r&&(r=i,t())};return this.store.subscribe(n)}canDragSource(t){if(!t)return!1;const r=this.registry.getSource(t);return Fe(r,`Expected to find a valid source. sourceId=${t}`),this.isDragging()?!1:r.canDrag(this,t)}canDropOnTarget(t){if(!t)return!1;const r=this.registry.getTarget(t);if(Fe(r,`Expected to find a valid target. targetId=${t}`),!this.isDragging()||this.didDrop())return!1;const n=this.registry.getTargetType(t),i=this.getItemType();return p0(n,i)&&r.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const r=this.registry.getSource(t,!0);if(Fe(r,`Expected to find a valid source. sourceId=${t}`),!this.isDragging()||!this.isSourcePublic())return!1;const n=this.registry.getSourceType(t),i=this.getItemType();return n!==i?!1:r.isDragging(this,t)}isOverTarget(t,r={shallow:!1}){if(!t)return!1;const{shallow:n}=r;if(!this.isDragging())return!1;const i=this.registry.getTargetType(t),o=this.getItemType();if(o&&!p0(i,o))return!1;const a=this.getTargetIds();if(!a.length)return!1;const s=a.indexOf(t);return n?s===a.length-1:s>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return Xb(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return Kb(this.store.getState().dragOffset)}constructor(t,r){this.store=t,this.registry=r}}const E1=typeof global<"u"?global:self,ty=E1.MutationObserver||E1.WebKitMutationObserver;function ry(e){return function(){const r=setTimeout(i,0),n=setInterval(i,50);function i(){clearTimeout(r),clearInterval(n),e()}}}function Qb(e){let t=1;const r=new ty(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const Zb=typeof ty=="function"?Qb:ry;class Jb{enqueueTask(t){const{queue:r,requestFlush:n}=this;r.length||(n(),this.flushing=!0),r[r.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.indexthis.capacity){for(let n=0,i=t.length-this.index;n{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=Zb(this.flush),this.requestErrorThrow=ry(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class e8{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,r){this.onError=t,this.release=r,this.task=null}}class t8{create(t){const r=this.freeTasks,n=r.length?r.pop():new e8(this.onError,i=>r[r.length]=i);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const ny=new Jb,r8=new t8(ny.registerPendingError);function n8(e){ny.enqueueTask(r8.create(e))}const hh="dnd-core/ADD_SOURCE",ph="dnd-core/ADD_TARGET",gh="dnd-core/REMOVE_SOURCE",zu="dnd-core/REMOVE_TARGET";function i8(e){return{type:hh,payload:{sourceId:e}}}function o8(e){return{type:ph,payload:{targetId:e}}}function a8(e){return{type:gh,payload:{sourceId:e}}}function s8(e){return{type:zu,payload:{targetId:e}}}function l8(e){Fe(typeof e.canDrag=="function","Expected canDrag to be a function."),Fe(typeof e.beginDrag=="function","Expected beginDrag to be a function."),Fe(typeof e.endDrag=="function","Expected endDrag to be a function.")}function u8(e){Fe(typeof e.canDrop=="function","Expected canDrop to be a function."),Fe(typeof e.hover=="function","Expected hover to be a function."),Fe(typeof e.drop=="function","Expected beginDrag to be a function.")}function g0(e,t){if(t&&Array.isArray(e)){e.forEach(r=>g0(r,!1));return}Fe(typeof e=="string"||typeof e=="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var ar;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(ar||(ar={}));let c8=0;function f8(){return c8++}function d8(e){const t=f8().toString();switch(e){case ar.SOURCE:return`S${t}`;case ar.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function S1(e){switch(e[0]){case"S":return ar.SOURCE;case"T":return ar.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function _1(e,t){const r=e.entries();let n=!1;do{const{done:i,value:[,o]}=r.next();if(o===t)return!0;n=!!i}while(!n);return!1}class h8{addSource(t,r){g0(t),l8(r);const n=this.addHandler(ar.SOURCE,t,r);return this.store.dispatch(i8(n)),n}addTarget(t,r){g0(t,!0),u8(r);const n=this.addHandler(ar.TARGET,t,r);return this.store.dispatch(o8(n)),n}containsHandler(t){return _1(this.dragSources,t)||_1(this.dropTargets,t)}getSource(t,r=!1){return Fe(this.isSourceId(t),"Expected a valid source ID."),r&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return Fe(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return Fe(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return Fe(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return S1(t)===ar.SOURCE}isTargetId(t){return S1(t)===ar.TARGET}removeSource(t){Fe(this.getSource(t),"Expected an existing source."),this.store.dispatch(a8(t)),n8(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){Fe(this.getTarget(t),"Expected an existing target."),this.store.dispatch(s8(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const r=this.getSource(t);Fe(r,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=r}unpinSource(){Fe(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,r,n){const i=d8(t);return this.types.set(i,r),t===ar.SOURCE?this.dragSources.set(i,n):t===ar.TARGET&&this.dropTargets.set(i,n),i}constructor(t){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=t}}const p8=(e,t)=>e===t;function g8(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function m8(e,t,r=p8){if(e.length!==t.length)return!1;for(let n=0;n0||!m8(r,n)))return Sa;const a=n[n.length-1],s=r[r.length-1];return a!==s&&(a&&i.push(a),s&&i.push(s)),i}function x8(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function w8(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function I8(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,o;for(o=0;o=0)&&(r[i]=e[i]);return r}let C1=0;const ul=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var b8=x.memo(function(t){var{children:r}=t,n=P8(t,["children"]);const[i,o]=k8(n);return x.useEffect(()=>{if(o){const a=iy();return++C1,()=>{--C1===0&&(a[ul]=null)}}},[]),X(Q2.Provider,{value:i,children:r})});function k8(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=$8(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}function $8(e,t=iy(),r,n){const i=t;return i[ul]||(i[ul]={dragDropManager:F8(e,t,r,n)}),i[ul]}function iy(){return typeof global<"u"?global:window}var N8=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;i--!==0;){var a=o[i];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r};const M8=Ka(N8),ci=typeof window<"u"?x.useLayoutEffect:x.useEffect;function L8(e,t,r){const[n,i]=x.useState(()=>t(e)),o=x.useCallback(()=>{const a=t(e);M8(n,a)||(i(a),r&&r())},[n,e,r]);return ci(o),[n,o]}function B8(e,t,r){const[n,i]=L8(e,t,r);return ci(function(){const a=e.getHandlerId();if(a!=null)return e.subscribeToStateChange(i,{handlerIds:[a]})},[e,i]),n}function oy(e,t,r){return B8(t,e||(()=>({})),()=>r.reconnect())}function ay(e,t){const r=[...t||[]];return t==null&&typeof e!="function"&&r.push(e),x.useMemo(()=>typeof e=="function"?e():e,r)}function U8(e){return x.useMemo(()=>e.hooks.dragSource(),[e])}function H8(e){return x.useMemo(()=>e.hooks.dragPreview(),[e])}let jc=!1,Xc=!1;class V8{receiveHandlerId(t){this.sourceId=t}getHandlerId(){return this.sourceId}canDrag(){Fe(!jc,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return jc=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{jc=!1}}isDragging(){if(!this.sourceId)return!1;Fe(!Xc,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Xc=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Xc=!1}}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}isDraggingSource(t){return this.internalMonitor.isDraggingSource(t)}isOverTarget(t,r){return this.internalMonitor.isOverTarget(t,r)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(t){return this.internalMonitor.subscribeToOffsetChange(t)}canDragSource(t){return this.internalMonitor.canDragSource(t)}canDropOnTarget(t){return this.internalMonitor.canDropOnTarget(t)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.sourceId=null,this.internalMonitor=t.getMonitor()}}let Kc=!1;class W8{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}canDrop(){if(!this.targetId)return!1;Fe(!Kc,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Kc=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Kc=!1}}isOver(t){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,t):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.targetId=null,this.internalMonitor=t.getMonitor()}}function z8(e,t,r){const n=r.getRegistry(),i=n.addTarget(e,t);return[i,()=>n.removeTarget(i)]}function G8(e,t,r){const n=r.getRegistry(),i=n.addSource(e,t);return[i,()=>n.removeSource(i)]}function m0(e,t,r,n){let i=r?r.call(n,e,t):void 0;if(i!==void 0)return!!i;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;const o=Object.keys(e),a=Object.keys(t);if(o.length!==a.length)return!1;const s=Object.prototype.hasOwnProperty.bind(t);for(let l=0;l, or turn it into a drag source or a drop target itself.`)}function X8(e){return(t=null,r=null)=>{if(!x.isValidElement(t)){const o=t;return e(o,r),o}const n=t;return j8(n),K8(n,r?o=>e(o,r):e)}}function sy(e){const t={};return Object.keys(e).forEach(r=>{const n=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const i=X8(n);t[r]=()=>i}}),t}function A1(e,t){typeof e=="function"?e(t):e.current=t}function K8(e,t){const r=e.ref;return Fe(typeof r!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a or
. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?x.cloneElement(e,{ref:n=>{A1(r,n),A1(t,n)}}):x.cloneElement(e,{ref:t})}class Y8{receiveHandlerId(t){this.handlerId!==t&&(this.handlerId=t,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(t){this.dragSourceOptionsInternal=t}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(t){this.dragPreviewOptionsInternal=t}reconnect(){const t=this.reconnectDragSource();this.reconnectDragPreview(t)}reconnectDragSource(){const t=this.dragSource,r=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return r&&this.disconnectDragSource(),this.handlerId?t?(r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=t,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,t,this.dragSourceOptions)),r):(this.lastConnectedDragSource=t,r):r}reconnectDragPreview(t=!1){const r=this.dragPreview,n=t||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(n&&this.disconnectDragPreview(),!!this.handlerId){if(!r){this.lastConnectedDragPreview=r;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=r,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,r,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!m0(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!m0(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(t){this.hooks=sy({dragSource:(r,n)=>{this.clearDragSource(),this.dragSourceOptions=n||null,v0(r)?this.dragSourceRef=r:this.dragSourceNode=r,this.reconnectDragSource()},dragPreview:(r,n)=>{this.clearDragPreview(),this.dragPreviewOptions=n||null,v0(r)?this.dragPreviewRef=r:this.dragPreviewNode=r,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=t}}class q8{get connectTarget(){return this.dropTarget}reconnect(){const t=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();t&&this.disconnectDropTarget();const r=this.dropTarget;if(this.handlerId){if(!r){this.lastConnectedDropTarget=r;return}t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=r,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,r,this.dropTargetOptions))}}receiveHandlerId(t){t!==this.handlerId&&(this.handlerId=t,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(t){this.dropTargetOptionsInternal=t}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!m0(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(t){this.hooks=sy({dropTarget:(r,n)=>{this.clearDropTarget(),this.dropTargetOptions=n,v0(r)?this.dropTargetRef=r:this.dropTargetNode=r,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}}function Io(){const{dragDropManager:e}=x.useContext(Q2);return Fe(e!=null,"Expected drag drop context"),e}function Q8(e,t){const r=Io(),n=x.useMemo(()=>new Y8(r.getBackend()),[r]);return ci(()=>(n.dragSourceOptions=e||null,n.reconnect(),()=>n.disconnectDragSource()),[n,e]),ci(()=>(n.dragPreviewOptions=t||null,n.reconnect(),()=>n.disconnectDragPreview()),[n,t]),n}function Z8(){const e=Io();return x.useMemo(()=>new V8(e),[e])}class J8{beginDrag(){const t=this.spec,r=this.monitor;let n=null;return typeof t.item=="object"?n=t.item:typeof t.item=="function"?n=t.item(r):n={},n??null}canDrag(){const t=this.spec,r=this.monitor;return typeof t.canDrag=="boolean"?t.canDrag:typeof t.canDrag=="function"?t.canDrag(r):!0}isDragging(t,r){const n=this.spec,i=this.monitor,{isDragging:o}=n;return o?o(i):r===t.getSourceId()}endDrag(){const t=this.spec,r=this.monitor,n=this.connector,{end:i}=t;i&&i(r.getItem(),r),n.reconnect()}constructor(t,r,n){this.spec=t,this.monitor=r,this.connector=n}}function ek(e,t,r){const n=x.useMemo(()=>new J8(e,t,r),[t,r]);return x.useEffect(()=>{n.spec=e},[e]),n}function tk(e){return x.useMemo(()=>{const t=e.type;return Fe(t!=null,"spec.type must be defined"),t},[e])}function rk(e,t,r){const n=Io(),i=ek(e,t,r),o=tk(e);ci(function(){if(o!=null){const[s,l]=G8(o,i,n);return t.receiveHandlerId(s),r.receiveHandlerId(s),l}},[n,t,r,i,o])}function nk(e,t){const r=ay(e,t);Fe(!r.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const n=Z8(),i=Q8(r.options,r.previewOptions);return rk(r,n,i),[oy(r.collect,n,i),U8(i),H8(i)]}function ik(e){return x.useMemo(()=>e.hooks.dropTarget(),[e])}function ok(e){const t=Io(),r=x.useMemo(()=>new q8(t.getBackend()),[t]);return ci(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function ak(){const e=Io();return x.useMemo(()=>new W8(e),[e])}function sk(e){const{accept:t}=e;return x.useMemo(()=>(Fe(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class lk{canDrop(){const t=this.spec,r=this.monitor;return t.canDrop?t.canDrop(r.getItem(),r):!0}hover(){const t=this.spec,r=this.monitor;t.hover&&t.hover(r.getItem(),r)}drop(){const t=this.spec,r=this.monitor;if(t.drop)return t.drop(r.getItem(),r)}constructor(t,r){this.spec=t,this.monitor=r}}function uk(e,t){const r=x.useMemo(()=>new lk(e,t),[t]);return x.useEffect(()=>{r.spec=e},[e]),r}function ck(e,t,r){const n=Io(),i=uk(e,t),o=sk(e);ci(function(){const[s,l]=z8(o,i,n);return t.receiveHandlerId(s),r.receiveHandlerId(s),l},[n,t,i,r,o.map(a=>a.toString()).join("|")])}function fk(e,t){const r=ay(e,t),n=ak(),i=ok(r.options);return ck(r,n,i),[oy(r.collect,n,i),ik(i)]}const ly=new RegExp("^([0-9]+)(\\s)([kKmMbBtT])$"),_a=new RegExp("^\\d{4}$"),dk=new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}|\\d{4}-\\d{2}-\\d{2}$");function hk({column:e,table:t,numberOfColumns:r}){function n(f){if(!f)return null;const d=new Date(f),h=d.toISOString().split("T")[0],m=d.toTimeString().split(" ")[0];return`${h} ${m}`}const i=t.getPreFilteredRowModel().flatRows.map(f=>f.original[e.id]),o=i.every(f=>typeof f=="string"||f===null),a=i.every(f=>typeof f=="number"||ly.test(f)||f===null||f===""),s=i.some(f=>typeof f=="string"&&f.includes(" ")),l=e.getFilterValue();let u="date";const c=i.every(f=>{const d=f==null?void 0:f.toString().replace(/[^0-9]/g,"").trim();return dk.test(f==null?void 0:f.toString())&&(u="datetime-local"),_a.test(f==null?void 0:f.toString())&&(u="number"),(d==null?void 0:d.length)>=4&&(Yl(e.id)||e.id.toLowerCase()==="index"&&!s)});return c&&u==="number"?Ce("div",{className:"flex gap-2 h-6",children:[X("input",{type:u,value:(l==null?void 0:l[0])??"",onChange:f=>{e.setFilterValue(d=>[`${f.target.value}`,`${d==null?void 0:d[1]}`])},min:i.reduce((f,d)=>Math.min(f,parseInt(d,10)),1/0),max:i.reduce((f,d)=>Math.max(f,parseInt(d,10)),-1/0),placeholder:"Start year",className:"_input",title:"Start year"}),X("input",{type:u,value:(l==null?void 0:l[1])??"",onChange:f=>{e.setFilterValue(d=>[`${d==null?void 0:d[0]}`,`${f.target.value}`])},min:i.reduce((f,d)=>Math.min(f,parseInt(d,10)),1/0),max:i.reduce((f,d)=>Math.max(f,parseInt(d,10)),-1/0),placeholder:"End year",className:"_input",title:"End year"})]}):c&&u!=="number"?Ce("div",{className:"flex gap-2 h-6",children:[X("input",{type:u,value:n(l==null?void 0:l[0])??"",onChange:f=>{const d=new Date(f.target.value).getTime();e.setFilterValue(h=>[d,h==null?void 0:h[1]])},placeholder:"Start date",className:"_input",title:"Start date"}),X("input",{type:u,value:n(l==null?void 0:l[1])??"",onChange:f=>{const d=new Date(f.target.value).getTime();e.setFilterValue(h=>[h==null?void 0:h[0],d])},placeholder:"End date",className:"_input",title:"End date"})]}):a?Ce("div",{className:"flex gap-0.5 h-6",children:[X("input",{type:"number",value:(l==null?void 0:l[0])??"",onChange:f=>e.setFilterValue(d=>[f.target.value,d==null?void 0:d[1]]),placeholder:"Min",className:"_input p-0.5",title:"Min"}),X("input",{type:"number",value:(l==null?void 0:l[1])??"",onChange:f=>e.setFilterValue(d=>[d==null?void 0:d[0],f.target.value]),placeholder:"Max",className:"_input p-0.5",title:"Max"})]}):o?X("div",{className:"h-6",children:X("input",{type:"text",value:l??"",onChange:f=>e.setFilterValue(f.target.value),placeholder:"Search...",className:"_input",title:"Search"})}):X("div",{className:"h-6"})}const pk=(e,t,r)=>(r.splice(r.indexOf(t),0,r.splice(r.indexOf(e),1)[0]),[...r]),gk=({header:e,table:t,advanced:r,idx:n,lockFirstColumn:i,setLockFirstColumn:o})=>{const{getState:a,setColumnOrder:s}=t,{columnOrder:l}=a(),{column:u}=e,[,c]=fk({accept:"column",drop:p=>{const g=pk(p.id,u.id,l);s(g)}}),[{isDragging:f},d,h]=nk({collect:p=>({isDragging:p.isDragging()}),item:()=>u,type:"column"}),m=()=>X("div",{ref:h,className:"flex gap-1 flex-col",children:e.isPlaceholder?null:Ce(q1,{children:[Ce("div",{className:"font-bold uppercase text-grey-700 dark:text-white tracking-widest flex gap-2 whitespace-nowrap justify-between",children:[Ce("div",{onClick:u.getToggleSortingHandler(),className:kt("flex gap-1",{"cursor-pointer select-none":u.getCanSort()}),children:[Kf(u.columnDef.header,e.getContext()),u.getCanSort()&&Ce("div",{className:"flex flex-col gap-0.5 items-center justify-center",children:[X("button",{className:kt({"text-[#669DCB]":u.getIsSorted()==="asc","text-grey-600":u.getIsSorted()!=="asc"}),children:X("svg",{xmlns:"http://www.w3.org/2000/svg",width:"6",height:"4",fill:"none",viewBox:"0 0 11 5",children:X("path",{fill:"currentColor",d:"M10.333 5l-5-5-5 5"})})}),X("button",{className:kt({"text-[#669DCB]":e.column.getIsSorted()==="desc","text-grey-600":e.column.getIsSorted()!=="desc"}),children:X("svg",{xmlns:"http://www.w3.org/2000/svg",width:"6",height:"4",fill:"none",viewBox:"0 0 11 5",children:X("path",{fill:"currentColor",d:"M.333 0l5 5 5-5"})})})]})]}),r&&u.id!=="select"&&X("button",{ref:d,className:"text-grey-600 hover:text-grey-800 dark:hover:text-white",children:X("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"11",fill:"none",viewBox:"0 0 17 16",children:X("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M3.667 6l-2 2 2 2M6.333 3.333l2-2 2 2M10.333 12.667l-2 2-2-2M13 6l2 2-2 2M1.667 8H15M8.333 1.333v13.334"})})})]}),r&&u.getCanFilter()?X("div",{children:X(hk,{column:u,table:t,numberOfColumns:(l==null?void 0:l.length)??0})}):null]})});return Ce("th",{className:kt("h-[70px] p-4 sticky",{"left-0 z-50 bg-white dark:bg-grey-900":n===0&&i}),colSpan:e.colSpan,style:{width:e.getSize()+10,opacity:f?.5:1},ref:c,children:[n===0?Ce(hb,{children:[X(pb,{asChild:!0,children:m()}),X(gb,{children:X(mb,{className:"bg-white text-black dark:text-white dark:bg-grey-900 border border-grey-200 dark:border-grey-800 rounded-md shadow-lg p-2 z-50 text-xs",children:X("div",{className:"flex flex-col gap-2",children:Ce("button",{onClick:()=>{o(!i)},className:"hover:bg-grey-300 dark:hover:bg-grey-800 rounded-md p-2",children:[i?"Unlock":"Lock"," first column"]})})})})]}):m(),X("button",{className:"resizer bg-grey-300/20 dark:hover:bg-white absolute top-0 right-0 w-0.5 h-full",onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler()})]})};function mk({open:e,close:t}){const r=window.download_path||"~/OpenBBUserData/exports";return Ce(jv,{open:e,onOpenChange:t,children:[Ce("div",{id:"loading",className:"saving",children:[X("div",{id:"loading_text",className:"loading_text"}),X("div",{id:"loader",className:"loader"})]}),X(Xv,{onClick:t,className:"_modal-overlay"}),Ce(Kv,{className:"_modal",children:[X(Wf,{children:X(ql,{})}),X(Wf,{className:"_modal-close",onClick:t,style:{float:"right",marginTop:20},children:X(ql,{className:"w-6 h-6"})}),X(Yv,{className:"_modal-title",children:"Success"}),Ce("div",{id:"popup_title",className:"popup_content",style:{padding:"0px 2px 2px 5px",marginTop:5},children:[X("div",{style:{display:"flex",flexDirection:"column",gap:0,fontSize:14},children:X("div",{children:Ce("label",{htmlFor:"title_text",children:[X("b",{children:window.title})," has been downloaded to",X("br",{}),X("br",{}),X("a",{style:{color:"#FFDD00",marginTop:15},href:`${r}`,onClick:n=>{n.preventDefault(),window.pywry.open_file(r)},children:r})]})})}),X("div",{style:{float:"right",marginTop:20},children:X("button",{className:"_btn",style:{padding:"8px 16px",width:"100%"},onClick:t,children:"Close"})})]})]})]})}function vk({columns:e,data:t,type:r,setType:n,downloadFinished:i}){const o=()=>{switch(r){case"csv":Qg("csv",e,t,i);break;case"xlsx":Qg("xlsx",e,t,i);break;case"png":sP("table",i);break}};return Ce("div",{className:"flex gap-2 items-center",children:[X(Xi,{labelType:"row",value:r,onChange:a=>{n(a)},label:"Type",placeholder:"Select type",groups:[{label:"Type",items:w0.map(a=>({label:a,value:a}))}]}),X("button",{onClick:o,className:"_btn",children:"Export"})]})}const uy="DropdownMenu",[xk,a$]=sn(uy,[Lu]),Ri=Lu(),[wk,cy]=xk(uy),yk=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:i,defaultOpen:o,onOpenChange:a,modal:s=!0}=e,l=Ri(t),u=x.useRef(null),[c=!1,f]=go({prop:i,defaultProp:o,onChange:a});return x.createElement(wk,{scope:t,triggerId:Kr(),triggerRef:u,contentId:Kr(),open:c,onOpenChange:f,onOpenToggle:x.useCallback(()=>f(d=>!d),[f]),modal:s},x.createElement(G2,ge({},l,{open:c,onOpenChange:f,dir:n,modal:s}),r))},Ek="DropdownMenuTrigger",Sk=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...i}=e,o=cy(Ek,r),a=Ri(r);return x.createElement(j2,ge({asChild:!0},a),x.createElement(Ie.button,ge({type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":n?"":void 0,disabled:n},i,{ref:xd(t,o.triggerRef),onPointerDown:Se(e.onPointerDown,s=>{!n&&s.button===0&&s.ctrlKey===!1&&(o.onOpenToggle(),o.open||s.preventDefault())}),onKeyDown:Se(e.onKeyDown,s=>{n||(["Enter"," "].includes(s.key)&&o.onOpenToggle(),s.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})))}),_k=e=>{const{__scopeDropdownMenu:t,...r}=e,n=Ri(t);return x.createElement(X2,ge({},n,r))},Tk="DropdownMenuContent",Ck=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=cy(Tk,r),o=Ri(r),a=x.useRef(!1);return x.createElement(K2,ge({id:i.contentId,"aria-labelledby":i.triggerId},o,n,{ref:t,onCloseAutoFocus:Se(e.onCloseAutoFocus,s=>{var l;a.current||(l=i.triggerRef.current)===null||l===void 0||l.focus(),a.current=!1,s.preventDefault()}),onInteractOutside:Se(e.onInteractOutside,s=>{const l=s.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,c=l.button===2||u;(!i.modal||c)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),Ak=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Ri(r);return x.createElement(rb,ge({},i,n,{ref:t}))}),Rk=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Ri(r);return x.createElement(nb,ge({},i,n,{ref:t}))}),Ok=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Ri(r);return x.createElement(ib,ge({},i,n,{ref:t}))}),Fk=yk,R1=Sk,Dk=_k,Pk=Ck,Ik=Ak,bk=Rk,Yc=Ok;function kk(e,t){x.useEffect(()=>{const r=n=>{!e.current||e.current.contains(n.target)||t(n)};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r)}},[e,t])}function O1({label:e,table:t,onlyIconTrigger:r=!1}){const[n,i]=x.useState(!1),o=x.useRef(null);kk(o,()=>i(!1)),x.useEffect(()=>{const s=l=>{l.key==="Escape"&&i(!1)};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[]);function a(){t.resetColumnFilters(),i(!1)}return Ce(Fk,{open:n,children:[r?X(R1,{title:"Filter columns",onClick:()=>i(!n),children:X("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-7 h-7",children:X("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 01-.659 1.591l-5.432 5.432a2.25 2.25 0 00-.659 1.591v2.927a2.25 2.25 0 01-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 00-.659-1.591L3.659 7.409A2.25 2.25 0 013 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0112 3z"})})}):Ce(Ik,{className:"flex flex-row items-center gap-2",children:[X(bk,{className:"whitespace-nowrap",children:e}),Ce(R1,{onClick:()=>i(!n),className:"bg-white text-black dark:bg-grey-900 dark:text-white whitespace-nowrap h-[36px] border-[1.5px] border-grey-700 rounded p-3 inline-flex items-center justify-center leading-none gap-[5px] shadow-[0_2px_10px] shadow-black/10 focus:shadow-[0_0_0_2px] focus:shadow-black data-[placeholder]:text-white outline-none","aria-label":e,children:[X("span",{children:"Filter columns"}),X(s0,{className:kt({"transform rotate-180 duration-200 transition":n})})]})]}),X(Dk,{children:Ce(Pk,{sideOffset:10,ref:o,className:"z-50 bg-white/80 dark:bg-grey-900/80 backdrop-filter backdrop-blur flex flex-col gap-4 overflow-auto border-[1.5px] border-grey-700 rounded p-3 max-h-[500px] text-black dark:text-white",children:[X(Yc,{children:X("button",{className:"_btn w-full",onClick:a,children:"Clear Filters"})}),X(Yc,{children:Ce("label",{className:"flex items-center gap-2",children:[X("input",{type:"checkbox",checked:t.getIsAllColumnsVisible(),onChange:t.getToggleAllColumnsVisibilityHandler()}),"Toggle All"]})}),t.getAllLeafColumns().filter(s=>s.id!=="select").map(s=>X(Yc,{children:Ce("label",{className:"flex items-center gap-2",children:[X("input",{type:"checkbox",checked:s.getIsVisible(),onChange:s.getToggleVisibilityHandler()}),s.id]})},s.id))]})})]})}function fy(e){return typeof e!="number"?typeof e=="string"&&e.includes("All")?e:x0:e<1?x0:e}function $k({table:e,currentPage:t,setCurrentPage:r}){const n=e.getFilteredRowModel().rows.length||0;return Ce("div",{className:"hidden md:flex items-center gap-3",children:[X(Xi,{value:t,onChange:i=>{const o=fy(i);r(o),o.toString().includes("All")?e.setPageSize(n):e.setPageSize(o)},labelType:"row",label:"Rows per page",placeholder:"Select rows per page",groups:[{label:"Rows per page",items:[10,20,30,40,50,`All (${n})`].map(i=>({label:`${i}`,value:i}))}]}),Ce("span",{className:"flex items-center gap-1",children:[X("strong",{children:e.getState().pagination.pageIndex+1}),"of",X("strong",{children:e.getPageCount()})]}),Ce("div",{className:"hidden mdl:block",children:[X("button",{className:kt("px-2",{"text-grey-400 dark:text-grey-700":!e.getCanPreviousPage(),"dark:text-white":e.getCanPreviousPage()}),onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),children:"<<"}),X("button",{className:kt("px-2",{"text-grey-400 dark:text-grey-700":!e.getCanPreviousPage(),"dark:text-white":e.getCanPreviousPage()}),onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),children:"<"}),X("button",{className:kt("px-2",{"text-grey-400 dark:text-grey-700":!e.getCanNextPage(),"dark:text-white":e.getCanNextPage()}),onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),children:">"}),X("button",{className:kt("px-2",{"text-grey-400 dark:text-grey-700":!e.getCanNextPage(),"dark:text-white":e.getCanNextPage()}),onClick:()=>e.setPageIndex(e.getPageCount()-1),disabled:!e.getCanNextPage(),children:">>"})]})]})}const Nk=new Date,Mk=50,x0=30;function Lk(e,t){try{const r=e.hasOwnProperty("index")?"index":e.hasOwnProperty("Index")?"Index":null,n=r?e[r]:null,i=e[t],o=typeof i,a=i==null?void 0:i.toString().replace(/[^0-9]/g,""),s=(a==null?void 0:a.length)>=4&&(Yl(t)||t.toLowerCase()==="index"||n&&typeof n=="string"&&(n.toLowerCase().includes("date")||n.toLowerCase().includes("day")||n.toLowerCase().includes("time")||n.toLowerCase().includes("timestamp")||n.toLowerCase().includes("year")||n.toLowerCase().includes("month")||n.toLowerCase().includes("week")||n.toLowerCase().includes("hour")||n.toLowerCase().includes("minute")));if(o==="string"&&i.startsWith("http")||!s)return(i==null?void 0:i.toString().length)??0;if(s&&!isNaN(new Date(i).getTime())&&!_a.test(i==null?void 0:i.toString())){if(typeof i=="string")return(i==null?void 0:i.toString().length)??0;try{const u=new Date(i);let c="";return u.getUTCHours()===0&&u.getUTCMinutes()===0&&u.getUTCSeconds()===0&&u.getMilliseconds()===0?c=u.toISOString().split("T")[0]:(c=u.toISOString(),c=`${c.split("T")[0]} ${c.split("T")[1].split(".")[0]}`),(c==null?void 0:c.toString().length)??0}catch{return(i==null?void 0:i.toString().length)??0}}return(i==null?void 0:i.toString().length)??0}catch{return 0}}const w0=["csv","xlsx","png"];function Bk({data:e,columns:t,title:r,initialTheme:n,cmd:i=""}){const[o,a]=qo("exportType",w0[0]),[s,l]=x.useState(!1),[u,c]=JC(n),[f,d]=x.useState(u==="dark"),h=W=>{c(u),d(W)},[m,p]=qo("rowsPerPage",x0,fy),[g,v]=qo("advanced",!1),[w,y]=qo("colors",!1),[E,b]=x.useState([]),[k,_]=x.useState(""),[C,A]=qo("fontSize","1"),[L,B]=x.useState(!1),U=t.reduce((W,Q,le)=>(W[Q]=le{const ie=Math.max(...W.map($e=>Lk($e,Q)),le!=null&&le.length?(le==null?void 0:le.length)+8:0);return Math.min(180,ie*5)},ae=x.useMemo(()=>[...t.map((W,Q)=>({accessorKey:W,accessorFn:le=>{const me=le.hasOwnProperty("index")?"index":le.hasOwnProperty("Index")?"Index":t[0],_e=me?le[me]:null,ie=le[W],$e=(ie==null?void 0:ie.toString().replace(/[^0-9]/g,""))??"",Pe=($e==null?void 0:$e.length)>=4&&(Yl(W)||W.toLowerCase()==="index"||_e&&typeof _e=="string"&&(_e.toLowerCase().includes("date")||_e.toLowerCase().includes("time")||_e.toLowerCase().includes("timestamp")||_e.toLowerCase().includes("year")||_e.toLowerCase().includes("month")||_e.toLowerCase().includes("week")||_e.toLowerCase().includes("hour")||_e.toLowerCase().includes("minute")));return Pe&&_a.test(ie==null?void 0:ie.toString())?ie:Pe?typeof ie=="number"?ie:new Date(ie).getTime():ie},id:W,header:W,size:ee(e,W,W),footer:W,cell:({row:le})=>{var Bt;const me=le.original.hasOwnProperty("index")?"index":le.original.hasOwnProperty("Index")?"Index":t[0],_e=me?le.original[me]:null,ie=le.original[W],$e=typeof ie,Pe=(ie==null?void 0:ie.toString().replace(/[^0-9]/g,""))??"",ve=(Pe==null?void 0:Pe.length)>=4&&(Yl(W)||W.toLowerCase()==="index"||_e&&typeof _e=="string"&&(_e.toLowerCase().includes("date")||_e.toLowerCase().includes("time")||_e.toLowerCase().includes("timestamp")||_e.toLowerCase().includes("year")));if($e==="string"&&ie.startsWith("http"))return X("a",{className:"_hyper-link",href:ie,target:"_blank",rel:"noreferrer",children:(ie==null?void 0:ie.length)>25?`${ie.substring(0,25)}...`:ie});if(ve&&_a.test(ie==null?void 0:ie.toString()))return X("p",{children:ie});if(ve&&!isNaN(new Date(ie).getTime())&&!_a.test(ie==null?void 0:ie.toString())){if(typeof ie=="string"){const Ne=ie.split("T")[0],Ze=(Bt=ie.split("T")[1])==null?void 0:Bt.split(".")[0];return Ze==="00:00:00"?X("p",{children:Ne}):Ce("p",{children:[Ne," ",Ze]})}try{const Ne=new Date(ie);let Ze="";return Ne.getUTCHours()===0&&Ne.getUTCMinutes()===0&&Ne.getUTCSeconds()===0&&Ne.getMilliseconds()===0?Ze=Ne.toISOString().split("T")[0]:(Ze=Ne.toISOString(),Ze=`${Ze.split("T")[0]} ${Ze.split("T")[1].split(".")[0]}`),X("p",{children:Ze})}catch{return X("p",{children:ie})}}if($e==="number"||ly.test(ie==null?void 0:ie.toString())){let Ne=tP(ie,W);const Ze=Number(t0(ie));if(typeof _e=="string"&&n2(_e)){Ne=Number(t0(ie));const us=Ne<2?4:2;Ne=Ne.toLocaleString("en-US",{maximumFractionDigits:us,minimumFractionDigits:2})}return X("p",{className:kt("whitespace-nowrap",{"text-black dark:text-white":!w,"text-[#16A34A]":Ze>0&&w,"text-[#F87171]":Ze<0&&w,"text-[#404040]":Ze===0&&w}),title:r2(ie).toString()??"",children:Ze!==0?Ze>0?`${Ne}`:`${Ne}`:Ne})}else if($e==="string")return X("div",{dangerouslySetInnerHTML:{__html:ZC(ie)}});return X("p",{children:ie})}}))],[g,w]),[he,Te]=x.useState(!1),[oe,ye]=x.useState(ae.map(W=>W.id)),te=()=>ye(t.map(W=>W.id)),O=x.useMemo(()=>{const W=oe.map(le=>le),Q=ae.map(le=>le.id);return!rP(W,Q)},[oe,ae]),M=aC({data:e,columns:ae,getCoreRowModel:YT(),getSortedRowModel:eC(),getFilteredRowModel:JT(),getPaginationRowModel:rC(),columnResizeMode:"onChange",onColumnVisibilityChange:G,onColumnOrderChange:ye,onSortingChange:b,onGlobalFilterChange:_,globalFilterFn:nP,state:{sorting:E,globalFilter:k,columnOrder:oe,columnVisibility:H},initialState:{pagination:{pageIndex:0,pageSize:typeof m=="string"?m.includes("All")?e==null?void 0:e.length:parseInt(m):m}}}),N=x.useRef(null),{rows:F}=M.getRowModel(),V=M.getVisibleFlatColumns(),[Y,J]=x.useState(!1);return x.useEffect(()=>{s&&(l(!1),J(!0))},[s]),Ce(q1,{children:[X(f5,{toast:{id:"max-columns",title:"Max 12 columns are visible by default",description:"You can change this by clicking on advanced and then top right 'Filter' button",status:"info"},open:L,setOpen:B}),X(mk,{open:Y,close:()=>J(!1)}),Ce("div",{ref:N,className:kt("overflow-x-hidden h-screen"),children:[Ce("div",{className:"relative p-4",id:"table",children:[X("div",{className:"absolute -inset-0.5 bg-gradient-to-r rounded-md blur-md from-[#072e49]/30 via-[#0d345f]/30 to-[#0d3362]/30"}),Ce("div",{className:"border border-grey-500/60 dark:border-grey-200/60 bg-white dark:bg-grey-900 rounded overflow-hidden relative z-20",children:[Ce("div",{className:"_header relative gap-4 py-2 text-center text-xs flex items-center justify-between px-4 text-white",style:{fontSize:`${Number(C)*90}%`},children:[X("div",{className:"w-1/3",children:X("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"40",fill:"none",viewBox:"0 0 64 40",children:X("path",{fill:"#fff",d:"M61.283 3.965H33.608v27.757h25.699V19.826H37.561v-3.965H63.26V3.965h-1.977zM39.538 23.792h15.815v3.965H37.561v-3.965h1.977zM59.306 9.913v1.983H37.561V7.931h21.745v1.982zM33.606 0h-3.954v3.965H33.606V0zM25.7 3.966H0V15.86h25.7v3.965H3.953v11.896h25.7V3.966h-3.955zm0 21.808v1.983H7.907v-3.965h17.791v1.982zm0-15.86v1.982H3.953V7.931h21.745v1.982zM37.039 35.693v2.952l-.246-.246-.245-.245-.245-.247-.245-.246-.246-.246-.245-.245-.245-.247-.247-.246-.245-.246-.245-.246-.245-.246-.246-.246h-.49v3.936h.49v-3.198l.246.246.245.246.245.246.245.246.246.246.246.246.245.247.246.245.245.246.245.247.245.246.246.245.245.246h.245v-3.936h-.49zM44.938 37.17h-.491v-1.477h-2.944v3.937h3.93v-2.46h-.495zm-2.944-.246v-.739h1.962v.984h-1.962v-.245zm2.944.984v1.23h-2.944V37.66h2.944v.247zM52.835 37.17h-.49v-1.477h-2.946v3.937h3.925v-2.46h-.489zm-2.944-.246v-.739h1.963v.984h-1.965l.002-.245zm2.944.984v1.23H49.89V37.66h2.946v.247zM29.174 35.693H25.739v3.936H29.663v-.491H26.229v-.984h2.943v-.493H26.229v-1.476h3.434v-.492h-.489zM13.37 35.693H9.934v3.937h3.925v-3.937h-.49zm0 .738v2.709h-2.945v-2.955h2.943l.001.246zM21.276 35.693h-3.435v3.937h.491v-1.476h3.434v-2.461h-.49zm0 .738v1.23h-2.944v-1.476h2.944v.246z"})})}),X("p",{className:"font-bold w-1/3 flex flex-col gap-0.5 items-center",children:r}),Ce("p",{className:"w-1/3 text-right text-xs",children:[new Intl.DateTimeFormat("en-GB",{dateStyle:"full",timeStyle:"long"}).format(Nk).replace(/:\d\d /," "),X("br",{}),X("span",{className:"text-grey-400",children:i})]})]}),X("div",{className:"overflow-auto max-h-[calc(100vh-170px)] smh:max-h-[calc(100vh-95px)]",children:Ce("table",{className:"text-sm relative",children:[X("thead",{className:"sticky top-0 bg-white dark:bg-grey-900",style:{fontSize:`${Number(C)*75}%`},children:M.getHeaderGroups().map((W,Q)=>X("tr",{children:W.headers.map((le,me)=>X(gk,{setLockFirstColumn:Te,lockFirstColumn:he,idx:me,advanced:g,header:le,table:M},le.id))},W.id))}),X("tbody",{children:M.getRowModel().rows.map((W,Q)=>X("tr",{className:"!h-[64px] border-b border-grey-400",style:{fontSize:`${Number(C)*100}%`},children:W.getVisibleCells().map((le,me)=>X("td",{className:kt("whitespace-normal p-4 text-black dark:text-white",{"bg-white dark:bg-grey-850":Q%2===0,"bg-grey-100 dark:bg-[#202020]":Q%2===1,"sticky left-0 z-10":me===0&&he}),style:{width:le.column.getSize()},children:Kf(le.column.columnDef.cell,le.getContext())},le.id))},W.id))}),(F==null?void 0:F.length)>30&&(V==null?void 0:V.length)>4&&X("tfoot",{children:M.getFooterGroups().map(W=>X("tr",{children:W.headers.map(Q=>X("th",{colSpan:Q.colSpan,className:"text-grey-500 bg-grey-100 dark:bg-grey-850 font-normal text-left text-sm h-10 p-4",style:{width:Q.getSize(),fontSize:`${Number(C)*100}%`},children:Q.isPlaceholder?null:Kf(Q.column.columnDef.footer,Q.getContext())},Q.id))},W.id))})]})})]})]}),Ce("div",{className:"smh:hidden flex max-h-[68px] overflow-x-auto bg-white/70 dark:bg-grey-900/70 backdrop-filter backdrop-blur z-20 bottom-0 left-0 w-full gap-10 justify-between py-4 px-4 text-sm",children:[Ce("div",{className:"flex items-center gap-10",children:[Ce(jv,{children:[X(pT,{className:"_btn",children:"Settings"}),Ce(gT,{children:[X(Xv,{className:"_modal-overlay"}),Ce(Kv,{className:"_modal",children:[X(Wf,{className:"absolute top-[40px] right-[46px] text-grey-200 hover:text-white rounded-[4px] focus:outline focus:outline-2 focus:outline-grey-500",children:X(ql,{className:"w-6 h-6"})}),X(Yv,{className:"uppercase font-bold tracking-widest",children:"Settings"}),Ce("div",{className:"grid grid-cols-2 gap-2 mt-10 text-sm",children:[O&&X("button",{onClick:()=>te(),className:"_btn h-9",children:"Reset Order"}),X(Xi,{labelType:"row",value:f?"light":"dark",onChange:W=>{h(W!=="dark")},label:"Theme",placeholder:"Select theme",groups:[{label:"Theme",items:[{label:"Dark",value:"dark"},{label:"Light",value:"light"}]}]}),X(Xi,{labelType:"row",value:o,onChange:W=>{a(W)},label:"Export type",placeholder:"Select export type",groups:[{label:"Export type",items:w0.map(W=>({label:W,value:W}))}]}),X(Xi,{labelType:"row",value:C,onChange:A,label:"Font size",placeholder:"Select font size",groups:[{label:"Font size",items:[{label:"50%",value:"0.5"},{label:"75%",value:"0.75"},{label:"100%",value:"1"},{label:"125%",value:"1.25"},{label:"150%",value:"1.5"},{label:"175%",value:"1.75"},{label:"200%",value:"2"}]}]}),X(O1,{table:M,label:"Filter"}),X("div",{className:"flex gap-2 items-center",children:X(Xi,{labelType:"row",value:g?"advanced":"simple",onChange:W=>{v(W==="advanced")},label:"Type",placeholder:"Select type",groups:[{label:"Type",items:[{label:"Simple",value:"simple"},{label:"Advanced",value:"advanced"}]}]})}),Ce("div",{className:"flex gap-2 items-center",children:[X("label",{htmlFor:"colors",children:"Colors"}),X("input",{id:"colors",type:"checkbox",checked:w,onChange:()=>y(!w)})]})]})]})]})]}),X(O1,{onlyIconTrigger:!0,table:M,label:""})]}),X($k,{currentPage:m,setCurrentPage:p,table:M}),X(vk,{setType:a,type:o,columns:t,data:e,downloadFinished:l})]})]})]})}function dy(e){let t=null;return()=>(t==null&&(t=e()),t)}function Uk(e,t){return e.filter(r=>r!==t)}function Hk(e,t){const r=new Set,n=o=>r.add(o);e.forEach(n),t.forEach(n);const i=[];return r.forEach(o=>i.push(o)),i}class Vk{enter(t){const r=this.entered.length,n=i=>this.isNodeInDocument(i)&&(!i.contains||i.contains(t));return this.entered=Hk(this.entered.filter(n),[t]),r===0&&this.entered.length>0}leave(t){const r=this.entered.length;return this.entered=Uk(this.entered.filter(this.isNodeInDocument),t),r>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class Wk{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(t=>{Object.defineProperty(this.item,t,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${t}" until the drop event.`),null}})})}loadDataTransfer(t){if(t){const r={};Object.keys(this.config.exposeProperties).forEach(n=>{const i=this.config.exposeProperties[n];i!=null&&(r[n]={value:i(t,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,r)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(t,r){return r===t.getSourceId()}endDrag(){}constructor(t){this.config=t,this.item={},this.initializeExposedProperties()}}const hy="__NATIVE_FILE__",py="__NATIVE_URL__",gy="__NATIVE_TEXT__",my="__NATIVE_HTML__",F1=Object.freeze(Object.defineProperty({__proto__:null,FILE:hy,HTML:my,TEXT:gy,URL:py},Symbol.toStringTag,{value:"Module"}));function qc(e,t,r){const n=t.reduce((i,o)=>i||e.getData(o),"");return n??r}const y0={[hy]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[my]:{exposeProperties:{html:(e,t)=>qc(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[py]:{exposeProperties:{urls:(e,t)=>qc(e,t,"").split(` +`),c=new Blob([u],{type:"text/csv;charset=utf-8;"}),f=`${window.title}.csv`;try{const d=await i2({filename:f});let h="csv";d!==null&&(h=d.name.split(".").pop()),await ji(`Saving ${h.toUpperCase()}`),r0(async function(){o2(c,f,d).then(async function(){await new Promise(m=>setTimeout(m,1500)),await ji("",!0),d||n(!0)})},2)()}catch(d){console.error(d)}return}const s=Uc.book_new(),l=Uc.aoa_to_sheet(a);Uc.book_append_sheet(s,l,"Sheet1"),await ji("Saving XLSX"),r0(async function(){await new Promise(u=>setTimeout(u,1500)),V6(s,`${window.title}.xlsx`),await ji("",!0),n==null||n(!0)},2)()}async function sP(e,t){const r=document.getElementById(e),n=`${window.title}.png`;try{const i=await i2({filename:n,is_image:!0});let o="png";i!==null&&(o=i.name.split(".").pop()),await ji(`Saving ${o.toUpperCase()}`),r0(async function(){c4.toBlob(r).then(function(a){o2(a,n,i).then(async function(){await new Promise(s=>setTimeout(s,1500)),await ji("",!0),i||t(!0)})})},2)()}catch(i){console.error(i)}}const r0=(e,t)=>{let r;return function(){const n=this,i=arguments;clearTimeout(r),r=setTimeout(()=>e.apply(n,i),t)}},ql=({title:e,titleId:t,...r})=>X("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,...r,children:X("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})});function Zg(e,[t,r]){return Math.min(r,Math.max(t,e))}function Ou(e){const t=e+"CollectionProvider",[r,n]=sn(t),[i,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),a=h=>{const{scope:m,children:p}=h,g=ir.useRef(null),v=ir.useRef(new Map).current;return ir.createElement(i,{scope:m,itemMap:v,collectionRef:g},p)},s=e+"CollectionSlot",l=ir.forwardRef((h,m)=>{const{scope:p,children:g}=h,v=o(s,p),w=We(m,v.collectionRef);return ir.createElement(oi,{ref:w},g)}),u=e+"CollectionItemSlot",c="data-radix-collection-item",f=ir.forwardRef((h,m)=>{const{scope:p,children:g,...v}=h,w=ir.useRef(null),y=We(m,w),E=o(u,p);return ir.useEffect(()=>(E.itemMap.set(w,{ref:w,...v}),()=>void E.itemMap.delete(w))),ir.createElement(oi,{[c]:"",ref:y},g)});function d(h){const m=o(e+"CollectionConsumer",h);return ir.useCallback(()=>{const g=m.collectionRef.current;if(!g)return[];const v=Array.from(g.querySelectorAll(`[${c}]`));return Array.from(m.itemMap.values()).sort((E,b)=>v.indexOf(E.ref.current)-v.indexOf(b.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:a,Slot:l,ItemSlot:f},d,n]}const lP=x.createContext(void 0);function Zd(e){const t=x.useContext(lP);return e||t||"ltr"}function Do(e){return e.split("-")[1]}function Jd(e){return e==="y"?"height":"width"}function Zr(e){return e.split("-")[0]}function _i(e){return["top","bottom"].includes(Zr(e))?"x":"y"}function Jg(e,t,r){let{reference:n,floating:i}=e;const o=n.x+n.width/2-i.width/2,a=n.y+n.height/2-i.height/2,s=_i(t),l=Jd(s),u=n[l]/2-i[l]/2,c=s==="x";let f;switch(Zr(t)){case"top":f={x:o,y:n.y-i.height};break;case"bottom":f={x:o,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:a};break;case"left":f={x:n.x-i.width,y:a};break;default:f={x:n.x,y:n.y}}switch(Do(t)){case"start":f[s]-=u*(r&&c?-1:1);break;case"end":f[s]+=u*(r&&c?-1:1)}return f}const uP=async(e,t,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:a}=r,s=o.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:f}=Jg(u,n,l),d=n,h={},m=0;for(let p=0;p({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:i,rects:o,platform:a,elements:s}=t,{element:l,padding:u=0}=on(e,t)||{};if(l==null)return{};const c=a2(u),f={x:r,y:n},d=_i(i),h=Jd(d),m=await a.getDimensions(l),p=d==="y",g=p?"top":"left",v=p?"bottom":"right",w=p?"clientHeight":"clientWidth",y=o.reference[h]+o.reference[d]-f[d]-o.floating[h],E=f[d]-o.reference[d],b=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l));let k=b?b[w]:0;k&&await(a.isElement==null?void 0:a.isElement(b))||(k=s.floating[w]||o.floating[h]);const _=y/2-E/2,C=k/2-m[h]/2-1,A=ja(c[g],C),L=ja(c[v],C),B=A,U=k-m[h]-L,H=k/2-m[h]/2+_,G=n0(B,H,U),ee=Do(i)!=null&&H!=G&&o.reference[h]/2-(He.concat(t,t+"-start",t+"-end"),[]);const cP={left:"right",right:"left",bottom:"top",top:"bottom"};function Zl(e){return e.replace(/left|right|bottom|top/g,t=>cP[t])}function fP(e,t,r){r===void 0&&(r=!1);const n=Do(e),i=_i(e),o=Jd(i);let a=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Zl(a)),{main:a,cross:Zl(a)}}const dP={start:"end",end:"start"};function Hc(e){return e.replace(/start|end/g,t=>dP[t])}const hP=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r;const{placement:n,middlewareData:i,rects:o,initialPlacement:a,platform:s,elements:l}=t,{mainAxis:u=!0,crossAxis:c=!0,fallbackPlacements:f,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...p}=on(e,t),g=Zr(n),v=Zr(a)===a,w=await(s.isRTL==null?void 0:s.isRTL(l.floating)),y=f||(v||!m?[Zl(a)]:function(B){const U=Zl(B);return[Hc(B),U,Hc(U)]}(a));f||h==="none"||y.push(...function(B,U,H,G){const ee=Do(B);let ae=function(he,Te,oe){const ye=["left","right"],te=["right","left"],O=["top","bottom"],M=["bottom","top"];switch(he){case"top":case"bottom":return oe?Te?te:ye:Te?ye:te;case"left":case"right":return Te?O:M;default:return[]}}(Zr(B),H==="start",G);return ee&&(ae=ae.map(he=>he+"-"+ee),U&&(ae=ae.concat(ae.map(Hc)))),ae}(a,m,h,w));const E=[a,...y],b=await Ga(t,p),k=[];let _=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&k.push(b[g]),c){const{main:B,cross:U}=fP(n,o,w);k.push(b[B],b[U])}if(_=[..._,{placement:n,overflows:k}],!k.every(B=>B<=0)){var C,A;const B=(((C=i.flip)==null?void 0:C.index)||0)+1,U=E[B];if(U)return{data:{index:B,overflows:_},reset:{placement:U}};let H=(A=_.filter(G=>G.overflows[0]<=0).sort((G,ee)=>G.overflows[1]-ee.overflows[1])[0])==null?void 0:A.placement;if(!H)switch(d){case"bestFit":{var L;const G=(L=_.map(ee=>[ee.placement,ee.overflows.filter(ae=>ae>0).reduce((ae,he)=>ae+he,0)]).sort((ee,ae)=>ee[1]-ae[1])[0])==null?void 0:L[0];G&&(H=G);break}case"initialPlacement":H=a}if(n!==H)return{reset:{placement:H}}}return{}}}};function t1(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function r1(e){return s2.some(t=>e[t]>=0)}const pP=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...i}=on(e,t);switch(n){case"referenceHidden":{const o=t1(await Ga(t,{...i,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:r1(o)}}}case"escaped":{const o=t1(await Ga(t,{...i,altBoundary:!0}),r.floating);return{data:{escapedOffsets:o,escaped:r1(o)}}}default:return{}}}}},gP=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:r,y:n}=t,i=await async function(o,a){const{placement:s,platform:l,elements:u}=o,c=await(l.isRTL==null?void 0:l.isRTL(u.floating)),f=Zr(s),d=Do(s),h=_i(s)==="x",m=["left","top"].includes(f)?-1:1,p=c&&h?-1:1,g=on(a,o);let{mainAxis:v,crossAxis:w,alignmentAxis:y}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...g};return d&&typeof y=="number"&&(w=d==="end"?-1*y:y),h?{x:w*p,y:v*m}:{x:v*m,y:w*p}}(t,e);return{x:r+i.x,y:n+i.y,data:i}}}};function l2(e){return e==="x"?"y":"x"}const mP=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:g=>{let{x:v,y:w}=g;return{x:v,y:w}}},...l}=on(e,t),u={x:r,y:n},c=await Ga(t,l),f=_i(Zr(i)),d=l2(f);let h=u[f],m=u[d];if(o){const g=f==="y"?"bottom":"right";h=n0(h+c[f==="y"?"top":"left"],h,h-c[g])}if(a){const g=d==="y"?"bottom":"right";m=n0(m+c[d==="y"?"top":"left"],m,m-c[g])}const p=s.fn({...t,[f]:h,[d]:m});return{...p,data:{x:p.x-r,y:p.y-n}}}}},vP=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=on(e,t),c={x:r,y:n},f=_i(i),d=l2(f);let h=c[f],m=c[d];const p=on(s,t),g=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const y=f==="y"?"height":"width",E=o.reference[f]-o.floating[y]+g.mainAxis,b=o.reference[f]+o.reference[y]-g.mainAxis;hb&&(h=b)}if(u){var v,w;const y=f==="y"?"width":"height",E=["top","left"].includes(Zr(i)),b=o.reference[d]-o.floating[y]+(E&&((v=a.offset)==null?void 0:v[d])||0)+(E?0:g.crossAxis),k=o.reference[d]+o.reference[y]+(E?0:((w=a.offset)==null?void 0:w[d])||0)-(E?g.crossAxis:0);mk&&(m=k)}return{[f]:h,[d]:m}}}},xP=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:r,rects:n,platform:i,elements:o}=t,{apply:a=()=>{},...s}=on(e,t),l=await Ga(t,s),u=Zr(r),c=Do(r),f=_i(r)==="x",{width:d,height:h}=n.floating;let m,p;u==="top"||u==="bottom"?(m=u,p=c===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(p=u,m=c==="end"?"top":"bottom");const g=h-l[m],v=d-l[p],w=!t.middlewareData.shift;let y=g,E=v;if(f){const k=d-l.left-l.right;E=c||w?ja(v,k):k}else{const k=h-l.top-l.bottom;y=c||w?ja(g,k):k}if(w&&!c){const k=jn(l.left,0),_=jn(l.right,0),C=jn(l.top,0),A=jn(l.bottom,0);f?E=d-2*(k!==0||_!==0?k+_:jn(l.left,l.right)):y=h-2*(C!==0||A!==0?C+A:jn(l.top,l.bottom))}await a({...t,availableWidth:E,availableHeight:y});const b=await i.getDimensions(o.floating);return d!==b.width||h!==b.height?{reset:{rects:!0}}:{}}}};function Zt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Nr(e){return Zt(e).getComputedStyle(e)}function u2(e){return e instanceof Zt(e).Node}function Ln(e){return u2(e)?(e.nodeName||"").toLowerCase():"#document"}function Cr(e){return e instanceof HTMLElement||e instanceof Zt(e).HTMLElement}function n1(e){return typeof ShadowRoot<"u"&&(e instanceof Zt(e).ShadowRoot||e instanceof ShadowRoot)}function Xa(e){const{overflow:t,overflowX:r,overflowY:n,display:i}=Nr(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(i)}function wP(e){return["table","td","th"].includes(Ln(e))}function i0(e){const t=eh(),r=Nr(e);return r.transform!=="none"||r.perspective!=="none"||!!r.containerType&&r.containerType!=="normal"||!t&&!!r.backdropFilter&&r.backdropFilter!=="none"||!t&&!!r.filter&&r.filter!=="none"||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function eh(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Fu(e){return["html","body","#document"].includes(Ln(e))}const o0=Math.min,lo=Math.max,Jl=Math.round,Ws=Math.floor,Bn=e=>({x:e,y:e});function c2(e){const t=Nr(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const i=Cr(e),o=i?e.offsetWidth:r,a=i?e.offsetHeight:n,s=Jl(r)!==o||Jl(n)!==a;return s&&(r=o,n=a),{width:r,height:n,$:s}}function Jr(e){return e instanceof Element||e instanceof Zt(e).Element}function th(e){return Jr(e)?e:e.contextElement}function uo(e){const t=th(e);if(!Cr(t))return Bn(1);const r=t.getBoundingClientRect(),{width:n,height:i,$:o}=c2(t);let a=(o?Jl(r.width):r.width)/n,s=(o?Jl(r.height):r.height)/i;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const yP=Bn(0);function f2(e){const t=Zt(e);return eh()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:yP}function ui(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const i=e.getBoundingClientRect(),o=th(e);let a=Bn(1);t&&(n?Jr(n)&&(a=uo(n)):a=uo(e));const s=function(d,h,m){return h===void 0&&(h=!1),!(!m||h&&m!==Zt(d))&&h}(o,r,n)?f2(o):Bn(0);let l=(i.left+s.x)/a.x,u=(i.top+s.y)/a.y,c=i.width/a.x,f=i.height/a.y;if(o){const d=Zt(o),h=n&&Jr(n)?Zt(n):n;let m=d.frameElement;for(;m&&n&&h!==d;){const p=uo(m),g=m.getBoundingClientRect(),v=getComputedStyle(m),w=g.left+(m.clientLeft+parseFloat(v.paddingLeft))*p.x,y=g.top+(m.clientTop+parseFloat(v.paddingTop))*p.y;l*=p.x,u*=p.y,c*=p.x,f*=p.y,l+=w,u+=y,m=Zt(m).frameElement}}return Ql({width:c,height:f,x:l,y:u})}function Du(e){return Jr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function en(e){var t;return(t=(u2(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function d2(e){return ui(en(e)).left+Du(e).scrollLeft}function vo(e){if(Ln(e)==="html")return e;const t=e.assignedSlot||e.parentNode||n1(e)&&e.host||en(e);return n1(t)?t.host:t}function h2(e){const t=vo(e);return Fu(t)?e.ownerDocument?e.ownerDocument.body:e.body:Cr(t)&&Xa(t)?t:h2(t)}function eu(e,t){var r;t===void 0&&(t=[]);const n=h2(e),i=n===((r=e.ownerDocument)==null?void 0:r.body),o=Zt(n);return i?t.concat(o,o.visualViewport||[],Xa(n)?n:[]):t.concat(n,eu(n))}function i1(e,t,r){let n;if(t==="viewport")n=function(i,o){const a=Zt(i),s=en(i),l=a.visualViewport;let u=s.clientWidth,c=s.clientHeight,f=0,d=0;if(l){u=l.width,c=l.height;const h=eh();(!h||h&&o==="fixed")&&(f=l.offsetLeft,d=l.offsetTop)}return{width:u,height:c,x:f,y:d}}(e,r);else if(t==="document")n=function(i){const o=en(i),a=Du(i),s=i.ownerDocument.body,l=lo(o.scrollWidth,o.clientWidth,s.scrollWidth,s.clientWidth),u=lo(o.scrollHeight,o.clientHeight,s.scrollHeight,s.clientHeight);let c=-a.scrollLeft+d2(i);const f=-a.scrollTop;return Nr(s).direction==="rtl"&&(c+=lo(o.clientWidth,s.clientWidth)-l),{width:l,height:u,x:c,y:f}}(en(e));else if(Jr(t))n=function(i,o){const a=ui(i,!0,o==="fixed"),s=a.top+i.clientTop,l=a.left+i.clientLeft,u=Cr(i)?uo(i):Bn(1);return{width:i.clientWidth*u.x,height:i.clientHeight*u.y,x:l*u.x,y:s*u.y}}(t,r);else{const i=f2(e);n={...t,x:t.x-i.x,y:t.y-i.y}}return Ql(n)}function p2(e,t){const r=vo(e);return!(r===t||!Jr(r)||Fu(r))&&(Nr(r).position==="fixed"||p2(r,t))}function EP(e,t,r){const n=Cr(t),i=en(t),o=r==="fixed",a=ui(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=Bn(0);if(n||!n&&!o)if((Ln(t)!=="body"||Xa(i))&&(s=Du(t)),Cr(t)){const u=ui(t,!0,o,t);l.x=u.x+t.clientLeft,l.y=u.y+t.clientTop}else i&&(l.x=d2(i));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function o1(e,t){return Cr(e)&&Nr(e).position!=="fixed"?t?t(e):e.offsetParent:null}function a1(e,t){const r=Zt(e);if(!Cr(e))return r;let n=o1(e,t);for(;n&&wP(n)&&Nr(n).position==="static";)n=o1(n,t);return n&&(Ln(n)==="html"||Ln(n)==="body"&&Nr(n).position==="static"&&!i0(n))?r:n||function(i){let o=vo(i);for(;Cr(o)&&!Fu(o);){if(i0(o))return o;o=vo(o)}return null}(e)||r}const SP={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:r,strategy:n}=e;const i=Cr(r),o=en(r);if(r===o)return t;let a={scrollLeft:0,scrollTop:0},s=Bn(1);const l=Bn(0);if((i||!i&&n!=="fixed")&&((Ln(r)!=="body"||Xa(o))&&(a=Du(r)),Cr(r))){const u=ui(r);s=uo(r),l.x=u.x+r.clientLeft,l.y=u.y+r.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-a.scrollLeft*s.x+l.x,y:t.y*s.y-a.scrollTop*s.y+l.y}},getDocumentElement:en,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e;const o=[...r==="clippingAncestors"?function(l,u){const c=u.get(l);if(c)return c;let f=eu(l).filter(p=>Jr(p)&&Ln(p)!=="body"),d=null;const h=Nr(l).position==="fixed";let m=h?vo(l):l;for(;Jr(m)&&!Fu(m);){const p=Nr(m),g=i0(m);g||p.position!=="fixed"||(d=null),(h?!g&&!d:!g&&p.position==="static"&&d&&["absolute","fixed"].includes(d.position)||Xa(m)&&!g&&p2(l,m))?f=f.filter(v=>v!==m):d=p,m=vo(m)}return u.set(l,f),f}(t,this._c):[].concat(r),n],a=o[0],s=o.reduce((l,u)=>{const c=i1(t,u,i);return l.top=lo(c.top,l.top),l.right=o0(c.right,l.right),l.bottom=o0(c.bottom,l.bottom),l.left=lo(c.left,l.left),l},i1(t,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:a1,getElementRects:async function(e){let{reference:t,floating:r,strategy:n}=e;const i=this.getOffsetParent||a1,o=this.getDimensions;return{reference:EP(t,await i(r),n),floating:{x:0,y:0,...await o(r)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){return c2(e)},getScale:uo,isElement:Jr,isRTL:function(e){return getComputedStyle(e).direction==="rtl"}};function _P(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,u=th(e),c=i||o?[...u?eu(u):[],...eu(t)]:[];c.forEach(g=>{i&&g.addEventListener("scroll",r,{passive:!0}),o&&g.addEventListener("resize",r)});const f=u&&s?function(g,v){let w,y=null;const E=en(g);function b(){clearTimeout(w),y&&y.disconnect(),y=null}return function k(_,C){_===void 0&&(_=!1),C===void 0&&(C=1),b();const{left:A,top:L,width:B,height:U}=g.getBoundingClientRect();if(_||v(),!B||!U)return;const H={rootMargin:-Ws(L)+"px "+-Ws(E.clientWidth-(A+B))+"px "+-Ws(E.clientHeight-(L+U))+"px "+-Ws(A)+"px",threshold:lo(0,o0(1,C))||1};let G=!0;function ee(ae){const he=ae[0].intersectionRatio;if(he!==C){if(!G)return k();he?k(!1,he):w=setTimeout(()=>{k(!1,1e-7)},100)}G=!1}try{y=new IntersectionObserver(ee,{...H,root:E.ownerDocument})}catch{y=new IntersectionObserver(ee,H)}y.observe(g)}(!0),b}(u,r):null;let d,h=-1,m=null;a&&(m=new ResizeObserver(g=>{let[v]=g;v&&v.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{m&&m.observe(t)})),r()}),u&&!l&&m.observe(u),m.observe(t));let p=l?ui(e):null;return l&&function g(){const v=ui(e);!p||v.x===p.x&&v.y===p.y&&v.width===p.width&&v.height===p.height||r(),p=v,d=requestAnimationFrame(g)}(),r(),()=>{c.forEach(g=>{i&&g.removeEventListener("scroll",r),o&&g.removeEventListener("resize",r)}),f&&f(),m&&m.disconnect(),m=null,l&&cancelAnimationFrame(d)}}const TP=(e,t,r)=>{const n=new Map,i={platform:SP,...r},o={...i.platform,_c:n};return uP(e,t,{...i,platform:o})},CP=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:i}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?e1({element:n.current,padding:i}).fn(r):{}:n?e1({element:n,padding:i}).fn(r):{}}}};var ll=typeof document<"u"?x.useLayoutEffect:x.useEffect;function tu(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 r,n,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!tu(e[n],t[n]))return!1;return!0}if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,i[n]))return!1;for(n=r;n--!==0;){const o=i[n];if(!(o==="_owner"&&e.$$typeof)&&!tu(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function g2(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function s1(e,t){const r=g2(e);return Math.round(t*r)/r}function l1(e){const t=x.useRef(e);return ll(()=>{t.current=e}),t}function AP(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[c,f]=x.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[d,h]=x.useState(n);tu(d,n)||h(n);const[m,p]=x.useState(null),[g,v]=x.useState(null),w=x.useCallback(ae=>{ae!=k.current&&(k.current=ae,p(ae))},[p]),y=x.useCallback(ae=>{ae!==_.current&&(_.current=ae,v(ae))},[v]),E=o||m,b=a||g,k=x.useRef(null),_=x.useRef(null),C=x.useRef(c),A=l1(l),L=l1(i),B=x.useCallback(()=>{if(!k.current||!_.current)return;const ae={placement:t,strategy:r,middleware:d};L.current&&(ae.platform=L.current),TP(k.current,_.current,ae).then(he=>{const Te={...he,isPositioned:!0};U.current&&!tu(C.current,Te)&&(C.current=Te,gi.flushSync(()=>{f(Te)}))})},[d,t,r,L]);ll(()=>{u===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,f(ae=>({...ae,isPositioned:!1})))},[u]);const U=x.useRef(!1);ll(()=>(U.current=!0,()=>{U.current=!1}),[]),ll(()=>{if(E&&(k.current=E),b&&(_.current=b),E&&b){if(A.current)return A.current(E,b,B);B()}},[E,b,B,A]);const H=x.useMemo(()=>({reference:k,floating:_,setReference:w,setFloating:y}),[w,y]),G=x.useMemo(()=>({reference:E,floating:b}),[E,b]),ee=x.useMemo(()=>{const ae={position:r,left:0,top:0};if(!G.floating)return ae;const he=s1(G.floating,c.x),Te=s1(G.floating,c.y);return s?{...ae,transform:"translate("+he+"px, "+Te+"px)",...g2(G.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:he,top:Te}},[r,s,G.floating,c.x,c.y]);return x.useMemo(()=>({...c,update:B,refs:H,elements:G,floatingStyles:ee}),[c,B,H,G,ee])}function RP(e){const[t,r]=x.useState(void 0);return Mt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,s=u.blockSize}else a=e.offsetWidth,s=e.offsetHeight;r({width:a,height:s})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}const m2="Popper",[v2,Pu]=sn(m2),[OP,x2]=v2(m2),FP=e=>{const{__scopePopper:t,children:r}=e,[n,i]=x.useState(null);return x.createElement(OP,{scope:t,anchor:n,onAnchorChange:i},r)},DP="PopperAnchor",PP=x.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...i}=e,o=x2(DP,r),a=x.useRef(null),s=We(t,a);return x.useEffect(()=>{o.onAnchorChange((n==null?void 0:n.current)||a.current)}),n?null:x.createElement(Ie.div,ge({},i,{ref:s}))}),w2="PopperContent",[IP,r$]=v2(w2),bP=x.forwardRef((e,t)=>{var r,n,i,o,a,s,l,u;const{__scopePopper:c,side:f="bottom",sideOffset:d=0,align:h="center",alignOffset:m=0,arrowPadding:p=0,collisionBoundary:g=[],collisionPadding:v=0,sticky:w="partial",hideWhenDetached:y=!1,avoidCollisions:E=!0,onPlaced:b,...k}=e,_=x2(w2,c),[C,A]=x.useState(null),L=We(t,ie=>A(ie)),[B,U]=x.useState(null),H=RP(B),G=(r=H==null?void 0:H.width)!==null&&r!==void 0?r:0,ee=(n=H==null?void 0:H.height)!==null&&n!==void 0?n:0,ae=f+(h!=="center"?"-"+h:""),he=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},Te=Array.isArray(g)?g:[g],oe=Te.length>0,ye={padding:he,boundary:Te.filter(kP),altBoundary:oe},{refs:te,floatingStyles:O,placement:M,isPositioned:N,middlewareData:F}=AP({strategy:"fixed",placement:ae,whileElementsMounted:_P,elements:{reference:_.anchor},middleware:[gP({mainAxis:d+ee,alignmentAxis:m}),E&&mP({mainAxis:!0,crossAxis:!1,limiter:w==="partial"?vP():void 0,...ye}),E&&hP({...ye}),xP({...ye,apply:({elements:ie,rects:$e,availableWidth:Pe,availableHeight:ve})=>{const{width:Pt,height:Bt}=$e.reference,Ne=ie.floating.style;Ne.setProperty("--radix-popper-available-width",`${Pe}px`),Ne.setProperty("--radix-popper-available-height",`${ve}px`),Ne.setProperty("--radix-popper-anchor-width",`${Pt}px`),Ne.setProperty("--radix-popper-anchor-height",`${Bt}px`)}}),B&&CP({element:B,padding:p}),$P({arrowWidth:G,arrowHeight:ee}),y&&pP({strategy:"referenceHidden"})]}),[V,Y]=y2(M),J=Dt(b);Mt(()=>{N&&(J==null||J())},[N,J]);const W=(i=F.arrow)===null||i===void 0?void 0:i.x,Q=(o=F.arrow)===null||o===void 0?void 0:o.y,le=((a=F.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[me,_e]=x.useState();return Mt(()=>{C&&_e(window.getComputedStyle(C).zIndex)},[C]),x.createElement("div",{ref:te.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:N?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:me,"--radix-popper-transform-origin":[(s=F.transformOrigin)===null||s===void 0?void 0:s.x,(l=F.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},x.createElement(IP,{scope:c,placedSide:V,onArrowChange:U,arrowX:W,arrowY:Q,shouldHideArrow:le},x.createElement(Ie.div,ge({"data-side":V,"data-align":Y},k,{ref:L,style:{...k.style,animation:N?void 0:"none",opacity:(u=F.hide)!==null&&u!==void 0&&u.referenceHidden?0:void 0}}))))});function kP(e){return e!==null}const $P=e=>({name:"transformOrigin",options:e,fn(t){var r,n,i,o,a;const{placement:s,rects:l,middlewareData:u}=t,f=((r=u.arrow)===null||r===void 0?void 0:r.centerOffset)!==0,d=f?0:e.arrowWidth,h=f?0:e.arrowHeight,[m,p]=y2(s),g={start:"0%",center:"50%",end:"100%"}[p],v=((n=(i=u.arrow)===null||i===void 0?void 0:i.x)!==null&&n!==void 0?n:0)+d/2,w=((o=(a=u.arrow)===null||a===void 0?void 0:a.y)!==null&&o!==void 0?o:0)+h/2;let y="",E="";return m==="bottom"?(y=f?g:`${v}px`,E=`${-h}px`):m==="top"?(y=f?g:`${v}px`,E=`${l.floating.height+h}px`):m==="right"?(y=`${-h}px`,E=f?g:`${w}px`):m==="left"&&(y=`${l.floating.width+h}px`,E=f?g:`${w}px`),{data:{x:y,y:E}}}});function y2(e){const[t,r="center"]=e.split("-");return[t,r]}const E2=FP,S2=PP,_2=bP;function NP(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}const rh=x.forwardRef((e,t)=>x.createElement(Ie.span,ge({},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}}))),MP=[" ","Enter","ArrowUp","ArrowDown"],LP=[" ","Enter"],Iu="Select",[bu,ku,BP]=Ou(Iu),[Po,n$]=sn(Iu,[BP,Pu]),nh=Pu(),[UP,Ti]=Po(Iu),[HP,VP]=Po(Iu),WP=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:i,onOpenChange:o,value:a,defaultValue:s,onValueChange:l,dir:u,name:c,autoComplete:f,disabled:d,required:h}=e,m=nh(t),[p,g]=x.useState(null),[v,w]=x.useState(null),[y,E]=x.useState(!1),b=Zd(u),[k=!1,_]=go({prop:n,defaultProp:i,onChange:o}),[C,A]=go({prop:a,defaultProp:s,onChange:l}),L=x.useRef(null),B=p?!!p.closest("form"):!0,[U,H]=x.useState(new Set),G=Array.from(U).map(ee=>ee.props.value).join(";");return x.createElement(E2,m,x.createElement(UP,{required:h,scope:t,trigger:p,onTriggerChange:g,valueNode:v,onValueNodeChange:w,valueNodeHasChildren:y,onValueNodeHasChildrenChange:E,contentId:Kr(),value:C,onValueChange:A,open:k,onOpenChange:_,dir:b,triggerPointerDownPosRef:L,disabled:d},x.createElement(bu.Provider,{scope:t},x.createElement(HP,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(ee=>{H(ae=>new Set(ae).add(ee))},[]),onNativeOptionRemove:x.useCallback(ee=>{H(ae=>{const he=new Set(ae);return he.delete(ee),he})},[])},r)),B?x.createElement(R2,{key:G,"aria-hidden":!0,required:h,tabIndex:-1,name:c,autoComplete:f,value:C,onChange:ee=>A(ee.target.value),disabled:d},C===void 0?x.createElement("option",{value:""}):null,Array.from(U)):null))},zP="SelectTrigger",GP=x.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...i}=e,o=nh(r),a=Ti(zP,r),s=a.disabled||n,l=We(t,a.onTriggerChange),u=ku(r),[c,f,d]=O2(m=>{const p=u().filter(w=>!w.disabled),g=p.find(w=>w.value===a.value),v=F2(p,m,g);v!==void 0&&a.onValueChange(v.value)}),h=()=>{s||(a.onOpenChange(!0),d())};return x.createElement(S2,ge({asChild:!0},o),x.createElement(Ie.button,ge({type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":a.value===void 0?"":void 0},i,{ref:l,onClick:Se(i.onClick,m=>{m.currentTarget.focus()}),onPointerDown:Se(i.onPointerDown,m=>{const p=m.target;p.hasPointerCapture(m.pointerId)&&p.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&(h(),a.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)},m.preventDefault())}),onKeyDown:Se(i.onKeyDown,m=>{const p=c.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&f(m.key),!(p&&m.key===" ")&&MP.includes(m.key)&&(h(),m.preventDefault())})})))}),jP="SelectValue",XP=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:i,children:o,placeholder:a,...s}=e,l=Ti(jP,r),{onValueNodeHasChildrenChange:u}=l,c=o!==void 0,f=We(t,l.onValueNodeChange);return Mt(()=>{u(c)},[u,c]),x.createElement(Ie.span,ge({},s,{ref:f,style:{pointerEvents:"none"}}),l.value===void 0&&a!==void 0?a:o)}),KP=x.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...i}=e;return x.createElement(Ie.span,ge({"aria-hidden":!0},i,{ref:t}),n||"▼")}),YP=e=>x.createElement(vu,ge({asChild:!0},e)),xo="SelectContent",qP=x.forwardRef((e,t)=>{const r=Ti(xo,e.__scopeSelect),[n,i]=x.useState();if(Mt(()=>{i(new DocumentFragment)},[]),!r.open){const o=n;return o?gi.createPortal(x.createElement(T2,{scope:e.__scopeSelect},x.createElement(bu.Slot,{scope:e.__scopeSelect},x.createElement("div",null,e.children))),o):null}return x.createElement(QP,ge({},e,{ref:t}))}),Hr=10,[T2,Ci]=Po(xo),QP=x.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:a,side:s,sideOffset:l,align:u,alignOffset:c,arrowPadding:f,collisionBoundary:d,collisionPadding:h,sticky:m,hideWhenDetached:p,avoidCollisions:g,...v}=e,w=Ti(xo,r),[y,E]=x.useState(null),[b,k]=x.useState(null),_=We(t,Y=>E(Y)),[C,A]=x.useState(null),[L,B]=x.useState(null),U=ku(r),[H,G]=x.useState(!1),ee=x.useRef(!1);x.useEffect(()=>{if(y)return _d(y)},[y]),Ed();const ae=x.useCallback(Y=>{const[J,...W]=U().map(me=>me.ref.current),[Q]=W.slice(-1),le=document.activeElement;for(const me of Y)if(me===le||(me==null||me.scrollIntoView({block:"nearest"}),me===J&&b&&(b.scrollTop=0),me===Q&&b&&(b.scrollTop=b.scrollHeight),me==null||me.focus(),document.activeElement!==le))return},[U,b]),he=x.useCallback(()=>ae([C,y]),[ae,C,y]);x.useEffect(()=>{H&&he()},[H,he]);const{onOpenChange:Te,triggerPointerDownPosRef:oe}=w;x.useEffect(()=>{if(y){let Y={x:0,y:0};const J=Q=>{var le,me,_e,ie;Y={x:Math.abs(Math.round(Q.pageX)-((le=(me=oe.current)===null||me===void 0?void 0:me.x)!==null&&le!==void 0?le:0)),y:Math.abs(Math.round(Q.pageY)-((_e=(ie=oe.current)===null||ie===void 0?void 0:ie.y)!==null&&_e!==void 0?_e:0))}},W=Q=>{Y.x<=10&&Y.y<=10?Q.preventDefault():y.contains(Q.target)||Te(!1),document.removeEventListener("pointermove",J),oe.current=null};return oe.current!==null&&(document.addEventListener("pointermove",J),document.addEventListener("pointerup",W,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",W,{capture:!0})}}},[y,Te,oe]),x.useEffect(()=>{const Y=()=>Te(!1);return window.addEventListener("blur",Y),window.addEventListener("resize",Y),()=>{window.removeEventListener("blur",Y),window.removeEventListener("resize",Y)}},[Te]);const[ye,te]=O2(Y=>{const J=U().filter(le=>!le.disabled),W=J.find(le=>le.ref.current===document.activeElement),Q=F2(J,Y,W);Q&&setTimeout(()=>Q.ref.current.focus())}),O=x.useCallback((Y,J,W)=>{const Q=!ee.current&&!W;(w.value!==void 0&&w.value===J||Q)&&(A(Y),Q&&(ee.current=!0))},[w.value]),M=x.useCallback(()=>y==null?void 0:y.focus(),[y]),N=x.useCallback((Y,J,W)=>{const Q=!ee.current&&!W;(w.value!==void 0&&w.value===J||Q)&&B(Y)},[w.value]),F=n==="popper"?u1:ZP,V=F===u1?{side:s,sideOffset:l,align:u,alignOffset:c,arrowPadding:f,collisionBoundary:d,collisionPadding:h,sticky:m,hideWhenDetached:p,avoidCollisions:g}:{};return x.createElement(T2,{scope:r,content:y,viewport:b,onViewportChange:k,itemRefCallback:O,selectedItem:C,onItemLeave:M,itemTextRefCallback:N,focusSelectedItem:he,selectedItemText:L,position:n,isPositioned:H,searchRef:ye},x.createElement(Sd,{as:oi,allowPinchZoom:!0},x.createElement(yd,{asChild:!0,trapped:w.open,onMountAutoFocus:Y=>{Y.preventDefault()},onUnmountAutoFocus:Se(i,Y=>{var J;(J=w.trigger)===null||J===void 0||J.focus({preventScroll:!0}),Y.preventDefault()})},x.createElement(mu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:Y=>Y.preventDefault(),onDismiss:()=>w.onOpenChange(!1)},x.createElement(F,ge({role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:Y=>Y.preventDefault()},v,V,{onPlaced:()=>G(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:Se(v.onKeyDown,Y=>{const J=Y.ctrlKey||Y.altKey||Y.metaKey;if(Y.key==="Tab"&&Y.preventDefault(),!J&&Y.key.length===1&&te(Y.key),["ArrowUp","ArrowDown","Home","End"].includes(Y.key)){let Q=U().filter(le=>!le.disabled).map(le=>le.ref.current);if(["ArrowUp","End"].includes(Y.key)&&(Q=Q.slice().reverse()),["ArrowUp","ArrowDown"].includes(Y.key)){const le=Y.target,me=Q.indexOf(le);Q=Q.slice(me+1)}setTimeout(()=>ae(Q)),Y.preventDefault()}})}))))))}),ZP=x.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...i}=e,o=Ti(xo,r),a=Ci(xo,r),[s,l]=x.useState(null),[u,c]=x.useState(null),f=We(t,_=>c(_)),d=ku(r),h=x.useRef(!1),m=x.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:v,focusSelectedItem:w}=a,y=x.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&u&&p&&g&&v){const _=o.trigger.getBoundingClientRect(),C=u.getBoundingClientRect(),A=o.valueNode.getBoundingClientRect(),L=v.getBoundingClientRect();if(o.dir!=="rtl"){const le=L.left-C.left,me=A.left-le,_e=_.left-me,ie=_.width+_e,$e=Math.max(ie,C.width),Pe=window.innerWidth-Hr,ve=Zg(me,[Hr,Pe-$e]);s.style.minWidth=ie+"px",s.style.left=ve+"px"}else{const le=C.right-L.right,me=window.innerWidth-A.right-le,_e=window.innerWidth-_.right-me,ie=_.width+_e,$e=Math.max(ie,C.width),Pe=window.innerWidth-Hr,ve=Zg(me,[Hr,Pe-$e]);s.style.minWidth=ie+"px",s.style.right=ve+"px"}const B=d(),U=window.innerHeight-Hr*2,H=p.scrollHeight,G=window.getComputedStyle(u),ee=parseInt(G.borderTopWidth,10),ae=parseInt(G.paddingTop,10),he=parseInt(G.borderBottomWidth,10),Te=parseInt(G.paddingBottom,10),oe=ee+ae+H+Te+he,ye=Math.min(g.offsetHeight*5,oe),te=window.getComputedStyle(p),O=parseInt(te.paddingTop,10),M=parseInt(te.paddingBottom,10),N=_.top+_.height/2-Hr,F=U-N,V=g.offsetHeight/2,Y=g.offsetTop+V,J=ee+ae+Y,W=oe-J;if(J<=N){const le=g===B[B.length-1].ref.current;s.style.bottom="0px";const me=u.clientHeight-p.offsetTop-p.offsetHeight,_e=Math.max(F,V+(le?M:0)+me+he),ie=J+_e;s.style.height=ie+"px"}else{const le=g===B[0].ref.current;s.style.top="0px";const _e=Math.max(N,ee+p.offsetTop+(le?O:0)+V)+W;s.style.height=_e+"px",p.scrollTop=J-N+p.offsetTop}s.style.margin=`${Hr}px 0`,s.style.minHeight=ye+"px",s.style.maxHeight=U+"px",n==null||n(),requestAnimationFrame(()=>h.current=!0)}},[d,o.trigger,o.valueNode,s,u,p,g,v,o.dir,n]);Mt(()=>y(),[y]);const[E,b]=x.useState();Mt(()=>{u&&b(window.getComputedStyle(u).zIndex)},[u]);const k=x.useCallback(_=>{_&&m.current===!0&&(y(),w==null||w(),m.current=!1)},[y,w]);return x.createElement(JP,{scope:r,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:k},x.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E}},x.createElement(Ie.div,ge({},i,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}}))))}),u1=x.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:i=Hr,...o}=e,a=nh(r);return x.createElement(_2,ge({},a,o,{ref:t,align:n,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[JP,ih]=Po(xo,{}),c1="SelectViewport",eI=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=Ci(c1,r),o=ih(c1,r),a=We(t,i.onViewportChange),s=x.useRef(0);return x.createElement(x.Fragment,null,x.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),x.createElement(bu.Slot,{scope:r},x.createElement(Ie.div,ge({"data-radix-select-viewport":"",role:"presentation"},n,{ref:a,style:{position:"relative",flex:1,overflow:"auto",...n.style},onScroll:Se(n.onScroll,l=>{const u=l.currentTarget,{contentWrapper:c,shouldExpandOnScrollRef:f}=o;if(f!=null&&f.current&&c){const d=Math.abs(s.current-u.scrollTop);if(d>0){const h=window.innerHeight-Hr*2,m=parseFloat(c.style.minHeight),p=parseFloat(c.style.height),g=Math.max(m,p);if(g0?y:0,c.style.justifyContent="flex-end")}}}s.current=u.scrollTop})}))))}),tI="SelectGroup",[rI,nI]=Po(tI),iI=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=Kr();return x.createElement(rI,{scope:r,id:i},x.createElement(Ie.div,ge({role:"group","aria-labelledby":i},n,{ref:t})))}),oI="SelectLabel",aI=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=nI(oI,r);return x.createElement(Ie.div,ge({id:i.id},n,{ref:t}))}),a0="SelectItem",[sI,C2]=Po(a0),lI=x.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:i=!1,textValue:o,...a}=e,s=Ti(a0,r),l=Ci(a0,r),u=s.value===n,[c,f]=x.useState(o??""),[d,h]=x.useState(!1),m=We(t,v=>{var w;return(w=l.itemRefCallback)===null||w===void 0?void 0:w.call(l,v,n,i)}),p=Kr(),g=()=>{i||(s.onValueChange(n),s.onOpenChange(!1))};return x.createElement(sI,{scope:r,value:n,disabled:i,textId:p,isSelected:u,onItemTextChange:x.useCallback(v=>{f(w=>{var y;return w||((y=v==null?void 0:v.textContent)!==null&&y!==void 0?y:"").trim()})},[])},x.createElement(bu.ItemSlot,{scope:r,value:n,disabled:i,textValue:c},x.createElement(Ie.div,ge({role:"option","aria-labelledby":p,"data-highlighted":d?"":void 0,"aria-selected":u&&d,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1},a,{ref:m,onFocus:Se(a.onFocus,()=>h(!0)),onBlur:Se(a.onBlur,()=>h(!1)),onPointerUp:Se(a.onPointerUp,g),onPointerMove:Se(a.onPointerMove,v=>{if(i){var w;(w=l.onItemLeave)===null||w===void 0||w.call(l)}else v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Se(a.onPointerLeave,v=>{if(v.currentTarget===document.activeElement){var w;(w=l.onItemLeave)===null||w===void 0||w.call(l)}}),onKeyDown:Se(a.onKeyDown,v=>{var w;((w=l.searchRef)===null||w===void 0?void 0:w.current)!==""&&v.key===" "||(LP.includes(v.key)&&g(),v.key===" "&&v.preventDefault())})}))))}),zs="SelectItemText",uI=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:i,...o}=e,a=Ti(zs,r),s=Ci(zs,r),l=C2(zs,r),u=VP(zs,r),[c,f]=x.useState(null),d=We(t,v=>f(v),l.onItemTextChange,v=>{var w;return(w=s.itemTextRefCallback)===null||w===void 0?void 0:w.call(s,v,l.value,l.disabled)}),h=c==null?void 0:c.textContent,m=x.useMemo(()=>x.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},h),[l.disabled,l.value,h]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=u;return Mt(()=>(p(m),()=>g(m)),[p,g,m]),x.createElement(x.Fragment,null,x.createElement(Ie.span,ge({id:l.textId},o,{ref:d})),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?gi.createPortal(o.children,a.valueNode):null)}),cI="SelectItemIndicator",fI=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return C2(cI,r).isSelected?x.createElement(Ie.span,ge({"aria-hidden":!0},n,{ref:t})):null}),f1="SelectScrollUpButton",dI=x.forwardRef((e,t)=>{const r=Ci(f1,e.__scopeSelect),n=ih(f1,e.__scopeSelect),[i,o]=x.useState(!1),a=We(t,n.onScrollButtonChange);return Mt(()=>{if(r.viewport&&r.isPositioned){let u=function(){const c=l.scrollTop>0;o(c)};var s=u;const l=r.viewport;return u(),l.addEventListener("scroll",u),()=>l.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),i?x.createElement(A2,ge({},e,{ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=r;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}})):null}),d1="SelectScrollDownButton",hI=x.forwardRef((e,t)=>{const r=Ci(d1,e.__scopeSelect),n=ih(d1,e.__scopeSelect),[i,o]=x.useState(!1),a=We(t,n.onScrollButtonChange);return Mt(()=>{if(r.viewport&&r.isPositioned){let u=function(){const c=l.scrollHeight-l.clientHeight,f=Math.ceil(l.scrollTop)l.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),i?x.createElement(A2,ge({},e,{ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=r;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}})):null}),A2=x.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...i}=e,o=Ci("SelectScrollButton",r),a=x.useRef(null),s=ku(r),l=x.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return x.useEffect(()=>()=>l(),[l]),Mt(()=>{var u;const c=s().find(f=>f.ref.current===document.activeElement);c==null||(u=c.ref.current)===null||u===void 0||u.scrollIntoView({block:"nearest"})},[s]),x.createElement(Ie.div,ge({"aria-hidden":!0},i,{ref:t,style:{flexShrink:0,...i.style},onPointerDown:Se(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(n,50))}),onPointerMove:Se(i.onPointerMove,()=>{var u;(u=o.onItemLeave)===null||u===void 0||u.call(o),a.current===null&&(a.current=window.setInterval(n,50))}),onPointerLeave:Se(i.onPointerLeave,()=>{l()})}))}),R2=x.forwardRef((e,t)=>{const{value:r,...n}=e,i=x.useRef(null),o=We(t,i),a=NP(r);return x.useEffect(()=>{const s=i.current,l=window.HTMLSelectElement.prototype,c=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==r&&c){const f=new Event("change",{bubbles:!0});c.call(s,r),s.dispatchEvent(f)}},[a,r]),x.createElement(rh,{asChild:!0},x.createElement("select",ge({},n,{ref:o,defaultValue:r})))});R2.displayName="BubbleSelect";function O2(e){const t=Dt(e),r=x.useRef(""),n=x.useRef(0),i=x.useCallback(a=>{const s=r.current+a;t(s),function l(u){r.current=u,window.clearTimeout(n.current),u!==""&&(n.current=window.setTimeout(()=>l(""),1e3))}(s)},[t]),o=x.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,i,o]}function F2(e,t,r){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=pI(e,Math.max(o,0));i.length===1&&(a=a.filter(u=>u!==r));const l=a.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==r?l:void 0}function pI(e,t){return e.map((r,n)=>e[(t+n)%e.length])}const gI=WP,mI=GP,vI=XP,xI=KP,wI=YP,yI=qP,EI=eI,Vc=iI,h1=aI,SI=lI,_I=uI,TI=fI,CI=dI,AI=hI;function oh(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,o;for(o=0;o=0)&&(r[i]=e[i]);return r}var RI=["color"],OI=x.forwardRef(function(e,t){var r=e.color,n=r===void 0?"currentColor":r,i=oh(e,RI);return x.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),x.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))}),FI=["color"],s0=x.forwardRef(function(e,t){var r=e.color,n=r===void 0?"currentColor":r,i=oh(e,FI);return x.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),x.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))}),DI=["color"],PI=x.forwardRef(function(e,t){var r=e.color,n=r===void 0?"currentColor":r,i=oh(e,DI);return x.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),x.createElement("path",{d:"M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))});const Xi=({value:e,onChange:t,label:r="Select",placeholder:n="Select a fruit…",groups:i,labelType:o="col"})=>{const a=(i==null?void 0:i.length)===1;return Ce(gI,{value:e,onValueChange:t,children:[Ce(Vc,{className:kt("flex gap-1",{"flex-row items-center gap-2":o==="row","flex-col":o==="col"}),children:[X(h1,{className:"whitespace-nowrap",children:r}),Ce(mI,{className:"justify-between bg-white text-black dark:text-white dark:bg-grey-900 whitespace-nowrap h-[36px] border-[1.5px] border-grey-700 rounded p-3 inline-flex items-center leading-none gap-[5px] shadow-[0_2px_10px] shadow-black/10 focus:shadow-[0_0_0_2px] focus:shadow-black data-[placeholder]:text-white outline-none","aria-label":r,children:[X(vI,{placeholder:n}),X(xI,{children:X(s0,{})})]})]}),X(wI,{children:Ce(yI,{className:"z-50 bg-white/80 dark:bg-grey-900/80 backdrop-filter backdrop-blur overflow-hidden border-[1.5px] border-grey-700 rounded p-3 shadow-[0px_10px_38px_-10px_rgba(22,_23,_24,_0.35),0px_10px_20px_-15px_rgba(22,_23,_24,_0.2)]",children:[X(CI,{className:"flex items-center justify-center h-[25px] cursor-default dark:text-white text-black",children:X(PI,{})}),X(EI,{className:"p-[5px]",children:a?X(Vc,{children:i[0].items.map(s=>X(p1,{value:s.value,disabled:s.disabled,children:s.label}))}):i.map((s,l)=>Ce(Vc,{children:[X(h1,{className:"text-xs leading-[25px]",children:s.label}),s.items.map(u=>X(p1,{value:u.value,disabled:u.disabled,children:u.label},u.value))]},s.label))}),X(AI,{className:"flex items-center justify-center h-[25px] cursor-default dark:text-white text-black",children:X(s0,{})})]})})]})},p1=x.forwardRef(({children:e,className:t,...r},n)=>Ce(SI,{className:kt("text-[13px] leading-none rounded-[3px] flex items-center h-[25px] pr-[35px] pl-[25px] relative select-none data-[disabled]:text-grey-400 data-[disabled]:pointer-events-none data-[highlighted]:outline-none data-[highlighted]:bg-grey-600 data-[highlighted]:text-white text-black dark:text-white",t),...r,ref:n,children:[X(_I,{children:e}),X(TI,{className:"absolute left-0 w-[25px] inline-flex items-center justify-center",children:X(OI,{})})]})),D2="ToastProvider",[ah,II,bI]=Ou("Toast"),[P2,i$]=sn("Toast",[bI]),[kI,$u]=P2(D2),I2=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:i="right",swipeThreshold:o=50,children:a}=e,[s,l]=x.useState(null),[u,c]=x.useState(0),f=x.useRef(!1),d=x.useRef(!1);return x.createElement(ah.Provider,{scope:t},x.createElement(kI,{scope:t,label:r,duration:n,swipeDirection:i,swipeThreshold:o,toastCount:u,viewport:s,onViewportChange:l,onToastAdd:x.useCallback(()=>c(h=>h+1),[]),onToastRemove:x.useCallback(()=>c(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:d},a))};I2.propTypes={label(e){if(e.label&&typeof e.label=="string"&&!e.label.trim()){const t=`Invalid prop \`label\` supplied to \`${D2}\`. Expected non-empty \`string\`.`;return new Error(t)}return null}};const $I="ToastViewport",NI=["F8"],l0="toast.viewportPause",u0="toast.viewportResume",MI=x.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=NI,label:i="Notifications ({hotkey})",...o}=e,a=$u($I,r),s=II(r),l=x.useRef(null),u=x.useRef(null),c=x.useRef(null),f=x.useRef(null),d=We(t,f,a.onViewportChange),h=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),m=a.toastCount>0;x.useEffect(()=>{const g=v=>{var w;n.every(E=>v[E]||v.code===E)&&((w=f.current)===null||w===void 0||w.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[n]),x.useEffect(()=>{const g=l.current,v=f.current;if(m&&g&&v){const w=()=>{if(!a.isClosePausedRef.current){const k=new CustomEvent(l0);v.dispatchEvent(k),a.isClosePausedRef.current=!0}},y=()=>{if(a.isClosePausedRef.current){const k=new CustomEvent(u0);v.dispatchEvent(k),a.isClosePausedRef.current=!1}},E=k=>{!g.contains(k.relatedTarget)&&y()},b=()=>{g.contains(document.activeElement)||y()};return g.addEventListener("focusin",w),g.addEventListener("focusout",E),g.addEventListener("pointermove",w),g.addEventListener("pointerleave",b),window.addEventListener("blur",w),window.addEventListener("focus",y),()=>{g.removeEventListener("focusin",w),g.removeEventListener("focusout",E),g.removeEventListener("pointermove",w),g.removeEventListener("pointerleave",b),window.removeEventListener("blur",w),window.removeEventListener("focus",y)}}},[m,a.isClosePausedRef]);const p=x.useCallback(({tabbingDirection:g})=>{const w=s().map(y=>{const E=y.ref.current,b=[E,...e5(E)];return g==="forwards"?b:b.reverse()});return(g==="forwards"?w.reverse():w).flat()},[s]);return x.useEffect(()=>{const g=f.current;if(g){const v=w=>{const y=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!y){const C=document.activeElement,A=w.shiftKey;if(w.target===g&&A){var b;(b=u.current)===null||b===void 0||b.focus();return}const U=p({tabbingDirection:A?"backwards":"forwards"}),H=U.findIndex(G=>G===C);if(Wc(U.slice(H+1)))w.preventDefault();else{var k,_;A?(k=u.current)===null||k===void 0||k.focus():(_=c.current)===null||_===void 0||_.focus()}}};return g.addEventListener("keydown",v),()=>g.removeEventListener("keydown",v)}},[s,p]),x.createElement(s_,{ref:l,role:"region","aria-label":i.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:m?void 0:"none"}},m&&x.createElement(g1,{ref:u,onFocusFromOutsideViewport:()=>{const g=p({tabbingDirection:"forwards"});Wc(g)}}),x.createElement(ah.Slot,{scope:r},x.createElement(Ie.ol,ge({tabIndex:-1},o,{ref:d}))),m&&x.createElement(g1,{ref:c,onFocusFromOutsideViewport:()=>{const g=p({tabbingDirection:"backwards"});Wc(g)}}))}),LI="ToastFocusProxy",g1=x.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...i}=e,o=$u(LI,r);return x.createElement(rh,ge({"aria-hidden":!0,tabIndex:0},i,{ref:t,style:{position:"fixed"},onFocus:a=>{var s;const l=a.relatedTarget;!((s=o.viewport)!==null&&s!==void 0&&s.contains(l))&&n()}}))}),Nu="Toast",BI="toast.swipeStart",UI="toast.swipeMove",HI="toast.swipeCancel",VI="toast.swipeEnd",WI=x.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:i,onOpenChange:o,...a}=e,[s=!0,l]=go({prop:n,defaultProp:i,onChange:o});return x.createElement(mi,{present:r||s},x.createElement(b2,ge({open:s},a,{ref:t,onClose:()=>l(!1),onPause:Dt(e.onPause),onResume:Dt(e.onResume),onSwipeStart:Se(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Se(e.onSwipeMove,u=>{const{x:c,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:Se(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Se(e.onSwipeEnd,u=>{const{x:c,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),l(!1)})})))}),[zI,GI]=P2(Nu,{onClose(){}}),b2=x.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:i,open:o,onClose:a,onEscapeKeyDown:s,onPause:l,onResume:u,onSwipeStart:c,onSwipeMove:f,onSwipeCancel:d,onSwipeEnd:h,...m}=e,p=$u(Nu,r),[g,v]=x.useState(null),w=We(t,G=>v(G)),y=x.useRef(null),E=x.useRef(null),b=i||p.duration,k=x.useRef(0),_=x.useRef(b),C=x.useRef(0),{onToastAdd:A,onToastRemove:L}=p,B=Dt(()=>{var G;(g==null?void 0:g.contains(document.activeElement))&&((G=p.viewport)===null||G===void 0||G.focus()),a()}),U=x.useCallback(G=>{!G||G===1/0||(window.clearTimeout(C.current),k.current=new Date().getTime(),C.current=window.setTimeout(B,G))},[B]);x.useEffect(()=>{const G=p.viewport;if(G){const ee=()=>{U(_.current),u==null||u()},ae=()=>{const he=new Date().getTime()-k.current;_.current=_.current-he,window.clearTimeout(C.current),l==null||l()};return G.addEventListener(l0,ae),G.addEventListener(u0,ee),()=>{G.removeEventListener(l0,ae),G.removeEventListener(u0,ee)}}},[p.viewport,b,l,u,U]),x.useEffect(()=>{o&&!p.isClosePausedRef.current&&U(b)},[o,b,p.isClosePausedRef,U]),x.useEffect(()=>(A(),()=>L()),[A,L]);const H=x.useMemo(()=>g?N2(g):null,[g]);return p.viewport?x.createElement(x.Fragment,null,H&&x.createElement(jI,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0},H),x.createElement(zI,{scope:r,onClose:B},gi.createPortal(x.createElement(ah.ItemSlot,{scope:r},x.createElement(a_,{asChild:!0,onEscapeKeyDown:Se(s,()=>{p.isFocusedToastEscapeKeyDownRef.current||B(),p.isFocusedToastEscapeKeyDownRef.current=!1})},x.createElement(Ie.li,ge({role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":p.swipeDirection},m,{ref:w,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Se(e.onKeyDown,G=>{G.key==="Escape"&&(s==null||s(G.nativeEvent),G.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,B()))}),onPointerDown:Se(e.onPointerDown,G=>{G.button===0&&(y.current={x:G.clientX,y:G.clientY})}),onPointerMove:Se(e.onPointerMove,G=>{if(!y.current)return;const ee=G.clientX-y.current.x,ae=G.clientY-y.current.y,he=!!E.current,Te=["left","right"].includes(p.swipeDirection),oe=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,ye=Te?oe(0,ee):0,te=Te?0:oe(0,ae),O=G.pointerType==="touch"?10:2,M={x:ye,y:te},N={originalEvent:G,delta:M};he?(E.current=M,Gs(UI,f,N,{discrete:!1})):m1(M,p.swipeDirection,O)?(E.current=M,Gs(BI,c,N,{discrete:!1}),G.target.setPointerCapture(G.pointerId)):(Math.abs(ee)>O||Math.abs(ae)>O)&&(y.current=null)}),onPointerUp:Se(e.onPointerUp,G=>{const ee=E.current,ae=G.target;if(ae.hasPointerCapture(G.pointerId)&&ae.releasePointerCapture(G.pointerId),E.current=null,y.current=null,ee){const he=G.currentTarget,Te={originalEvent:G,delta:ee};m1(ee,p.swipeDirection,p.swipeThreshold)?Gs(VI,h,Te,{discrete:!0}):Gs(HI,d,Te,{discrete:!0}),he.addEventListener("click",oe=>oe.preventDefault(),{once:!0})}})})))),p.viewport))):null});b2.propTypes={type(e){if(e.type&&!["foreground","background"].includes(e.type)){const t=`Invalid prop \`type\` supplied to \`${Nu}\`. Expected \`foreground | background\`.`;return new Error(t)}return null}};const jI=e=>{const{__scopeToast:t,children:r,...n}=e,i=$u(Nu,t),[o,a]=x.useState(!1),[s,l]=x.useState(!1);return ZI(()=>a(!0)),x.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),s?null:x.createElement(vu,{asChild:!0},x.createElement(rh,n,o&&x.createElement(x.Fragment,null,i.label," ",r)))},XI=x.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return x.createElement(Ie.div,ge({},n,{ref:t}))}),KI=x.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return x.createElement(Ie.div,ge({},n,{ref:t}))}),YI="ToastAction",qI=x.forwardRef((e,t)=>{const{altText:r,...n}=e;return r?x.createElement($2,{altText:r,asChild:!0},x.createElement(k2,ge({},n,{ref:t}))):null});qI.propTypes={altText(e){return e.altText?null:new Error(`Missing prop \`altText\` expected on \`${YI}\``)}};const QI="ToastClose",k2=x.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,i=GI(QI,r);return x.createElement($2,{asChild:!0},x.createElement(Ie.button,ge({type:"button"},n,{ref:t,onClick:Se(e.onClick,i.onClose)})))}),$2=x.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...i}=e;return x.createElement(Ie.div,ge({"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0},i,{ref:t}))});function N2(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),JI(n)){const i=n.ariaHidden||n.hidden||n.style.display==="none",o=n.dataset.radixToastAnnounceExclude==="";if(!i)if(o){const a=n.dataset.radixToastAnnounceAlt;a&&t.push(a)}else t.push(...N2(n))}}),t}function Gs(e,t,r,{discrete:n}){const i=r.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?wd(i,o):i.dispatchEvent(o)}const m1=(e,t,r=0)=>{const n=Math.abs(e.x),i=Math.abs(e.y),o=n>i;return t==="left"||t==="right"?o&&n>r:!o&&i>r};function ZI(e=()=>{}){const t=Dt(e);Mt(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function JI(e){return e.nodeType===e.ELEMENT_NODE}function e5(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Wc(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}const t5=I2,r5=MI,n5=WI,i5=XI,o5=KI,a5=k2,s5=({title:e,titleId:t,...r})=>Ce("svg",{viewBox:"0 0 18 18",width:18,height:18,fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":t,...r,children:[e?X("title",{id:t,children:e}):null,X("path",{d:"M9 16.5a7.5 7.5 0 1 0 0-15 7.5 7.5 0 0 0 0 15ZM11.25 6.75l-4.5 4.5M6.75 6.75l4.5 4.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]}),l5=({title:e,titleId:t,...r})=>Ce("svg",{viewBox:"0 0 24 24",width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":t,...r,children:[e?X("title",{id:t,children:e}):null,X("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10ZM12 16v-4M12 8h.01",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]}),u5=({title:e,titleId:t,...r})=>Ce("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":t,...r,children:[e?X("title",{id:t,children:e}):null,X("path",{d:"M16.5 8.31V9a7.5 7.5 0 1 1-4.447-6.855",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),X("path",{d:"M16.5 3 9 10.508l-2.25-2.25",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]}),c5=({title:e,titleId:t,...r})=>Ce("svg",{viewBox:"0 0 18 18",width:18,height:18,fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":t,...r,children:[e?X("title",{id:t,children:e}):null,X("path",{d:"M7.718 2.895 1.366 13.5a1.5 1.5 0 0 0 1.282 2.25h12.705a1.5 1.5 0 0 0 1.283-2.25L10.283 2.895a1.5 1.5 0 0 0-2.565 0v0ZM9 6.75v3M9 12.75h.008",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]}),f5=({toast:e,open:t,setOpen:r})=>Ce(t5,{children:[Ce(n5,{open:t,onOpenChange:n=>{e.preventClose||r(n)},className:kt("z-50 fixed bottom-4 md:left-1/2 md:-translate-x-[50%] inset-x-4 w-auto shadow-lg md:max-w-[658px] duration-300","radix-state-open:animate-fade-in","radix-state-closed:animate-toast-hide","radix-swipe-end:animate-toast-swipe-out","translate-x-radix-toast-swipe-move-x","radix-swipe-cancel:translate-x-0 radix-swipe-cancel:duration-200 radix-swipe-cancel:ease-[ease]","px-[40px] md:px-[58px] py-6 flex flex-col border rounded-[4px]",{"bg-green-100 text-green-600 border-green-600":e.status==="success","bg-red-200 text-red-600 border-red-600":e.status==="error","bg-blue-100 text-blue-700 border-blue-600":e.status==="info","bg-orange-200 text-orange-600 border-orange-600":e.status==="warning"},{"h-[72px]":!e.description}),children:[e.status==="success"?X(u5,{className:"absolute left-[8px] md:left-[25px] top-[25px]"}):e.status==="warning"?X(c5,{className:"absolute left-[8px] md:left-[25px] top-[25px]"}):e.status==="error"?X(s5,{className:"absolute left-[8px] md:left-[25px] top-[25px]"}):X(l5,{className:"absolute left-[8px] md:left-[25px] top-[25px]"}),X(i5,{className:"text-grey-900 font-bold text-sm",children:e.title}),e.description&&X(o5,{className:"mt-2 text-[10px] md:text-xs text-grey-800",children:e.description}),X(a5,{className:"absolute top-7 right-5 md:right-7",children:X(ql,{className:"w-4 h-4 text-grey-900"})})]}),X(r5,{})]}),zc="rovingFocusGroup.onEntryFocus",d5={bubbles:!1,cancelable:!0},sh="RovingFocusGroup",[c0,M2,h5]=Ou(sh),[p5,L2]=sn(sh,[h5]),[g5,m5]=p5(sh),v5=x.forwardRef((e,t)=>x.createElement(c0.Provider,{scope:e.__scopeRovingFocusGroup},x.createElement(c0.Slot,{scope:e.__scopeRovingFocusGroup},x.createElement(x5,ge({},e,{ref:t}))))),x5=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,...c}=e,f=x.useRef(null),d=We(t,f),h=Zd(o),[m=null,p]=go({prop:a,defaultProp:s,onChange:l}),[g,v]=x.useState(!1),w=Dt(u),y=M2(r),E=x.useRef(!1),[b,k]=x.useState(0);return x.useEffect(()=>{const _=f.current;if(_)return _.addEventListener(zc,w),()=>_.removeEventListener(zc,w)},[w]),x.createElement(g5,{scope:r,orientation:n,dir:h,loop:i,currentTabStopId:m,onItemFocus:x.useCallback(_=>p(_),[p]),onItemShiftTab:x.useCallback(()=>v(!0),[]),onFocusableItemAdd:x.useCallback(()=>k(_=>_+1),[]),onFocusableItemRemove:x.useCallback(()=>k(_=>_-1),[])},x.createElement(Ie.div,ge({tabIndex:g||b===0?-1:0,"data-orientation":n},c,{ref:d,style:{outline:"none",...e.style},onMouseDown:Se(e.onMouseDown,()=>{E.current=!0}),onFocus:Se(e.onFocus,_=>{const C=!E.current;if(_.target===_.currentTarget&&C&&!g){const A=new CustomEvent(zc,d5);if(_.currentTarget.dispatchEvent(A),!A.defaultPrevented){const L=y().filter(ee=>ee.focusable),B=L.find(ee=>ee.active),U=L.find(ee=>ee.id===m),G=[B,U,...L].filter(Boolean).map(ee=>ee.ref.current);B2(G)}}E.current=!1}),onBlur:Se(e.onBlur,()=>v(!1))})))}),w5="RovingFocusGroupItem",y5=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:o,...a}=e,s=Kr(),l=o||s,u=m5(w5,r),c=u.currentTabStopId===l,f=M2(r),{onFocusableItemAdd:d,onFocusableItemRemove:h}=u;return x.useEffect(()=>{if(n)return d(),()=>h()},[n,d,h]),x.createElement(c0.ItemSlot,{scope:r,id:l,focusable:n,active:i},x.createElement(Ie.span,ge({tabIndex:c?0:-1,"data-orientation":u.orientation},a,{ref:t,onMouseDown:Se(e.onMouseDown,m=>{n?u.onItemFocus(l):m.preventDefault()}),onFocus:Se(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:Se(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){u.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const p=_5(m,u.orientation,u.dir);if(p!==void 0){m.preventDefault();let v=f().filter(w=>w.focusable).map(w=>w.ref.current);if(p==="last")v.reverse();else if(p==="prev"||p==="next"){p==="prev"&&v.reverse();const w=v.indexOf(m.currentTarget);v=u.loop?T5(v,w+1):v.slice(w+1)}setTimeout(()=>B2(v))}})})))}),E5={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function S5(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function _5(e,t,r){const n=S5(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return E5[n]}function B2(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function T5(e,t){return e.map((r,n)=>e[(t+n)%e.length])}const C5=v5,A5=y5,R5=["Enter"," "],O5=["ArrowDown","PageUp","Home"],U2=["ArrowUp","PageDown","End"],F5=[...O5,...U2],Mu="Menu",[f0,D5,P5]=Ou(Mu),[Ai,Lu]=sn(Mu,[P5,Pu,L2]),lh=Pu(),H2=L2(),[I5,ls]=Ai(Mu),[b5,uh]=Ai(Mu),k5=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:i,onOpenChange:o,modal:a=!0}=e,s=lh(t),[l,u]=x.useState(null),c=x.useRef(!1),f=Dt(o),d=Zd(i);return x.useEffect(()=>{const h=()=>{c.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>c.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),x.createElement(E2,s,x.createElement(I5,{scope:t,open:r,onOpenChange:f,content:l,onContentChange:u},x.createElement(b5,{scope:t,onClose:x.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:c,dir:d,modal:a},n)))},$5=x.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,i=lh(r);return x.createElement(S2,ge({},i,n,{ref:t}))}),V2="MenuPortal",[N5,M5]=Ai(V2,{forceMount:void 0}),L5=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:i}=e,o=ls(V2,t);return x.createElement(N5,{scope:t,forceMount:r},x.createElement(mi,{present:r||o.open},x.createElement(vu,{asChild:!0,container:i},n)))},On="MenuContent",[B5,W2]=Ai(On),U5=x.forwardRef((e,t)=>{const r=M5(On,e.__scopeMenu),{forceMount:n=r.forceMount,...i}=e,o=ls(On,e.__scopeMenu),a=uh(On,e.__scopeMenu);return x.createElement(f0.Provider,{scope:e.__scopeMenu},x.createElement(mi,{present:n||o.open},x.createElement(f0.Slot,{scope:e.__scopeMenu},a.modal?x.createElement(H5,ge({},i,{ref:t})):x.createElement(V5,ge({},i,{ref:t})))))}),H5=x.forwardRef((e,t)=>{const r=ls(On,e.__scopeMenu),n=x.useRef(null),i=We(t,n);return x.useEffect(()=>{const o=n.current;if(o)return _d(o)},[]),x.createElement(z2,ge({},e,{ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Se(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)}))}),V5=x.forwardRef((e,t)=>{const r=ls(On,e.__scopeMenu);return x.createElement(z2,ge({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)}))}),z2=x.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:f,onInteractOutside:d,onDismiss:h,disableOutsideScroll:m,...p}=e,g=ls(On,r),v=uh(On,r),w=lh(r),y=H2(r),E=D5(r),[b,k]=x.useState(null),_=x.useRef(null),C=We(t,_,g.onContentChange),A=x.useRef(0),L=x.useRef(""),B=x.useRef(0),U=x.useRef(null),H=x.useRef("right"),G=x.useRef(0),ee=m?Sd:x.Fragment,ae=m?{as:oi,allowPinchZoom:!0}:void 0,he=oe=>{var ye,te;const O=L.current+oe,M=E().filter(W=>!W.disabled),N=document.activeElement,F=(ye=M.find(W=>W.ref.current===N))===null||ye===void 0?void 0:ye.textValue,V=M.map(W=>W.textValue),Y=J5(V,O,F),J=(te=M.find(W=>W.textValue===Y))===null||te===void 0?void 0:te.ref.current;(function W(Q){L.current=Q,window.clearTimeout(A.current),Q!==""&&(A.current=window.setTimeout(()=>W(""),1e3))})(O),J&&setTimeout(()=>J.focus())};x.useEffect(()=>()=>window.clearTimeout(A.current),[]),Ed();const Te=x.useCallback(oe=>{var ye,te;return H.current===((ye=U.current)===null||ye===void 0?void 0:ye.side)&&tb(oe,(te=U.current)===null||te===void 0?void 0:te.area)},[]);return x.createElement(B5,{scope:r,searchRef:L,onItemEnter:x.useCallback(oe=>{Te(oe)&&oe.preventDefault()},[Te]),onItemLeave:x.useCallback(oe=>{var ye;Te(oe)||((ye=_.current)===null||ye===void 0||ye.focus(),k(null))},[Te]),onTriggerLeave:x.useCallback(oe=>{Te(oe)&&oe.preventDefault()},[Te]),pointerGraceTimerRef:B,onPointerGraceIntentChange:x.useCallback(oe=>{U.current=oe},[])},x.createElement(ee,ae,x.createElement(yd,{asChild:!0,trapped:i,onMountAutoFocus:Se(o,oe=>{var ye;oe.preventDefault(),(ye=_.current)===null||ye===void 0||ye.focus()}),onUnmountAutoFocus:a},x.createElement(mu,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:f,onInteractOutside:d,onDismiss:h},x.createElement(C5,ge({asChild:!0},y,{dir:v.dir,orientation:"vertical",loop:n,currentTabStopId:b,onCurrentTabStopIdChange:k,onEntryFocus:Se(l,oe=>{v.isUsingKeyboardRef.current||oe.preventDefault()})}),x.createElement(_2,ge({role:"menu","aria-orientation":"vertical","data-state":q5(g.open),"data-radix-menu-content":"",dir:v.dir},w,p,{ref:C,style:{outline:"none",...p.style},onKeyDown:Se(p.onKeyDown,oe=>{const te=oe.target.closest("[data-radix-menu-content]")===oe.currentTarget,O=oe.ctrlKey||oe.altKey||oe.metaKey,M=oe.key.length===1;te&&(oe.key==="Tab"&&oe.preventDefault(),!O&&M&&he(oe.key));const N=_.current;if(oe.target!==N||!F5.includes(oe.key))return;oe.preventDefault();const V=E().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);U2.includes(oe.key)&&V.reverse(),Q5(V)}),onBlur:Se(e.onBlur,oe=>{oe.currentTarget.contains(oe.target)||(window.clearTimeout(A.current),L.current="")}),onPointerMove:Se(e.onPointerMove,h0(oe=>{const ye=oe.target,te=G.current!==oe.clientX;if(oe.currentTarget.contains(ye)&&te){const O=oe.clientX>G.current?"right":"left";H.current=O,G.current=oe.clientX}}))})))))))}),W5=x.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return x.createElement(Ie.div,ge({role:"group"},n,{ref:t}))}),z5=x.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return x.createElement(Ie.div,ge({},n,{ref:t}))}),d0="MenuItem",v1="menu.itemSelect",G5=x.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...i}=e,o=x.useRef(null),a=uh(d0,e.__scopeMenu),s=W2(d0,e.__scopeMenu),l=We(t,o),u=x.useRef(!1),c=()=>{const f=o.current;if(!r&&f){const d=new CustomEvent(v1,{bubbles:!0,cancelable:!0});f.addEventListener(v1,h=>n==null?void 0:n(h),{once:!0}),wd(f,d),d.defaultPrevented?u.current=!1:a.onClose()}};return x.createElement(j5,ge({},i,{ref:l,disabled:r,onClick:Se(e.onClick,c),onPointerDown:f=>{var d;(d=e.onPointerDown)===null||d===void 0||d.call(e,f),u.current=!0},onPointerUp:Se(e.onPointerUp,f=>{var d;u.current||(d=f.currentTarget)===null||d===void 0||d.click()}),onKeyDown:Se(e.onKeyDown,f=>{const d=s.searchRef.current!=="";r||d&&f.key===" "||R5.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})}))}),j5=x.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:i,...o}=e,a=W2(d0,r),s=H2(r),l=x.useRef(null),u=We(t,l),[c,f]=x.useState(!1),[d,h]=x.useState("");return x.useEffect(()=>{const m=l.current;if(m){var p;h(((p=m.textContent)!==null&&p!==void 0?p:"").trim())}},[o.children]),x.createElement(f0.ItemSlot,{scope:r,disabled:n,textValue:i??d},x.createElement(A5,ge({asChild:!0},s,{focusable:!n}),x.createElement(Ie.div,ge({role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0},o,{ref:u,onPointerMove:Se(e.onPointerMove,h0(m=>{n?a.onItemLeave(m):(a.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus())})),onPointerLeave:Se(e.onPointerLeave,h0(m=>a.onItemLeave(m))),onFocus:Se(e.onFocus,()=>f(!0)),onBlur:Se(e.onBlur,()=>f(!1))}))))}),X5="MenuRadioGroup";Ai(X5,{value:void 0,onValueChange:()=>{}});const K5="MenuItemIndicator";Ai(K5,{checked:!1});const Y5="MenuSub";Ai(Y5);function q5(e){return e?"open":"closed"}function Q5(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function Z5(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function J5(e,t,r){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=Z5(e,Math.max(o,0));i.length===1&&(a=a.filter(u=>u!==r));const l=a.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==r?l:void 0}function eb(e,t){const{x:r,y:n}=e;let i=!1;for(let o=0,a=t.length-1;on!=c>n&&r<(u-s)*(n-l)/(c-l)+s&&(i=!i)}return i}function tb(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return eb(r,t)}function h0(e){return t=>t.pointerType==="mouse"?e(t):void 0}const G2=k5,j2=$5,X2=L5,K2=U5,rb=W5,nb=z5,ib=G5,Y2="ContextMenu",[ob,o$]=sn(Y2,[Lu]),Bu=Lu(),[ab,q2]=ob(Y2),sb=e=>{const{__scopeContextMenu:t,children:r,onOpenChange:n,dir:i,modal:o=!0}=e,[a,s]=x.useState(!1),l=Bu(t),u=Dt(n),c=x.useCallback(f=>{s(f),u(f)},[u]);return x.createElement(ab,{scope:t,open:a,onOpenChange:c,modal:o},x.createElement(G2,ge({},l,{dir:i,open:a,onOpenChange:c,modal:o}),r))},lb="ContextMenuTrigger",ub=x.forwardRef((e,t)=>{const{__scopeContextMenu:r,disabled:n=!1,...i}=e,o=q2(lb,r),a=Bu(r),s=x.useRef({x:0,y:0}),l=x.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...s.current})}),u=x.useRef(0),c=x.useCallback(()=>window.clearTimeout(u.current),[]),f=d=>{s.current={x:d.clientX,y:d.clientY},o.onOpenChange(!0)};return x.useEffect(()=>c,[c]),x.useEffect(()=>void(n&&c()),[n,c]),x.createElement(x.Fragment,null,x.createElement(j2,ge({},a,{virtualRef:l})),x.createElement(Ie.span,ge({"data-state":o.open?"open":"closed","data-disabled":n?"":void 0},i,{ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:n?e.onContextMenu:Se(e.onContextMenu,d=>{c(),f(d),d.preventDefault()}),onPointerDown:n?e.onPointerDown:Se(e.onPointerDown,js(d=>{c(),u.current=window.setTimeout(()=>f(d),700)})),onPointerMove:n?e.onPointerMove:Se(e.onPointerMove,js(c)),onPointerCancel:n?e.onPointerCancel:Se(e.onPointerCancel,js(c)),onPointerUp:n?e.onPointerUp:Se(e.onPointerUp,js(c))})))}),cb=e=>{const{__scopeContextMenu:t,...r}=e,n=Bu(t);return x.createElement(X2,ge({},n,r))},fb="ContextMenuContent",db=x.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,i=q2(fb,r),o=Bu(r),a=x.useRef(!1);return x.createElement(K2,ge({},o,n,{ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:s=>{var l;(l=e.onCloseAutoFocus)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&a.current&&s.preventDefault(),a.current=!1},onInteractOutside:s=>{var l;(l=e.onInteractOutside)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&!i.modal&&(a.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))});function js(e){return t=>t.pointerType!=="mouse"?e(t):void 0}const hb=sb,pb=ub,gb=cb,mb=db,Q2=x.createContext({dragDropManager:void 0});function rr(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var x1=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Gc=function(){return Math.random().toString(36).substring(7).split("").join(".")},w1={INIT:"@@redux/INIT"+Gc(),REPLACE:"@@redux/REPLACE"+Gc(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Gc()}};function vb(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Z2(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(rr(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(rr(1));return r(Z2)(e,t)}if(typeof e!="function")throw new Error(rr(2));var i=e,o=t,a=[],s=a,l=!1;function u(){s===a&&(s=a.slice())}function c(){if(l)throw new Error(rr(3));return o}function f(p){if(typeof p!="function")throw new Error(rr(4));if(l)throw new Error(rr(5));var g=!0;return u(),s.push(p),function(){if(g){if(l)throw new Error(rr(6));g=!1,u();var w=s.indexOf(p);s.splice(w,1),a=null}}}function d(p){if(!vb(p))throw new Error(rr(7));if(typeof p.type>"u")throw new Error(rr(8));if(l)throw new Error(rr(9));try{l=!0,o=i(o,p)}finally{l=!1}for(var g=a=s,v=0;vn&&n[i]?n[i]:r||null,e)}function yb(e,t){return e.filter(r=>r!==t)}function J2(e){return typeof e=="object"}function Eb(e,t){const r=new Map,n=o=>{r.set(o,r.has(o)?r.get(o)+1:1)};e.forEach(n),t.forEach(n);const i=[];return r.forEach((o,a)=>{o===1&&i.push(a)}),i}function Sb(e,t){return e.filter(r=>t.indexOf(r)>-1)}const ch="dnd-core/INIT_COORDS",Uu="dnd-core/BEGIN_DRAG",fh="dnd-core/PUBLISH_DRAG_SOURCE",Hu="dnd-core/HOVER",Vu="dnd-core/DROP",Wu="dnd-core/END_DRAG";function y1(e,t){return{type:ch,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const _b={type:ch,payload:{clientOffset:null,sourceClientOffset:null}};function Tb(e){return function(r=[],n={publishSource:!0}){const{publishSource:i=!0,clientOffset:o,getSourceClientOffset:a}=n,s=e.getMonitor(),l=e.getRegistry();e.dispatch(y1(o)),Cb(r,s,l);const u=Ob(r,s);if(u==null){e.dispatch(_b);return}let c=null;if(o){if(!a)throw new Error("getSourceClientOffset must be defined");Ab(a),c=a(u)}e.dispatch(y1(o,c));const d=l.getSource(u).beginDrag(s,u);if(d==null)return;Rb(d),l.pinSource(u);const h=l.getSourceType(u);return{type:Uu,payload:{itemType:h,item:d,sourceId:u,clientOffset:o||null,sourceClientOffset:c||null,isSourcePublic:!!i}}}}function Cb(e,t,r){Fe(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(n){Fe(r.getSource(n),"Expected sourceIds to be registered.")})}function Ab(e){Fe(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function Rb(e){Fe(J2(e),"Item must be an object.")}function Ob(e,t){let r=null;for(let n=e.length-1;n>=0;n--)if(t.canDragSource(e[n])){r=e[n];break}return r}function Fb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Db(e){for(var t=1;t{const l=bb(a,s,i,n),u={type:Vu,payload:{dropResult:Db({},r,l)}};e.dispatch(u)})}}function Ib(e){Fe(e.isDragging(),"Cannot call drop while not dragging."),Fe(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function bb(e,t,r,n){const i=r.getTarget(e);let o=i?i.drop(n,e):void 0;return kb(o),typeof o>"u"&&(o=t===0?{}:n.getDropResult()),o}function kb(e){Fe(typeof e>"u"||J2(e),"Drop result must either be an object or undefined.")}function $b(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function Nb(e){return function(){const r=e.getMonitor(),n=e.getRegistry();Mb(r);const i=r.getSourceId();return i!=null&&(n.getSource(i,!0).endDrag(r,i),n.unpinSource()),{type:Wu}}}function Mb(e){Fe(e.isDragging(),"Cannot call endDrag while not dragging.")}function p0(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function Lb(e){return function(r,{clientOffset:n}={}){Bb(r);const i=r.slice(0),o=e.getMonitor(),a=e.getRegistry(),s=o.getItemType();return Hb(i,a,s),Ub(i,o,a),Vb(i,o,a),{type:Hu,payload:{targetIds:i,clientOffset:n||null}}}}function Bb(e){Fe(Array.isArray(e),"Expected targetIds to be an array.")}function Ub(e,t,r){Fe(t.isDragging(),"Cannot call hover while not dragging."),Fe(!t.didDrop(),"Cannot call hover after drop.");for(let n=0;n=0;n--){const i=e[n],o=t.getTargetType(i);p0(o,r)||e.splice(n,1)}}function Vb(e,t,r){e.forEach(function(n){r.getTarget(n).hover(t,n)})}function Wb(e){return function(){if(e.getMonitor().isDragging())return{type:fh}}}function zb(e){return{beginDrag:Tb(e),publishDragSource:Wb(e),hover:Lb(e),drop:Pb(e),endDrag:Nb(e)}}class Gb{receiveBackend(t){this.backend=t}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const t=this,{dispatch:r}=this.store;function n(o){return(...a)=>{const s=o.apply(t,a);typeof s<"u"&&r(s)}}const i=zb(this);return Object.keys(i).reduce((o,a)=>{const s=i[a];return o[a]=n(s),o},{})}dispatch(t){this.store.dispatch(t)}constructor(t,r){this.isSetUp=!1,this.handleRefCountChange=()=>{const n=this.store.getState().refCount>0;this.backend&&(n&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!n&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}}function jb(e,t){return{x:e.x+t.x,y:e.y+t.y}}function ey(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Xb(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:n}=e;return!t||!r||!n?null:ey(jb(t,n),r)}function Kb(e){const{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:ey(t,r)}const Sa=[],dh=[];Sa.__IS_NONE__=!0;dh.__IS_ALL__=!0;function Yb(e,t){return e===Sa?!1:e===dh||typeof t>"u"?!0:Sb(t,e).length>0}class qb{subscribeToStateChange(t,r={}){const{handlerIds:n}=r;Fe(typeof t=="function","listener must be a function."),Fe(typeof n>"u"||Array.isArray(n),"handlerIds, when specified, must be an array of strings.");let i=this.store.getState().stateId;const o=()=>{const a=this.store.getState(),s=a.stateId;try{s===i||s===i+1&&!Yb(a.dirtyHandlerIds,n)||t()}finally{i=s}};return this.store.subscribe(o)}subscribeToOffsetChange(t){Fe(typeof t=="function","listener must be a function.");let r=this.store.getState().dragOffset;const n=()=>{const i=this.store.getState().dragOffset;i!==r&&(r=i,t())};return this.store.subscribe(n)}canDragSource(t){if(!t)return!1;const r=this.registry.getSource(t);return Fe(r,`Expected to find a valid source. sourceId=${t}`),this.isDragging()?!1:r.canDrag(this,t)}canDropOnTarget(t){if(!t)return!1;const r=this.registry.getTarget(t);if(Fe(r,`Expected to find a valid target. targetId=${t}`),!this.isDragging()||this.didDrop())return!1;const n=this.registry.getTargetType(t),i=this.getItemType();return p0(n,i)&&r.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const r=this.registry.getSource(t,!0);if(Fe(r,`Expected to find a valid source. sourceId=${t}`),!this.isDragging()||!this.isSourcePublic())return!1;const n=this.registry.getSourceType(t),i=this.getItemType();return n!==i?!1:r.isDragging(this,t)}isOverTarget(t,r={shallow:!1}){if(!t)return!1;const{shallow:n}=r;if(!this.isDragging())return!1;const i=this.registry.getTargetType(t),o=this.getItemType();if(o&&!p0(i,o))return!1;const a=this.getTargetIds();if(!a.length)return!1;const s=a.indexOf(t);return n?s===a.length-1:s>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return Xb(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return Kb(this.store.getState().dragOffset)}constructor(t,r){this.store=t,this.registry=r}}const E1=typeof global<"u"?global:self,ty=E1.MutationObserver||E1.WebKitMutationObserver;function ry(e){return function(){const r=setTimeout(i,0),n=setInterval(i,50);function i(){clearTimeout(r),clearInterval(n),e()}}}function Qb(e){let t=1;const r=new ty(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const Zb=typeof ty=="function"?Qb:ry;class Jb{enqueueTask(t){const{queue:r,requestFlush:n}=this;r.length||(n(),this.flushing=!0),r[r.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.indexthis.capacity){for(let n=0,i=t.length-this.index;n{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=Zb(this.flush),this.requestErrorThrow=ry(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class e8{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,r){this.onError=t,this.release=r,this.task=null}}class t8{create(t){const r=this.freeTasks,n=r.length?r.pop():new e8(this.onError,i=>r[r.length]=i);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const ny=new Jb,r8=new t8(ny.registerPendingError);function n8(e){ny.enqueueTask(r8.create(e))}const hh="dnd-core/ADD_SOURCE",ph="dnd-core/ADD_TARGET",gh="dnd-core/REMOVE_SOURCE",zu="dnd-core/REMOVE_TARGET";function i8(e){return{type:hh,payload:{sourceId:e}}}function o8(e){return{type:ph,payload:{targetId:e}}}function a8(e){return{type:gh,payload:{sourceId:e}}}function s8(e){return{type:zu,payload:{targetId:e}}}function l8(e){Fe(typeof e.canDrag=="function","Expected canDrag to be a function."),Fe(typeof e.beginDrag=="function","Expected beginDrag to be a function."),Fe(typeof e.endDrag=="function","Expected endDrag to be a function.")}function u8(e){Fe(typeof e.canDrop=="function","Expected canDrop to be a function."),Fe(typeof e.hover=="function","Expected hover to be a function."),Fe(typeof e.drop=="function","Expected beginDrag to be a function.")}function g0(e,t){if(t&&Array.isArray(e)){e.forEach(r=>g0(r,!1));return}Fe(typeof e=="string"||typeof e=="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var ar;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(ar||(ar={}));let c8=0;function f8(){return c8++}function d8(e){const t=f8().toString();switch(e){case ar.SOURCE:return`S${t}`;case ar.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function S1(e){switch(e[0]){case"S":return ar.SOURCE;case"T":return ar.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function _1(e,t){const r=e.entries();let n=!1;do{const{done:i,value:[,o]}=r.next();if(o===t)return!0;n=!!i}while(!n);return!1}class h8{addSource(t,r){g0(t),l8(r);const n=this.addHandler(ar.SOURCE,t,r);return this.store.dispatch(i8(n)),n}addTarget(t,r){g0(t,!0),u8(r);const n=this.addHandler(ar.TARGET,t,r);return this.store.dispatch(o8(n)),n}containsHandler(t){return _1(this.dragSources,t)||_1(this.dropTargets,t)}getSource(t,r=!1){return Fe(this.isSourceId(t),"Expected a valid source ID."),r&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return Fe(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return Fe(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return Fe(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return S1(t)===ar.SOURCE}isTargetId(t){return S1(t)===ar.TARGET}removeSource(t){Fe(this.getSource(t),"Expected an existing source."),this.store.dispatch(a8(t)),n8(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){Fe(this.getTarget(t),"Expected an existing target."),this.store.dispatch(s8(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const r=this.getSource(t);Fe(r,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=r}unpinSource(){Fe(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,r,n){const i=d8(t);return this.types.set(i,r),t===ar.SOURCE?this.dragSources.set(i,n):t===ar.TARGET&&this.dropTargets.set(i,n),i}constructor(t){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=t}}const p8=(e,t)=>e===t;function g8(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function m8(e,t,r=p8){if(e.length!==t.length)return!1;for(let n=0;n0||!m8(r,n)))return Sa;const a=n[n.length-1],s=r[r.length-1];return a!==s&&(a&&i.push(a),s&&i.push(s)),i}function x8(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function w8(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function I8(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,o;for(o=0;o=0)&&(r[i]=e[i]);return r}let C1=0;const ul=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var b8=x.memo(function(t){var{children:r}=t,n=P8(t,["children"]);const[i,o]=k8(n);return x.useEffect(()=>{if(o){const a=iy();return++C1,()=>{--C1===0&&(a[ul]=null)}}},[]),X(Q2.Provider,{value:i,children:r})});function k8(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=$8(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}function $8(e,t=iy(),r,n){const i=t;return i[ul]||(i[ul]={dragDropManager:F8(e,t,r,n)}),i[ul]}function iy(){return typeof global<"u"?global:window}var N8=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;i--!==0;){var a=o[i];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r};const M8=Ka(N8),ci=typeof window<"u"?x.useLayoutEffect:x.useEffect;function L8(e,t,r){const[n,i]=x.useState(()=>t(e)),o=x.useCallback(()=>{const a=t(e);M8(n,a)||(i(a),r&&r())},[n,e,r]);return ci(o),[n,o]}function B8(e,t,r){const[n,i]=L8(e,t,r);return ci(function(){const a=e.getHandlerId();if(a!=null)return e.subscribeToStateChange(i,{handlerIds:[a]})},[e,i]),n}function oy(e,t,r){return B8(t,e||(()=>({})),()=>r.reconnect())}function ay(e,t){const r=[...t||[]];return t==null&&typeof e!="function"&&r.push(e),x.useMemo(()=>typeof e=="function"?e():e,r)}function U8(e){return x.useMemo(()=>e.hooks.dragSource(),[e])}function H8(e){return x.useMemo(()=>e.hooks.dragPreview(),[e])}let jc=!1,Xc=!1;class V8{receiveHandlerId(t){this.sourceId=t}getHandlerId(){return this.sourceId}canDrag(){Fe(!jc,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return jc=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{jc=!1}}isDragging(){if(!this.sourceId)return!1;Fe(!Xc,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Xc=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Xc=!1}}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}isDraggingSource(t){return this.internalMonitor.isDraggingSource(t)}isOverTarget(t,r){return this.internalMonitor.isOverTarget(t,r)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(t){return this.internalMonitor.subscribeToOffsetChange(t)}canDragSource(t){return this.internalMonitor.canDragSource(t)}canDropOnTarget(t){return this.internalMonitor.canDropOnTarget(t)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.sourceId=null,this.internalMonitor=t.getMonitor()}}let Kc=!1;class W8{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}canDrop(){if(!this.targetId)return!1;Fe(!Kc,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Kc=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Kc=!1}}isOver(t){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,t):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.targetId=null,this.internalMonitor=t.getMonitor()}}function z8(e,t,r){const n=r.getRegistry(),i=n.addTarget(e,t);return[i,()=>n.removeTarget(i)]}function G8(e,t,r){const n=r.getRegistry(),i=n.addSource(e,t);return[i,()=>n.removeSource(i)]}function m0(e,t,r,n){let i=r?r.call(n,e,t):void 0;if(i!==void 0)return!!i;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;const o=Object.keys(e),a=Object.keys(t);if(o.length!==a.length)return!1;const s=Object.prototype.hasOwnProperty.bind(t);for(let l=0;l, or turn it into a drag source or a drop target itself.`)}function X8(e){return(t=null,r=null)=>{if(!x.isValidElement(t)){const o=t;return e(o,r),o}const n=t;return j8(n),K8(n,r?o=>e(o,r):e)}}function sy(e){const t={};return Object.keys(e).forEach(r=>{const n=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const i=X8(n);t[r]=()=>i}}),t}function A1(e,t){typeof e=="function"?e(t):e.current=t}function K8(e,t){const r=e.ref;return Fe(typeof r!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a or
. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?x.cloneElement(e,{ref:n=>{A1(r,n),A1(t,n)}}):x.cloneElement(e,{ref:t})}class Y8{receiveHandlerId(t){this.handlerId!==t&&(this.handlerId=t,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(t){this.dragSourceOptionsInternal=t}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(t){this.dragPreviewOptionsInternal=t}reconnect(){const t=this.reconnectDragSource();this.reconnectDragPreview(t)}reconnectDragSource(){const t=this.dragSource,r=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return r&&this.disconnectDragSource(),this.handlerId?t?(r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=t,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,t,this.dragSourceOptions)),r):(this.lastConnectedDragSource=t,r):r}reconnectDragPreview(t=!1){const r=this.dragPreview,n=t||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(n&&this.disconnectDragPreview(),!!this.handlerId){if(!r){this.lastConnectedDragPreview=r;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=r,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,r,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!m0(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!m0(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(t){this.hooks=sy({dragSource:(r,n)=>{this.clearDragSource(),this.dragSourceOptions=n||null,v0(r)?this.dragSourceRef=r:this.dragSourceNode=r,this.reconnectDragSource()},dragPreview:(r,n)=>{this.clearDragPreview(),this.dragPreviewOptions=n||null,v0(r)?this.dragPreviewRef=r:this.dragPreviewNode=r,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=t}}class q8{get connectTarget(){return this.dropTarget}reconnect(){const t=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();t&&this.disconnectDropTarget();const r=this.dropTarget;if(this.handlerId){if(!r){this.lastConnectedDropTarget=r;return}t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=r,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,r,this.dropTargetOptions))}}receiveHandlerId(t){t!==this.handlerId&&(this.handlerId=t,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(t){this.dropTargetOptionsInternal=t}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!m0(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(t){this.hooks=sy({dropTarget:(r,n)=>{this.clearDropTarget(),this.dropTargetOptions=n,v0(r)?this.dropTargetRef=r:this.dropTargetNode=r,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}}function Io(){const{dragDropManager:e}=x.useContext(Q2);return Fe(e!=null,"Expected drag drop context"),e}function Q8(e,t){const r=Io(),n=x.useMemo(()=>new Y8(r.getBackend()),[r]);return ci(()=>(n.dragSourceOptions=e||null,n.reconnect(),()=>n.disconnectDragSource()),[n,e]),ci(()=>(n.dragPreviewOptions=t||null,n.reconnect(),()=>n.disconnectDragPreview()),[n,t]),n}function Z8(){const e=Io();return x.useMemo(()=>new V8(e),[e])}class J8{beginDrag(){const t=this.spec,r=this.monitor;let n=null;return typeof t.item=="object"?n=t.item:typeof t.item=="function"?n=t.item(r):n={},n??null}canDrag(){const t=this.spec,r=this.monitor;return typeof t.canDrag=="boolean"?t.canDrag:typeof t.canDrag=="function"?t.canDrag(r):!0}isDragging(t,r){const n=this.spec,i=this.monitor,{isDragging:o}=n;return o?o(i):r===t.getSourceId()}endDrag(){const t=this.spec,r=this.monitor,n=this.connector,{end:i}=t;i&&i(r.getItem(),r),n.reconnect()}constructor(t,r,n){this.spec=t,this.monitor=r,this.connector=n}}function ek(e,t,r){const n=x.useMemo(()=>new J8(e,t,r),[t,r]);return x.useEffect(()=>{n.spec=e},[e]),n}function tk(e){return x.useMemo(()=>{const t=e.type;return Fe(t!=null,"spec.type must be defined"),t},[e])}function rk(e,t,r){const n=Io(),i=ek(e,t,r),o=tk(e);ci(function(){if(o!=null){const[s,l]=G8(o,i,n);return t.receiveHandlerId(s),r.receiveHandlerId(s),l}},[n,t,r,i,o])}function nk(e,t){const r=ay(e,t);Fe(!r.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const n=Z8(),i=Q8(r.options,r.previewOptions);return rk(r,n,i),[oy(r.collect,n,i),U8(i),H8(i)]}function ik(e){return x.useMemo(()=>e.hooks.dropTarget(),[e])}function ok(e){const t=Io(),r=x.useMemo(()=>new q8(t.getBackend()),[t]);return ci(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function ak(){const e=Io();return x.useMemo(()=>new W8(e),[e])}function sk(e){const{accept:t}=e;return x.useMemo(()=>(Fe(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class lk{canDrop(){const t=this.spec,r=this.monitor;return t.canDrop?t.canDrop(r.getItem(),r):!0}hover(){const t=this.spec,r=this.monitor;t.hover&&t.hover(r.getItem(),r)}drop(){const t=this.spec,r=this.monitor;if(t.drop)return t.drop(r.getItem(),r)}constructor(t,r){this.spec=t,this.monitor=r}}function uk(e,t){const r=x.useMemo(()=>new lk(e,t),[t]);return x.useEffect(()=>{r.spec=e},[e]),r}function ck(e,t,r){const n=Io(),i=uk(e,t),o=sk(e);ci(function(){const[s,l]=z8(o,i,n);return t.receiveHandlerId(s),r.receiveHandlerId(s),l},[n,t,i,r,o.map(a=>a.toString()).join("|")])}function fk(e,t){const r=ay(e,t),n=ak(),i=ok(r.options);return ck(r,n,i),[oy(r.collect,n,i),ik(i)]}const ly=new RegExp("^([0-9]+)(\\s)([kKmMbBtT])$"),_a=new RegExp("^\\d{4}$"),dk=new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}|\\d{4}-\\d{2}-\\d{2}$");function hk({column:e,table:t,numberOfColumns:r}){function n(f){if(!f)return null;const d=new Date(f),h=d.toISOString().split("T")[0],m=d.toTimeString().split(" ")[0];return`${h} ${m}`}const i=t.getPreFilteredRowModel().flatRows.map(f=>f.original[e.id]),o=i.every(f=>typeof f=="string"||f===null),a=i.every(f=>typeof f=="number"||ly.test(f)||f===null||f===""),s=i.some(f=>typeof f=="string"&&f.includes(" ")),l=e.getFilterValue();let u="date";const c=i.every(f=>{const d=f==null?void 0:f.toString().replace(/[^0-9]/g,"").trim();return dk.test(f==null?void 0:f.toString())&&(u="datetime-local"),_a.test(f==null?void 0:f.toString())&&(u="number"),(d==null?void 0:d.length)>=4&&(Yl(e.id)||e.id.toLowerCase()==="index"&&!s)});return c&&u==="number"?Ce("div",{className:"flex gap-2 h-6",children:[X("input",{type:u,value:(l==null?void 0:l[0])??"",onChange:f=>{e.setFilterValue(d=>[`${f.target.value}`,`${d==null?void 0:d[1]}`])},min:i.reduce((f,d)=>Math.min(f,parseInt(d,10)),1/0),max:i.reduce((f,d)=>Math.max(f,parseInt(d,10)),-1/0),placeholder:"Start year",className:"_input",title:"Start year"}),X("input",{type:u,value:(l==null?void 0:l[1])??"",onChange:f=>{e.setFilterValue(d=>[`${d==null?void 0:d[0]}`,`${f.target.value}`])},min:i.reduce((f,d)=>Math.min(f,parseInt(d,10)),1/0),max:i.reduce((f,d)=>Math.max(f,parseInt(d,10)),-1/0),placeholder:"End year",className:"_input",title:"End year"})]}):c&&u!=="number"?Ce("div",{className:"flex gap-2 h-6",children:[X("input",{type:u,value:n(l==null?void 0:l[0])??"",onChange:f=>{const d=new Date(f.target.value).getTime();e.setFilterValue(h=>[d,h==null?void 0:h[1]])},placeholder:"Start date",className:"_input",title:"Start date"}),X("input",{type:u,value:n(l==null?void 0:l[1])??"",onChange:f=>{const d=new Date(f.target.value).getTime();e.setFilterValue(h=>[h==null?void 0:h[0],d])},placeholder:"End date",className:"_input",title:"End date"})]}):a?Ce("div",{className:"flex gap-0.5 h-6",children:[X("input",{type:"number",value:(l==null?void 0:l[0])??"",onChange:f=>e.setFilterValue(d=>[f.target.value,d==null?void 0:d[1]]),placeholder:"Min",className:"_input p-0.5",title:"Min"}),X("input",{type:"number",value:(l==null?void 0:l[1])??"",onChange:f=>e.setFilterValue(d=>[d==null?void 0:d[0],f.target.value]),placeholder:"Max",className:"_input p-0.5",title:"Max"})]}):o?X("div",{className:"h-6",children:X("input",{type:"text",value:l??"",onChange:f=>e.setFilterValue(f.target.value),placeholder:"Search...",className:"_input",title:"Search"})}):X("div",{className:"h-6"})}const pk=(e,t,r)=>(r.splice(r.indexOf(t),0,r.splice(r.indexOf(e),1)[0]),[...r]),gk=({header:e,table:t,advanced:r,idx:n,lockFirstColumn:i,setLockFirstColumn:o})=>{const{getState:a,setColumnOrder:s}=t,{columnOrder:l}=a(),{column:u}=e,[,c]=fk({accept:"column",drop:p=>{const g=pk(p.id,u.id,l);s(g)}}),[{isDragging:f},d,h]=nk({collect:p=>({isDragging:p.isDragging()}),item:()=>u,type:"column"}),m=()=>X("div",{ref:h,className:"flex gap-1 flex-col",children:e.isPlaceholder?null:Ce(q1,{children:[Ce("div",{className:"font-bold uppercase text-grey-700 dark:text-white tracking-widest flex gap-2 whitespace-nowrap justify-between",children:[Ce("div",{onClick:u.getToggleSortingHandler(),className:kt("flex gap-1",{"cursor-pointer select-none":u.getCanSort()}),children:[Kf(u.columnDef.header,e.getContext()),u.getCanSort()&&Ce("div",{className:"flex flex-col gap-0.5 items-center justify-center",children:[X("button",{className:kt({"text-[#669DCB]":u.getIsSorted()==="asc","text-grey-600":u.getIsSorted()!=="asc"}),children:X("svg",{xmlns:"http://www.w3.org/2000/svg",width:"6",height:"4",fill:"none",viewBox:"0 0 11 5",children:X("path",{fill:"currentColor",d:"M10.333 5l-5-5-5 5"})})}),X("button",{className:kt({"text-[#669DCB]":e.column.getIsSorted()==="desc","text-grey-600":e.column.getIsSorted()!=="desc"}),children:X("svg",{xmlns:"http://www.w3.org/2000/svg",width:"6",height:"4",fill:"none",viewBox:"0 0 11 5",children:X("path",{fill:"currentColor",d:"M.333 0l5 5 5-5"})})})]})]}),r&&u.id!=="select"&&X("button",{ref:d,className:"text-grey-600 hover:text-grey-800 dark:hover:text-white",children:X("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"11",fill:"none",viewBox:"0 0 17 16",children:X("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M3.667 6l-2 2 2 2M6.333 3.333l2-2 2 2M10.333 12.667l-2 2-2-2M13 6l2 2-2 2M1.667 8H15M8.333 1.333v13.334"})})})]}),r&&u.getCanFilter()?X("div",{children:X(hk,{column:u,table:t,numberOfColumns:(l==null?void 0:l.length)??0})}):null]})});return Ce("th",{className:kt("h-[70px] p-4 sticky",{"left-0 z-50 bg-white dark:bg-grey-900":n===0&&i}),colSpan:e.colSpan,style:{width:e.getSize()+10,opacity:f?.5:1},ref:c,children:[n===0?Ce(hb,{children:[X(pb,{asChild:!0,children:m()}),X(gb,{children:X(mb,{className:"bg-white text-black dark:text-white dark:bg-grey-900 border border-grey-200 dark:border-grey-800 rounded-md shadow-lg p-2 z-50 text-xs",children:X("div",{className:"flex flex-col gap-2",children:Ce("button",{onClick:()=>{o(!i)},className:"hover:bg-grey-300 dark:hover:bg-grey-800 rounded-md p-2",children:[i?"Unlock":"Lock"," first column"]})})})})]}):m(),X("button",{className:"resizer bg-grey-300/20 dark:hover:bg-white absolute top-0 right-0 w-0.5 h-full",onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler()})]})};function mk({open:e,close:t}){const r=window.download_path||"~/OpenBBUserData/exports";return Ce(jv,{open:e,onOpenChange:t,children:[Ce("div",{id:"loading",className:"saving",children:[X("div",{id:"loading_text",className:"loading_text"}),X("div",{id:"loader",className:"loader"})]}),X(Xv,{onClick:t,className:"_modal-overlay"}),Ce(Kv,{className:"_modal",children:[X(Wf,{children:X(ql,{})}),X(Wf,{className:"_modal-close",onClick:t,style:{float:"right",marginTop:20},children:X(ql,{className:"w-6 h-6"})}),X(Yv,{className:"_modal-title",children:"Success"}),Ce("div",{id:"popup_title",className:"popup_content",style:{padding:"0px 2px 2px 5px",marginTop:5},children:[X("div",{style:{display:"flex",flexDirection:"column",gap:0,fontSize:14},children:X("div",{children:Ce("label",{htmlFor:"title_text",children:[X("b",{children:window.title})," has been downloaded to",X("br",{}),X("br",{}),X("a",{style:{color:"#FFDD00",marginTop:15},href:`${r}`,onClick:n=>{n.preventDefault(),window.pywry.open_file(r)},children:r})]})})}),X("div",{style:{float:"right",marginTop:20},children:X("button",{className:"_btn",style:{padding:"8px 16px",width:"100%"},onClick:t,children:"Close"})})]})]})]})}function vk({columns:e,data:t,type:r,setType:n,downloadFinished:i}){const o=()=>{switch(r){case"csv":Qg("csv",e,t,i);break;case"xlsx":Qg("xlsx",e,t,i);break;case"png":sP("table",i);break}};return Ce("div",{className:"flex gap-2 items-center",children:[X(Xi,{labelType:"row",value:r,onChange:a=>{n(a)},label:"Type",placeholder:"Select type",groups:[{label:"Type",items:w0.map(a=>({label:a,value:a}))}]}),X("button",{onClick:o,className:"_btn",children:"Export"})]})}const uy="DropdownMenu",[xk,a$]=sn(uy,[Lu]),Ri=Lu(),[wk,cy]=xk(uy),yk=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:i,defaultOpen:o,onOpenChange:a,modal:s=!0}=e,l=Ri(t),u=x.useRef(null),[c=!1,f]=go({prop:i,defaultProp:o,onChange:a});return x.createElement(wk,{scope:t,triggerId:Kr(),triggerRef:u,contentId:Kr(),open:c,onOpenChange:f,onOpenToggle:x.useCallback(()=>f(d=>!d),[f]),modal:s},x.createElement(G2,ge({},l,{open:c,onOpenChange:f,dir:n,modal:s}),r))},Ek="DropdownMenuTrigger",Sk=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...i}=e,o=cy(Ek,r),a=Ri(r);return x.createElement(j2,ge({asChild:!0},a),x.createElement(Ie.button,ge({type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":n?"":void 0,disabled:n},i,{ref:xd(t,o.triggerRef),onPointerDown:Se(e.onPointerDown,s=>{!n&&s.button===0&&s.ctrlKey===!1&&(o.onOpenToggle(),o.open||s.preventDefault())}),onKeyDown:Se(e.onKeyDown,s=>{n||(["Enter"," "].includes(s.key)&&o.onOpenToggle(),s.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})))}),_k=e=>{const{__scopeDropdownMenu:t,...r}=e,n=Ri(t);return x.createElement(X2,ge({},n,r))},Tk="DropdownMenuContent",Ck=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=cy(Tk,r),o=Ri(r),a=x.useRef(!1);return x.createElement(K2,ge({id:i.contentId,"aria-labelledby":i.triggerId},o,n,{ref:t,onCloseAutoFocus:Se(e.onCloseAutoFocus,s=>{var l;a.current||(l=i.triggerRef.current)===null||l===void 0||l.focus(),a.current=!1,s.preventDefault()}),onInteractOutside:Se(e.onInteractOutside,s=>{const l=s.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,c=l.button===2||u;(!i.modal||c)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),Ak=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Ri(r);return x.createElement(rb,ge({},i,n,{ref:t}))}),Rk=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Ri(r);return x.createElement(nb,ge({},i,n,{ref:t}))}),Ok=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Ri(r);return x.createElement(ib,ge({},i,n,{ref:t}))}),Fk=yk,R1=Sk,Dk=_k,Pk=Ck,Ik=Ak,bk=Rk,Yc=Ok;function kk(e,t){x.useEffect(()=>{const r=n=>{!e.current||e.current.contains(n.target)||t(n)};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r)}},[e,t])}function O1({label:e,table:t,onlyIconTrigger:r=!1}){const[n,i]=x.useState(!1),o=x.useRef(null);kk(o,()=>i(!1)),x.useEffect(()=>{const s=l=>{l.key==="Escape"&&i(!1)};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[]);function a(){t.resetColumnFilters(),i(!1)}return Ce(Fk,{open:n,children:[r?X(R1,{title:"Filter columns",onClick:()=>i(!n),children:X("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-7 h-7",children:X("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 01-.659 1.591l-5.432 5.432a2.25 2.25 0 00-.659 1.591v2.927a2.25 2.25 0 01-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 00-.659-1.591L3.659 7.409A2.25 2.25 0 013 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0112 3z"})})}):Ce(Ik,{className:"flex flex-row items-center gap-2",children:[X(bk,{className:"whitespace-nowrap",children:e}),Ce(R1,{onClick:()=>i(!n),className:"bg-white text-black dark:bg-grey-900 dark:text-white whitespace-nowrap h-[36px] border-[1.5px] border-grey-700 rounded p-3 inline-flex items-center justify-center leading-none gap-[5px] shadow-[0_2px_10px] shadow-black/10 focus:shadow-[0_0_0_2px] focus:shadow-black data-[placeholder]:text-white outline-none","aria-label":e,children:[X("span",{children:"Filter columns"}),X(s0,{className:kt({"transform rotate-180 duration-200 transition":n})})]})]}),X(Dk,{children:Ce(Pk,{sideOffset:10,ref:o,className:"z-50 bg-white/80 dark:bg-grey-900/80 backdrop-filter backdrop-blur flex flex-col gap-4 overflow-auto border-[1.5px] border-grey-700 rounded p-3 max-h-[500px] text-black dark:text-white",children:[X(Yc,{children:X("button",{className:"_btn w-full",onClick:a,children:"Clear Filters"})}),X(Yc,{children:Ce("label",{className:"flex items-center gap-2",children:[X("input",{type:"checkbox",checked:t.getIsAllColumnsVisible(),onChange:t.getToggleAllColumnsVisibilityHandler()}),"Toggle All"]})}),t.getAllLeafColumns().filter(s=>s.id!=="select").map(s=>X(Yc,{children:Ce("label",{className:"flex items-center gap-2",children:[X("input",{type:"checkbox",checked:s.getIsVisible(),onChange:s.getToggleVisibilityHandler()}),s.id]})},s.id))]})})]})}function fy(e){return typeof e!="number"?typeof e=="string"&&e.includes("All")?e:x0:e<1?x0:e}function $k({table:e,currentPage:t,setCurrentPage:r}){const n=e.getFilteredRowModel().rows.length||0;return Ce("div",{className:"hidden md:flex items-center gap-3",children:[X(Xi,{value:t,onChange:i=>{const o=fy(i);r(o),o.toString().includes("All")?e.setPageSize(n):e.setPageSize(o)},labelType:"row",label:"Rows per page",placeholder:"Select rows per page",groups:[{label:"Rows per page",items:[10,20,30,40,50,`All (${n})`].map(i=>({label:`${i}`,value:i}))}]}),Ce("span",{className:"flex items-center gap-1",children:[X("strong",{children:e.getState().pagination.pageIndex+1}),"of",X("strong",{children:e.getPageCount()})]}),Ce("div",{className:"hidden mdl:block",children:[X("button",{className:kt("px-2",{"text-grey-400 dark:text-grey-700":!e.getCanPreviousPage(),"dark:text-white":e.getCanPreviousPage()}),onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),children:"<<"}),X("button",{className:kt("px-2",{"text-grey-400 dark:text-grey-700":!e.getCanPreviousPage(),"dark:text-white":e.getCanPreviousPage()}),onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),children:"<"}),X("button",{className:kt("px-2",{"text-grey-400 dark:text-grey-700":!e.getCanNextPage(),"dark:text-white":e.getCanNextPage()}),onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),children:">"}),X("button",{className:kt("px-2",{"text-grey-400 dark:text-grey-700":!e.getCanNextPage(),"dark:text-white":e.getCanNextPage()}),onClick:()=>e.setPageIndex(e.getPageCount()-1),disabled:!e.getCanNextPage(),children:">>"})]})]})}const Nk=new Date,Mk=50,x0=30;function Lk(e,t){try{const r=e.hasOwnProperty("index")?"index":e.hasOwnProperty("Index")?"Index":null,n=r?e[r]:null,i=e[t],o=typeof i,a=i==null?void 0:i.toString().replace(/[^0-9]/g,""),s=(a==null?void 0:a.length)>=4&&(Yl(t)||t.toLowerCase()==="index"||n&&typeof n=="string"&&(n.toLowerCase().includes("date")||n.toLowerCase().includes("day")||n.toLowerCase().includes("time")||n.toLowerCase().includes("timestamp")||n.toLowerCase().includes("year")||n.toLowerCase().includes("month")||n.toLowerCase().includes("week")||n.toLowerCase().includes("hour")||n.toLowerCase().includes("minute")));if(o==="string"&&i.startsWith("http")||!s)return(i==null?void 0:i.toString().length)??0;if(s&&!isNaN(new Date(i).getTime())&&!_a.test(i==null?void 0:i.toString())){if(typeof i=="string")return(i==null?void 0:i.toString().length)??0;try{const u=new Date(i);let c="";return u.getUTCHours()===0&&u.getUTCMinutes()===0&&u.getUTCSeconds()===0&&u.getMilliseconds()===0?c=u.toISOString().split("T")[0]:(c=u.toISOString(),c=`${c.split("T")[0]} ${c.split("T")[1].split(".")[0]}`),(c==null?void 0:c.toString().length)??0}catch{return(i==null?void 0:i.toString().length)??0}}return(i==null?void 0:i.toString().length)??0}catch{return 0}}const w0=["csv","xlsx","png"];function Bk({data:e,columns:t,title:r,initialTheme:n,cmd:i=""}){const[o,a]=qo("exportType",w0[0]),[s,l]=x.useState(!1),[u,c]=JC(n),[f,d]=x.useState(u==="dark"),h=W=>{c(u),d(W)},[m,p]=qo("rowsPerPage",x0,fy),[g,v]=qo("advanced",!1),[w,y]=qo("colors",!1),[E,b]=x.useState([]),[k,_]=x.useState(""),[C,A]=qo("fontSize","1"),[L,B]=x.useState(!1),U=t.reduce((W,Q,le)=>(W[Q]=le{const ie=Math.max(...W.map($e=>Lk($e,Q)),le!=null&&le.length?(le==null?void 0:le.length)+8:0);return Math.min(200,ie*12)},ae=x.useMemo(()=>[...t.map((W,Q)=>({accessorKey:W,accessorFn:le=>{const me=le.hasOwnProperty("index")?"index":le.hasOwnProperty("Index")?"Index":t[0],_e=me?le[me]:null,ie=le[W],$e=(ie==null?void 0:ie.toString().replace(/[^0-9]/g,""))??"",Pe=($e==null?void 0:$e.length)>=4&&(Yl(W)||W.toLowerCase()==="index"||_e&&typeof _e=="string"&&(_e.toLowerCase().includes("date")||_e.toLowerCase().includes("time")||_e.toLowerCase().includes("timestamp")||_e.toLowerCase().includes("year")||_e.toLowerCase().includes("month")||_e.toLowerCase().includes("week")||_e.toLowerCase().includes("hour")||_e.toLowerCase().includes("minute")));return Pe&&_a.test(ie==null?void 0:ie.toString())?ie:Pe?typeof ie=="number"?ie:new Date(ie).getTime():ie},id:W,header:W,size:ee(e,W,W),footer:W,cell:({row:le})=>{var Bt;const me=le.original.hasOwnProperty("index")?"index":le.original.hasOwnProperty("Index")?"Index":t[0],_e=me?le.original[me]:null,ie=le.original[W],$e=typeof ie,Pe=(ie==null?void 0:ie.toString().replace(/[^0-9]/g,""))??"",ve=(Pe==null?void 0:Pe.length)>=4&&(Yl(W)||W.toLowerCase()==="index"||_e&&typeof _e=="string"&&(_e.toLowerCase().includes("date")||_e.toLowerCase().includes("time")||_e.toLowerCase().includes("timestamp")||_e.toLowerCase().includes("year")));if($e==="string"&&ie.startsWith("http"))return X("a",{className:"_hyper-link",href:ie,target:"_blank",rel:"noreferrer",children:(ie==null?void 0:ie.length)>25?`${ie.substring(0,25)}...`:ie});if(ve&&_a.test(ie==null?void 0:ie.toString()))return X("p",{children:ie});if(ve&&!isNaN(new Date(ie).getTime())&&!_a.test(ie==null?void 0:ie.toString())){if(typeof ie=="string"){const Ne=ie.split("T")[0],Ze=(Bt=ie.split("T")[1])==null?void 0:Bt.split(".")[0];return Ze==="00:00:00"?X("p",{children:Ne}):Ce("p",{children:[Ne," ",Ze]})}try{const Ne=new Date(ie);let Ze="";return Ne.getUTCHours()===0&&Ne.getUTCMinutes()===0&&Ne.getUTCSeconds()===0&&Ne.getMilliseconds()===0?Ze=Ne.toISOString().split("T")[0]:(Ze=Ne.toISOString(),Ze=`${Ze.split("T")[0]} ${Ze.split("T")[1].split(".")[0]}`),X("p",{children:Ze})}catch{return X("p",{children:ie})}}if($e==="number"||ly.test(ie==null?void 0:ie.toString())){let Ne=tP(ie,W);const Ze=Number(t0(ie));if(typeof _e=="string"&&n2(_e)){Ne=Number(t0(ie));const us=Ne<2?4:2;Ne=Ne.toLocaleString("en-US",{maximumFractionDigits:us,minimumFractionDigits:2})}return X("p",{className:kt("whitespace-nowrap",{"text-black dark:text-white":!w,"text-[#16A34A]":Ze>0&&w,"text-[#F87171]":Ze<0&&w,"text-[#404040]":Ze===0&&w}),title:r2(ie).toString()??"",children:Ze!==0?Ze>0?`${Ne}`:`${Ne}`:Ne})}else if($e==="string")return X("div",{dangerouslySetInnerHTML:{__html:ZC(ie)}});return X("p",{children:ie})}}))],[g,w]),[he,Te]=x.useState(!1),[oe,ye]=x.useState(ae.map(W=>W.id)),te=()=>ye(t.map(W=>W.id)),O=x.useMemo(()=>{const W=oe.map(le=>le),Q=ae.map(le=>le.id);return!rP(W,Q)},[oe,ae]),M=aC({data:e,columns:ae,getCoreRowModel:YT(),getSortedRowModel:eC(),getFilteredRowModel:JT(),getPaginationRowModel:rC(),columnResizeMode:"onChange",onColumnVisibilityChange:G,onColumnOrderChange:ye,onSortingChange:b,onGlobalFilterChange:_,globalFilterFn:nP,state:{sorting:E,globalFilter:k,columnOrder:oe,columnVisibility:H},initialState:{pagination:{pageIndex:0,pageSize:typeof m=="string"?m.includes("All")?e==null?void 0:e.length:parseInt(m):m}}}),N=x.useRef(null),{rows:F}=M.getRowModel(),V=M.getVisibleFlatColumns(),[Y,J]=x.useState(!1);return x.useEffect(()=>{s&&(l(!1),J(!0))},[s]),Ce(q1,{children:[X(f5,{toast:{id:"max-columns",title:"Max 12 columns are visible by default",description:"You can change this by clicking on advanced and then top right 'Filter' button",status:"info"},open:L,setOpen:B}),X(mk,{open:Y,close:()=>J(!1)}),Ce("div",{ref:N,className:kt("overflow-x-hidden h-screen"),children:[Ce("div",{className:"relative p-4",id:"table",children:[X("div",{className:"absolute -inset-0.5 bg-gradient-to-r rounded-md blur-md from-[#072e49]/30 via-[#0d345f]/30 to-[#0d3362]/30"}),Ce("div",{className:"border border-grey-500/60 dark:border-grey-200/60 bg-white dark:bg-grey-900 rounded overflow-hidden relative z-20",children:[Ce("div",{className:"_header relative gap-4 py-2 text-center text-xs flex items-center justify-between px-4 text-white",style:{fontSize:`${Number(C)*90}%`},children:[X("div",{className:"w-1/3",children:X("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"40",fill:"none",viewBox:"0 0 64 40",children:X("path",{fill:"#fff",d:"M61.283 3.965H33.608v27.757h25.699V19.826H37.561v-3.965H63.26V3.965h-1.977zM39.538 23.792h15.815v3.965H37.561v-3.965h1.977zM59.306 9.913v1.983H37.561V7.931h21.745v1.982zM33.606 0h-3.954v3.965H33.606V0zM25.7 3.966H0V15.86h25.7v3.965H3.953v11.896h25.7V3.966h-3.955zm0 21.808v1.983H7.907v-3.965h17.791v1.982zm0-15.86v1.982H3.953V7.931h21.745v1.982zM37.039 35.693v2.952l-.246-.246-.245-.245-.245-.247-.245-.246-.246-.246-.245-.245-.245-.247-.247-.246-.245-.246-.245-.246-.245-.246-.246-.246h-.49v3.936h.49v-3.198l.246.246.245.246.245.246.245.246.246.246.246.246.245.247.246.245.245.246.245.247.245.246.246.245.245.246h.245v-3.936h-.49zM44.938 37.17h-.491v-1.477h-2.944v3.937h3.93v-2.46h-.495zm-2.944-.246v-.739h1.962v.984h-1.962v-.245zm2.944.984v1.23h-2.944V37.66h2.944v.247zM52.835 37.17h-.49v-1.477h-2.946v3.937h3.925v-2.46h-.489zm-2.944-.246v-.739h1.963v.984h-1.965l.002-.245zm2.944.984v1.23H49.89V37.66h2.946v.247zM29.174 35.693H25.739v3.936H29.663v-.491H26.229v-.984h2.943v-.493H26.229v-1.476h3.434v-.492h-.489zM13.37 35.693H9.934v3.937h3.925v-3.937h-.49zm0 .738v2.709h-2.945v-2.955h2.943l.001.246zM21.276 35.693h-3.435v3.937h.491v-1.476h3.434v-2.461h-.49zm0 .738v1.23h-2.944v-1.476h2.944v.246z"})})}),X("p",{className:"font-bold w-1/3 flex flex-col gap-0.5 items-center",children:r}),Ce("p",{className:"w-1/3 text-right text-xs",children:[new Intl.DateTimeFormat("en-GB",{dateStyle:"full",timeStyle:"long"}).format(Nk).replace(/:\d\d /," "),X("br",{}),X("span",{className:"text-grey-400",children:i})]})]}),X("div",{className:"overflow-auto max-h-[calc(100vh-170px)] smh:max-h-[calc(100vh-95px)]",children:Ce("table",{className:"text-sm relative",children:[X("thead",{className:"sticky top-0 bg-white dark:bg-grey-900",style:{fontSize:`${Number(C)*100}%`},children:M.getHeaderGroups().map((W,Q)=>X("tr",{children:W.headers.map((le,me)=>X(gk,{setLockFirstColumn:Te,lockFirstColumn:he,idx:me,advanced:g,header:le,table:M},le.id))},W.id))}),X("tbody",{children:M.getRowModel().rows.map((W,Q)=>X("tr",{className:"!h-[64px] border-b border-grey-400",style:{fontSize:`${Number(C)*100}%`},children:W.getVisibleCells().map((le,me)=>X("td",{className:kt("whitespace-normal p-4 text-black dark:text-white",{"bg-white dark:bg-grey-850":Q%2===0,"bg-grey-100 dark:bg-[#202020]":Q%2===1,"sticky left-0 z-10":me===0&&he}),style:{width:le.column.getSize()},children:Kf(le.column.columnDef.cell,le.getContext())},le.id))},W.id))}),(F==null?void 0:F.length)>30&&(V==null?void 0:V.length)>4&&X("tfoot",{children:M.getFooterGroups().map(W=>X("tr",{children:W.headers.map(Q=>X("th",{colSpan:Q.colSpan,className:"text-grey-500 bg-grey-100 dark:bg-grey-850 font-normal text-left text-sm h-10 p-4",style:{width:Q.getSize(),fontSize:`${Number(C)*100}%`},children:Q.isPlaceholder?null:Kf(Q.column.columnDef.footer,Q.getContext())},Q.id))},W.id))})]})})]})]}),Ce("div",{className:"smh:hidden flex max-h-[68px] overflow-x-auto bg-white/70 dark:bg-grey-900/70 backdrop-filter backdrop-blur z-20 bottom-0 left-0 w-full gap-10 justify-between py-4 px-4 text-sm",children:[Ce("div",{className:"flex items-center gap-10",children:[Ce(jv,{children:[X(pT,{className:"_btn",children:"Settings"}),Ce(gT,{children:[X(Xv,{className:"_modal-overlay"}),Ce(Kv,{className:"_modal",children:[X(Wf,{className:"absolute top-[40px] right-[46px] text-grey-200 hover:text-white rounded-[4px] focus:outline focus:outline-2 focus:outline-grey-500",children:X(ql,{className:"w-6 h-6"})}),X(Yv,{className:"uppercase font-bold tracking-widest",children:"Settings"}),Ce("div",{className:"grid grid-cols-2 gap-2 mt-10 text-sm",children:[O&&X("button",{onClick:()=>te(),className:"_btn h-9",children:"Reset Order"}),X(Xi,{labelType:"row",value:f?"light":"dark",onChange:W=>{h(W!=="dark")},label:"Theme",placeholder:"Select theme",groups:[{label:"Theme",items:[{label:"Dark",value:"dark"},{label:"Light",value:"light"}]}]}),X(Xi,{labelType:"row",value:o,onChange:W=>{a(W)},label:"Export type",placeholder:"Select export type",groups:[{label:"Export type",items:w0.map(W=>({label:W,value:W}))}]}),X(Xi,{labelType:"row",value:C,onChange:A,label:"Font size",placeholder:"Select font size",groups:[{label:"Font size",items:[{label:"50%",value:"0.5"},{label:"75%",value:"0.75"},{label:"100%",value:"1"},{label:"125%",value:"1.25"},{label:"150%",value:"1.5"},{label:"175%",value:"1.75"},{label:"200%",value:"2"}]}]}),X(O1,{table:M,label:"Filter"}),X("div",{className:"flex gap-2 items-center",children:X(Xi,{labelType:"row",value:g?"advanced":"simple",onChange:W=>{v(W==="advanced")},label:"Type",placeholder:"Select type",groups:[{label:"Type",items:[{label:"Simple",value:"simple"},{label:"Advanced",value:"advanced"}]}]})}),Ce("div",{className:"flex gap-2 items-center",children:[X("label",{htmlFor:"colors",children:"Colors"}),X("input",{id:"colors",type:"checkbox",checked:w,onChange:()=>y(!w)})]})]})]})]})]}),X(O1,{onlyIconTrigger:!0,table:M,label:""})]}),X($k,{currentPage:m,setCurrentPage:p,table:M}),X(vk,{setType:a,type:o,columns:t,data:e,downloadFinished:l})]})]})]})}function dy(e){let t=null;return()=>(t==null&&(t=e()),t)}function Uk(e,t){return e.filter(r=>r!==t)}function Hk(e,t){const r=new Set,n=o=>r.add(o);e.forEach(n),t.forEach(n);const i=[];return r.forEach(o=>i.push(o)),i}class Vk{enter(t){const r=this.entered.length,n=i=>this.isNodeInDocument(i)&&(!i.contains||i.contains(t));return this.entered=Hk(this.entered.filter(n),[t]),r===0&&this.entered.length>0}leave(t){const r=this.entered.length;return this.entered=Uk(this.entered.filter(this.isNodeInDocument),t),r>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class Wk{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(t=>{Object.defineProperty(this.item,t,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${t}" until the drop event.`),null}})})}loadDataTransfer(t){if(t){const r={};Object.keys(this.config.exposeProperties).forEach(n=>{const i=this.config.exposeProperties[n];i!=null&&(r[n]={value:i(t,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,r)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(t,r){return r===t.getSourceId()}endDrag(){}constructor(t){this.config=t,this.item={},this.initializeExposedProperties()}}const hy="__NATIVE_FILE__",py="__NATIVE_URL__",gy="__NATIVE_TEXT__",my="__NATIVE_HTML__",F1=Object.freeze(Object.defineProperty({__proto__:null,FILE:hy,HTML:my,TEXT:gy,URL:py},Symbol.toStringTag,{value:"Module"}));function qc(e,t,r){const n=t.reduce((i,o)=>i||e.getData(o),"");return n??r}const y0={[hy]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[my]:{exposeProperties:{html:(e,t)=>qc(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[py]:{exposeProperties:{urls:(e,t)=>qc(e,t,"").split(` `),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[gy]:{exposeProperties:{text:(e,t)=>qc(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function zk(e,t){const r=y0[e];if(!r)throw new Error(`native type ${e} has no configuration`);const n=new Wk(r);return n.loadDataTransfer(t),n}function Qc(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(y0).filter(r=>{const n=y0[r];return n!=null&&n.matchesTypes?n.matchesTypes.some(i=>t.indexOf(i)>-1):!1})[0]||null}const Gk=dy(()=>/firefox/i.test(navigator.userAgent)),vy=dy(()=>!!window.safari);class D1{interpolate(t){const{xs:r,ys:n,c1s:i,c2s:o,c3s:a}=this;let s=r.length-1;if(t===r[s])return n[s];let l=0,u=a.length-1,c;for(;l<=u;){c=Math.floor(.5*(l+u));const h=r[c];if(ht)u=c-1;else return n[c]}s=Math.max(0,u);const f=t-r[s],d=f*f;return n[s]+i[s]*f+o[s]*d+a[s]*f*d}constructor(t,r){const{length:n}=t,i=[];for(let h=0;ht[h]{let k=new D1([0,.5,1],[l.y,l.y/c*m,l.y+m-c]).interpolate(d);return vy()&&o&&(k+=(window.devicePixelRatio-1)*m),k},g=()=>new D1([0,.5,1],[l.x,l.x/u*h,l.x+h-u]).interpolate(f),{offsetX:v,offsetY:w}=i,y=v===0||v,E=w===0||w;return{x:y?v:g(),y:E?w:p()}}class qk{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var t;return!((t=this.globalContext)===null||t===void 0)&&t.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var t;return((t=this.optionsArgs)===null||t===void 0?void 0:t.rootElement)||this.window}constructor(t,r){this.ownerDocument=null,this.globalContext=t,this.optionsArgs=r}}function Qk(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function P1(e){for(var t=1;t{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDragSource(t,r,n){this.sourceNodes.set(t,r),this.sourceNodeOptions.set(t,n);const i=a=>this.handleDragStart(a,t),o=a=>this.handleSelectStart(a);return r.setAttribute("draggable","true"),r.addEventListener("dragstart",i),r.addEventListener("selectstart",o),()=>{this.sourceNodes.delete(t),this.sourceNodeOptions.delete(t),r.removeEventListener("dragstart",i),r.removeEventListener("selectstart",o),r.setAttribute("draggable","false")}}connectDropTarget(t,r){const n=a=>this.handleDragEnter(a,t),i=a=>this.handleDragOver(a,t),o=a=>this.handleDrop(a,t);return r.addEventListener("dragenter",n),r.addEventListener("dragover",i),r.addEventListener("drop",o),()=>{r.removeEventListener("dragenter",n),r.removeEventListener("dragover",i),r.removeEventListener("drop",o)}}addEventListeners(t){t.addEventListener&&(t.addEventListener("dragstart",this.handleTopDragStart),t.addEventListener("dragstart",this.handleTopDragStartCapture,!0),t.addEventListener("dragend",this.handleTopDragEndCapture,!0),t.addEventListener("dragenter",this.handleTopDragEnter),t.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.addEventListener("dragover",this.handleTopDragOver),t.addEventListener("dragover",this.handleTopDragOverCapture,!0),t.addEventListener("drop",this.handleTopDrop),t.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(t){t.removeEventListener&&(t.removeEventListener("dragstart",this.handleTopDragStart),t.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),t.removeEventListener("dragend",this.handleTopDragEndCapture,!0),t.removeEventListener("dragenter",this.handleTopDragEnter),t.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.removeEventListener("dragover",this.handleTopDragOver),t.removeEventListener("dragover",this.handleTopDragOverCapture,!0),t.removeEventListener("drop",this.handleTopDrop),t.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const t=this.monitor.getSourceId(),r=this.sourceNodeOptions.get(t);return P1({dropEffect:this.altKeyPressed?"copy":"move"},r||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const t=this.monitor.getSourceId(),r=this.sourcePreviewNodeOptions.get(t);return P1({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(F1).some(r=>F1[r]===t)}beginDragNativeItem(t,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=zk(t,r),this.currentNativeHandle=this.registry.addSource(t,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(t){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=t;const r=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var n;return(n=this.rootElement)===null||n===void 0?void 0:n.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},r)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var t;(t=this.window)===null||t===void 0||t.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(t,r){t.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(r))}handleDragEnter(t,r){this.dragEnterTargetIds.unshift(r)}handleDragOver(t,r){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(r)}handleDrop(t,r){this.dropTargetIds.unshift(r)}constructor(t,r,n){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=i=>{const o=this.sourceNodes.get(i);return o&&xy(o)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=i=>!!(i&&this.document&&this.document.body&&this.document.body.contains(i)),this.endDragIfSourceWasRemovedFromDOM=()=>{const i=this.currentDragSourceNode;i==null||this.isNodeInDocument(i)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=i=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(i||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=i=>{if(i.defaultPrevented)return;const{dragStartSourceIds:o}=this;this.dragStartSourceIds=null;const a=Xs(i);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(o||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:a});const{dataTransfer:s}=i,l=Qc(s);if(this.monitor.isDragging()){if(s&&typeof s.setDragImage=="function"){const c=this.monitor.getSourceId(),f=this.sourceNodes.get(c),d=this.sourcePreviewNodes.get(c)||f;if(d){const{anchorX:h,anchorY:m,offsetX:p,offsetY:g}=this.getCurrentSourcePreviewNodeOptions(),y=Yk(f,d,a,{anchorX:h,anchorY:m},{offsetX:p,offsetY:g});s.setDragImage(d,y.x,y.y)}}try{s==null||s.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(i.target);const{captureDraggingState:u}=this.getCurrentSourcePreviewNodeOptions();u?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(l)this.beginDragNativeItem(l);else{if(s&&!s.types&&(i.target&&!i.target.hasAttribute||!i.target.hasAttribute("draggable")))return;i.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=i=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var o;(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(i.dataTransfer)}if(!this.enterLeaveCounter.enter(i.target)||this.monitor.isDragging())return;const{dataTransfer:s}=i,l=Qc(s);l&&this.beginDragNativeItem(l,s)},this.handleTopDragEnter=i=>{const{dragEnterTargetIds:o}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=i.altKey,o.length>0&&this.actions.hover(o,{clientOffset:Xs(i)}),o.some(s=>this.monitor.canDropOnTarget(s))&&(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=i=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var o;(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(i.dataTransfer)}},this.handleTopDragOver=i=>{const{dragOverTargetIds:o}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none");return}this.altKeyPressed=i.altKey,this.lastClientOffset=Xs(i),this.scheduleHover(o),(o||[]).some(s=>this.monitor.canDropOnTarget(s))?(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?i.preventDefault():(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=i=>{this.isDraggingNativeItem()&&i.preventDefault(),this.enterLeaveCounter.leave(i.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=i=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var o;i.preventDefault(),(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(i.dataTransfer)}else Qc(i.dataTransfer)&&i.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=i=>{const{dropTargetIds:o}=this;this.dropTargetIds=[],this.actions.hover(o,{clientOffset:Xs(i)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=i=>{const o=i.target;typeof o.dragDrop=="function"&&(o.tagName==="INPUT"||o.tagName==="SELECT"||o.tagName==="TEXTAREA"||o.isContentEditable||(i.preventDefault(),o.dragDrop()))},this.options=new qk(r,n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new Vk(this.isNodeInDocument)}}const Jk=function(t,r,n){return new Zk(t,r,n)};function e$(){const[e,t]=x.useState(null),[r,n]=x.useState("Interactive Table");x.useEffect(()=>{const a=setInterval(()=>{if(window.json_data){const s=JSON.parse(window.json_data);console.log(s),t(s),s.title&&typeof s.title=="string"&&n(s.title),clearInterval(a)}},100);return()=>clearInterval(a)},[]);const o=(a=>{var h;if(!a)return null;const s=(h=a.title)==null?void 0:h.replace(/|<\/b>/g,"").replace(/ /g,"_"),l=new Date().toISOString().slice(0,10).replace(/-/g,""),u=new Date().toISOString().slice(11,19).replace(/:/g,"");window.title=`openbb_${s}_${l}_${u}`;const c=a.columns;a.index;const d=a.data.map((m,p)=>{const g={};return m.forEach((v,w)=>{g[c[w]]=v||(v===0?0:"")}),g});return{columns:c,data:d}})(e);return X("div",{className:"relative h-full bg-white dark:bg-black text-black dark:text-white",children:X(b8,{backend:Jk,children:o&&X(Bk,{title:r,data:o.data,columns:o.columns,initialTheme:e.theme&&typeof e.theme=="string"&&e.theme==="dark"?"dark":"light",cmd:(e==null?void 0:e.command_location)??""})})})}Ov.render(X(ir.StrictMode,{children:X(e$,{})}),document.getElementById("root"));