df-script 1.8.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/README.md +153 -203
  2. package/dist/api.d.ts +41 -36
  3. package/dist/columnExpressions/ColumnExpr.d.ts +5 -8
  4. package/dist/columnExpressions/ExprBase.d.ts +7 -0
  5. package/dist/columnExpressions/constants.d.ts +1 -0
  6. package/dist/columnExpressions/functions/all.d.ts +13 -13
  7. package/dist/columnExpressions/functions/coalesce.d.ts +2 -2
  8. package/dist/columnExpressions/functions/duration.d.ts +16 -21
  9. package/dist/columnExpressions/functions/element.d.ts +10 -10
  10. package/dist/columnExpressions/functions/exclude.d.ts +14 -14
  11. package/dist/columnExpressions/functions/implode.d.ts +7 -7
  12. package/dist/columnExpressions/functions/lit.d.ts +9 -9
  13. package/dist/columnExpressions/functions/seqRange.d.ts +69 -0
  14. package/dist/columnExpressions/functions/struct.d.ts +6 -6
  15. package/dist/columnExpressions/functions/when.d.ts +31 -32
  16. package/dist/columnExpressions/index.d.ts +4 -7
  17. package/dist/columnExpressions/mixins/AggregationExpr.d.ts +672 -141
  18. package/dist/columnExpressions/mixins/ArithmeticExpr.d.ts +701 -327
  19. package/dist/columnExpressions/mixins/ArrayExpr.d.ts +543 -231
  20. package/dist/columnExpressions/mixins/ComparisonExpr.d.ts +398 -201
  21. package/dist/columnExpressions/mixins/LogicalExpr.d.ts +59 -29
  22. package/dist/columnExpressions/mixins/ManipulationExpr.d.ts +23 -9
  23. package/dist/columnExpressions/mixins/StandardExpr.d.ts +3234 -0
  24. package/dist/columnExpressions/mixins/StringExpr.d.ts +1299 -396
  25. package/dist/columnExpressions/mixins/StructExpr.d.ts +72 -30
  26. package/dist/columnExpressions/mixins/TemporalExpr.d.ts +518 -212
  27. package/dist/columnExpressions/mixins/WindowExpr.d.ts +270 -102
  28. package/dist/columnExpressions/typeInference.d.ts +13 -0
  29. package/dist/columnExpressions/types.d.ts +6 -1
  30. package/dist/columnExpressions/utils.d.ts +16 -0
  31. package/dist/constants.d.ts +38 -0
  32. package/dist/dataframe/dataframe.d.ts +755 -608
  33. package/dist/dataframe/grouped/grouped.d.ts +24 -6
  34. package/dist/dataframe/grouped.d.ts +70 -0
  35. package/dist/dataframe/index.d.ts +1 -1
  36. package/dist/dataframe/lazy.d.ts +37 -0
  37. package/dist/dataframe/types.d.ts +46 -22
  38. package/dist/dataframe/utils.d.ts +10 -4
  39. package/dist/datatypes/index.d.ts +11 -4
  40. package/dist/expressions.js +1 -0
  41. package/dist/expressions.mjs +1 -0
  42. package/dist/functions/concat.d.ts +68 -16
  43. package/dist/functions/index.d.ts +2 -2
  44. package/dist/functions/readCsv.d.ts +35 -0
  45. package/dist/functions/readJson.d.ts +33 -0
  46. package/dist/index.js +5 -6
  47. package/dist/index.mjs +5 -6
  48. package/dist/types.d.ts +148 -7
  49. package/dist/utils/array.d.ts +54 -18
  50. package/dist/utils/binary.d.ts +6 -2
  51. package/dist/utils/csv.d.ts +4 -1
  52. package/dist/utils/date.d.ts +3 -19
  53. package/dist/utils/duration.d.ts +7 -5
  54. package/dist/utils/json.d.ts +56 -2
  55. package/dist/utils/number.d.ts +5 -2
  56. package/dist/utils/object.d.ts +7 -12
  57. package/dist/utils/string.d.ts +83 -2
  58. package/dist/utils/table.d.ts +76 -0
  59. package/dist/utils.js +4 -0
  60. package/dist/utils.mjs +4 -0
  61. package/package.json +29 -8
  62. package/dist/assets/index-DBhGK6Tp.css +0 -1
  63. package/dist/assets/index-DEJEV_tU.js +0 -195
  64. package/dist/index.html +0 -17
package/dist/index.mjs CHANGED
@@ -1,6 +1,5 @@
1
- var nn=Object.defineProperty;var ws=Object.getOwnPropertyDescriptor;var Ss=Object.getOwnPropertyNames;var As=Object.prototype.hasOwnProperty;var Pe=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var k=(n,e)=>()=>(n&&(e=n(n=0)),e);var hr=(n,e)=>{for(var t in e)nn(n,t,{get:e[t],enumerable:!0})},Ds=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Ss(e))!As.call(n,o)&&o!==t&&nn(n,o,{get:()=>e[o],enumerable:!(r=ws(e,o))||r.enumerable});return n};var yr=n=>Ds(nn({},"__esModule",{value:!0}),n);var se,dr,gr,Ye,_r,br,be=k(()=>{"use strict";se="*",dr="*literal*",gr="*coalesce*",Ye="*element*",_r="*struct*",br="*duration*"});var xr=k(()=>{"use strict"});function K(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function Ee(n){if(!K(n))return!1;let e=Object.getPrototypeOf(n);if(e===null)return!0;let t=Object.prototype.hasOwnProperty.call(e,"constructor")&&e.constructor;return typeof t!="function"?!1:Function.prototype.toString.call(t)===qs}function vr(n){if(typeof n!="function")return!1;let e="";try{e=Function.prototype.toString.call(n)}catch{return!1}if(/^class[\s{]/.test(e))return!0;if(n===Symbol||n===BigInt)return!1;let t=Object.getOwnPropertyDescriptor(n,"prototype");return t&&!t.writable?e.includes("[native code]"):!1}function me(n,e,t,r){if(!K(n))return!1;if(!(Symbol.toStringTag in n))return Object.prototype.toString.call(n)===e;if(!t)return!1;try{return t.call(n,r),!0}catch{return!1}}function U(n){return me(n,Ts,rn)&&rn?!Number.isNaN(rn.call(n)):!1}function xe(n){return me(n,Cs,Ls)}function dt(n){return me(n,Os,Ps)}function gt(n){return me(n,Is,Bs)}function Mr(n){return me(n,ks,$s,"key")}function Ur(n){return K(n)?Symbol.toStringTag in n?n instanceof Error:Object.prototype.toString.call(n)===Es:!1}function Ar(n){return me(n,Ir,on)}function Dr(n){return me(n,Er,sn)}function Tr(n){return me(n,kr,an)}function Cr(n){return me(n,Rr,He)}function Or(n){return me(n,Nr,Xe)}function ce(n){if(!K(n))return n;switch(Object.prototype.toString.call(n)){case Er:if(Dr(n))try{return sn.call(n)}catch{}break;case Ir:if(Ar(n))try{return on.call(n)}catch{}break;case kr:if(Tr(n))try{return an.call(n)}catch{}break;case Rr:if(Cr(n)&&He)try{return He.call(n)}catch{}break;case Nr:if(Or(n)&&Xe)try{return Xe.call(n)}catch{}break}if(Symbol.toStringTag in n){if(Dr(n))try{return sn.call(n)}catch{}else if(Ar(n))try{return on.call(n)}catch{}else if(Tr(n))try{return an.call(n)}catch{}else if(Cr(n)&&He)try{return He.call(n)}catch{}else if(Or(n)&&Xe)try{return Xe.call(n)}catch{}}if(typeof n.valueOf=="function"&&n.valueOf!==Object.prototype.valueOf)try{let t=n.valueOf();if(typeof t!="object"||t===null)return t}catch{}return n}var Ts,Cs,Os,Is,Es,ks,Ir,Er,kr,Rr,Nr,Rs,Ns,wr,Sr,vs,Ms,Us,Fs,js,Vs,Ls,Ps,Bs,rn,$s,on,sn,an,He,Xe,qs,ye=k(()=>{"use strict";Ts="[object Date]",Cs="[object RegExp]",Os="[object Set]",Is="[object Map]",Es="[object Error]",ks="[object URLSearchParams]",Ir="[object String]",Er="[object Number]",kr="[object Boolean]",Rr="[object BigInt]",Nr="[object Symbol]",Rs=typeof Date=="function"?Date.prototype:void 0,Ns=Object.getPrototypeOf(/./),wr=typeof Set=="function"?Set.prototype:void 0,Sr=typeof Map=="function"?Map.prototype:void 0,vs=typeof URLSearchParams=="function"?URLSearchParams.prototype:void 0,Ms=Object.getPrototypeOf(""),Us=Object.getPrototypeOf(0),Fs=Object.getPrototypeOf(!0),js=typeof BigInt=="function"?BigInt.prototype:void 0,Vs=typeof Symbol=="function"?Symbol.prototype:void 0,Ls=Object.getOwnPropertyDescriptor(Ns,"source")?.get,Ps=wr?Object.getOwnPropertyDescriptor(wr,"size")?.get:void 0,Bs=Sr?Object.getOwnPropertyDescriptor(Sr,"size")?.get:void 0,rn=Rs?.valueOf,$s=vs?.has,on=Ms.valueOf,sn=Us.valueOf,an=Fs.valueOf,He=js?.valueOf,Xe=Vs?.valueOf,qs=Function.prototype.toString.call(Object)});var ln,un,Fr=k(()=>{"use strict";ln=1000n,un=1000000n});function F(n,e){return typeof n!="number"?!1:Number.isNaN(n)?e?.allowNaN??e?.allowNonFiniteNumbers??!1:Number.isFinite(n)?!0:e?.allowNonFiniteNumbers??!1}function jr(n){for(let e=1;e<n.length;e++)if(n[e].length!==3)return!1;return!0}function $r(n,e){if(Ks.test(n))return null;let t=n.trim();if(t==="")return null;t.startsWith("(")&&t.endsWith(")")&&(t="-"+t.slice(1,-1).trim());let r=t[t.length-1];(r==="-"||r==="+")&&t.length>1&&(t=r+t.slice(0,-1).trim()),e||(t=t.replace(zs,""));let o=t.includes("."),s=t.includes(",");if(o&&s){let a=t.lastIndexOf("."),i=t.lastIndexOf(","),l=i>a,f=l?".":",",u=l?i:a,c=t.slice(0,u).split(f);return c.length>1&&!jr(c)||c[0].replace(Vr,"").length>3?null:l?t.replace(Lr,"").replace(_t,"."):t.replace(_t,"")}if(s||o){let a=s?",":".",i=t.split(a);if(i.length>2||a===","&&i.length===2&&i[1].length===3){let l=i[0].replace(Vr,"").length;if(l===0){if(a===","||i.length>2)return null}else return l>3?null:jr(i)?t.replace(s?_t:Lr,""):null}if(s)return t.replace(_t,".")}return t}function M(n,{allowNonFiniteNumbers:e=!1,strictNumericString:t=!1,floatScientific:r=!0}={}){if(n==null||typeof n=="symbol")return null;switch(n=ce(n),typeof n){case"number":return F(n,{allowNonFiniteNumbers:e})?n:null;case"boolean":return n?1:0;case"bigint":{let o=Number(n);return F(o,{allowNonFiniteNumbers:e})?o:null}case"object":{if(U(n)){let o=n.getTime();return F(o,{allowNonFiniteNumbers:e})?o:null}return null}case"string":{let o=$r(n,t);if(o===null)return null;if(e){let i=o.toLowerCase();if(i==="nan"||i==="-nan"||i==="+nan")return NaN;if(i==="infinity"||i==="+infinity")return 1/0;if(i==="-infinity")return-1/0}if(Br.test(o)&&!r||!Pr.test(o))return null;let a=Number(o);return F(a,{allowNonFiniteNumbers:e})?a:null}default:return null}}function qr({locale:n="en-US",accountingNegatives:e=!1,fallback:t="NaN",formatNonFinite:r=!1,...o}={}){o.useGrouping===void 0&&(o.useGrouping=!1),o.maximumFractionDigits===void 0&&o.maximumSignificantDigits===void 0&&(o.maximumFractionDigits=20),e&&(o.currencySign="accounting",o.style===void 0&&(o.style="decimal"));let s=new Intl.NumberFormat(n,o);return a=>{if(typeof a=="bigint")return e&&a<0n?`(${s.format(-a)})`:s.format(a);let i=M(a,{allowNonFiniteNumbers:!0});return i===null||Number.isNaN(i)?t:Number.isFinite(i)?e&&i<0?`(${s.format(Math.abs(i))})`:s.format(i):r?t:e&&i===-1/0?`(${s.format(1/0)})`:String(i)}}function cn(n,{floatPrecision:e="Float64",allowNonFiniteNumbers:t=!0,floatScientific:r=!0,strictNumericString:o=!1}={}){let s=M(n,{allowNonFiniteNumbers:t,floatScientific:r,strictNumericString:o});return s===null||(e==="Float32"&&(s=Math.fround(s)),!F(s,{allowNonFiniteNumbers:t}))?null:s}function bt(n,{range:e="Int32"}={}){if(!F(n)||!Number.isInteger(n))return!1;let t=typeof e=="string"?Kr[e]:e;return n>=t.min&&n<=t.max}function de(n,{range:e="Int32",coerce:t="truncate"}={}){let r=M(n);if(r===null)return null;switch(t){case"round":r=Math.round(r);break;case"floor":r=Math.floor(r);break;case"ceil":r=Math.ceil(r);break;case"truncate":r=Math.trunc(r);break}let o=typeof e=="string"?Kr[e]:e;return pe(r,{min:o.min,max:o.max})}function Be(n,{range:e="Int64",truncate:t=!1}={}){if(n==null||typeof n=="symbol")return null;n=ce(n);let r=null;if(typeof n=="bigint")r=n;else if(typeof n=="string"){let s=$r(n,!1);if(s===null||!Pr.test(s))return null;if(Br.test(s)){let a=Number(s);if(!Number.isFinite(a)||!t&&!Number.isInteger(a))return null;r=BigInt(Math.trunc(a))}else{let a=s.indexOf(".");if(a!==-1){if(!t&&/[^0]/.test(s.slice(a+1)))return null;s=s.slice(0,a)}try{r=BigInt(s)}catch{return null}}}else{let s=M(n);if(s===null||!t&&!Number.isInteger(s))return null;r=BigInt(Math.trunc(s))}let o=typeof e=="string"?Ws[e]:e;return pe(r,{min:o.min,max:o.max})}function Gs(n,e){let t=n-e;if(t<0||e<0)return null;if(t>15)return Number.MAX_SAFE_INTEGER;let r=Math.min(e,16),o=Math.pow(10,t)-Math.pow(10,-r);return o>0?o:null}function fn(n,e){let t=n.toString();if(t.includes("e")){let r=Math.pow(10,e);return Math.round(n*r)/r}return+(Math.round(+(t+"e"+e))+"e"+-e)}function xt(n,{precision:e,scale:t}={}){let r=M(n);if(r===null)return null;let o=r;if(t!==void 0&&(o=fn(o,t)),e!==void 0){let a=Gs(e,t??0);a!==null&&(o=pe(o,{min:-a,max:a}))}return o}function pe(n,e){if(!e)return n;let{min:t=null,max:r=null,safe:o=!0}=e;if(t!==null&&r!==null&&t>r)return t;let s=n;if(o&&typeof s=="number"){if(Number.isNaN(s))return t!==null?t:r!==null?r:n;if(s===1/0)return r!==null?r:n;if(s===-1/0)return t!==null?t:n}return t!==null&&s<t?t:r!==null&&s>r?r:s}function zr(n){let e=n|0;return function(){let t=e=e+1831565813|0;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}}var Pr,Ks,zs,Br,Vr,Lr,_t,Kr,Ws,Ze=k(()=>{"use strict";ye();Pr=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/,Ks=/0[xobXOB]/,zs=/[\s_]/g,Br=/[eE]/;Vr=/^[+-]/,Lr=/\./g,_t=/,/g;Kr={Int8:{min:-128,max:127},Int16:{min:-32768,max:32767},Int32:{min:-2147483648,max:2147483647},UInt8:{min:0,max:255},UInt16:{min:0,max:65535},UInt32:{min:0,max:4294967295}};Ws={Int64:{min:-9223372036854775808n,max:9223372036854775807n},UInt64:{min:0n,max:18446744073709551615n}}});function B(n){if(!ArrayBuffer.isView(n))return!1;if(Wr)return Wr.call(n)!==void 0;let e=Object.prototype.toString.call(n);return e!=="[object DataView]"&&e.endsWith("Array]")}function E(n){return Array.isArray(n)||B(n)}function Qe(n){return n==null?[]:Array.isArray(n)?[...n]:B(n)?Array.from(n):[n]}function we(n){let e=Qe(n),t=e.length,r=new Array(t);for(let o=0;o<t;o++)r[o]=String(e[o]);return r}function wt(n,e,t){let r=n.length,o=e<-r||e>=r;if(o&&!t)throw new ie(`Index ${e} is out of bounds for array of length ${r}`);return o?null:n.at(e)??null}function Q(n,e,{mode:t="every",allowNulls:r=!1,allowEmpty:o=!0}={}){if(!E(n))return!1;let s=n.length;if(s===0)return o?t==="every":!1;let a=n,i;if(typeof e=="function")i=vr(e)?f=>f instanceof e:e;else switch(e){case"null":i=l=>l===null;break;case"undefined":i=l=>l===void 0;break;case"nullish":i=l=>l==null;break;case"any":i=()=>!0;break;case"date":i=U;break;case"object":i=K;break;case"plainObject":i=Ee;break;case"number":i=F;break;default:i=l=>typeof l===e;break}if(r){let l=i;i=f=>f==null||l(f)}if(t==="every"){for(let l=0;l<s;l++)if(!i(a[l]))return!1;return!0}else{for(let l=0;l<s;l++)if(i(a[l]))return!0;return!1}}function et(n,{descending:e=!1,nullsLast:t=!0}={}){if(!E(n))return[];let r=n,o=r.length;if(o===0)return[];if(B(n)){let c=r.slice().sort();return e&&c.reverse(),Array.from(c)}let s=[],a=[],i=!0,l=!0,f=!0;for(let c=0;c<o;c++){let m=r[c];if(m==null)a.push(m);else if(s.push(m),f){let p=typeof m;p!=="number"&&(i=!1),p!=="string"&&(l=!1),!i&&!l&&(f=!1)}}return s.length>1&&(i?s.sort(e?(c,m)=>m-c:(c,m)=>c-m):l?s.sort(e?(c,m)=>m.localeCompare(c):(c,m)=>c.localeCompare(m)):s.sort((c,m)=>{let p=typeof c,h=typeof m;if(p!==h){let y=p<h?-1:1;return e?-y:y}return c<m?e?1:-1:c>m?e?-1:1:0})),a.length===0?s:t?s.concat(a):a.concat(s)}function P(n){if(!E(n))return Gr;let e=n.length;if(e===0)return Gr;let t=null,r=null,o=null,s=null,a=0,i=0,l=0,f=0,u=0,c=0;for(let p=0;p<e;p++){let h=n[p];if(h==null||typeof h=="number"&&!F(h,{allowNonFiniteNumbers:!0,allowNaN:!1})){i++;continue}(t==null||h<t)&&(t=h,o=p),(r==null||h>r)&&(r=h,s=p);let y=M(h);if(y!==null){let d=l+y;Math.abs(l)>=Math.abs(y)?f+=l-d+y:f+=y-d+l,l=d,a++;let g=y-u;u+=g/a;let _=y-u;c+=g*_}}let m=a>1?c/(a-1):0;return{sum:a>0?l+f:null,count:a,min:t,max:r,minIdx:o,maxIdx:s,mean:a>0?(l+f)/a:null,variance:m,std:Math.sqrt(m),nullCount:i,len:e,hasNulls:i>0,isNumeric:a>0&&a===e-i}}function Se(n,{strict:e=!1,keySelector:t}={}){let r=Array.from(n),o=new Map;if(e){let a=t??G,i=new Map,l=r.length;for(let u=0;u<l;u++){let c=r[u],m=a(c),p=i.get(m);p===void 0?i.set(m,{val:c,count:1}):p.count++}let f=[];for(let u of i.values())f.push(u.val);for(let u=0;u<l;u++){let c=r[u],m=a(c),p=i.get(m);o.set(c,p.count)}return{values:f,count:f.length,frequencies:o}}let s=r.length;for(let a=0;a<s;a++){let i=r[a];o.set(i,(o.get(i)??0)+1)}return{values:Array.from(o.keys()),count:o.size,frequencies:o}}function Yr(n,{step:e=1,offsetStart:t=0,offsetEnd:r,maxItemsGathered:o,null_on_oob:s=!0}={}){if(n==null)return null;if(o!==void 0&&o<=0)return[];if(e===0)throw new v("Step size step cannot be zero");let a=n.length;if(a===0?t!==0:t>=a||t<-a){if(!s)throw new ie(`Start offset ${t} is out of bounds for array of length ${a}`);return null}let l=t<0?a+t:t,f=r!==void 0?r<0?a+r:r:e>0?a:-1,u=[];if(e>0)for(let c=l;c<f&&c<a&&!(c>=0&&(u.push(n[c]),o!==void 0&&u.length>=o));c+=e);else for(let c=l;c>f&&c>=0&&!(c<a&&(u.push(n[c]),o!==void 0&&u.length>=o));c+=e);return u}function Hr(n,e=",",{ignoreNulls:t=!1,nullValue:r="",prefix:o="",suffix:s="",limit:a,truncationMarker:i="...",valueFormatter:l}={}){let f=n.length,u=[],c=a!==void 0?Math.max(0,a):f,m=!1;for(let p=0;p<f;p++){if(u.length>=c){m=!0;break}let h=n[p];h!=null?u.push(l?l(h,p):String(h)):t||u.push(r)}return o+u.join(e)+(m?i:"")+s}function ke(n,e,t={}){let r=n.length,{mode:o="cumulative",step:s=1,coerce:a=y=>y,condition:i,reverse:l=!1,startIndex:f=l?r-1:0,endIndex:u=l?-1:r}=t,c=l?-1:1,m=f,p=u,h=(y,d)=>{(!i||i(n[y],y,n))&&(n[y]=a(d))};if(o==="constant"){let y=a(e);for(let d=m;l?d>p:d<p;d+=c)h(d,y)}else if(o==="independent")if(typeof s=="function"){let y=0;for(let d=m;l?d>p:d<p;d+=c)h(d,s({index:y,initialValue:e,originalValue:n[d],absoluteIndex:d,targetArray:n})),y++}else for(let y=m;l?y>p:y<p;y+=c)h(y,e+y*s);else{let y=e,d=!0,g=0;for(let _=m;l?_>p:_<p;_+=c)d?(h(_,y),d=!1):(typeof s=="function"?y=s({prev:y,index:g,originalValue:n[_],absoluteIndex:_,targetArray:n}):y=y+s,h(_,y)),g++}}function Xr(n){let e=n.length,t=0,r=new Float64Array(e);for(let s=0;s<e;s++){let a=n[s],i=M(a,{allowNonFiniteNumbers:!0});i!==null&&F(i,{allowNonFiniteNumbers:!0,allowNaN:!1})&&(r[t++]=i)}if(t===0)return null;let o=r.subarray(0,t);return o.sort(),o}function $e(n){let e=Xr(n);if(!e)return null;let t=e.length,r=Math.floor(t/2);return t%2!==0?e[r]:(e[r-1]+e[r])/2}function St(n,e){if(e<0||e>1)return null;let t=Xr(n);if(!t)return null;let r=t.length,o=e*(r-1),s=Math.floor(o),a=Math.ceil(o);return s===a?t[s]:t[s]+(o-s)*(t[a]-t[s])}function At(n){if(!E(n)||n.length===0)return null;let e=new Map,t=n.length,r=0,o=[];for(let s=0;s<t;s++){let a=n[s];if(a==null||typeof a=="number"&&!F(a,{allowNonFiniteNumbers:!0,allowNaN:!1}))continue;let i=(e.get(a)??0)+1;e.set(a,i),i>r?(r=i,o=[a]):i===r&&o.push(a)}return o.length===0?null:et(o)}function Zr(n,e){let t=n.length;if(t===0)return[];let r=Math.trunc(e);if(isNaN(r)||r===0)return Array.isArray(n)?n.slice():Array.from(n);let o=Math.abs(r);if(o>=t)return new Array(t).fill(null);let s=new Array(t);if(r>0){s.fill(null,0,r);for(let a=r;a<t;a++){let i=n[a-r];s[a]=i??null}}else{let a=t-o;for(let i=0;i<a;i++){let l=n[i+o];s[i]=l??null}s.fill(null,a,t)}return s}function mn(n){let e=n.length,t=0,r=0,o=0,s=0,a=0,i=0;for(let m=0;m<e;m++){let p=n[m];if(!p)continue;let h=M(p[0]),y=M(p[1]);if(h===null||y===null)continue;t++;let d=h-r;r+=d/t;let g=h-r,_=y-o;o+=_/t;let T=y-o;i+=d*T,s+=d*g,a+=_*T}if(t<2)return{covariance:null,correlation:null};let l=i/(t-1);if(s===0||a===0)return{covariance:l,correlation:null};let f=Math.sqrt(s*a);if(f===0||Number.isNaN(f))return{covariance:l,correlation:null};let u=i/f,c=Math.max(-1,Math.min(1,u));return{covariance:l,correlation:c}}function Jr(n){let e=n.length,t=new Int32Array(e);for(let s=0;s<e;s++)t[s]=s;t.sort((s,a)=>n[s]-n[a]);let r=new Float64Array(e),o=0;for(;o<e;){let s=o+1;for(;s<e&&n[t[s]]===n[t[o]];)s++;let a=(o+1+s)/2;for(let i=o;i<s;i++)r[t[i]]=a;o=s}return r}function Js(n,e,t){if(t<2)return null;let r=0,o=0,s=0,a=0,i=0;for(let u=0;u<t;u++){let c=n[u],m=e[u],p=c-r;r+=p/(u+1);let h=c-r,y=m-o;o+=y/(u+1);let d=m-o;i+=p*d,s+=p*h,a+=y*d}if(s===0||a===0)return null;let l=Math.sqrt(s*a);if(l===0||Number.isNaN(l))return null;let f=i/l;return Math.max(-1,Math.min(1,f))}function Qr(n){let e=n.length,t=new Float64Array(e),r=new Float64Array(e),o=0;for(let i=0;i<e;i++){let l=n[i];if(l){let f=M(l[0]),u=M(l[1]);f!==null&&u!==null&&(t[o]=f,r[o]=u,o++)}}if(o<2)return null;let s=Jr(t.subarray(0,o)),a=Jr(r.subarray(0,o));return Js(s,a,o)}function eo(n){let e=n.length,t=0,r=0;for(let o=0;o<e;o++){let s=n[o];if(!s)continue;let a=M(s[0]),i=M(s[1]);a===null||i===null||(t+=a*i,r++)}return r>0?t:null}function to(n){let e=n.length,t=0,r=0,o=0;for(let s=0;s<e;s++){let a=n[s];if(!a)continue;let i=M(a[0]),l=M(a[1]);i===null||l===null||(t+=i*l,r+=l,o++)}return o===0||Math.abs(r)<1e-12?null:t/r}function no(n,e){let t=Math.max(0,Math.floor(n||0)),r=Math.max(0,Math.floor(e||0)),o=t*r;if(!bt(o,{range:"UInt32"}))throw new v(`Cartesian product size (${o} rows) exceeds maximum JavaScript array capacity.`);let s=new Array(o),a=new Array(o),i=0;for(let l=0;l<t;l++)for(let f=0;f<r;f++)s[i]=l,a[i]=f,i++;return{leftIndices:s,rightIndices:a}}function Dt(n,e,t={}){let r=t.side==="right",o=t.getValue,s=0,a=n.length;for(;s<a;){let i=s+a>>>1,l=o?o(i,n[i]):n[i];(r?l<=e:l<e)?s=i+1:a=i}return s}var Wr,Gr,tt=k(()=>{"use strict";ye();Ze();Tt();Y();Wr=(()=>{try{let n=new Uint8Array(0),e=Object.getPrototypeOf(n),t=Object.getPrototypeOf(e),r=Object.getOwnPropertyDescriptor(t,Symbol.toStringTag)?.get;return r&&r.call(n)==="Uint8Array"?r:void 0}catch{return}})();Gr={sum:null,count:0,min:null,max:null,minIdx:null,maxIdx:null,mean:null,variance:0,std:0,nullCount:0,len:0,hasNulls:!1,isNumeric:!1}});function ro(n){let e=ce(n);return typeof e=="string"?e.trim().length===0:!1}function Ct(n){let e=ce(n);if(e==null)return"";let t=String(e);return typeof RegExp.escape=="function"?RegExp.escape(t):t.replace(Ys,"\\$&")}function qe(n,e=null,t={}){if(n==null)return t.returnStringOnNull?"":null;let{mode:r="both",returnStringOnNull:o=!1,maxScanStart:s=1,maxScanEnd:a=1,maxMatchesStart:i=1,maxMatchesEnd:l=1,trimFirst:f=!1,stringOptions:u}=t,{literal:c=!1,caseInsensitive:m=!1}=u??{},p=(S,b="both")=>b==="start"?S.trimStart():b==="end"?S.trimEnd():S.trim(),h=n;if(f&&e!=null&&(h=p(n,r)),e==null){let S=p(h,r);return o||S!==""?S:null}let y=xe(e)?S=>{try{e.lastIndex=0}catch{}return e.test(S)}:(()=>{let S=new Set(m?e.toLowerCase():e);return b=>S.has(m?b.toLowerCase():b)})(),d=h.length;if(s===1&&i===1&&a===1&&l===1&&!c){let S=0,b=d;if(r==="both"||r==="start")for(;S<d&&y(h[S]);)S++;if(r==="both"||r==="end")for(;b>S&&y(h[b-1]);)b--;let D=S===0&&b===d?h:h.substring(S,b);return o||D!==""?D:null}let _=new Uint8Array(d),T=(S,b,D)=>{if(d===0||D===0)return;let C=S?0:d-1,O=S?d:-1,N=S?1:-1,J=!1,Z=0,W=0;for(let oe=C;oe!==O;oe+=N)if(y(h[oe])){if(!J){if(b!==null&&b>=0&&W>=b||D!==null&&D>=0&&Z>=D)break;J=!0,Z++}_[oe]=1}else if(J=!1,W++,b!==null&&b>=0&&W>=b)break},A=(S,b,D,C,O)=>{if(d===0||O===0||b===0)return;let N=D?0:d-1,J=0,Z=0,W=m?h.toLowerCase():h;for(;N>=0&&N<d&&!(O!==null&&O>=0&&J>=O);){let oe=D?N:N-b+1;if(!D&&oe<0)break;let le=D?W.indexOf(S,oe):W.lastIndexOf(S,oe);if(le===-1)break;let yt=D?le-N:N-(le+b-1);if(Z+=yt,C!==null&&C>=0&&Z>=C)break;for(let Le=0;Le<b;Le++)_[le+Le]=1;J++,N=D?le+b:le-1}};if(r==="both"||r==="start")if(c&&typeof e=="string"){let S=m?e.toLowerCase():e;A(S,e.length,!0,s,i)}else T(!0,s,i);if(r==="both"||r==="end")if(c&&typeof e=="string"){let S=m?e.toLowerCase():e;A(S,e.length,!1,a,l)}else T(!1,a,l);let x="";for(let S=0;S<d;S++)_[S]===0&&(x+=h[S]);return o||x!==""?x:null}function G(n,{depth:e=0,maxDepth:t=50}={}){if(e>t)return"v:circular";if(n===null)return"v:null";if(n===void 0)return"v:undefined";if(U(n))return`d:${n.getTime()}`;if(B(n)){let o=n.toString();return`u:${n.constructor.name}:${o.length}:${o}`}if(Array.isArray(n)){let o=n.length,s=new Array(o),a={depth:e+1,maxDepth:t};for(let i=0;i<o;i++)s[i]=G(n[i],a);return`a:[${s.join("")}]`}if(dt(n)){let o=Array.from(n),s=o.length,a=new Array(s),i={depth:e+1,maxDepth:t};for(let l=0;l<s;l++)a[l]=G(o[l],i);return a.sort(),`set:[${a.join("")}]`}if(gt(n)){let o=Array.from(n.keys()),s=o.length,a=new Array(s),i={depth:e+1,maxDepth:t};for(let l=0;l<s;l++){let f=o[l];a[l]=`${G(f,i)}${"\0"}${G(n.get(f),i)}`}return a.sort(),`map:{${a.join("")}}`}if(typeof n=="object"&&typeof n.toJSON=="function"){let o=n.toJSON();if(o!==n)return`j:${G(o,{depth:e+1,maxDepth:t})}`}if(xe(n)){let o=n.toString();return`r:${o.length}:${o}`}if(Ee(n)){let o=Object.keys(n).sort(),s=o.length,a=new Array(s),i={depth:e+1,maxDepth:t};for(let l=0;l<s;l++){let f=o[l];a[l]=`${G(f,i)}${"\0"}${G(n[f],i)}`}return`o:{${a.join("")}}`}if(typeof n=="function"){let o=n.toString();return`f:${o.length}:${o}`}if(typeof n=="string")return`s:${n.length}:${n}`;if(typeof n=="symbol"){let o=n.toString();return`y:${o.length}:${o}`}if(typeof n=="number"||typeof n=="boolean"||typeof n=="bigint")return`${typeof n}:${n}`;let r=String(n);return`${typeof n}:${r.length}:${r}`}function Qs(n){if(n==null)return[];let e=String(n);if(!e)return[];let r=e.normalize("NFC").replace(Hs,"$1$2").match(Xs)||[],o=[];for(let s=0;s<r.length;s++){let a=r[s];Zs.has(a)||o.push(a)}return o}function nt(n,e){let t=Qs(n),r=t.length;if(r===0)return"";let{format:o}=e;if(o==="camel"||o==="pascal"){let s="";for(let a=0;a<r;a++){let i=t[a];s+=a===0&&o==="camel"?i.toLowerCase():i.charAt(0).toUpperCase()+i.slice(1).toLowerCase()}return s}if(o==="kebab"||o==="snake"){let s=o==="kebab"?"-":"_",a=new Array(r);for(let i=0;i<r;i++)a[i]=t[i].toLowerCase();return a.join(s)}return String(n)}var Ys,Hs,Xs,Zs,Tt=k(()=>{"use strict";ye();tt();Ys=/[-\/\\^$*+?.()|\[\]{}]/g;Hs=/(\p{L})['’](\p{L})/gu,Xs=new RegExp(["\\p{Lu}+s(?!\\p{Ll})","\\p{Lu}+(?=\\p{Lu}\\p{Ll})","\\p{Lu}+\\p{Ll}*","\\p{Ll}+","\\p{N}+","\\p{L}+"].join("|"),"gu"),Zs=new Set(["__proto__","proto","constructor","prototype"])});function ni(n){let e=oo.get(n);return e||(e=new Intl.DateTimeFormat("en-US",{timeZone:n,hourCycle:"h23",weekday:"short",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3}),oo.set(n,e)),e}function ri(n,e){let t=`${n}_${e}`,r=so.get(t);return r||(r=new Intl.DateTimeFormat(n,{timeZoneName:"short",timeZone:e}),so.set(t,r)),r}function oi(n){let e=io.get(n);if(e===void 0){try{Intl.DateTimeFormat(void 0,{timeZone:n}),e=!0}catch{e=!1}io.set(n,e)}return e}function he(n){let e=!n||n==="local"?Intl.DateTimeFormat().resolvedOptions().timeZone:n;return oi(e)?e:"UTC"}function ee(n,e=0,t=1,r=0,o=0,s=0,a=0){let i=new Date(0);return i.setUTCFullYear(n,e,t),i.setUTCHours(r,o,s,a),i}function si(n,e,t){let r=[0,3,2,5,0,3,5,1,4,6,2,4],o=n;return e<3&&(o-=1),(o+Math.floor(o/4)-Math.floor(o/100)+Math.floor(o/400)+r[e-1]+t)%7}function re(n,e){let t=he(e);if(t.toUpperCase()==="UTC")return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),ms:n.getUTCMilliseconds(),dayOfWeek:n.getUTCDay(),timeZone:"UTC"};let o=ni(t).formatToParts(n),s="0",a="0",i="0",l="0",f="0",u="0",c="0";for(let _=0,T=o.length;_<T;_++){let A=o[_];switch(A.type){case"year":s=A.value;break;case"month":a=A.value;break;case"day":i=A.value;break;case"hour":l=A.value;break;case"minute":f=A.value;break;case"second":u=A.value;break;case"fractionalSecond":c=A.value;break}}let m=parseInt(s,10),p=parseInt(a,10),h=parseInt(i,10),y=parseInt(l,10);y===24&&(y=0);let d=Math.round(parseFloat("0."+c)*1e3)||0,g=si(m,p,h);return{year:m,month:p,day:h,hour:y,minute:parseInt(f,10),second:parseInt(u,10),ms:d,dayOfWeek:g,timeZone:t}}function Ke(n,e){let t=he(e);if(t.toUpperCase()==="UTC")return 0;let r=re(n,"UTC"),o=re(n,t),s=ee(r.year,r.month-1,r.day,r.hour,r.minute,r.second,r.ms).getTime(),a=ee(o.year,o.month-1,o.day,o.hour,o.minute,o.second,o.ms).getTime();return Math.round((a-s)/6e4)}function ao(n,e){let t=n>=0?"+":"-",r=Math.abs(n),o=String(Math.floor(r/60)).padStart(2,"0"),s=String(r%60).padStart(2,"0");return e==="iso"?`${t}${o}:${s}`:`${t}${o}${s}`}function H(n,e){let t=ce(n);if(t==null)return null;let r=null;if(U(t))r=t;else if(typeof t=="number"||typeof t=="bigint")r=new Date(ii(t));else if(typeof t=="string"){if(ro(t))return null;r=new Date(t)}if(!r||!U(r))return null;if(e?.dateOnly){let o=typeof t=="string",s=o&&ti.test(t),a=o&&!s&&!uo.test(t)?"local":"UTC",i=re(r,a);return ee(i.year,i.month-1,i.day)}return r}function It(n){let e=ce(n);if(e==null)return null;let t=null;if(typeof e=="string"){let o=e.trim();if(ei.test(o)){let s=uo.test(o);t=H(`1970-01-01T${o}${s?"":"Z"}`)}}let r=t||H(e);return r?Ne(r,{format:"%H:%M:%S.%ms"}):null}function co(n,e="ms"){let t=n.getTime();switch(e){case"s":return Math.floor(t/1e3);case"ms":return t;case"us":return BigInt(t)*ln;case"ns":return BigInt(t)*un}}function ii(n){if(typeof n=="bigint"){let t=n<0n?-n:n;return t<=30000000000n?Number(n)*1e3:t<=30000000000000n?Number(n):t<=30000000000000000n?Number(n/ln):Number(n/un)}let e=Math.abs(n);return e<=3e10?n*1e3:e<=3e13?n:e<=3e16?Math.floor(n/1e3):Math.floor(n/1e6)}function fo(n){if(!U(n))return null;let e=n.getUTCFullYear();return Math.floor((e-1)/100)+1}function dn(n,e={field:"week"}){if(!U(n))return null;let t=ee(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()),r=t.getUTCDay()||7;if(t.setUTCDate(t.getUTCDate()+4-r),e.field==="year")return t.getUTCFullYear();let o=ee(t.getUTCFullYear(),0,1),s=Math.round((t.getTime()-o.getTime())/864e5);return Math.floor(s/7)+1}function mo(n){if(!U(n))return null;let e=n.getUTCFullYear();return Math.floor((e-1)/1e3)+1}function Et(n,e,t=1){return U(n)?ee(n.getUTCFullYear(),n.getUTCMonth()+e,t):null}function gn(n){if(!U(n))return null;let e=ee(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()).getTime(),t=ee(n.getUTCFullYear(),0,1).getTime();return Math.floor((e-t)/864e5)+1}function po(n){return U(n)?Math.floor(n.getUTCMonth()/3)+1:null}function _n(n){let e;if(U(n))e=n.getUTCFullYear();else if(F(n))e=n;else return!1;return e%4===0&&e%100!==0||e%400===0}function ho(n){return n.replace(/%[FTRD]/g,e=>li[e]||e)}function ui(n){let e=n.replace(":",""),t=e[0]==="+"?1:-1,r=parseInt(e.slice(1,3),10)||0,o=parseInt(e.slice(3,5),10)||0;return t*(r*60+o)}function Ne(n,{format:e,locale:t,timeZone:r="UTC"}){if(!U(n)||typeof e!="string")return"";let o=t&&t.trim()||Intl.DateTimeFormat().resolvedOptions().locale||"en-US",s=ho(e),a=null,i=()=>a??=re(n,r);return s.replace(Ot,(l,f)=>{if(f==="%")return"%";let u=bn[f];return u?u.format(n,o,r,i()):l})}function yo(n,{format:e,strict:t=!0,defaultTimeZone:r="UTC"}){if(typeof n!="string"||typeof e!="string")return null;let o=ho(e),s=[],a="",i=0;Ot.lastIndex=0;let l;for(;(l=Ot.exec(o))!==null;){let y=o.slice(i,l.index);a+=Ct(y);let d=l[1];if(d==="%")a+="\\%";else{let g=bn[d];g&&g.parseRegex?(s.push(g),a+=`(${g.parseRegex})`):a+=Ct(l[0])}i=Ot.lastIndex}a+=Ct(o.slice(i));let f=new RegExp("^\\s*"+a+"\\s*$"),u=n.match(f);if(!u)return t?null:H(n);let c={year:1970,month:1,day:1,hour:0,minute:0,second:0,ms:0,offset:null},m=null,p=!1;for(let y=0;y<s.length;y++){let d=u[y+1],g=s[y],_=g.parseNormalize?g.parseNormalize(d):parseInt(d,10);g.key==="j"&&(p=!0),g.parseField==="ampm"?m=_:g.parseField==="offset"?c.offset=_:g.parseField&&(c[g.parseField]=_)}if(m&&(m==="PM"&&c.hour<12&&(c.hour+=12),m==="AM"&&c.hour===12&&(c.hour=0)),p){let y=_n(c.year)?366:365;if(c.day<1||c.day>y)return null;let d=ee(c.year,0,1);d.setUTCDate(c.day),c.month=d.getUTCMonth()+1,c.day=d.getUTCDate()}let h=ee(c.year,c.month-1,c.day,c.hour,c.minute,c.second,c.ms);if(!U(h)||h.getUTCFullYear()!==c.year||h.getUTCMonth()+1!==c.month||h.getUTCDate()!==c.day||h.getUTCHours()!==c.hour||h.getUTCMinutes()!==c.minute||h.getUTCSeconds()!==c.second||h.getUTCMilliseconds()!==c.ms)return null;if(c.offset)h=new Date(h.getTime()-ui(c.offset)*6e4);else if(r.toUpperCase()!=="UTC"){let y=he(r),d=Ke(h,y);h=new Date(h.getTime()-d*6e4);let g=Ke(h,y);g!==d&&(h=new Date(h.getTime()-(g-d)*6e4))}return U(h)?h:null}function go(n,e,{excludeWeekdays:t=[],holidays:r=[],roll:o}={}){if(!bt(e))throw new ie(`The offset parameter 'n' must be a whole integer. Received: ${e}`);if(t.length===0&&(!r||Array.isArray(r)&&r.length===0||r instanceof Set&&r.size===0)&&!o)return e;if(7-t.length<=0)throw new ie("All weekdays are excluded; cannot offset.");let a=new Set;if(r instanceof Set)for(let c of r){let m=new Date(c);t.includes(m.getUTCDay())||a.add(c)}else if(Array.isArray(r))for(let c=0;c<r.length;c++){let m=H(r[c]);if(!m||t.includes(m.getUTCDay()))continue;let p=ee(m.getUTCFullYear(),m.getUTCMonth(),m.getUTCDate());a.add(p.getTime())}let i=c=>t.includes(c.getUTCDay())?!0:a.has(c.getTime()),l=ee(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()),f=new Date(l.getTime());if(o&&i(f)){if(o==="raise")throw new ie("Start date falls on an excluded day or holiday.");let c=o==="forward"?1:-1;for(;i(f);)f.setUTCDate(f.getUTCDate()+c)}if(e!==0){let c=e>0?1:-1,m=0,p=Math.abs(e);for(;m<p;)f.setUTCDate(f.getUTCDate()+c),i(f)||m++}let u=f.getTime()-l.getTime();return Math.round(u/864e5)}function xn(n,e,t){let r=he(e),o=t?.type??"total",s;if(o==="total")s=Ke(n,r);else{let l=re(n,r).year,f=Ke(ee(l,0,1),r),u=Ke(ee(l,6,1),r),c=Math.min(f,u);o==="daylightSavingTime"?s=Ke(n,r)-c:s=c}switch(t?.format??"milliseconds"){case"minutes":return s;case"hours":return s/60;case"iso":return ao(s,"iso");case"basic":return ao(s,"basic");default:return s*6e4}}function _o(n,e={}){if(!U(n))return null;let t=e.excludeWeekdays??[0,6],r=n.getUTCDay();if(t.includes(r))return!1;let o=e.holidays;if(o){if(o instanceof Set){let s=Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate());if(o.has(s))return!1}else if(Array.isArray(o)&&o.length>0){let s=new Set;for(let i=0;i<o.length;i++){let l=H(o[i]);l&&s.add(Date.UTC(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate()))}let a=Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate());if(s.has(a))return!1}}return!0}function bo(n,e={}){let t=re(n,e?.timeZone??void 0),r=e?.year??t.year,o=e?.month!=null?e.month-1:t.month-1,s=e?.day??t.day,a=e?.hour??t.hour,i=e?.minute??t.minute,l=e?.second??t.second,f=e?.ms??t.ms;return ee(r,o,s,a,i,l,f)}var ei,uo,ti,oo,so,io,bn,ai,Ot,li,wn=k(()=>{"use strict";Tt();Y();ye();Ze();Fr();ei=/^\d{2}:\d{2}/,uo=/(?:Z|[+-]\d{2}(?::?\d{2})?)$/i,ti=/^\d{4}-\d{2}-\d{2}$/,oo=new Map;so=new Map;io=new Map;bn={Y:{key:"Y",format:(n,e,t,r)=>{let o=r.year;return o>=0?String(o).padStart(4,"0"):"-"+String(Math.abs(o)).padStart(4,"0")},parseRegex:"[+-]?\\d{4,}",parseField:"year"},y:{key:"y",format:(n,e,t,r)=>String(Math.abs(r.year)%100).padStart(2,"0"),parseRegex:"\\d{2}",parseField:"year",parseNormalize:n=>{let e=parseInt(n,10);return e+(e>=69?1900:2e3)}},m:{key:"m",format:(n,e,t,r)=>String(r.month).padStart(2,"0"),parseRegex:"\\d{2}",parseField:"month"},d:{key:"d",format:(n,e,t,r)=>String(r.day).padStart(2,"0"),parseRegex:"\\d{2}",parseField:"day"},e:{key:"e",format:(n,e,t,r)=>String(r.day).padStart(2," "),parseRegex:"\\s?\\d{1,2}",parseField:"day"},H:{key:"H",format:(n,e,t,r)=>String(r.hour).padStart(2,"0"),parseRegex:"\\d{2}",parseField:"hour"},I:{key:"I",format:(n,e,t,r)=>String(r.hour%12||12).padStart(2,"0"),parseRegex:"\\d{2}",parseField:"hour"},p:{key:"p",format:(n,e,t,r)=>r.hour>=12?"PM":"AM",parseRegex:"AM|PM|am|pm",parseField:"ampm",parseNormalize:n=>n.toUpperCase()},M:{key:"M",format:(n,e,t,r)=>String(r.minute).padStart(2,"0"),parseRegex:"\\d{2}",parseField:"minute"},S:{key:"S",format:(n,e,t,r)=>String(r.second).padStart(2,"0"),parseRegex:"\\d{2}",parseField:"second"},A:{key:"A",format:(n,e,t)=>n.toLocaleDateString(e,{weekday:"long",timeZone:he(t)})},a:{key:"a",format:(n,e,t)=>n.toLocaleDateString(e,{weekday:"short",timeZone:he(t)})},B:{key:"B",format:(n,e,t)=>n.toLocaleDateString(e,{month:"long",timeZone:he(t)})},b:{key:"b",format:(n,e,t)=>n.toLocaleDateString(e,{month:"short",timeZone:he(t)})},h:{key:"h",format:(n,e,t)=>n.toLocaleDateString(e,{month:"short",timeZone:he(t)})},j:{key:"j",format:(n,e,t,r)=>String(gn(ee(r.year,r.month-1,r.day))??1).padStart(3,"0"),parseRegex:"\\d{3}",parseField:"day",parseNormalize:n=>parseInt(n,10)},u:{key:"u",format:(n,e,t,r)=>String(r.dayOfWeek||7)},w:{key:"w",format:(n,e,t,r)=>String(r.dayOfWeek)},Z:{key:"Z",format:(n,e,t)=>{let r=he(t);if(r.toUpperCase()==="UTC")return"UTC";let o=ri(e,r).formatToParts(n);for(let s=0,a=o.length;s<a;s++)if(o[s].type==="timeZoneName")return o[s].value;return"UTC"}},z:{key:"z",format:(n,e,t)=>xn(n,t,{format:"basic"}),parseRegex:"[+-]\\d{2}(?::?\\d{2})?",parseField:"offset",parseNormalize:n=>n.replace(":","")},ms:{key:"ms",format:(n,e,t,r)=>String(r.ms).padStart(3,"0"),parseRegex:"\\d{3}",parseField:"ms",parseNormalize:n=>parseInt(n,10)},f:{key:"f",format:(n,e,t,r)=>String(r.ms).padStart(3,"0").padEnd(6,"0"),parseRegex:"\\d{1,9}",parseField:"ms",parseNormalize:n=>parseInt(n.padEnd(6,"0").slice(0,3),10)}},ai=Object.keys(bn).concat("%").sort((n,e)=>e.length-n.length),Ot=new RegExp("%("+ai.join("|")+")","g"),li={"%F":"%Y-%m-%d","%T":"%H:%M:%S","%R":"%H:%M","%D":"%m/%d/%y"}});function xo(n,{format:e="json",allowPrimitives:t=!1,trimBeforeParse:r=!1,reviver:o,ndjson:{skipInvalidLines:s=!1,maxLines:a,skipLines:i}={},guard:l,onError:f,fallback:u=ot}={}){if(typeof n!="string")return u!==ot?u:n;let c=r?n.trim():n;if(c==="")return u!==ot?u:n;let m;try{if(e==="ndjson"){let p=[],h=0,y=0,d=0;Sn.lastIndex=0;let g;for(;;){g=Sn.exec(c);let _=g?c.substring(d,g.index):c.substring(d);g&&(d=Sn.lastIndex);let T=_.trim();if(T!==""&&(h++,i===void 0||h>i))if(!t&&!ci(T)){if(!s)throw new v("NDJSON line is not wrapped and primitives are disallowed")}else try{if(p.push(JSON.parse(T,o)),y++,a!==void 0&&y>=a)break}catch(A){if(!s)throw A}if(!g)break}if(p.length===0)throw new Ae("No valid NDJSON lines processed");m=p}else{if(!t&&!fi(c))throw new v("JSON string is not wrapped and primitives are disallowed");m=JSON.parse(c,o)}}catch(p){return f?.(p),u!==ot?u:n}return l&&!l(m)?(f?.(new Error("Parsed value failed guard validation")),u!==ot?u:n):m}function st(n={}){let e=n.bigintStrategy??"string",t=n.handleCircular?new WeakSet:null,o=Array.isArray(n.replacer)?n.replacer.map(String):null,s=a=>e==="number"&&a<=BigInt(Number.MAX_SAFE_INTEGER)&&a>=BigInt(Number.MIN_SAFE_INTEGER)?Number(a):a.toString();return function(i,l){let f=l;if(typeof n.replacer=="function")f=n.replacer.call(this,i,l);else if(o&&i!==""&&!Array.isArray(this)&&!o.includes(i))return;if(f===void 0)return;let u=f===l&&this!=null?this[i]:f;if(typeof n.onCustom=="function"){let c=n.onCustom.call(this,i,u);if(c!==u||c===void 0&&u!==void 0)return c}if(u!==null&&typeof u!="object"&&typeof u!="bigint")return f;if(t&&u!==null&&typeof u=="object"){if(i===""&&(t=new WeakSet),t.has(u))return n.onCircular?n.onCircular.call(this,i,u):"[Circular]";t.add(u)}return typeof u=="bigint"?n.voidBigIntReplacement?f:n.onBigInt?n.onBigInt(u):s(u):B(u)?n.voidTypedArrayReplacement?f:n.onTypedArray?n.onTypedArray(u):Array.from(u):dt(u)?n.voidSetReplacement?f:n.onSet?n.onSet(u):Array.from(u):gt(u)?n.voidMapReplacement?f:n.onMap?n.onMap(u):Array.from(u.entries()):xe(u)?n.voidRegExpReplacement?f:n.onRegExp?n.onRegExp(u):u.toString():U(u)?n.voidDateReplacement?f:n.onDate?n.onDate(u):n.formatDate?n.formatDate(u):u.toISOString():Ur(u)?n.onError?n.onError(u):{name:u.name,message:u.message,stack:u.stack}:Mr(u)?n.onURLSearchParams?n.onURLSearchParams(u):u.toString():f}}var Sn,ot,ci,fi,kt=k(()=>{"use strict";tt();ye();Y();Sn=/\r\n|\n|\r/g,ot=Symbol("no_fallback"),ci=n=>{let e=n.length;if(e<2)return!1;let t=n[0],r=n[e-1];return t==="{"&&r==="}"||t==="["&&r==="]"},fi=n=>{let e=0,t=n.length;for(;e<t&&/\s/.test(n[e]);)e++;let r=t-1;for(;r>=e&&/\s/.test(n[r]);)r--;if(e>=r)return!1;let o=n[e],s=n[r];return o==="{"&&s==="}"||o==="["&&s==="]"}});var ne,ze,Rt,ve,Me,it,Ue,at,Nt=k(()=>{"use strict";ne=class n{matches(e){if(e==null)return!1;if(e instanceof n)return!!(this.equals(e)||this.name.startsWith("Decimal")&&e.name.startsWith("Decimal")&&e.precision===void 0&&e.scale===void 0);if(typeof e=="function"){if(e.prototype instanceof n)return this instanceof e;try{let t=e();if(t instanceof n)return this.constructor===t.constructor}catch{}}return!1}get isNumeric(){return!1}get isInteger(){return!1}get isFloat(){return!1}get isSigned(){return!1}get isUnsigned(){return!1}get isTemporal(){return!1}get isNested(){return!1}get isBoolean(){return!1}get isString(){return!1}get isUtf8(){return!1}get isObject(){return!1}get isNull(){return!1}get isBinary(){return!1}},ze=class extends ne{get isNumeric(){return!0}},Rt=class extends ze{get isInteger(){return!0}},ve=class extends Rt{get isSigned(){return!0}},Me=class extends Rt{get isUnsigned(){return!0}},it=class extends ze{get isFloat(){return!0}},Ue=class extends ne{get isTemporal(){return!0}},at=class extends ne{get isNested(){return!0}}});var An,wo,Dn,So,Tn,Ao,Cn,Mt,On,Do,In,To,En,Co,kn,Oo,Rn,Io,Nn,Ut,vt,vn,Ft,Mn,ut,Un,Eo,Fn,ko,jn,Ro,Vn,No,ge,jt,Ln,vo,lt,Mo,Pn,Uo,Bn,Fo,ct=k(()=>{"use strict";Nt();q();An=class extends ve{name="Int8";coerce(e){return de(e,{range:"Int8"})}equals(e){return e.name==="Int8"}allocate(e){return new Int8Array(e)}},wo=new An,Dn=class extends ve{name="Int16";coerce(e){return de(e,{range:"Int16"})}equals(e){return e.name==="Int16"}allocate(e){return new Int16Array(e)}},So=new Dn,Tn=class extends ve{name="Int32";coerce(e){return de(e,{range:"Int32"})}equals(e){return e.name==="Int32"}allocate(e){return new Int32Array(e)}},Ao=new Tn,Cn=class extends ve{name="Int64";coerce(e){return Be(e,{truncate:!0})}equals(e){return e.name==="Int64"}allocate(e){return new BigInt64Array(e)}},Mt=new Cn,On=class extends Me{name="UInt8";coerce(e){return de(e,{range:"UInt8"})}equals(e){return e.name==="UInt8"}allocate(e){return new Uint8Array(e)}},Do=new On,In=class extends Me{name="UInt16";coerce(e){return de(e,{range:"UInt16"})}equals(e){return e.name==="UInt16"}allocate(e){return new Uint16Array(e)}},To=new In,En=class extends Me{name="UInt32";coerce(e){return de(e,{range:"UInt32"})}equals(e){return e.name==="UInt32"}allocate(e){return new Uint32Array(e)}},Co=new En,kn=class extends Me{name="UInt64";coerce(e){return Be(e,{range:"UInt64"})}equals(e){return e.name==="UInt64"}allocate(e){return new BigUint64Array(e)}},Oo=new kn,Rn=class extends it{name="Float32";coerce(e){return cn(e,{floatPrecision:"Float32"})}equals(e){return e.name==="Float32"}allocate(e){return new Float32Array(e)}},Io=new Rn,Nn=class extends it{name="Float64";coerce(e){return cn(e,{floatPrecision:"Float64"})}equals(e){return e.name==="Float64"}allocate(e){return new Float64Array(e)}},Ut=new Nn,vt=class n extends ze{constructor(t,r){super();this.precision=t;this.scale=r;this.name=t!==void 0&&r!==void 0?`Decimal(${t}, ${r})`:"Decimal"}precision;scale;name;coerce(t){return xt(t,{precision:this.precision,scale:this.scale})}equals(t){return t instanceof n&&this.precision===t.precision&&this.scale===t.scale}allocate(t){return new Array(t).fill(null)}},vn=class extends ne{name="Boolean";get isBoolean(){return!0}coerce(e){return e==null?null:!!e}equals(e){return e.name==="Boolean"}allocate(e){return new Array(e).fill(null)}},Ft=new vn,Mn=class extends ne{name="Utf8";get isString(){return!0}get isUtf8(){return!0}coerce(e){return e==null?null:String(e)}equals(e){return e.name==="Utf8"}allocate(e){return new Array(e).fill(null)}},ut=new Mn,Un=class extends ne{name="Binary";get isBinary(){return!0}coerce(e){return jo(e)}equals(e){return e.name==="Binary"}allocate(e){return new Array(e).fill(null)}},Eo=new Un,Fn=class extends ne{name="Null";get isNull(){return!0}coerce(e){return null}equals(e){return e.name==="Null"}allocate(e){return new Array(e).fill(null)}},ko=new Fn,jn=class extends ne{name="Object";get isObject(){return!0}coerce(e){return e===void 0?null:e}equals(e){return e.name==="Object"}allocate(e){return new Array(e).fill(null)}},Ro=new jn,Vn=class extends Ue{name="Date";coerce(e){return H(e,{dateOnly:!0})}equals(e){return e.name==="Date"}allocate(e){return new Array(e).fill(null)}},No=new Vn,ge=class n extends Ue{name="Datetime";timeUnit;timeZone;constructor(e="ms",t=null){super(),this.timeUnit=e,this.timeZone=t}coerce(e){return H(e)}equals(e){return e instanceof n&&e.timeUnit===this.timeUnit&&e.timeZone===this.timeZone}allocate(e){return new Array(e).fill(null)}},jt=new ge,Ln=class extends Ue{name="Time";coerce(e){return It(e)}equals(e){return e.name==="Time"}allocate(e){return new Array(e).fill(null)}},vo=new Ln,lt=class n extends Ue{name="Duration";timeUnit;constructor(e="ms"){super(),this.timeUnit=e}coerce(e){return M(e)}equals(e){return e instanceof n&&e.timeUnit===this.timeUnit}allocate(e){return new Array(e).fill(null)}},Mo=new lt,Pn=class n extends at{constructor(t){super();this.innerType=t}innerType;name="Array";coerce(t){if(t==null)return null;let r=E(t)?Array.from(t):[t],o=r.length,s=new Array(o);for(let a=0;a<o;a++)s[a]=this.innerType.coerce(r[a]);return s}equals(t){return t instanceof n&&this.innerType.equals(t.innerType)}allocate(t){return new Array(t).fill(null)}},Uo=n=>new Pn(n),Bn=class n extends at{constructor(t){super();this.fields=t}fields;name="Struct";coerce(t){if(!K(t))return null;let r={},o=Object.keys(this.fields),s=o.length;for(let a=0;a<s;a++){let i=o[a],l=this.fields[i];r[i]=l.coerce(t[i])}return r}equals(t){if(!(t instanceof n))return!1;let r=Object.keys(this.fields),o=Object.keys(t.fields);if(r.length!==o.length)return!1;for(let s=0;s<r.length;s++){let a=r[s];if(!this.fields[a].equals(t.fields[a]))return!1}return!0}allocate(t){return new Array(t).fill(null)}},Fo=n=>new Bn(n)});var j,De=k(()=>{"use strict";Nt();ct();ct();Nt();j={Int8:wo,Int16:So,Int32:Ao,Int64:Mt,UInt8:Do,UInt16:To,UInt32:Co,UInt64:Oo,Float32:Io,Float64:Ut,Decimal:(n,e)=>new vt(n,e),Boolean:Ft,Utf8:ut,Binary:Eo,Date:No,Datetime:jt,Time:vo,Duration:Mo,Object:Ro,Null:ko,Array:Uo,Struct:Fo}});function pi(n={}){let e=n.nullValue!==void 0?n.nullValue:"",t=qr(n.numericFormatOptions),r=n.replacerOptions||{},o=i=>n.datetimeFormat?Ne(i,{format:n.datetimeFormat}):n.dateFormat?Ne(i,{format:n.dateFormat}):n.timeFormat?Ne(i,{format:n.timeFormat}):i.toISOString(),s=st({formatDate:o,...r}),a=typeof r.onBigInt=="function";return i=>{if(i==null||typeof i=="symbol"||typeof i=="function")return{str:e,isNumeric:!1};if(typeof i=="bigint"&&!a&&!r.voidBigIntReplacement)return{str:t(i),isNumeric:!0};let l=s.call(null,"",i),f=ce(l);return f==null||typeof f=="symbol"||typeof f=="function"?{str:e,isNumeric:!1}:typeof f=="string"?{str:f,isNumeric:!1}:typeof f=="number"||typeof f=="bigint"?{str:t(f),isNumeric:!0}:typeof f=="boolean"?{str:f?"true":"false",isNumeric:!1}:typeof f=="object"?{str:JSON.stringify(f,st({formatDate:o,...r})),isNumeric:!1}:{str:String(f),isNumeric:!1}}}function Lt(n,e,t={}){let{separator:r=",",quoteChar:o='"',includeHeader:s=!0,lineTerminator:a=`
2
- `,quoteStyle:i="necessary",includeBom:l=!1,onRow:f,...u}=t,c=Object.keys(n),m=c.length,p=[],h=!0,y=pi(u),d=(_,T=!1)=>{let A,x=!1;if(T)A=String(_);else{let b=y(_);A=b.str,x=b.isNumeric}if(i==="never")return A;if(i==="always"){let b=A.split(o).join(o+o);return o+b+o}if(i==="non_numeric"&&!x&&_!=null){let b=A.split(o).join(o+o);return o+b+o}if(A.includes(r)||A.includes(o)||A.includes(`
3
- `)||A.includes("\r")){let b=A.split(o).join(o+o);return o+b+o}return A},g=_=>{if(h){let T=l?"\uFEFF"+_:_;f?f(T):p.push(T),h=!1}else f?f(a+_):p.push(_)};if(s){let _=new Array(m);for(let T=0;T<m;T++)_[T]=d(c[T],!0);g(_.join(r))}for(let _=0;_<e;_++){let T=new Array(m);for(let A=0;A<m;A++)T[A]=d(n[c[A]][_],!1);g(T.join(r))}return f?l?"\uFEFF":"":p.join(a)}function Vo(n,e={}){let t=e.separator||",",r=e.quoteChar||'"',o=n;o.startsWith("\uFEFF")&&(o=o.substring("\uFEFF".length));let s=[],a=[],i="",l=!1,f=!1,u=!1,c=o.length;for(let m=0;m<c;m++){let p=o[m];if(l)f=!0,u=!1,p===r?m+1<c&&o[m+1]===r?(i+=r,m++):l=!1:i+=p;else if(p===r)f=!0,u=!1,l=!0;else if(p===t)a.push(i),i="",u=!0;else{let h=!1;p==="\r"?(h=!0,m+1<c&&o[m+1]===`
4
- `&&m++):p===`
5
- `&&(h=!0),h?(f||a.length>0||i!==""||u)&&(a.push(i),s.push(a),a=[],i="",f=!1,u=!1):(f=!0,u=!1,i+=p)}}return(f||a.length>0||i!==""||u)&&(a.push(i),s.push(a)),s}function Lo(n,e={}){let t=new Set(e.nullValues??["","NA","null","NaN"]),r=n.length,o=!0,s=!0,a=!0,i=!0,l=!1;for(let u=0;u<r;u++){let c=n[u].trim();if(!t.has(c)){if(l=!0,o){let m=c.toLowerCase();m!=="true"&&m!=="false"&&m!=="1"&&m!=="0"&&(o=!1)}if(a&&Be(c,{truncate:!1})===null&&(a=!1),s&&M(c,{allowNonFiniteNumbers:!0})===null&&(s=!1),i&&H(c)===null&&(i=!1),!o&&!s&&!a&&!i)break}}let f=new Array(r);if(!l||!o&&!s&&!a&&!i){for(let u=0;u<r;u++){let c=n[u];f[u]=t.has(c.trim())?null:c}return{type:ut,values:f}}if(o){for(let u=0;u<r;u++){let c=n[u].trim();if(t.has(c))f[u]=null;else{let m=c.toLowerCase();f[u]=m==="true"||m==="1"}}return{type:Ft,values:f}}if(a){for(let u=0;u<r;u++){let c=n[u].trim();f[u]=t.has(c)?null:Be(c,{truncate:!1})}return{type:Mt,values:f}}if(s){for(let u=0;u<r;u++){let c=n[u].trim();f[u]=t.has(c)?null:M(c,{allowNonFiniteNumbers:!0})}return{type:Ut,values:f}}if(i){for(let u=0;u<r;u++){let c=n[u].trim();f[u]=t.has(c)?null:H(c)}return{type:jt,values:f}}return{type:ut,values:f}}var Po=k(()=>{"use strict";wn();kt();Ze();De();ye()});function hi(n){return n==null?!1:typeof n=="string"||B(n)?!0:Array.isArray(n)}function jo(n){return hi(n)?Object.prototype.toString.call(n)==="[object Uint8Array]"?n:typeof n=="string"?new TextEncoder().encode(n):B(n)?new Uint8Array(n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength)):new Uint8Array(n):null}var Bo=k(()=>{"use strict";tt()});function $o(n,e){return e==="us"?n*1e3:e==="ns"?n*1e6:n}var qo=k(()=>{"use strict"});var q=k(()=>{"use strict";ye();Ze();wn();tt();Tt();kt();Po();Bo();qo()});function X(n,e,t,r=""){if(!(n in e))throw new Te(n,`${t} "${n}" does not exist${r}`)}function qn(n,e){let t=Object.keys(n),r=t.length,o=e;for(let s=0;s<r;s++){let a=t[s],i=n[a],l=E(i)?i.length:0;if(o===void 0)o=l;else if(l!==o)throw new te(`Column height mismatch: Column "${a}" has length ${l}, but DataFrame height is ${o}`)}return o===void 0?0:o}function Pt(n,e="Value cannot be null or undefined"){if(n==null)throw new v(e);return n}function Ta(n,e){if(!n)throw new v(e)}var Ko=k(()=>{"use strict";Y();q()});var Ce,z,Te,Fe,ie,te,v,Ae,Y=k(()=>{"use strict";Ko();Ce=class extends Error{constructor(e){super(e),this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},z=class extends Ce{},Te=class extends z{constructor(e,t){super(t||`Column "${e}" does not exist in the DataFrame.`)}},Fe=class extends Ce{},ie=class extends Ce{},te=class extends Ce{},v=class extends Ce{},Ae=class extends Ce{}});function yi(n,e,t){let r=new Map,o=t.length,s=new Array(o);for(let a=0;a<o;a++){let i=t[a];typeof i=="string"?(X(i,n,"Partition key"," in the DataFrame."),s[a]=n[i]):s[a]=i.evaluate(n,e)}if(o===1){let a=s[0];for(let i=0;i<e;i++){let l=a[i],f=l==null?"":G(l),u=r.get(f);u===void 0&&(u=[],r.set(f,u)),u.push(i)}return r}for(let a=0;a<e;a++){let i=new Array(o);for(let u=0;u<o;u++){let c=s[u][a];i[u]=c==null?"":G(c)}let l=i.join("\0"),f=r.get(l);f===void 0&&(f=[],r.set(l,f)),f.push(a)}return r}function zo(n,e,t){let r=new Array(t);if(t===0)return r;let o=n._partitionBy||[],s=yi(e,t,o),a=n._evaluatePre(n._partitionOpsIndex,e,t);for(let i of s.values()){let l=i.length,f=new Array(l);for(let u=0;u<l;u++)f[u]=a[i[u]];if(n._evaluateWindow){for(let u=0;u<l;u++)r[i[u]]=n._evaluateWindow(f,i,u);continue}if(n._aggFn){let u=n._aggFn(f);for(let c=0;c<l;c++)r[i[c]]=u;continue}for(let u=0;u<l;u++)r[i[u]]=a[i[u]]}return n._evaluatePost(n._partitionOpsIndex,r,e)}function Wo(n){if(!Array.isArray(n)||n.length===0)return{columns:{},height:0};let e=n.length,t=new Set;for(let s=0;s<e;s++){let a=n[s];if(K(a)){let i=Object.keys(a);for(let l=0;l<i.length;l++)t.add(i[l])}}let r=Array.from(t),o={};for(let s=0;s<r.length;s++)o[r[s]]=new Array(e);for(let s=0;s<e;s++){let a=n[s]||{};for(let i=0;i<r.length;i++){let l=r[i],f=a[l];o[l][s]=f===void 0?null:f}}return{columns:o,height:e}}function Go(n,e){let t=Object.keys(n),r=new Array(e);for(let o=0;o<e;o++){let s={};for(let a=0;a<t.length;a++){let i=t[a],l=n[i][o];s[i]=l===void 0?null:l}r[o]=s}return r}function va(n,e,t){let r={};for(let o=0;o<t.length;o++){let s=t[o],a=n[s][e];r[s]=a===void 0?null:a}return r}function Ie(n){if(n.length===0)return j.Utf8;let e=!0,t=!0,r=!0,o=!0,s=!0,a=!0,i=!0,l=!0,f=!1,u=!1,c=[];for(let m=0;m<n.length;m++){let p=n[m];if(p!=null){if(u=!0,p instanceof Uint8Array||(i=!1),!E(p)||p instanceof Uint8Array)a=!1;else{let h=p,y=h.length;for(let d=0;d<y;d++)c.push(h[d])}U(p)&&(f=!0),typeof p!="boolean"&&(e=!1),typeof p!="bigint"&&(o=!1),typeof p!="number"?(r=!1,t=!1):Number.isInteger(p)||(t=!1),!U(p)&&(typeof p!="string"||isNaN(Date.parse(p)))&&(s=!1),(!K(p)||p instanceof Uint8Array)&&(l=!1)}}if(!u)return j.Null;if(i)return j.Binary;if(a){let m=Ie(c);return j.Array(m)}if(e)return j.Boolean;if(o)return j.Int64;if(r&&!t)return j.Float64;if(r&&t){let m=!0;for(let p=0;p<n.length;p++){let h=n[p];if(h!=null&&(h<-2147483648||h>2147483647)){m=!1;break}}return m?j.Int32:j.Float64}return s&&f?j.Datetime:l?j.Object:j.Utf8}function ft(n,e){let t=Object.keys(n),r=t.length,o=e.length,s={};for(let a=0;a<r;a++){let i=t[a],l=n[i],f=B(l)?new l.constructor(o):new Array(o);for(let u=0;u<o;u++)f[u]=l[e[u]];s[i]=f}return s}function Oe(n,e,t){let r=e.length;if(r===1)return G(n[e[0]][t]);let o=new Array(r);for(let s=0;s<r;s++)o[s]=G(n[e[s]][t]);return o.join("\0")}function je(n,e,t){let r=e.allocate?e.allocate(t):new Array(t);if(B(r)){let s=r;for(let a=0;a<t;a++){let i=e.coerce(n[a]);if(i==null){let l=new Array(t);for(let f=0;f<a;f++)l[f]=s[f];l[a]=null;for(let f=a+1;f<t;f++)l[f]=e.coerce(n[f]);return l}s[a]=i}}else for(let s=0;s<t;s++)r[s]=e.coerce(n[s]);return r}function Jo(n,e){if(n)if(typeof n=="string"){if(typeof Pe!="function")throw new Ae("File writing is not supported in this environment (missing require('fs')).");Pe("fs").writeFileSync(n,e,"utf8")}else if(K(n)&&typeof n.write=="function")n.write(e);else throw new v("Invalid file argument. Expected a file path string or a writable stream/object with a write method.")}function Yo(n,e,t,r,o,s,a={}){let{how:i="inner",join_nulls:l=!1,maintain_order:f}=a,u=(b,D,C)=>{if(!l){for(let O=0;O<D.length;O++)if(b[D[O]][C]==null)return null}return Oe(b,D,C)};if(i==="cross")return no(t,r);let c=new Map;for(let b=0;b<r;b++){let D=u(e,s,b);if(D===null)continue;let C=c.get(D);C===void 0&&(C=[],c.set(D,C)),C.push(b)}let m=[],p=[];if(i==="semi"||i==="anti"){for(let b=0;b<t;b++){let D=u(n,o,b),C=D===null?void 0:c.get(D),O=C!==void 0&&C.length>0;(i==="semi"&&O||i==="anti"&&!O)&&(m.push(b),p.push(null))}return{leftIndices:m,rightIndices:p}}let h=i==="outer"||i==="right",y=h?new Set:null;for(let b=0;b<t;b++){let D=u(n,o,b),C=D===null?void 0:c.get(D);if(C===void 0)(i==="left"||i==="outer")&&(m.push(b),p.push(null));else for(let O=0;O<C.length;O++){let N=C[O];h&&y.add(N),m.push(b),p.push(N)}}if(h)for(let b=0;b<r;b++)y.has(b)||(m.push(-1),p.push(b));let d=f||"none";if(d==="none"||d==="left")return{leftIndices:m,rightIndices:p};let g=m.length,_=new Int32Array(g);for(let b=0;b<g;b++)_[b]=b;let T=b=>m[b]===-1?Number.MAX_SAFE_INTEGER:m[b],A=b=>p[b]??Number.MAX_SAFE_INTEGER;d==="right"?_.sort((b,D)=>A(b)-A(D)||b-D):d==="left_right"?_.sort((b,D)=>T(b)-T(D)||A(b)-A(D)||b-D):d==="right_left"&&_.sort((b,D)=>A(b)-A(D)||T(b)-T(D)||b-D);let x=new Array(g),S=new Array(g);for(let b=0;b<g;b++){let D=_[b];x[b]=m[D],S[b]=p[D]}return{leftIndices:x,rightIndices:S}}function Ho(n,e,t,r,o,s,a,i,l={}){let f=l.strategy??"backward",u=l.allow_exact_matches??!0,c=l.check_sorted??!0;X(o,n,"Join on key"," in the left DataFrame."),X(s,e,"Join on key"," in the right DataFrame.");let m=n[o],p=e[s];if(c){let x=(S,b,D,C)=>{for(let O=1;O<b;O++){let N=M(S[O-1]),J=M(S[O]);if(F(N)&&F(J)&&J<N)throw new v(`${C} DataFrame key column "${D}" is not sorted in ascending order at row ${O}.`)}};x(m,t,o,"left"),x(p,r,s,"right")}let h=a.length>0,y=new Map;if(h)for(let x=0;x<r;x++){let S=Oe(e,i,x),b=y.get(S);b||(b=[],y.set(S,b)),b.push(x)}let d=new Array(r);if(!h)for(let x=0;x<r;x++)d[x]=x;let g=new Array(t),_=new Array(t),T=(x,S)=>{let b=S.length;if(b===0)return null;let D=(W,oe)=>M(p[oe])??NaN;if(f==="backward"){let W=Dt(S,x,{side:u?"right":"left",getValue:D})-1;return W>=0?S[W]:null}if(f==="forward"){let W=Dt(S,x,{side:u?"left":"right",getValue:D});return W<b?S[W]:null}let C=Dt(S,x,{side:"right",getValue:D}),O=C-1,N=C;if(u||(O>=0&&D(O,S[O])===x&&O--,N<b&&D(N,S[N])===x&&N++),O<0)return N<b?S[N]:null;if(N>=b)return O>=0?S[O]:null;let J=D(O,S[O]),Z=D(N,S[N]);return Math.abs(x-J)<=Math.abs(x-Z)?S[O]:S[N]},A=l.tolerance!==void 0?M(l.tolerance):null;for(let x=0;x<t;x++){g[x]=x;let S=M(m[x]);if(!F(S)){_[x]=null;continue}let b=h?y.get(Oe(n,a,x))||[]:d;if(b.length===0){_[x]=null;continue}let D=T(S,b);if(D!==null&&A!==null){let C=M(p[D]);(!F(A)||!F(C)||Math.abs(S-C)>A)&&(D=null)}_[x]=D}return{leftIndices:g,rightIndices:_}}function zn(n,e,t,r,o,s,a,i,l={}){let[f="",u="_right"]=l.suffixes||[],c=l.coalesce??!0,m=l.how||"inner",p=o.length,h={},y={},d=new Set(a),g=new Set(i),_=(D,C)=>{let O=C!==""?C:"_left",N=`${D}${O}`,J=1;for(;x.has(N);)N=`${D}${O}_${J++}`;return x.add(N),N},T=(D,C,O=-1)=>{let N=C.length,J=new Array(N);for(let Z=0;Z<N;Z++){let W=C[Z];J[Z]=W!==null&&W!==O?D[W]:null}return J},A=new Map;for(let D=0;D<a.length;D++)A.has(a[D])||A.set(a[D],i[D]);let x=new Set,S=Object.keys(n),b=Object.keys(e);for(let D=0;D<S.length;D++){let C=S[D];(!(C in e)||d.has(C)||g.has(C))&&x.add(C)}for(let D=0;D<S.length;D++){let C=S[D],O=d.has(C),N;C in e&&!O&&!g.has(C)?f!==""?(x.add(C),N=_(C,f)):x.has(C)?N=_(C,f):(N=C,x.add(C)):N=C;let J=n[C],Z=O?A.get(C):null,W=Z?e[Z]:null;if(O&&c){let oe=new Array(p);for(let le=0;le<p;le++){let yt=o[le],Le=s[le],bs=yt!==-1?J[yt]:null,xs=Le!==null&&W?W[Le]:null;oe[le]=bs??xs}h[N]=oe}else h[N]=T(J,o);t[C]?y[N]=t[C]:Z&&r[Z]&&(y[N]=r[Z])}if(m!=="semi"&&m!=="anti")for(let D=0;D<b.length;D++){let C=b[D];if(c&&g.has(C))continue;let O;x.has(C)?O=_(C,u):(O=C,x.add(C)),h[O]=T(e[C],s),r[C]&&(y[O]=r[C])}return V._createDirect(h,y,p)}var Bt=k(()=>{"use strict";We();De();q();Y()});function di(n,e){if(n==null)return null;let t=typeof n=="object"&&U(n)?n.getTime():n;return e(t)}function Xo(n,e,t){if(n==null||e==null)return null;let r=typeof n=="object"&&U(n)?n.getTime():n,o=typeof e=="object"&&U(e)?e.getTime():e;return t(r,o)}function _e(n,e,t){return n._isWindow?zo(n,e,t):n.evaluate(e,t)}var I,L,fe=k(()=>{"use strict";q();ye();Bt();I=n=>e=>{let t=e.length,r=new Array(t);for(let o=0;o<t;o++)r[o]=di(e[o],n);return r},L=(n,e,t)=>(r,o)=>{let s=r.length,a=n._resolve(e,o,s),i=new Array(s);if(E(a))for(let l=0;l<s;l++)i[l]=Xo(r[l],a[l],t);else for(let l=0;l<s;l++)i[l]=Xo(r[l],a,t);return i}});var w,$,ae=k(()=>{"use strict";Y();fe();w=(n,e)=>{let t=n.constructor,r=n._colNames||n._colName||"",o=new t(r);return Object.assign(o,n),o._ops=e?[...n._ops,e]:[...n._ops],o},$=class n{_ops=[];_outputName="";_isLiteral;_literalValue;_aggFn=null;_castType;_groupingOpsIndex;_partitionOpsIndex;_partitionBy=null;_evaluateWindow;_evaluatePost(e,t,r){let o=this._ops,s=e!==void 0?e:o.length,a=t;for(let i=s;i<o.length;i++)a=o[i](a,r);return a}_evaluatePre(e,t,r){let o=this._getInitialValue(t,r),s=this._ops,a=e!==void 0?e:s.length;for(let i=0;i<a;i++)o=s[i](o,t);return o}_getInitialValue(e,t){let r=this._colName;if(r&&r!=="*"&&!r.startsWith("*")&&!(r in e))throw new Te(r);return(r&&r!=="*"?e[r]:null)||new Array(t).fill(null)}_resolve(e,t,r){return e instanceof n?e._isLiteral&&e._ops.length===1?e._literalValue:_e(e,t,r):e}alias(e){let t=w(this);return t._outputName=e,t}cast(e){let t=w(this,I(r=>e.coerce(r)));return t._castType=e,t}debug(e){return w(this,t=>(console.log(`[DEBUG] ${e?e+": ":""}`,t),t))}evaluate(e,t){return this._evaluatePre(void 0,e,t)}}});var $t,Wn=k(()=>{"use strict";ae();fe();q();$t=class extends ${abs(){return w(this,I(Math.abs))}acos(){return w(this,I(e=>e<-1||e>1?null:Math.acos(e)))}acosh(){return w(this,I(e=>e<1?null:Math.acosh(e)))}add(e){return w(this,L(this,e,(t,r)=>t+r))}asin(){return w(this,I(e=>e<-1||e>1?null:Math.asin(e)))}asinh(){return w(this,I(Math.asinh))}atan(){return w(this,I(Math.atan))}atan2(e){return w(this,L(this,e,Math.atan2))}atanh(){return w(this,I(e=>e<=-1||e>=1?null:Math.atanh(e)))}cbrt(){return w(this,I(Math.cbrt))}ceil(){return w(this,I(Math.ceil))}clip(e=null,t=null){return w(this,I(r=>pe(r,{min:e,max:t})))}copysign(e){return w(this,L(this,e,(t,r)=>Math.abs(t)*(r>=0?1:-1)))}cos(){return w(this,I(Math.cos))}cosh(){return w(this,I(Math.cosh))}degrees(){return w(this,I(e=>e*(180/Math.PI)))}div(e){return w(this,L(this,e,(t,r)=>r===0?null:t/r))}exp(){return w(this,I(Math.exp))}expm1(){return w(this,I(Math.expm1))}floor(){return w(this,I(Math.floor))}floordiv(e){return w(this,L(this,e,(t,r)=>r===0?null:Math.floor(t/r)))}hypot(e){return w(this,L(this,e,Math.hypot))}log(e=Math.E){return w(this,I(t=>t<=0?null:e===Math.E?Math.log(t):Math.log(t)/Math.log(e)))}log1p(){return w(this,I(e=>e<=-1?null:Math.log1p(e)))}mod(e){return w(this,L(this,e,(t,r)=>r===0?null:t%r))}mul(e){return w(this,L(this,e,(t,r)=>t*r))}negate(){return w(this,I(e=>-e))}pow(e){return w(this,L(this,e,Math.pow))}radians(){return w(this,I(e=>e*(Math.PI/180)))}rand(e,{min:t=0,max:r=1,integer:o=!1}={}){return w(this,s=>{let a=s.length,i=new Float64Array(a),l=e!==void 0?zr(e):Math.random,f=r-t;for(let u=0;u<a;u++){let c=l();i[u]=o?Math.floor(c*(f+1))+t:c*f+t}return i})}round(e=0){return w(this,I(t=>fn(t,e)))}round_sig_figs(e){return w(this,I(t=>F(t)?Number(t.toPrecision(e)):t))}sign(){return w(this,I(Math.sign))}sin(){return w(this,I(Math.sin))}sinh(){return w(this,I(Math.sinh))}sqrt(){return w(this,I(e=>e<0?null:Math.sqrt(e)))}sub(e){return w(this,L(this,e,(t,r)=>t-r))}tan(){return w(this,I(Math.tan))}tanh(){return w(this,I(Math.tanh))}trunc(){return w(this,I(Math.trunc))}}});var qt,Gn=k(()=>{"use strict";ae();fe();q();qt=class extends ${and(e){return w(this,(t,r)=>{let o=t.length,s=this._resolve(e,r,o),a=E(s),i=new Array(o);for(let l=0;l<o;l++){let f=t[l],u=a?s[l]:s;f===!1||u===!1?i[l]=!1:f==null||u==null?i[l]=null:i[l]=!0}return i})}not(){return w(this,I(e=>!e))}or(e){return w(this,(t,r)=>{let o=t.length,s=this._resolve(e,r,o),a=E(s),i=new Array(o);for(let l=0;l<o;l++){let f=t[l],u=a?s[l]:s;f===!0||u===!0?i[l]=!0:f==null||u==null?i[l]=null:i[l]=!1}return i})}xor(e){return w(this,L(this,e,(t,r)=>!!t!=!!r))}}});function Zo(n,e,t,r){let o=n.length,s=new Array(o);if(t&&typeof t=="object"&&"evaluate"in t){let a=t.evaluate(e,o);for(let i=0;i<o;i++){let l=n[i];if(l==null)s[i]=null;else{let f=a[i],u=new Set;if(E(f)){let m=f.length;for(let p=0;p<m;p++)u.add(G(f[p]))}else u.add(G(f));let c=u.has(G(l));s[i]=r?!c:c}}}else{let a=E(t)?t:[],i=new Set,l=a.length;for(let f=0;f<l;f++)i.add(G(a[f]));for(let f=0;f<o;f++){let u=n[f];if(u==null)s[f]=null;else{let c=i.has(G(u));s[f]=r?!c:c}}}return s}function Qo(n,e){let{frequencies:t}=Se(n,{strict:!0}),r=n.length,o=new Array(r);for(let s=0;s<r;s++){let a=t.get(n[s])||0;o[s]=e?a>1:a===1}return o}function es(n,e,t){let r=n.length,o=new Array(r);if(E(e))for(let s=0;s<r;s++){let a=n[s],i=e[s];a==null&&i==null?o[s]=!t:a==null||i==null?o[s]=t:o[s]=t?a!==i:a===i}else for(let s=0;s<r;s++){let a=n[s];a==null&&e==null?o[s]=!t:a==null||e==null?o[s]=t:o[s]=t?a!==e:a===e}return o}var Kt,Jn=k(()=>{"use strict";ae();fe();q();Kt=class extends ${between(e,t,r="both"){return w(this,(o,s)=>{let a=o.length,i=this._resolve(e,s,a),l=this._resolve(t,s,a),f=new Array(a),u=E(i),c=E(l);for(let m=0;m<a;m++){let p=o[m],h=u?i[m]:i,y=c?l[m]:l;if(p==null||h==null||y==null)f[m]=null;else{let d=r==="both"||r==="left"?p>=h:p>h,g=r==="both"||r==="right"?p<=y:p<y;f[m]=d&&g}}return f})}eq(e){return w(this,L(this,e,(t,r)=>t===r))}eq_missing(e){return w(this,(t,r)=>{let o=this._resolve(e,r,t.length);return es(t,o,!1)})}ge(e){return w(this,L(this,e,(t,r)=>t>=r))}gt(e){return w(this,L(this,e,(t,r)=>t>r))}has_nulls(){return this._deriveAgg(e=>{for(let t=0;t<e.length;t++)if(e[t]==null)return!0;return!1})}is_close(e,{abs_tol:t=1e-8,rel_tol:r=1e-8,nans_equal:o=!1}={}){return w(this,(s,a)=>{let i=s.length,l=this._resolve(e,a,i),f=E(l),u=new Array(i);for(let c=0;c<i;c++){let m=s[c],p=f?l[c]:l;if(m==null||p==null)u[c]=null;else if(F(m)&&F(p)){let h=Math.abs(m-p),y=Math.max(r*Math.max(Math.abs(m),Math.abs(p)),t);u[c]=h<=y}else Number.isNaN(m)&&Number.isNaN(p)?u[c]=o:u[c]=m===p}return u})}is_duplicated(){return w(this,e=>Qo(e,!0))}is_empty({ignoreNulls:e=!1}={}){return w(this,I(t=>typeof t=="string"?t.length===0:E(t)?e?Q(t,"nullish",{mode:"every"}):t.length===0:null))}is_finite(){return w(this,I(Number.isFinite))}is_in(e){return w(this,(t,r)=>Zo(t,r,e,!1))}is_infinite(){return w(this,I(e=>e===1/0||e===-1/0))}is_nan(){return w(this,I(Number.isNaN))}is_not_nan(){return w(this,I(e=>!Number.isNaN(e)))}is_not_null(){return w(this,e=>{let t=e.length,r=new Array(t);for(let o=0;o<t;o++)r[o]=e[o]!=null;return r})}is_null(){return w(this,e=>{let t=e.length,r=new Array(t);for(let o=0;o<t;o++)r[o]=e[o]==null;return r})}is_unique(){return w(this,e=>Qo(e,!1))}le(e){return w(this,L(this,e,(t,r)=>t<=r))}lt(e){return w(this,L(this,e,(t,r)=>t<r))}ne(e){return w(this,L(this,e,(t,r)=>t!==r))}ne_missing(e){return w(this,(t,r)=>{let o=this._resolve(e,r,t.length);return es(t,o,!0)})}not_in(e){return w(this,(t,r)=>Zo(t,r,e,!0))}}});var Yn,zt,Hn=k(()=>{"use strict";ae();fe();q();Yn=class{constructor(e){this.expr=e}expr;_deriveString(e){return w(this.expr,I(t=>e(String(t))))}_patternGuard(e,t){return e==null?w(this.expr,r=>new Array(r.length).fill(null)):t()}concat(e){return w(this.expr,L(this.expr,e,(t,r)=>String(t)+String(r)))}contains(e){return this._patternGuard(e,()=>this._deriveString(t=>xe(e)?e.test(t):t.includes(e)))}count_matches(e){return this._patternGuard(e,()=>this._deriveString(t=>{if(xe(e)){let r=e.global?e:new RegExp(e.source,e.flags+"g"),o=t.match(r);return o?o.length:0}else{let r=0,o=t.indexOf(e);for(;o!==-1;)r++,o=t.indexOf(e,o+e.length);return r}}))}decode_uri_component(){return this._deriveString(e=>{try{return decodeURIComponent(e)}catch{return e}})}encode_uri_component(){return this._deriveString(e=>{try{return encodeURIComponent(e)}catch{return e}})}ends_with(e){return this._deriveString(t=>t.endsWith(e))}explode(){return this._deriveString(e=>e.split(""))}extract(e,t=0){return this._patternGuard(e,()=>this._deriveString(r=>{let o=r.match(e);return o&&o[t]!==void 0?o[t]:null}))}len(){return this.len_chars()}len_bytes(){return this._deriveString(e=>new TextEncoder().encode(e).length)}len_chars(){return this._deriveString(e=>e.length)}lower(){return this._deriveString(e=>e.toLowerCase())}lpad(e,t=" "){return this._deriveString(r=>r.padStart(e,t))}pad_end(e,t=" "){return this.rpad(e,t)}pad_start(e,t=" "){return this.lpad(e,t)}replace(e,t){return this._patternGuard(e,()=>this._deriveString(r=>r.replace(e,t)))}replace_all(e,t){return this._patternGuard(e,()=>this._deriveString(r=>r.replaceAll(e,t)))}reverse(){return this._deriveString(e=>e.split("").reverse().join(""))}rpad(e,t=" "){return this._deriveString(r=>r.padEnd(e,t))}slice(e,t){return this._deriveString(r=>{let o=e<0?r.length+e:e,s=t!==void 0?o+t:void 0;return r.slice(o,s)})}split(e){return this._deriveString(t=>t.split(e))}starts_with(e){return this._deriveString(t=>t.startsWith(e))}strip_chars(e,t){return this._deriveString(r=>qe(r,e,{mode:"both",...t}))}strip_chars_end(e,t){return this._deriveString(r=>qe(r,e,{mode:"end",...t}))}strip_chars_start(e,t){return this._deriveString(r=>qe(r,e,{mode:"start",...t}))}strip_prefix(e){return this._deriveString(t=>qe(t,e,{mode:"start",maxScanStart:1,maxMatchesStart:1,returnStringOnNull:!0,stringOptions:{literal:!0}}))}strip_suffix(e){return this._deriveString(t=>qe(t,e,{mode:"end",maxScanEnd:1,maxMatchesEnd:1,returnStringOnNull:!0,stringOptions:{literal:!0}}))}strptime(e){return this._deriveString(t=>yo(t,e))}to_camelcase(){return this._deriveString(e=>nt(e,{format:"camel"}))}to_date(){return this._deriveString(e=>H(e,{dateOnly:!0}))}to_datetime(){return this._deriveString(H)}to_decimal(e,t){return this._deriveString(r=>xt(r,{precision:e,scale:t}))}to_integer(){return this._deriveString(e=>de(e))}to_kebabcase(){return this._deriveString(e=>nt(e,{format:"kebab"}))}to_lowercase(){return this.lower()}to_pascalcase(){return this._deriveString(e=>nt(e,{format:"pascal"}))}to_snakecase(){return this._deriveString(e=>nt(e,{format:"snake"}))}to_time(){return this._deriveString(It)}to_titlecase(){return this._deriveString(e=>e.replace(/\b\w/g,t=>t.toUpperCase()))}to_uppercase(){return this.upper()}trim(){return this.strip_chars()}trim_end(){return this.strip_chars_end()}trim_start(){return this.strip_chars_start()}upper(){return this._deriveString(e=>e.toUpperCase())}zfill(e){return this._deriveString(t=>t.padStart(e,"0"))}},zt=class extends ${get str(){return new Yn(this)}}});var Wt,Xn=k(()=>{"use strict";ae();fe();Y();q();Wt=class extends ${_deriveAgg(e){let t=w(this);return t._aggFn=e,t._groupingOpsIndex=this._ops.length,t._partitionOpsIndex=this._ops.length,t}_deriveAggBinary(e,t){return w(this,L(this,e,(r,o)=>[r,o]))._deriveAgg(t)}all(){return this._deriveAgg(e=>Q(e,t=>!!t,{mode:"every"}))}all_null(){return this._deriveAgg(e=>Q(e,"nullish",{mode:"every"}))}any(){return this._deriveAgg(e=>Q(e,t=>!!t,{mode:"some"}))}any_null(){return this._deriveAgg(e=>Q(e,"nullish",{mode:"some"}))}avg(){return this._deriveAgg(e=>P(e).mean)}corr(e){return this._deriveAggBinary(e,t=>mn(t)?.correlation??null)}count(e={}){return e.includeNulls?this._deriveAgg(t=>t.length):this._deriveAgg(t=>P(t).count)}cov(e){return this._deriveAggBinary(e,t=>mn(t)?.covariance??null)}dot(e){return this._deriveAggBinary(e,t=>eo(t))}first(){return this._deriveAgg(e=>e[0]??null)}implode(){return this._deriveAgg(e=>e)}last(){return this._deriveAgg(e=>e[e.length-1]??null)}max(){return this._deriveAgg(e=>P(e).max)}mean(){return this.avg()}median(){return this._deriveAgg(e=>$e(e))}min(){return this._deriveAgg(e=>P(e).min)}mode(){return this._deriveAgg(e=>At(e))}n_unique(e={}){return this._deriveAgg(t=>Se(t,e).count)}null_count(){return this._deriveAgg(e=>P(e).nullCount)}quantile(e){if(e<0||e>1)throw new ie("Quantile q must be between 0 and 1");return this._deriveAgg(t=>St(t,e))}spearman_corr(e){return this._deriveAggBinary(e,t=>Qr(t))}std(){return this._deriveAgg(e=>P(e).std)}sum(){return this._deriveAgg(e=>P(e).sum)}w_avg(e){return this._deriveAggBinary(e,t=>to(t))}}});function Zn(n,e,t={}){if(e==null)return null;let r=t.dense?"_denseRankCache":"_rankCache",o=n[r];if(!o){let s=n;if(t.ignoreNulls){s=[];let l=n.length;for(let f=0;f<l;f++)n[f]!=null&&s.push(n[f])}t.dense&&(s=Array.from(new Set(s)));let a=et(s);o=new Map;let i=a.length;for(let l=0;l<i;l++){let f=a[l];o.has(f)||o.set(f,l+1)}n[r]=o}return o.get(e)??null}var Gt,Qn=k(()=>{"use strict";ae();q();Gt=class extends ${_partitionBy=this._partitionBy||null;_window(e){let t=w(this);return t._partitionOpsIndex=this._ops.length,t._groupingOpsIndex=this._ops.length,t._evaluateWindow=e,t}_rolling(e,t){return this._window(function(r,o,s){let a=Math.max(0,s-e+1),i=s+1,l=r.slice(a,i);return t(l)})}_cum(e,t,r,o){return this._window(function(s,a,i){let l=t,f=!1,u=e?i:0,c=e?s.length-1:i;for(let m=u;m<=c;m++){let p=s[m];p!=null&&(l=r(l,p),f=!0)}return o?o(l,f):l})}get _isWindow(){return this._partitionBy!==null||this._evaluateWindow!==void 0||this._aggFn!==null}cum_count(e=!1){return this._cum(e,0,t=>t+1)}cum_max(e=!1){return this._cum(e,null,(t,r)=>t===null||r>t?r:t)}cum_min(e=!1){return this._cum(e,null,(t,r)=>t===null||r<t?r:t)}cum_prod(e=!1){return this._cum(e,1,(t,r)=>t*r,(t,r)=>r?t:null)}cum_sum(e=!1){return this._cum(e,0,(t,r)=>t+r)}dense_rank(){return this._window(function(e,t,r){return Zn(e,e[r],{dense:!0})})}lag(e=1,t=null){return this._window(function(r,o,s){let a=t;return s-e>=0&&(a=r[s-e]),a})}lead(e=1,t=null){return this._window(function(r,o,s){let a=t;return s+e<r.length&&(a=r[s+e]),a})}over(e){let t=w(this),r=Array.isArray(e)?e:[e];return t._partitionBy=r,t}rank(){return this._window(function(e,t,r){return Zn(e,e[r])})}rolling_max(e){return this._rolling(e,t=>P(t).max)}rolling_mean(e){return this._rolling(e,t=>P(t).mean)}rolling_median(e){return this._rolling(e,t=>$e(t))}rolling_min(e){return this._rolling(e,t=>P(t).min)}rolling_quantile(e,t){return this._rolling(t,r=>St(r,e))}rolling_rank(e){return this._rolling(e,t=>Zn(t,t[t.length-1],{ignoreNulls:!0}))}rolling_std(e){return this._rolling(e,t=>P(t).std)}rolling_sum(e){return this._rolling(e,t=>P(t).sum)}row_number(){let e=this._window(function(t,r,o){return o+1});return e._outputName="row_number",e}}});var er,Jt,tr=k(()=>{"use strict";ae();fe();q();be();Y();er=class{constructor(e){this.expr=e}expr;_deriveArray(e){return w(this.expr,I(t=>E(t)?e(t):null))}all(){return this._deriveArray(e=>Q(e,t=>!!t,{mode:"every"}))}any(){return this._deriveArray(e=>Q(e,t=>!!t,{mode:"some"}))}contains(e){return this._deriveArray(t=>t.includes(e))}contains_all(e){return this._deriveArray(t=>Q(e,r=>t.includes(r),{mode:"every"}))}contains_any(e){return this._deriveArray(t=>Q(e,r=>t.includes(r),{mode:"some"}))}count_matches(e,t={}){return this._deriveArray(r=>Se(r,t).frequencies.get(e)??0)}filter(e){return w(this.expr,(t,r)=>{let o=t.length,s=new Array(o),a=Object.create(r);for(let i=0;i<o;i++){let l=t[i];if(!E(l)){s[i]=null;continue}let f=l.length;a[Ye]=l;let u=_e(e,a,f),c=[];if(E(u)){let m=Math.min(f,u.length);for(let p=0;p<m;p++)u[p]&&c.push(l[p])}else if(u)for(let m=0;m<f;m++)c.push(l[m]);s[i]=c}return s})}explode({empty_as_null:e=!0,keep_nulls:t=!0}={}){return w(this.expr,r=>{let o=r.length,s=0;for(let f=0;f<o;f++){let u=r[f];if(E(u)){s+=u.length||(e?1:0);continue}if(u!=null){s+=1;continue}t&&(s+=1)}let a=new Array(s),i=new Int32Array(s),l=0;for(let f=0;f<o;f++){let u=r[f];if(E(u)){let c=u.length;if(c>0){for(let m=0;m<c;m++)i[l]=f,a[l++]=u[m];continue}e&&(i[l]=f,a[l++]=null);continue}if(u!=null){i[l]=f,a[l++]=u;continue}t&&(i[l]=f,a[l++]=null)}return a.rowMap=i,a})}first(e=!0){return this.get(0,e)}gather(e,t=!0){return this._deriveArray(r=>{let o=typeof e=="number"?[e]:e,s=o.length,a=new Array(s);for(let i=0;i<s;i++)a[i]=wt(r,o[i],t);return a})}gather_every(e={}){return this._deriveArray(t=>Yr(t,e))}get(e,t=!0){return this._deriveArray(r=>wt(r,e,t))}join(e=",",t={}){return this._deriveArray(r=>Hr(r,e,t))}last(e=!0){return this.get(-1,e)}len(){return this.lengths()}lengths(){return this._deriveArray(e=>e.length)}max(){return this._deriveArray(e=>P(e).max)}max_index(){return this._deriveArray(e=>P(e).maxIdx)}mean(){return this._deriveArray(e=>P(e).mean)}median(){return this._deriveArray(e=>$e(e))}min(){return this._deriveArray(e=>P(e).min)}min_index(){return this._deriveArray(e=>P(e).minIdx)}mode(){return this._deriveArray(e=>At(e))}n_unique(e={}){return this._deriveArray(t=>Se(t,e).count)}reverse(){return this._deriveArray(e=>e.slice().reverse())}shift(e=1){return this._deriveArray(t=>Zr(t,e))}slice(e,t){return this._deriveArray(r=>r.slice(e,t))}splice(e,t,...r){return this._deriveArray(o=>{let s=[...o];return s.splice(e,t??s.length,...r),s})}sort(e){return this._deriveArray(t=>et(t,e))}std(){return this._deriveArray(e=>P(e).std)}sum(){return this._deriveArray(e=>P(e).sum)}to_struct({upper_bound:e,fields:t}={}){return w(this.expr,r=>{let o=r.length,s=new Array(o),a=0;if(Array.isArray(t))a=t.length;else if(typeof e=="number")a=e;else for(let l=0;l<o;l++){let f=r[l];E(f)&&f.length>a&&(a=f.length)}if(a===0)throw new ie("to_struct cannot be evaluated: struct width is 0. Provide an upper_bound, non-empty fields names, or non-empty lists.");let i=new Array(a);for(let l=0;l<a;l++)typeof t=="function"?i[l]=t(l):i[l]=(Array.isArray(t)?t[l]:null)??`field_${l}`;for(let l=0;l<o;l++){let f=r[l];if(!E(f)){s[l]=null;continue}let u={};for(let c=0;c<a;c++)u[i[c]]=wt(f,c,!0);s[l]=u}return s})}unique(e={}){return this._deriveArray(t=>Se(t,e).values)}variance(){return this._deriveArray(e=>P(e).variance)}eval(e){return w(this.expr,(t,r)=>{let o=t.length,s=new Array(o);for(let a=0;a<o;a++){let i=t[a];if(!E(i)){s[a]=null;continue}let l=i.length,f={...r,[Ye]:i};if(e._aggFn!=null&&(e._partitionBy==null||e._partitionBy.length===0)){let c=e._groupingOpsIndex!==void 0?e._groupingOpsIndex:e._ops.length,m=e._evaluatePre(c,f,l),p=e._aggFn(Array.from(m));s[a]=e._evaluatePost(c,[p],f)}else s[a]=_e(e,f,l)}return s})}},Jt=class extends ${get arr(){return new er(this)}}});function ts(n){return Pt(n,"Column reference cannot be null or undefined."),Yt||(Yt=(ue(),yr(ns)).ColumnExpr),Yt.isColExpr(n)?n:new Yt(n)}var Yt,nr,Ht,rr=k(()=>{"use strict";ae();Y();Yt=null;nr=class{constructor(e){this.expr=e;return new Proxy(this,{get(t,r,o){return r in t?Reflect.get(t,r,o):typeof r=="string"?t.field(r):Reflect.get(t,r,o)}})}expr;field(e){return w(this.expr,t=>{let r=t.length,o=new Array(r);for(let s=0;s<r;s++){let a=t[s];o[s]=a!=null&&typeof a=="object"?a[e]:null}return o}).alias(e)}rename_fields(e){return w(this.expr,t=>{let r=t.length,o=new Array(r),s=Object.keys(e),a=s.length;for(let i=0;i<r;i++){let l=t[i];if(l==null||typeof l!="object"){o[i]=null;continue}let f={},u=Object.keys(l),c=u.length;for(let m=0;m<c;m++){let p=u[m];f[p]=l[p]}for(let m=0;m<a;m++){let p=s[m];if(p in f){let h=e[p];f[h]=f[p],delete f[p]}}o[i]=f}return o})}with_fields(e){return w(this.expr,(t,r)=>{let o=t.length,s=new Array(o),a=[];if(Array.isArray(e)){let f=e.length;for(let u=0;u<f;u++){let c=e[u],m=ts(c),p=m._outputName||m._colName;if(!p)throw new v("Expressions passed to struct.with_fields must have a name/alias.");a.push({name:p,expr:m})}}else if(e&&typeof e=="object"){let f=Object.keys(e),u=f.length;for(let c=0;c<u;c++){let m=f[c],p=ts(e[m]);a.push({name:m,expr:p})}}let i=a.length,l=new Array(i);for(let f=0;f<i;f++)l[f]=a[f].expr.evaluate(r,o);for(let f=0;f<o;f++){let u=t[f];if(u==null||typeof u!="object"){s[f]=null;continue}let c={},m=Object.keys(u),p=m.length;for(let h=0;h<p;h++){let y=m[h];c[y]=u[y]}for(let h=0;h<i;h++)c[a[h].name]=l[h][f];s[f]=c}return s})}unnest(){let e=w(this.expr);return e.isUnnest=!0,e.baseExpr=this.expr,e}},Ht=class extends ${get struct(){return new nr(this)}}});var Xt,rs=k(()=>{"use strict";ae();q();Y();Xt=class extends ${fill_null({value:e=void 0,strategy:t=void 0,limit:r=void 0}={}){return w(this,(o,s)=>{let a=o.length,i=Array.from(o);if(t!==void 0)if(t==="zero"||t==="one"||t==="min"||t==="max"||t==="mean"){let l;t==="zero"?l=0:t==="one"?l=1:l=P(o)[t],ke(i,l,{mode:"constant",condition:f=>f==null})}else if(t==="forward"||t==="backward"){let l=t==="forward",f=null,u=0;ke(i,null,{mode:"independent",reverse:!l,step:({originalValue:c})=>c!=null?(f=c,u=0,c):f!==null&&(r===void 0||u<r)?(u++,f):null})}else throw new v(`Unsupported fill_null strategy: "${t}"`);else{let l=this._resolve(e,s,a),f=E(l);ke(i,null,{mode:"independent",step:({index:u,originalValue:c})=>c??(f?l[u]:l)})}return i})}reverse(){return w(this,e=>e.slice().reverse())}}});var ns={};hr(ns,{ColumnExpr:()=>R,resolveColumnSelectors:()=>Ve});function gi(n,e){for(let t of e)for(let r of Object.getOwnPropertyNames(t.prototype))r!=="constructor"&&Object.defineProperty(n.prototype,r,Object.getOwnPropertyDescriptor(t.prototype,r)||Object.create(null))}function _i(n,e,t,r){if(!(n instanceof R)){if(K(n)&&"evaluate"in n&&!n._colName){let o=[];for(let s=0;s<e.length;s++)t.has(e[s])||o.push(e[s]);return o}return null}if(n._colNames&&n._colNames.length>0)return n._colNames;if(n._colName==="*"){let o=new Set(n._excludedCols),s=[];for(let a=0;a<e.length;a++){let i=e[a];!o.has(i)&&!t.has(i)&&s.push(i)}return s}if(n._targetType||n._targetTypes&&n._targetTypes.length>0){if(!r)throw new Fe("Cannot resolve DataType column selector without DataFrame schema.");let o=[];for(let s=0;s<e.length;s++){let a=e[s];if(t.has(a))continue;let i=r[a];if(i){if(n._targetType)i.matches(n._targetType)&&o.push(a);else if(n._targetTypes){for(let l=0;l<n._targetTypes.length;l++)if(i.matches(n._targetTypes[l])){o.push(a);break}}}}return o}return null}function Ve(n,e,t,r,o){let s=[],a=t?new Set(t):new Set;for(let i=0;i<n.length;i++){let l=n[i];if(typeof l=="string"){s.push(new R(l));continue}if(K(l)&&l.isUnnest){let u=[],c=l._colName;if(typeof c=="string"&&r&&r[c]&&r[c].name==="Struct"&&(u=Object.keys(r[c].fields)),u.length===0&&o){let h=Object.keys(o)[0],y=h?o[h].length:0,d=l.baseExpr.evaluate(o,y),g=d.length;for(let _=0;_<g;_++){let T=d[_];if(T!=null&&typeof T=="object"){u=Object.keys(T);break}}}let m=u.length;if(m>0){for(let p=0;p<m;p++){let h=u[p],y=l.baseExpr.struct.field(h);s.push(y)}continue}}let f=_i(l,e,a,r);if(f!==null)for(let u=0;u<f.length;u++){let c=new R(f[u]);c._ops=[...l._ops||[]],c._aggFn=l._aggFn,c._partitionOpsIndex=l._partitionOpsIndex,c._groupingOpsIndex=l._groupingOpsIndex,c._partitionBy=l._partitionBy,l._evaluateWindow&&(c._evaluateWindow=l._evaluateWindow),l._outputName&&l._outputName!=="*"&&(c._outputName=l._outputName),s.push(c)}else s.push(l)}return s}var R,ue=k(()=>{"use strict";ae();Wn();Jn();Xn();Qn();Hn();Gn();or();tr();rr();rs();q();De();Y();R=class n extends ${_colName="";_colNames;_excludedCols=[];_targetType;_targetTypes;static isColExpr(e){if(!K(e))return!1;try{return"evaluate"in e&&typeof e.evaluate=="function"}catch{return!1}}static toColExpr(e){return Pt(e,"Column reference cannot be null or undefined."),n.isColExpr(e)?e:new n(e)}constructor(e){super(),Array.isArray(e)?e.some(r=>r instanceof ne||typeof r=="function")?this._targetTypes=e:this._colNames=e.map(String):e instanceof ne||typeof e=="function"?this._targetType=e:(this._colName=String(e),this._outputName=this._colName)}};gi(R,[$t,Kt,Wt,Gt,zt,qt,Zt,Jt,Ht,Xt])});function Ge(n,e={strict:!0}){let t=e,r=new R(dr);return r._literalValue=n,t.name&&(r._outputName=t.name),r._ops.push(o=>{let s=o.length,a=(x,S)=>x===void 0?S:pe(x<0?s+x:x,{min:0,max:s}),i=a(t.startIndex,0),l=a(t.endIndex,s),f=Math.max(0,l-i),u=t.n!==void 0?t.n:f,c=t.strict!==!1;if(c){if(u!==s)throw new te(`Column height mismatch: seq_range length ${u} does not match DataFrame height ${s}`)}else{let x=t.pad??!1,S=t.truncate??!1;if(x&&!S&&u>f)throw new te(`Cannot pad seq_range output: specified length ${u} starting at index ${i} exceeds slice width ${f} (requires truncation).`);if(S&&!x&&u<f)throw new te(`Cannot truncate seq_range output: specified length ${u} starting at index ${i} is less than slice width ${f} (requires padding).`)}let m=s,p=!!t.dtype,h=t.mode||"cumulative",y=t.step!==void 0?t.step:1,d=p?x=>t.dtype.coerce(x):x=>x;if(c){let x=t.dtype?.allocate?t.dtype.allocate(m):new Array(m);return ke(x,n,{mode:h,step:y,coerce:d,startIndex:0,endIndex:m}),x}let g=Math.min(i+u,l),_=t.padValue!==void 0?t.padValue:null,T=d(_);if(h==="constant"&&i===0&&g===m&&!t.dtype){let x=new Array(m);for(let S=0;S<m;S++)x[S]=n;return x}let A=new Array(m);return A.fill(T),ke(A,n,{mode:h,step:y,coerce:d,startIndex:i,endIndex:g}),A}),r}var sr=k(()=>{"use strict";ue();be();Y();q()});function Je(n,e){let t=Ge(n,{strict:!0,mode:"constant",dtype:e?.dtype,name:e?.name});return t._isLiteral=!0,t}var Qt=k(()=>{"use strict";sr()});var os={};hr(os,{duration:()=>ir});function ir(n={}){let e=n.timeUnit??"ms",t=[],r=[[n.weeks,6048e5],[n.days,864e5],[n.hours,36e5],[n.minutes,6e4],[n.seconds,1e3],[n.milliseconds,1],[n.microseconds,.001],[n.nanoseconds,1e-6]];for(let[s,a]of r)if(s!=null){let i=F(s)?Je(s):R.toColExpr(s);t.push({expr:i,multiplier:a})}if(t.length===0)throw new v("At least one duration component must be specified for $df.duration().");let o=new R(br);return o._castType=new lt(e),o._ops.push((s,a)=>{let i=s?s.length:0;if(i===0&&a){let c=Object.keys(a)[0];c&&E(a[c])&&(i=a[c].length)}i===0&&(i=1);let l=new Float64Array(i),f=new Uint8Array(i);for(let c=0;c<t.length;c++){let{expr:m,multiplier:p}=t[c],h=_e(m,a,i);if(E(h)){let y=h,d=y.length;for(let g=0;g<i;g++){if(f[g]===1)continue;let _=M(g<d?y[g]:d===1?y[0]:null);_!=null?l[g]+=_*p:(f[g]=1,l[g]=0)}}else{let y=M(h);if(y!=null){let d=y*p;for(let g=0;g<i;g++)f[g]!==1&&(l[g]+=d)}else{f.fill(1),l.fill(0);break}}}let u=new Array(i);for(let c=0;c<i;c++)if(f[c]===1)u[c]=null;else{let m=Math.round(l[c]*1e6)/1e6;u[c]=$o(m,e)}return u}),o.alias("duration")}var ar=k(()=>{"use strict";ue();Qt();be();fe();ct();Y();q()});var lr,Zt,or=k(()=>{"use strict";ct();Y();ae();fe();q();lr=class{constructor(e){this.expr=e}expr;_colTz(){let e=this.expr._castType;return e instanceof ge?e.timeZone:null}_colTu(){let e=this.expr._castType;return e instanceof ge?e.timeUnit:null}_deriveDate(e){return w(this.expr,I(t=>{let r=H(t);return r?e(r):null}))}cast_time_unit(e){return this.expr.cast(new ge(e,this._colTz()))}century(){return this._deriveDate(fo)}convert_time_zone(e){let t=this._colTz();if(this.expr._castType instanceof ge&&t===null)throw new v('convert_time_zone() requires a timezone-aware Datetime column. Use .dt.replace({ timeZone: "..." }) to assign a timezone first.');return this.expr.cast(new ge(this._colTu()??"ms",e))}date(){return this._deriveDate(e=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())))}day(e){let t=e||this._colTz()||"UTC";return this._deriveDate(r=>re(r,t).day)}days_in_month(e){let t=e||this._colTz()||"UTC";return this._deriveDate(r=>{let o=re(r,t),s=Et(ee(o.year,o.month-1,1),1,0);return s?s.getUTCDate():null})}epoch(e="ms"){return this._deriveDate(t=>co(t,e))}hour(e){let t=e||this._colTz()||"UTC";return this._deriveDate(r=>re(r,t).hour)}is_business_day(e={}){return this._deriveDate(t=>_o(t,e))}is_leap_year(){return this._deriveDate(_n)}iso_week(){return this._deriveDate(e=>dn(e,{field:"week"}))}iso_year(){return this._deriveDate(e=>dn(e,{field:"year"}))}microsecond(){return this.millisecond().mul(1e3)}millennium(){return this._deriveDate(mo)}millisecond(){return this._deriveDate(e=>e.getUTCMilliseconds())}minute(e){let t=e||this._colTz()||"UTC";return this._deriveDate(r=>re(r,t).minute)}month(e){let t=e||this._colTz()||"UTC";return this._deriveDate(r=>re(r,t).month)}month_end(){return this._deriveDate(e=>Et(e,1,0))}month_start(){return this._deriveDate(e=>Et(e,0,1))}nanosecond(){return this.millisecond().mul(1e6)}offset_day(e,t={}){let o=t?.excludeWeekdays?.length||t?.holidays||t?.roll?w(this.expr,L(this.expr,e,(a,i)=>{let l=H(a);return l?go(l,i,t):null})):e,{duration:s}=(ar(),yr(os));return this.expr.add(s({days:o}))}ordinal_day(){return this._deriveDate(gn)}quarter(){return this._deriveDate(po)}replace(e){return w(this.expr,I(t=>{let r=H(t);return r?bo(r,e):null}))}second(){return this._deriveDate(e=>e.getUTCSeconds())}strftime(e){let t=this._colTz(),r=t&&!e.timeZone?{...e,timeZone:t}:e;return this._deriveDate(o=>Ne(o,r))}time(){return this._deriveDate(e=>e.toISOString().split("T")[1].slice(0,12))}timestamp(e="ms"){return this.epoch(e)}total_days(){return this.expr.div(864e5)}total_hours(){return this.expr.div(36e5)}total_microseconds(){return this.expr.mul(1e3)}total_milliseconds(){return this.expr}total_minutes(){return this.expr.div(6e4)}total_nanoseconds(){return this.expr.mul(1e6)}total_seconds(){return this.expr.div(1e3)}utc_offset(e,t={}){return w(this.expr,I(r=>{let o=H(r);return o?xn(o,e,t):null}))}week(){return this.iso_week()}weekday(e){let t=e||this._colTz()||"UTC";return this._deriveDate(r=>re(r,t).dayOfWeek||7)}year(e){let t=e||this._colTz()||"UTC";return this._deriveDate(r=>re(r,t).year)}},Zt=class extends ${get dt(){return new lr(this)}}});function mt(){return new R("*")}var ss=k(()=>{"use strict";ue()});function is(n){let e=new R("*");return e._excludedCols=Array.isArray(n)?n:[n],e}var as=k(()=>{"use strict";ue()});function ls(...n){let e=n.length===1&&Array.isArray(n[0])?n[0]:n,t=new R(gr);return t._ops.push((r,o)=>{let s=r.length,a=u=>R.isColExpr(u)?u.evaluate(o,s):typeof u=="string"?o[u]||new Array(s).fill(null):u,i=e.length,l=new Array(i);for(let u=0;u<i;u++)l[u]=a(e[u]);let f=new Array(s);for(let u=0;u<s;u++){let c=null;for(let m=0;m<i;m++){let p=l[m],h=E(p)?p[u]:p;if(h!=null){c=h;break}}f[u]=c}return f}),t}var us=k(()=>{"use strict";ue();q();be()});function cs(n){return new cr(n)}var ur,cr,en,fs=k(()=>{"use strict";ue();q();ur=class{_predicates;_values;constructor(e,t){this._predicates=e,this._values=t}then(e){return new en(this._predicates,this._values.concat(e))}},cr=class{_predicates;constructor(e){this._predicates=[e]}then(e){return new en(this._predicates,[e])}},en=class n extends R{_predicates;_values;_otherwiseValue;constructor(e,t,r=null){super(typeof e=="string"?e:"*when*"),this._predicates=Array.isArray(e)?e:[],this._values=t||[],this._otherwiseValue=r,this._ops.push((o,s)=>{let a=o.length,i=p=>R.isColExpr(p)?p.evaluate(s,a):typeof p=="string"&&p in s?s[p]:p,l=this._predicates.length,f=new Array(l),u=new Array(l);for(let p=0;p<l;p++)f[p]=i(this._predicates[p]),u[p]=i(this._values[p]);let c=i(this._otherwiseValue),m=new Array(a);for(let p=0;p<a;p++){let h=!1;for(let y=0;y<l;y++)if((E(f[y])?f[y][p]:f[y])===!0){m[p]=E(u[y])?u[y][p]:u[y],h=!0;break}h||(m[p]=E(c)?c[p]:c)}return m})}when(e){return new ur(this._predicates.concat(e),this._values)}otherwise(e){return new n(this._predicates,this._values,e)}}});function ms(n){return R.toColExpr(n).implode()}var ps=k(()=>{"use strict";ue()});function hs(){return new R(Ye)}var ys=k(()=>{"use strict";ue();be()});function ds(n,...e){let t;Array.isArray(n)||n&&typeof n=="object"&&!R.isColExpr(n)?t=n:t=[n,...e];let r=Je({}).struct.with_fields(t);return delete r._isLiteral,delete r._literalValue,r._colName=_r,r.alias("struct")}var gs=k(()=>{"use strict";ue();Qt();be()});var pt=k(()=>{"use strict";be();xr();ae();Wn();Gn();Jn();Hn();Xn();Qn();or();tr();rr();ue();Qt();ss();as();us();fs();ps();sr();ys();gs();ar();fe()});var tn,_s=k(()=>{"use strict";We();Bt();pt();tn=class{_groups;_keys;_allKeys;_parentColumns;_parentHeight;_parentSchema;constructor(e,t,r,o,s,a){this._groups=e,this._keys=t,this._allKeys=r,this._parentColumns=o,this._parentHeight=s,this._parentSchema=a}to_dataframe(){let e=this._keys.length,t=new Array(e);for(let i=0;i<e;i++)t[i]=String(this._keys[i]);let r=this._groups.size,o={};for(let i=0;i<t.length;i++)o[t[i]]=new Array(r);let s=0;for(let i of this._groups.values()){if(i.length===0)continue;let l=i[0];for(let f=0;f<t.length;f++){let u=t[f],c=this._parentColumns[u][l];o[u][s]=c===void 0?null:c}s++}let a={};for(let i of t)a[i]=this._parentSchema[i];return V._createDirect(o,a,s)}agg(...e){let t=this._allKeys.length,r=new Array(t);for(let c=0;c<t;c++)r[c]=String(this._allKeys[c]);let o=this._keys.length,s=new Array(o);for(let c=0;c<o;c++)s[c]=String(this._keys[c]);let a=Ve(e.flat(),r,s,this._parentSchema,this._parentColumns),i=this._groups.size,l={};for(let c=0;c<s.length;c++)l[s[c]]=new Array(i);let f=0;for(let c of this._groups.values()){if(c.length===0)continue;let m=c[0];for(let p=0;p<s.length;p++){let h=s[p],y=this._parentColumns[h][m];l[h][f]=y===void 0?null:y}f++}for(let c=0;c<a.length;c++){let m=a[c],p=m._outputName||m._colName||"*";if(!m._aggFn)l[p]=m.evaluate(l,i);else{let h=m._evaluatePre(m._groupingOpsIndex,this._parentColumns,this._parentHeight),y=new Array(i),d=0;for(let g of this._groups.values()){if(g.length===0)continue;let _=new Array(g.length);for(let T=0;T<g.length;T++)_[T]=h[g[T]];y[d]=m._aggFn(_),d++}l[p]=m._evaluatePost(m._groupingOpsIndex,y,l)}}let u={};for(let c of s)u[c]=this._parentSchema[c];for(let c of a){let m=c._outputName||c._colName||"*";u[m]=Ie(l[m])}return V._createDirect(l,u,f)}}});function wi(n,e,t){if(n==null)throw new z(`Invalid input to ${e} at index ${t}: item cannot be null or undefined.`);if(n instanceof V)return[n];if(Ee(n))return[new V(n)];if(E(n)){if(Q(n,V,{mode:"every"}))return n;if(Q(n,"plainObject",{mode:"every"}))return[new V(n)];let r=Q(n,V,{mode:"some"});for(let o=0;o<n.length;o++)if(r?!(n[o]instanceof V):!Ee(n[o]))throw new z(r?`Invalid input to ${e} at index ${t}, sub-index ${o}: nested array must contain only DataFrame instances.`:`Invalid input to ${e} at index ${t}, row ${o}: rows must be plain objects.`)}throw new z(`Invalid input to ${e} at index ${t}: expected DataFrame, row array, or column dictionary.`)}function ht(n,{how:e="vertical",horizontal:t}={}){if(n==null)throw new z("Invalid input to concat: rawItems cannot be null or undefined.");let r=Array.isArray(n)?n:[n],o=[];for(let a=0;a<r.length;a++)o.push(...wi(r[a],"concat",a));let s=t?.strict??!0;if(o.length===0)return V._createDirect({},{},0);if(o.length===1&&e!=="horizontal")return o[0];switch(e){case"vertical":{let a=[];for(let h=0;h<o.length;h++)o[h].height>0&&a.push(o[h]);if(a.length===0)return V._createDirect({},{},0);let i=a[0],l=Object.keys(i._columns);for(let h=0;h<o.length;h++){let y=o[h];if(y.height===0)continue;let d=Object.keys(y._columns);if(l.length!==d.length)throw new z(`[Strict Vertical] Column count mismatch at index ${h}.`);for(let g=0;g<l.length;g++){if(l[g]!==d[g])throw new z(`[Strict Vertical] Schema mismatch at position ${g} in DF ${h}. Expected column "${l[g]}", but found "${d[g]}".`);let _=i.schema[l[g]],T=y.schema[l[g]];if(_&&T&&!_.equals(T))throw new Fe(`[Strict Type Check] Schema type mismatch for column "${l[g]}": expected ${_.name}, found ${T.name}.`)}}let f=0;for(let h of o)f+=h.height;let u={},c=o.length;for(let h=0;h<c;h++)if(o[h].height>0){u=o[h].schema;break}Object.keys(u).length===0&&c>0&&(u=o[0].schema);let m={};for(let h of l){let y=u[h],d=!1;for(let _ of o){let T=_._columns[h];if(!T){d=!0;break}if(!B(T)){for(let A=0;A<T.length;A++)if(T[A]==null){d=!0;break}}if(d)break}let g=y&&y.allocate?y.allocate(f):new Array(f).fill(null);d&&B(g)&&(g=new Array(f).fill(null)),m[h]=g}let p=0;for(let h of o){let y=h.height;if(y!==0){for(let d of l){let g=h._columns[d]||new Array(y).fill(null),_=m[d];if(B(_)&&B(g))_.set(g,p);else{let T=_;for(let A=0;A<y;A++)T[p+A]=g[A]}}p+=y}}return V._createDirect(m,u,f)}case"horizontal":{let a=o[0].height;for(let u=1;u<o.length;u++)o[u].height>a&&(a=o[u].height);let i=new Set;for(let u=0;u<o.length;u++){let c=o[u];if(s&&c.height!==a)throw new te(`[Horizontal] Row count mismatch at index ${u}. Expected ${a}, got ${c.height}. Set strict=false to allow padding.`);for(let m of Object.keys(c._columns)){if(i.has(m))throw new z(`[Horizontal] Duplicate column name "${m}" detected. Horizontal concat requires unique names.`);i.add(m)}}let l={},f={};for(let u of o){let c=u.height;Object.assign(f,u.schema);let m=Object.keys(u._columns),p=m.length;for(let h=0;h<p;h++){let y=m[h],d=u._columns[y];if(c===a)l[y]=B(d)?Array.from(d):d;else{let g=new Array(a);for(let _=0;_<c;_++)g[_]=d[_];for(let _=c;_<a;_++)g[_]=null;l[y]=g}}}return V._createDirect(l,f,a)}case"diagonal":{let a=new Set;for(let m of o)for(let p of Object.keys(m._columns))a.add(p);let i=Array.from(a),l=0;for(let m=0;m<o.length;m++)l+=o[m].height;let f={};for(let m of i){let p=null;for(let h of o){let y=h.schema[m];if(y){if(p===null)p=y;else if(!p.equals(y))throw new Fe(`[Strict Type Check] Schema type mismatch for column "${m}": expected ${p.name}, found ${y.name}.`)}}f[m]=p||j.Utf8}let u={};for(let m=0;m<i.length;m++)u[i[m]]=new Array(l).fill(null);let c=0;for(let m=0;m<o.length;m++){let p=o[m],h=p.height;if(h!==0){for(let y=0;y<i.length;y++){let d=i[y],g=u[d],_=p._columns[d];if(_!==void 0)if(B(_)&&B(g))g.set(_,c);else{let T=g;for(let A=0;A<h;A++)T[c+A]=_[A]}else{let T=g;for(let A=0;A<h;A++)T[c+A]=null}}c+=h}}return V._createDirect(u,f,l)}}}var fr=k(()=>{"use strict";We();De();q();Y()});var V,We=k(()=>{"use strict";pt();_s();kt();De();q();Y();fr();Bt();V=class n{_columns;_height;_schema={};static _createDirect(e,t,r){qn(e,r);let o=Object.create(n.prototype);return o._columns=e,o._schema=t,o._height=r,o}constructor(e,t,r){if(Array.isArray(e)){let{columns:o,height:s}=Wo(e);this._columns=o,this._height=s,t?this._applySchema(t):this._inferSchema();return}if(K(e)){this._columns=e,this._height=qn(e,r),t?this._applySchema(t):this._inferSchema();return}this._columns={},this._height=0,t?this._applySchema(t):this._schema={}}_inferSchema(){let e={},t=Object.keys(this._columns),r=t.length;for(let o=0;o<r;o++){let s=t[o];e[s]=Ie(this._columns[s])}this._applySchema(e)}_applySchema(e){this._schema=e;let t=Object.keys(e),r={};for(let o of t){let s=e[o],a=this._columns[o];r[o]=a?je(a,s,this._height):je(new Array(this._height).fill(null),s,this._height)}this._columns=r}get columns(){return Object.keys(this._columns)}concat(e,t={}){let r=Q(e,n,{mode:"every",allowEmpty:!1})?e:[e];return ht([this,...r],t)}drop(...e){let t=new Set(e.flat()),r={},o={};for(let s of Object.keys(this._columns))t.has(s)||(r[s]=this._columns[s],o[s]=this._schema[s]);return n._createDirect(r,o,this._height)}drop_nulls(e){return this._height===0?this:this.filter(e?new R(e).is_not_null():mt().is_not_null())}get dtypes(){let e=Object.keys(this._columns),t=e.length,r=new Array(t);for(let o=0;o<t;o++)r[o]=this._schema[e[o]];return r}explode(e,t){let r=R.toColExpr(e),o=r._colNames||[r._colName||r._outputName],s=new Set,a=o.length;for(let u=0;u<a;u++){let c=o[u];if(!c)throw new z("Expression passed to explode must have a column name.");X(c,this._columns,"Explode column"),s.add(c)}let i=Object.keys(this._columns),l=[],f=i.length;for(let u=0;u<f;u++){let c=i[u];l.push(s.has(c)?new R(c).arr.explode(t):new R(c))}return this.select(...l)}fill_null(e={}){return this._height===0?this:this.with_columns(mt().fill_null(e))}filter(...e){if(this._height===0)return n._createDirect({},this._schema,0);let t=this._height,r=Object.keys(this._columns),o=r.length,s=[],a=[],i=[],l=e.length;for(let d=0;d<l;d++){let g=e[d];typeof g=="function"?a.push(g):i.push(g)}let f=Ve(i,r,void 0,this._schema,this._columns),u=f.length;for(let d=0;d<u;d++)s.push(f[d].evaluate(this._columns,t));let c=[],m=0,p=null;if(a.length>0){let d=this._columns;p={};for(let g=0;g<o;g++){let _=r[g],T=d[_];Object.defineProperty(p,_,{get(){let A=T[m];return A===void 0?null:A},enumerable:!0,configurable:!0})}}for(let d=0;d<t;d++){let g=!0;for(let _=0;_<s.length;_++)if(!s[_][d]){g=!1;break}if(g){if(p){m=d;for(let _=0;_<a.length;_++)if(!a[_](p)){g=!1;break}}g&&c.push(d)}}let h=ft(this._columns,c),y=c.length;return n._createDirect(h,this._schema,y)}get_schema(){return this._schema}groupby(e){let t=Qe(e),r=new Map,o=this._height,s=we(e);for(let i=0;i<s.length;i++)X(s[i],this._columns,"Grouping key");for(let i=0;i<o;i++){let l=Oe(this._columns,s,i),f=r.get(l);f===void 0&&r.set(l,f=[]),f.push(i)}let a=Object.keys(this._columns);return new tn(r,t,a,this._columns,this._height,this._schema)}head(e=10){return this.limit(e,{offset:0,from:"start"})}clone(){let e={};for(let t of Object.keys(this._columns)){let r=this._columns[t];Array.isArray(r)||B(r)?e[t]=r.slice():e[t]=Array.prototype.slice.call(r)}return n._createDirect(e,{...this._schema},this._height)}get height(){return this._height}hstack(e,t={}){return this.concat(e,{how:"horizontal",horizontal:t})}insert_column(e,t,r){let o=R.toColExpr(r).alias(t),s=Object.keys(this._columns),a=s.length,i=[];for(let f=0;f<a;f++){let u=s[f];u!==t&&i.push(u)}let l=Math.max(0,Math.min(e,i.length));return i.splice(l,0,o),this.select(...i)}item(e,t){let r=this._height,o=Object.keys(this._columns),s=o.length;if(e===void 0&&t===void 0){if(r!==1||s!==1)throw new z("DataFrame.item() can only be called without arguments if the shape is (1, 1).");return this._columns[o[0]][0]}if(e===void 0||t===void 0)throw new z("DataFrame.item() requires both row and column to be specified if not empty.");if(e<0||e>=r)throw new te(`Row index ${e} is out of bounds for DataFrame height ${r}.`);let a;if(typeof t=="number"){if(t<0||t>=s)throw new te(`Column index ${t} is out of bounds for DataFrame width ${s}.`);a=o[t]}else if(a=t,this._columns[a]===void 0)throw new Te(a);return this._columns[a][e]}*iter_columns(){let e=Object.keys(this._columns),t=e.length,r=this._columns;for(let o=0;o<t;o++)yield r[e[o]]}*iter_rows({named:e=!1}={}){let t=Object.keys(this._columns),r=t.length,o=this._columns,s=this._height,a=new Array(r);for(let i=0;i<r;i++)a[i]=o[t[i]];if(e)for(let i=0;i<s;i++){let l={};for(let f=0;f<r;f++)l[t[f]]=a[f][i];yield l}else for(let i=0;i<s;i++){let l=new Array(r);for(let f=0;f<r;f++)l[f]=a[f][i];yield l}}join(e){let{other:t,on:r,leftOn:o,rightOn:s,how:a="inner",suffixes:i=["","_right"],join_nulls:l=!1,coalesce:f=!0,maintain_order:u="none"}=e;if(a==="cross"&&(r!==void 0||o!==void 0||s!==void 0))throw new v('Cannot specify "on", "leftOn", or "rightOn" when how is "cross". Cross joins produce a keyless Cartesian product.');if(r!==void 0&&(o!==void 0||s!==void 0))throw new v('Cannot specify both "on" and "leftOn"/"rightOn" in join(). Use either "on" or both "leftOn" and "rightOn".');if(o!==void 0&&s===void 0||o===void 0&&s!==void 0)throw new v('join() requires both "leftOn" and "rightOn" when specifying heterogeneous join keys.');if(a!=="cross"&&r===void 0&&o===void 0&&s===void 0)throw new v('join() requires either "on" or both "leftOn" and "rightOn" parameters.');let c=[],m=[];if(o!==void 0&&s!==void 0){if(c=we(o),m=we(s),c.length===0||m.length===0)throw new v('join() requires non-empty key arrays in "leftOn" and "rightOn".');if(c.length!==m.length)throw new v(`join() "leftOn" length (${c.length}) must match "rightOn" length (${m.length}).`)}else if(r!==void 0&&(c=we(r),m=c,c.length===0))throw new v('join() requires at least one key column in "on".');for(let g=0;g<c.length;g++)X(c[g],this._columns,"Join key"," in the left DataFrame."),X(m[g],t._columns,"Join key"," in the right DataFrame.");let h={...e,how:a,suffixes:i,join_nulls:l,coalesce:f,maintain_order:typeof u=="boolean"?u?"left":"none":u??"none"},{leftIndices:y,rightIndices:d}=Yo(this._columns,t._columns,this._height,t._height,c,m,h);return zn(this._columns,t._columns,this._schema,t._schema,y,d,c,m,{suffixes:i,coalesce:f,how:a})}join_asof(e){let{other:t,on:r,leftOn:o,rightOn:s,by:a,leftBy:i,rightBy:l,strategy:f="backward",tolerance:u,allow_exact_matches:c=!0,suffixes:m=["","_right"],coalesce:p=!0,check_sorted:h=!0}=e;if(!t||!(t instanceof n))throw new v("join_asof() requires a valid right DataFrame in the 'other' parameter.");let y=String(o??r??""),d=String(s??r??"");if(!y||!d)throw new v('join_asof() requires join key specified via "on", or "leftOn" and "rightOn".');let g=C=>C?Array.isArray(C)?C.map(String):[String(C)]:[],_=g(i??a),T=g(l??a);if(_.length!==T.length)throw new v('join_asof() "by" (or "leftBy" / "rightBy") key lists must have equal lengths.');for(let C=0;C<_.length;C++)X(_[C],this._columns,"Partition key"," in the left DataFrame."),X(T[C],t._columns,"Partition key"," in the right DataFrame.");let A={...e,strategy:f,tolerance:u,allow_exact_matches:c,suffixes:m,coalesce:p,check_sorted:h},{leftIndices:x,rightIndices:S}=Ho(this._columns,t._columns,this._height,t._height,y,d,_,T,A),b=[y,..._],D=[d,...T];return zn(this._columns,t._columns,this._schema,t._schema,x,S,b,D,{suffixes:m,coalesce:p,how:"left"})}limit(e,{offset:t=0,from:r="start"}={}){let o=this._height,s=pe(Math.floor(e),{min:0,max:o}),a=pe(Math.floor(t),{min:0,max:o}),i=a,l=Math.min(a+s,o);r==="end"&&(l=o-a,i=Math.max(l-s,0));let f=l-i,u={},c=Object.keys(this._columns),m=c.length;for(let p=0;p<m;p++){let h=c[p];u[h]=this._columns[h].slice(i,l)}return n._createDirect(u,this._schema,f)}pivot(e){if(this._height===0)return n._createDirect({},{},0);let{index:t,columns:r,values:o}=e,s=we(t),a=s.length;for(let x=0;x<a;x++)X(s[x],this._columns,"Pivot index key");let i=String(r),l=String(o);X(i,this._columns,"Pivot column key"),X(l,this._columns,"Pivot values key");let f=new Map,u=[],c=new Set,m=this._height,p=this._columns[i],h=this._columns[l];for(let x=0;x<m;x++){let S=Oe(this._columns,s,x);c.add(String(p[x])),f.get(S)===void 0&&(f.set(S,f.size),u.push(x))}let y=f.size,d={},g={};for(let x=0;x<a;x++){let S=s[x];d[S]=this._columns[S],this._schema[S]&&(g[S]=this._schema[S])}let _=ft(d,u),T=Array.from(c),A=this._schema[l]||j.Utf8;for(let x=0;x<T.length;x++){let S=T[x];_[S]=new Array(y).fill(null),g[S]=A}for(let x=0;x<m;x++){let S=Oe(this._columns,s,x),b=f.get(S),D=String(p[x]);_[D][b]=h[x]}return n._createDirect(_,g,y)}rename(e){let t=e||{},r={},o={},s=Object.keys(this._columns);for(let i of s){let l=t[i]||i;r[l]=this._columns[i],o[l]=this._schema[i]}if(Object.keys(r).length<s.length)throw new z("Rename collision: Multiple columns mapped to the same output name.");return n._createDirect(r,o,this._height)}reverse(){if(this._height===0)return this;let e={},t=Object.keys(this._columns),r=t.length;for(let o=0;o<r;o++){let s=t[o];e[s]=this._columns[s].slice().reverse()}return n._createDirect(e,this._schema,this._height)}get schema(){return this._schema}select(...e){let t=this._normalizeArgs(e),r=Object.keys(this._columns),o=Ve(t,r,void 0,this._schema,this._columns),s=o.length;if(s===0)return n._createDirect({},{},this._height);let a={},i={},l=new Array(s),f=new Array(s),u=new Set,c=null;for(let h=0;h<s;h++){let y=o[h],d=y._outputName||y._colName||"*";if(u.has(d))throw new z(`Duplicate column selection: "${d}" is selected multiple times.`);u.add(d);let g=_e(y,this._columns,this._height);l[h]=g,f[h]=d;let _=g&&g.rowMap;if(_)if(c){let T=_.length;if(T!==c.length)throw new te(`Mismatched explode heights: Column "${d}" has length ${T}, but another exploded column has length ${c.length}`);for(let A=0;A<T;A++)if(_[A]!==c[A])throw new te(`Mismatched explode heights: Column "${d}" has mismatched row lengths compared to another exploded column.`)}else c=_}let m=c?c.length:this._height,p=s>0;for(let h=0;h<s;h++){let y=o[h],d=y._aggFn!=null&&(y._partitionBy==null||y._partitionBy.length===0),g=!!y._isLiteral;if(!d&&!g){p=!1;break}}for(let h=0;h<s;h++){let y=f[h],d=l[h],g=d,_=g&&g.rowMap,T=E(d)?d.length:0,A=c&&!_?this._height:m;if(T!==A)throw new te(`Column height mismatch: Column "${y}" has length ${T}, but expected ${A}`);if(c&&!_){let x=c.length;if(B(d)){let S=new g.constructor(x);for(let b=0;b<x;b++)S[b]=g[c[b]];d=S}else{let S=new Array(x);for(let b=0;b<x;b++)S[b]=g[c[b]];d=S}}l[h]=d}p&&(m=1);for(let h=0;h<s;h++){let y=o[h],d=f[h],g=l[h],_=y._colName||d,T=y instanceof R&&y._ops.length===0&&!y._isWindow&&!y._aggFn,x=y._castType||T&&this._schema[_]||Ie(g);i[d]=x,a[d]=je(g,x,m)}return n._createDirect(a,i,m)}get shape(){return[this.height,this.width]}slice(e,t){let r=this._height,o=e<0?Math.max(r+e,0):Math.min(e,r),s=t===void 0?r:t<0?Math.max(r+t,0):Math.min(t,r),a=Math.max(s-o,0);return this.limit(a,{offset:o})}sort(e){if(!e||!e.by||this._height===0)return this;let{by:t,descending:r=!1,nullsLast:o=!0,custom:s}=e,a=Qe(t);for(let h=0;h<a.length;h++){let y=R.toColExpr(a[h]);y._colName&&X(y._colName,this._columns,"Sort key")}let i=Array.isArray(r)?r:new Array(a.length).fill(r),l=a.length,f=new Array(l);for(let h=0;h<l;h++){let y=a[h],d=i[h]?-1:1,g=s&&typeof y=="string"?s[y]:null,_=R.toColExpr(y).evaluate(this._columns,this._height);f[h]={values:_,isDesc:d,customComp:g}}let u=f.length,c=o?1:-1,m=new Array(this._height);for(let h=0;h<this._height;h++)m[h]=h;m.sort((h,y)=>{for(let d=0;d<u;d++){let{values:g,isDesc:_,customComp:T}=f[d],A=g[h],x=g[y];if(T){let b=T(A,x);if(b!==0)return b*_;continue}if(A==null||x==null){if(A===x)continue;return(A==null?1:-1)*c}if(A===x)continue;return(A<x?-1:1)*_}return 0});let p=ft(this._columns,m);return n._createDirect(p,this._schema,this._height)}tail(e=10){return this.limit(e,{offset:0,from:"end"})}to_dict(){return{...this._columns}}to_dicts(){return Go(this._columns,this._height)}to_array(e){if(this._height===0)return[];if(e==null)return new Array(this._height).fill(null);let r=R.toColExpr(e).evaluate(this._columns,this._height);return Array.isArray(r)?r:Array.from(r)}transpose({include_header:e=!1,header_name:t="column",column_names:r}={}){if(this._height===0){let u={},c={};return e&&(u[t]=je([],j.Utf8,0),c[t]=j.Utf8),n._createDirect(u,c,0)}let o=this.columns;typeof r=="string"&&(X(r,this._columns,"column_names"),o=o.filter(u=>u!==r));let s=[];if(typeof r=="string"){let u=this._columns[r];s=new Array(this._height);for(let c=0;c<this._height;c++){let m=u[c];if(m==null)throw new z(`Transpose column_names column "${r}" contains null/undefined at index ${c}`);s[c]=String(m)}}else if(r!=null&&typeof r!="string"&&Symbol.iterator in Object(r)){let u=Array.from(r);if(u.length!==this._height)throw new z(`column_names length (${u.length}) must match the height of the DataFrame (${this._height})`);s=new Array(this._height);for(let c=0;c<this._height;c++)s[c]=String(u[c])}else{s=new Array(this._height);for(let u=0;u<this._height;u++)s[u]=`column_${u}`}let a=new Set;e&&a.add(t);for(let u=0;u<s.length;u++){let c=s[u];if(a.has(c))throw new z(`Duplicate column name in transposed DataFrame: "${c}"`);a.add(c)}let i=o.length,l={},f={};e&&(l[t]=je(o,j.Utf8,i),f[t]=j.Utf8);for(let u=0;u<this._height;u++){let c=s[u],m=new Array(i);for(let h=0;h<i;h++)m[h]=this._columns[o[h]][u];let p=Ie(m);l[c]=je(m,p,i),f[c]=p}return n._createDirect(l,f,i)}unique(e){if(this._height===0)return n._createDirect({},this._schema,0);let t=Qe(e),r=t.length===0?Object.keys(this._columns):t.map(String);for(let f of r)X(f,this._columns,"Unique column key");let o=new Set,s=[],a=this._height;for(let f=0;f<a;f++){let u=Oe(this._columns,r,f);o.has(u)||(o.add(u),s.push(f))}let i=ft(this._columns,s),l=s.length;return n._createDirect(i,this._schema,l)}unpivot(e){let{idVars:t,valueVars:r,varName:o="variable",valueName:s="value"}=e,a=we(t),i=we(r),l=a.length,f=i.length;for(let h of a)X(h,this._columns,"Unpivot id variable key");for(let h of i)X(h,this._columns,"Unpivot value variable key");let u=this._height*f,c={};for(let h=0;h<l;h++)c[a[h]]=new Array(u);c[o]=new Array(u),c[s]=new Array(u);let m=0;for(let h=0;h<this._height;h++)for(let y=0;y<f;y++){let d=i[y];for(let g=0;g<l;g++){let _=a[g];c[_][m]=this._columns[_][h]}c[o][m]=d,c[s][m]=this._columns[d][h],m++}let p={};for(let h of a)p[h]=this._schema[h];return p[o]=j.Utf8,p[s]=Ie(c[s]),n._createDirect(c,p,u)}vstack(e){return this.concat(e,{how:"vertical"})}get width(){return Object.keys(this._columns).length}_normalizeArgs(e){let t=e.flat(),r=[];for(let o of t)if(typeof o=="string")r.push(new R(o));else if(R.isColExpr(o))r.push(o);else if(K(o)){let s=Object.keys(o),a=s.length;for(let i=0;i<a;i++){let l=s[i],f=o[l];if(R.isColExpr(f))r.push(f.alias(l));else{let u=new R(l);u.evaluate=(c,m)=>new Array(m).fill(f),r.push(u)}}}return r}with_columns(...e){if(e.length===0)return this;let t=this._normalizeArgs(e),r=Object.keys(this._columns),o=Ve(t,r,void 0,this._schema,this._columns),s=o.length;if(s===0)return this;let a=new Map;for(let f=0;f<s;f++){let u=o[f],c=u._outputName||u._colName||"*";a.set(c,u)}let i=[],l=r.length;for(let f=0;f<l;f++){let u=r[f];i.push(a.get(u)||new R(u)),a.delete(u)}for(let f of a.values())i.push(f);return this.select(...i)}with_row_index(e="index",t=0){let r=Ge(t,{mode:"independent",dtype:j.UInt32,step:1}),o=this.insert_column(0,e,r);return o._schema[e]=j.UInt32,o}write_json(e,{format:t="json",replacerOptions:r}={}){if(t!=="json"&&t!=="ndjson")throw new v(`Unsupported JSON format: "${t}". Expected "json" or "ndjson".`);let o=r?.replacer===null?void 0:st(r),s;if(t==="ndjson"){let a=this.to_dicts(),i=a.length,l=new Array(i);for(let f=0;f<i;f++)l[f]=JSON.stringify(a[f],o);s=l.join(`
6
- `)}else s=JSON.stringify(this.to_dicts(),o);return Jo(e,s),s}write_csv(e,t={}){if(e){if(typeof e=="string"){if(typeof Pe!="function")throw new Ae("File writing is not supported in this environment (missing require('fs')).");let r=Pe("fs"),o=r.openSync(e,"w");try{Lt(this._columns,this._height,{...t,onRow:s=>{r.writeSync(o,s,null,"utf8")}})}finally{r.closeSync(o)}}else if(K(e)&&typeof e.write=="function")Lt(this._columns,this._height,{...t,onRow:r=>{e.write(r)}});else throw new v("Invalid file argument. Expected a file path string or a writable stream/object with a write method.");return""}return Lt(this._columns,this._height,t)}}});pt();pt();De();fr();We();q();Y();function mr(n,{format:e="json",trimBeforeParse:t=!0,schema:r,...o}={}){let s=xo(n,{format:e,trimBeforeParse:t,...o});if(s===n)throw new z(`Invalid JSON input: must be a valid, non-empty JSON ${e} string.`);let a=Array.isArray(s)?s:K(s)?[s]:[];return new V(a,r)}We();q();function pr(n,e={}){let{hasHeader:t=!0,schema:r,inferSchema:o=!0}=e,s=Vo(n,e);if(s.length===0)return new V({});let a,i;t?(a=s[0],i=s.slice(1)):(a=s[0].map((m,p)=>`column_${p}`),i=s);let l=a.length,f=i.length,u={};for(let m=0;m<l;m++){let p=a[m],h=new Array(f);for(let y=0;y<f;y++)h[y]=i[y][m]!==void 0?i[y][m]:"";u[p]=h}let c={};for(let m=0;m<l;m++){let p=a[m],h=u[p];if(r&&r[p])c[p]=h;else if(o){let{values:y}=Lo(h,e);c[p]=y}else c[p]=h}return new V(c,r)}function Si(n,e){return new V(n,e)}var $c={data:Si,col:n=>new R(n),all:mt,exclude:is,coalesce:ls,concat:ht,read_json:mr,read_csv:pr,lit:Je,when:cs,implode:ms,seq_range:Ge,element:hs,struct:ds,duration:ir,DataType:j};De();Y();export{$c as $df,se as ALL_COLUMNS_MARKER,Wt as AggregationExpr,$t as ArithmeticExpr,Uo as Array,Uo as ArrayDataType,Jt as ArrayExpr,er as ArrayExprNamespace,Pn as ArrayType,Eo as Binary,Un as BinaryType,Ft as Boolean,Ft as BooleanDataType,vn as BooleanType,gr as COALESCE_MARKER,R as ColumnExpr,Te as ColumnNotFoundError,Kt as ComparisonExpr,ie as ComputeError,Ce as DFScriptError,br as DURATION_MARKER,V as DataFrame,z as DataFrameError,ne as DataType,j as DataTypeRegistry,No as Date,No as DateDataType,lr as DateTimeExprNamespace,Vn as DateType,jt as Datetime,ge as DatetimeType,vt as DecimalType,Mo as Duration,lt as DurationType,Ye as ELEMENT_MARKER,$ as ExprBase,Io as Float32,Rn as Float32Type,Ut as Float64,Nn as Float64Type,it as FloatDataType,tn as GroupedData,Ae as IOStreamError,So as Int16,Dn as Int16Type,Ao as Int32,Tn as Int32Type,Mt as Int64,Cn as Int64Type,wo as Int8,An as Int8Type,Rt as IntegerDataType,v as InvalidArgumentError,dr as LITERAL_MARKER,qt as LogicalExpr,at as NestedDataType,ko as Null,Fn as NullType,ze as NumericDataType,Ro as Object,Ro as ObjectDataType,jn as ObjectType,_r as STRUCT_MARKER,Fe as SchemaError,te as ShapeError,ve as SignedIntegerType,zt as StringExpr,Yn as StringExprNamespace,Fo as Struct,Ht as StructExpr,nr as StructExprNamespace,Bn as StructType,Ue as TemporalDataType,Zt as TemporalExpr,vo as Time,Ln as TimeType,To as UInt16,In as UInt16Type,Co as UInt32,En as UInt32Type,Oo as UInt64,kn as UInt64Type,Do as UInt8,On as UInt8Type,Me as UnsignedIntegerType,ut as Utf8,Mn as Utf8Type,cr as When,en as WhenThen,ur as WhenThenChain,Gt as WindowExpr,Ho as alignAsofIndices,Yo as alignKeyIndices,mt as all,X as assertColumnExists,qn as assertHeight,Pt as assertNotNull,Ta as assertValidArgument,ls as coalesce,je as coerceColumn,Go as columnsToRows,Oe as computeRowHash,ht as concat,w as derive,ir as duration,hs as element,Xo as evalBinaryOp,di as evalUnaryOp,_e as evaluateExpression,is as exclude,ft as gatherColumnsByIndices,va as getRowFromColumns,ms as implode,Ie as inferColumnType,L as kleeneBinary,I as kleeneUnary,Je as lit,zn as materializeJoinedDataFrame,pr as read_csv,mr as read_json,Ve as resolveColumnSelectors,zo as resolveWindowExpr,Wo as rowsToColumns,Ge as seq_range,ds as struct,cs as when,Jo as writeStringToFileOrStream};
1
+ var he=Object.defineProperty;var Ma=Object.getOwnPropertyDescriptor;var Ua=Object.getOwnPropertyNames;var Fa=Object.prototype.hasOwnProperty;var ja=(e,t,n)=>t in e?he(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var An=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var j=(e,t)=>()=>(e&&(t=e(e=0)),t);var To=(e,t)=>{for(var n in t)he(e,n,{get:t[n],enumerable:!0})},va=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ua(t))!Fa.call(e,o)&&o!==n&&he(e,o,{get:()=>t[o],enumerable:!(r=Ma(t,o))||r.enumerable});return e};var Eo=e=>va(he({},"__esModule",{value:!0}),e);var T=(e,t,n)=>ja(e,typeof t!="symbol"?t+"":t,n);var ht,Io,Do,Sn,Co,du,Ro,Gt=j(()=>{"use strict";ht="*",Io="*literal*",Do="*coalesce*",Sn="*element*",Co="*struct*",du="*duration*",Ro="*when*"});var _o=j(()=>{"use strict"});function v(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Ft(e){if(!v(e))return!1;try{if(!Object.prototype.hasOwnProperty.call(e,Symbol.toStringTag)&&Object.prototype.toString.call(e)!==Xa)return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;if(Object.getPrototypeOf(t)!==null||!Object.prototype.hasOwnProperty.call(t,"isPrototypeOf"))return!1;let n=Object.getOwnPropertyDescriptor(t,"toString");if(!n||typeof n.value!="function")return!1;let r=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof r!="function"?!1:Function.prototype.toString.call(r)===dl}catch{return!1}}function Lo(e){if(typeof e!="function")return!1;try{let t=Function.prototype.toString.call(e),n=t.replace(/^(?:\s+|\/\*[\s\S]*?\*\/|\/\/[^\r\n]*)+/,"");if(/^(?:@[\w$.]+(?:\([^)]*\))?\s+)*class\b/.test(n))return!0;let r=Object.getOwnPropertyDescriptor(e,"prototype");if(r&&!r.writable&&t.includes("[native code]")){let o=Bo.length;for(let i=0;i<o;i++)try{return Reflect.construct(e,Bo[i],hl),!0}catch{}}}catch{return!1}return!1}function jt(e,t,n,r){if(!v(e))return!1;if(n)try{let o=n.call(e);return r!==void 0?o===r:!0}catch{return!1}try{return Object.prototype.hasOwnProperty.call(e,Symbol.toStringTag)?!1:Object.prototype.toString.call(e)===t}catch{return!1}}function L(e){if(!v(e))return!1;if(jo)try{return!Number.isNaN(jo.call(e))}catch{return!1}try{return Object.prototype.hasOwnProperty.call(e,Symbol.toStringTag)?!1:Object.prototype.toString.call(e)===Ba&&!Number.isNaN(e.getTime())}catch{return!1}}function mt(e){return jt(e,Pa,rl)}function ge(e){return jt(e,Va,ol)}function be(e){return jt(e,La,il)}function $o(e){if(!v(e))return!1;if(vo)try{return vo.call(e,"key"),!0}catch{return!1}return jt(e,Ka,void 0)}function Ko(e){if(!v(e))return!1;try{if(e instanceof Error)return!0;let t=e;for(;t!==null;){if(!Object.prototype.hasOwnProperty.call(t,Symbol.toStringTag)&&Object.prototype.toString.call(t)===$a)return!0;t=Object.getPrototypeOf(t)}}catch{return!1}return!1}function xe(e){if(!v(e))return!1;try{let t=ArrayBuffer.isView(e)?e.buffer:e;return Ae(t)||!we(t)?!1:"detached"in t&&t.detached!==void 0?t.detached===!0:(al?.call(t,0,0),!1)}catch{return!0}}function we(e){return jt(e,Ja,sl)}function Ae(e){return jt(e,Wa,ll)}function qo(e){return jt(e,za,ul)}function ar(e){return jt(e,qa,Jt,"Uint8Array")}function Go(e){return jt(e,Ga,Jt,"Uint8ClampedArray")}function Q(e){if(!v(e))return e;let t=Po.length;for(let n=0;n<t;n++){let r=Po[n];if(r)try{return r.call(e)}catch{}}return e}var Ba,Pa,Va,La,$a,Ka,qa,Ga,Ja,Wa,za,Xa,Ya,No,ko,Mo,Ha,Za,Qa,tl,nl,el,rl,ol,il,sr,Uo,Fo,Jt,sl,al,ll,ul,jo,vo,cl,fl,ml,pl,yl,dl,Vo,hl,gl,Bo,Po,Rt=j(()=>{"use strict";Ba="[object Date]",Pa="[object RegExp]",Va="[object Set]",La="[object Map]",$a="[object Error]",Ka="[object URLSearchParams]",qa="[object Uint8Array]",Ga="[object Uint8ClampedArray]",Ja="[object ArrayBuffer]",Wa="[object SharedArrayBuffer]",za="[object DataView]",Xa="[object Object]",Ya=typeof Date=="function"?Date.prototype:void 0,No=typeof RegExp=="function"?RegExp.prototype:void 0,ko=typeof Set=="function"?Set.prototype:void 0,Mo=typeof Map=="function"?Map.prototype:void 0,Ha=typeof URLSearchParams=="function"?URLSearchParams.prototype:void 0,Za=typeof String=="function"?String.prototype:void 0,Qa=typeof Number=="function"?Number.prototype:void 0,tl=typeof Boolean=="function"?Boolean.prototype:void 0,nl=typeof BigInt=="function"?BigInt.prototype:void 0,el=typeof Symbol=="function"?Symbol.prototype:void 0,rl=No?Object.getOwnPropertyDescriptor(No,"source")?.get:void 0,ol=ko?Object.getOwnPropertyDescriptor(ko,"size")?.get:void 0,il=Mo?Object.getOwnPropertyDescriptor(Mo,"size")?.get:void 0,sr=typeof ArrayBuffer=="function"?ArrayBuffer.prototype:void 0,Uo=typeof SharedArrayBuffer=="function"?SharedArrayBuffer.prototype:void 0,Fo=typeof DataView=="function"?DataView.prototype:void 0,Jt=typeof Uint8Array=="function"?Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype),Symbol.toStringTag)?.get:void 0,sl=sr?Object.getOwnPropertyDescriptor(sr,"byteLength")?.get:void 0,al=sr?.slice,ll=Uo?Object.getOwnPropertyDescriptor(Uo,"byteLength")?.get:void 0,ul=Fo?Object.getOwnPropertyDescriptor(Fo,"byteLength")?.get:void 0,jo=Ya?.valueOf,vo=Ha?.has,cl=Za?.valueOf,fl=Qa?.valueOf,ml=tl?.valueOf,pl=nl?.valueOf,yl=el?.valueOf,dl=Function.prototype.toString.call(Object);Vo=function(){},hl=new Proxy(Vo,{construct(){return this}}),gl=typeof ArrayBuffer=="function"?new ArrayBuffer(0):void 0,Bo=[[],[Vo],[gl],[{}]];Po=[fl,cl,ml,pl,yl]});var Jo,Wo,Wt,lr,ur,Se,St,Jn,Mt,_t,Oe,On,Te,Wn,zn,cr,fr,mr,Xn,Yn,un,bl,zo,Xo,Yo,Ho,Zo,Qo,ti,ni,ei,ri,oi,ii,si,ai,li,ui,ci,fi,pr,mi,pi,yr,dr,yi,Ot=j(()=>{"use strict";Jo="\\r\\n|\\n|\\r",Wo=/\r\n|\n|\r/,Wt=new TextEncoder,lr=new TextDecoder("utf-8"),ur=new TextDecoder("utf-8",{fatal:!0}),Se=6048e5,St=864e5,Jn=36e5,Mt=6e4,_t=1e3,Oe=1,On=.001,Te=1e-6,Wn=1e3,zn=1e6,cr=1000n,fr=1000000n,mr=Object.freeze({sunday:0,monday:1,tuesday:2,wednesday:3,thursday:4,friday:5,saturday:6}),Xn="\0",Yn="",un=-1,bl=4294967295,zo=-9223372036854775808n,Xo=9223372036854775807n,Yo=0n,Ho=18446744073709551615n,Zo=-2147483648,Qo=2147483647,ti=0,ni=bl,ei=-32768,ri=32767,oi=0,ii=65535,si=-128,ai=127,li=0,ui=255,ci=31,fi=127,pr=55296,mi=56319,pi=56320,yr=57343,dr=Object.freeze({9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r"}),yi=Object.freeze({b:"\b",0:"\0",...Object.fromEntries(Object.entries(dr).map(([e,t])=>[t.slice(1),String.fromCharCode(Number(e))]))})});function M(e,t){return typeof e!="number"?!1:Number.isNaN(e)?t?.allowNaN??t?.allowNonFiniteNumbers??!1:Number.isFinite(e)?!0:t?.allowNonFiniteNumbers??!1}function di(e){for(let t=1;t<e.length;t++)if(e[t].length!==3)return!1;return!0}function wi(e,t){if(xl.test(e))return null;let n=e.trim();if(n==="")return null;n.startsWith("(")&&n.endsWith(")")&&(n="-"+n.slice(1,-1).trim());let r=n[n.length-1];(r==="-"||r==="+")&&n.length>1&&(n=r+n.slice(0,-1).trim()),t||(n=n.replace(wl,""));let o=n.includes("."),i=n.includes(",");if(o&&i){let s=n.lastIndexOf("."),a=n.lastIndexOf(","),l=a>s,c=l?".":",",u=l?a:s,f=n.slice(0,u).split(c);return f.length>1&&!di(f)||f[0].replace(hi,"").length>3?null:l?n.replace(gi,"").replace(Ee,"."):n.replace(Ee,"")}if(i||o){let s=i?",":".",a=n.split(s);if(a.length>2||s===","&&a.length===2&&a[1].length===3){let l=a[0].replace(hi,"").length;if(l===0){if(s===","||a.length>2)return null}else return l>3?null:di(a)?n.replace(i?Ee:gi,""):null}if(i)return n.replace(Ee,".")}return n}function $(e,{allowNonFiniteNumbers:t=!1,strictNumericString:n=!1,floatScientific:r=!0}={}){if(e==null||typeof e=="symbol")return null;switch(e=Q(e),typeof e){case"number":return M(e,{allowNonFiniteNumbers:t})?e:null;case"boolean":return e?1:0;case"bigint":{let o=Number(e);return M(o,{allowNonFiniteNumbers:t})?o:null}case"object":{if(L(e)){let o=e.getTime();return M(o,{allowNonFiniteNumbers:t})?o:null}return null}case"string":{let o=wi(e,n);if(o===null)return null;if(t){let a=o.toLowerCase();if(a==="nan"||a==="-nan"||a==="+nan")return NaN;if(a==="infinity"||a==="+infinity")return 1/0;if(a==="-infinity")return-1/0}if(xi.test(o)&&!r||!bi.test(o))return null;let s=Number(o);return M(s,{allowNonFiniteNumbers:t})?s:null}default:return null}}function Ai({locale:e="en-US",accountingNegatives:t=!1,fallback:n="NaN",formatNonFinite:r=!1,...o}={}){o.useGrouping===void 0&&(o.useGrouping=!1),o.maximumFractionDigits===void 0&&o.maximumSignificantDigits===void 0&&(o.maximumFractionDigits=20),t&&(o.currencySign="accounting",o.style===void 0&&(o.style="decimal"));let i=new Intl.NumberFormat(e,o);return s=>{if(typeof s=="bigint")return t&&s<0n?`(${i.format(-s)})`:i.format(s);let a=$(s,{allowNonFiniteNumbers:!0});return a===null||Number.isNaN(a)?n:Number.isFinite(a)?t&&a<0?`(${i.format(Math.abs(a))})`:i.format(a):r?n:t&&a===-1/0?`(${i.format(1/0)})`:String(a)}}function hr(e,{floatPrecision:t="Float64",allowNonFiniteNumbers:n=!0,floatScientific:r=!0,strictNumericString:o=!1}={}){let i=$(e,{allowNonFiniteNumbers:n,floatScientific:r,strictNumericString:o});return i===null||(t==="Float32"&&(i=Math.fround(i)),!M(i,{allowNonFiniteNumbers:n}))?null:i}function Ie(e,t,n){if(!e)return null;let r=typeof e=="string"?t[e]:e;return r&&typeof r.min===n&&typeof r.max===n?r:null}function At(e,{range:t="Int32"}={}){if(!M(e)||!Number.isInteger(e))return!1;let n=Ie(t,Si,"number");return n!=null&&e>=n.min&&e<=n.max}function gt(e,{range:t="Int32",coerce:n="truncate"}={}){let r=$(e);if(r===null)return null;switch(n){case"round":r=Math.round(r);break;case"floor":r=Math.floor(r);break;case"ceil":r=Math.ceil(r);break;case"truncate":r=Math.trunc(r);break}let o=Ie(t,Si,"number");return o!=null?z(r,{min:o.min,max:o.max}):null}function Tn(e,{range:t="Int64"}={}){let n=Q(e);if(typeof n!="bigint")return!1;let r=Ie(t,Oi,"bigint");return r!=null&&n>=r.min&&n<=r.max}function zt(e,{range:t="Int64",truncate:n=!1}={}){if(e==null||typeof e=="symbol")return null;try{e=Q(e)}catch{return null}let r=null;if(typeof e=="bigint")r=e;else if(typeof e=="string"){let i=wi(e,!1);if(i===null||!bi.test(i))return null;if(xi.test(i)){let s=i.search(/[eE]/),a=i.slice(0,s),l=i.slice(s+1),c=parseInt(l,10);if(Number.isNaN(c)||c>1e5||c<-1e5)return null;let u=a.startsWith("-");(u||a.startsWith("+"))&&(a=a.slice(1));let f=a.indexOf("."),p=a,m=0;f!==-1&&(m=a.length-f-1,p=a.slice(0,f)+a.slice(f+1)),p=p.replace(/^0+/,"")||"0";try{let y=BigInt(p);u&&(y=-y);let d=c-m;if(d>=0)r=y*10n**BigInt(d);else{let h=10n**BigInt(-d),g=y%h;if(!n&&g!==0n)return null;r=y/h}}catch{return null}}else{let s=i.indexOf(".");if(s!==-1){if(!n&&/[^0]/.test(i.slice(s+1)))return null;i=i.slice(0,s)}try{r=BigInt(i)}catch{return null}}}else{let i=$(e);if(i===null||!n&&!Number.isInteger(i))return null;r=BigInt(Math.trunc(i))}let o=Ie(t,Oi,"bigint");return!o||r<o.min||r>o.max?null:r}function Al(e,t){let n=e-t;if(n<0||t<0)return null;if(n>15)return Number.K;let r=z(t,{min:0,max:16}),o=Math.pow(10,n)-Math.pow(10,-r);return o>0?o:null}function gr(e,t){if(!Number.isFinite(e))return e;let n=e.toString();if(n.includes("e")){let r=Math.pow(10,t);return Math.round(e*r)/r}return+(Math.round(+(n+"e"+t))+"e"+-t)}function De(e,{precision:t,scale:n}={}){let r=$(e);if(r===null)return null;let o=r;if(n!==void 0&&(o=gr(o,n)),t!==void 0){let s=Al(t,n??0);s!==null&&(o=z(o,{min:-s,max:s}))}return o}function z(e,t){if(!t)return e;let{min:n=null,max:r=null,safe:o=!0}=t;if(n!==null&&r!==null&&n>r)return n;let i=e;if(o&&typeof i=="number"){if(Number.isNaN(i))return n!==null?n:r!==null?r:e;if(i===1/0)return r!==null?r:e;if(i===-1/0)return n!==null?n:e}return n!==null&&i<n?n:r!==null&&i>r?r:i}function Ti(e){let t=e|0;return function(){let n=t=t+1831565813|0;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}var bi,xl,wl,xi,hi,gi,Ee,Si,Oi,vt=j(()=>{"use strict";Rt();Ot();bi=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/,xl=/0[xobXOB]/,wl=/[\s_\u200B-\u200D\uFEFF]/g,xi=/[eE]/;hi=/^[+-]/,gi=/\./g,Ee=/,/g;Si={Int8:{min:si,max:ai},Int16:{min:ei,max:ri},Int32:{min:Zo,max:Qo},UInt8:{min:li,max:ui},UInt16:{min:oi,max:ii},UInt32:{min:ti,max:ni}};Oi={Int64:{min:zo,max:Xo},UInt64:{min:Yo,max:Ho}}});function ot(e){if(!ArrayBuffer.isView(e))return!1;if(Jt)return Jt.call(e)!==void 0;let t=Object.prototype.toString.call(e);return t!=="[object DataView]"&&t.endsWith("Array]")}function V(e){return Array.isArray(e)||ot(e)}function bt(e){return e==null?[]:Array.isArray(e)?[...e]:ot(e)?Array.from(e):[e]}function En(e,t,n){let r=e.length,o=t<-r||t>=r;if(o&&!n)throw new at(`Index ${t} is out of bounds for array of length ${r}`);return o?null:e.at(t)??null}function Di(e){if(typeof e=="function"){let t=Lo(e);return{check:t?n=>n instanceof e:n=>!!e(n),coerce:n=>{if(t)return n instanceof e?n:null;let r=e(n);return typeof r=="boolean"?r?n:null:r}}}switch(e){case"string":return{check:t=>typeof t=="string",coerce:t=>String(t)};case"number":return{check:M,coerce:t=>$(t)??NaN};case"boolean":return{check:t=>typeof t=="boolean",coerce:Boolean};case"bigint":return{check:Tn,coerce:t=>zt(t)};case"date":return{check:L,coerce:t=>X(t)};case"object":return{check:v,coerce:t=>v(t)?t:null};case"plainObject":return{check:Ft,coerce:t=>Ft(t)?t:null};case"null":return{check:t=>t===null,coerce:()=>null};case"undefined":return{check:t=>t===void 0,coerce:()=>{}};case"nullish":return{check:t=>t==null,coerce:()=>null};default:return{check:()=>!0,coerce:t=>t}}}function H(e,t,{mode:n="every",allowNulls:r=!1,allowEmpty:o=!0}={}){if(!V(e))return!1;let i=e,s=i.length;if(s===0)return o?n==="every":!1;let{check:a}=Di(t);if(n==="every"){for(let l=0;l<s;l++){let c=i[l];if(!(r&&c==null)&&!a(c))return!1}return!0}for(let l=0;l<s;l++){let c=i[l];if(r&&c==null||a(c))return!0}return!1}function Nt(e,t="any",{mode:n="every",allowNulls:r=!1,allowEmpty:o=!0}={}){let i=bt(e),s=i.length;if(s===0){if(!o)throw new at("Expected non-empty array");return[]}let{check:a,coerce:l}=Di(t),c=new Array(s),u=0;for(let f=0;f<s;f++){let p=i[f];if(r&&p==null){c[u++]=p;continue}let m=l(p);if(a(m))c[u++]=m;else if(n==="every")throw new at(`Failed to convert array item at index ${f} ('${p}') to target type '${t}'`)}if(n==="some"){if(u===0)throw new at(`No items in array could be converted to target type '${t}'`);u<s&&(c.length=u)}return c}function br(e,t,{descending:n=!1,nullsLast:r=!0,customComp:o}={}){let s=!!(Array.isArray(n)?n[0]:n)?-1:1;if(typeof o=="function")return o(e,t)*s;if(Object.is(e,t)||e==null&&t==null)return 0;if(e==null||t==null)return(e==null?1:-1)*(r?1:-1);let a=L(e),l=L(t);if(a!==l)return a?-1:1;if(a&&l)return(e.getTime()<t.getTime()?-1:e.getTime()>t.getTime()?1:0)*s;let c=typeof e,u=typeof t,f=c==="number"||c==="bigint",p=u==="number"||u==="bigint",m=Number.isNaN(e),y=Number.isNaN(t);return m&&y?0:m||y?(m?1:-1)*(r?1:-1):f&&p?(e<t?-1:e>t?1:0)*s:c!==u?c<u?-1:1:c==="string"?e.localeCompare(t)*s:(e<t?-1:e>t?1:0)*s}function Hn(e,{descending:t=!1,nullsLast:n=!0,customComp:r}={}){if(!V(e))return[];let o=e,i=o.length;if(i<=1)return ot(e)?Array.from(o):i===0?[]:[o[0]];let s=!!(Array.isArray(t)?t[0]:t),a=e instanceof Float32Array||e instanceof Float64Array;if(ot(e)&&!r&&n&&(!a||!s)){let c=o.slice().sort();return s&&c.reverse(),Array.from(c)}let l=new Array(i);for(let c=0;c<i;c++)l[c]=o[c];return l.sort((c,u)=>br(c,u,{descending:t,nullsLast:n,customComp:r}))}function K(e){if(!V(e))return Ei;let t=e.length;if(t===0)return Ei;let n=null,r=null,o=null,i=null,s=0,a=0,l=0,c=0,u=0,f=1,p=0,m=0;for(let h=0;h<t;h++){let g=e[h];if(g==null){a++;continue}if(typeof g=="number"&&Number.isNaN(g)){l++,a++;continue}(n==null||g<n)&&(n=g,o=h),(r==null||g>r)&&(r=g,i=h);let x=$(g);if(x!==null){let b=c+x;Math.abs(c)>=Math.abs(x)?u+=c-b+x:u+=x-b+c,c=b,f*=x,s++;let O=x-p;p+=O/s;let w=x-p;m+=O*w}}let y=s>1?m/(s-1):0,d=l>0;return{sum:s>0?c+u:null,product:s>0?f:null,count:s,min:n,max:r,nanMin:d?NaN:n,nanMax:d?NaN:r,minIdx:o,maxIdx:i,mean:s>0?(c+u)/s:null,variance:y,std:Math.sqrt(y),nullCount:a,nanCount:l,len:t,hasNulls:a>0,isNumeric:s>0&&s===t-a}}function Xt(e,{strict:t=!1,keySelector:n}={}){let r=Array.from(e),o=new Map;if(t){let s=n??lt,a=new Map,l=r.length;for(let u=0;u<l;u++){let f=r[u],p=s(f),m=a.get(p);m===void 0?a.set(p,{val:f,count:1}):m.count++}let c=[];for(let u of a.values())c.push(u.val);for(let u=0;u<l;u++){let f=r[u],p=s(f),m=a.get(p);o.set(f,m.count)}return{values:c,count:c.length,frequencies:o}}let i=r.length;for(let s=0;s<i;s++){let a=r[s];o.set(a,(o.get(a)??0)+1)}return{values:Array.from(o.keys()),count:o.size,frequencies:o}}function Ce(e,{step:t=1,offsetStart:n=0,offsetEnd:r,maxItemsGathered:o,nullOnOob:i=!0}={}){if(e==null)return null;if(o!==void 0&&o<=0)return[];if(t===0)throw new N("Step size step cannot be zero");let s=e.length;if(s===0?n!==0:n>=s||n<-s){if(!i)throw new at(`Start offset ${n} is out of bounds for array of length ${s}`);return null}let l=n<0?s+n:n,c=r!==void 0?r<0?s+r:r:t>0?s:-1,u=[];if(t>0)for(let f=l;f<c&&f<s&&!(f>=0&&(u.push(e[f]),o!==void 0&&u.length>=o));f+=t);else for(let f=l;f>c&&f>=0&&!(f<s&&(u.push(e[f]),o!==void 0&&u.length>=o));f+=t);return u}function Re(e,t=",",{ignoreNulls:n=!1,nullValue:r="",prefix:o="",suffix:i="",limit:s,truncationMarker:a="...",valueFormatter:l}={}){let c=e.length,u=[],f=z(s??c,{min:0}),p=!1;for(let m=0;m<c;m++){if(u.length>=f){p=!0;break}let y=e[m];y!=null?u.push(l?l(y,m):String(y)):n||u.push(r)}return o+u.join(t)+(p?a:"")+i}function Ci(e,t,n={}){let r=e.length,{mode:o="cumulative",step:i=1,coerce:s=d=>d,condition:a,reverse:l=!1,startIndex:c=l?r-1:0,endIndex:u=l?-1:r}=n,f=l?-1:1,p=c,m=u,y=(d,h)=>{(!a||a(e[d],d,e))&&(e[d]=s(h))};if(o==="constant"){let d=s(t);for(let h=p;l?h>m:h<m;h+=f)y(h,d)}else if(o==="independent")if(typeof i=="function"){let d=0;for(let h=p;l?h>m:h<m;h+=f)y(h,i({index:d,initialValue:t,originalValue:e[h],absoluteIndex:h,targetArray:e})),d++}else for(let d=p;l?d>m:d<m;d+=f)y(d,t+d*i);else{let d=t,h=!0,g=0;for(let x=p;l?x>m:x<m;x+=f)h?(y(x,d),h=!1):(typeof i=="function"?d=i({prev:d,index:g,originalValue:e[x],absoluteIndex:x,targetArray:e}):d=d+i,y(x,d)),g++}}function Sl(e){let t=e.length,n=0,r=new Float64Array(t);for(let i=0;i<t;i++){let s=e[i],a=$(s,{allowNonFiniteNumbers:!0});a!==null&&M(a,{allowNonFiniteNumbers:!0,allowNaN:!1})&&(r[n++]=a)}if(n===0)return null;let o=r.subarray(0,n);return o.sort(),o}function cn(e,t){if(t<0||t>1)return null;let n=Sl(e);if(!n)return null;let r=n.length,o=t*(r-1),i=Math.floor(o),s=Math.ceil(o);return i===s?n[i]:n[i]+(o-i)*(n[s]-n[i])}function _e(e){if(!V(e)||e.length===0)return null;let t=new Map,n=e.length,r=0,o=[];for(let i=0;i<n;i++){let s=e[i];if(s==null||typeof s=="number"&&!M(s,{allowNonFiniteNumbers:!0,allowNaN:!1}))continue;let a=(t.get(s)??0)+1;t.set(s,a),a>r?(r=a,o=[s]):a===r&&o.push(s)}return o.length===0?null:Hn(o)}function Ri(e,t){let n=e.length;if(n===0)return[];let r=Math.trunc(t);if(isNaN(r)||r===0)return bt(e);let o=Math.abs(r);if(o>=n)return new Array(n).fill(null);let i=new Array(n);if(r>0){i.fill(null,0,r);for(let s=r;s<n;s++){let a=e[s-r];i[s]=a??null}}else{let s=n-o;for(let a=0;a<s;a++){let l=e[a+o];i[a]=l??null}i.fill(null,s,n)}return i}function _i(e){let t=e.length,n=new Float64Array(t),r=new Float64Array(t),o=0;for(let i=0;i<t;i++){let s=e[i];if(!s)continue;let a=$(s[0]),l=$(s[1]);a===null||l===null||(n[o]=a,r[o]=l,o++)}return{xArr:n,yArr:r,count:o}}function Ni(e,t,n){if(n<2)return null;let r=0,o=0,i=0,s=0,a=0;for(let f=0;f<n;f++){let p=e[f],m=t[f],y=p-r;r+=y/(f+1);let d=p-r,h=m-o;o+=h/(f+1);let g=m-o;a+=y*g,i+=y*d,s+=h*g}let l=a/(n-1);if(i===0||s===0)return{covariance:l,correlation:null};let c=Math.sqrt(i*s);if(c===0||Number.isNaN(c))return{covariance:l,correlation:null};let u=z(a/c,{min:-1,max:1});return{covariance:l,correlation:u}}function xr(e){let{xArr:t,yArr:n,count:r}=_i(e);return r<2?{covariance:null,correlation:null}:Ni(t,n,r)??{covariance:null,correlation:null}}function Ii(e){let t=e.length,n=new Int32Array(t);for(let i=0;i<t;i++)n[i]=i;n.sort((i,s)=>e[i]-e[s]);let r=new Float64Array(t),o=0;for(;o<t;){let i=o+1;for(;i<t&&e[n[i]]===e[n[o]];)i++;let s=(o+1+i)/2;for(let a=o;a<i;a++)r[n[a]]=s;o=i}return r}function Ol(e,t,n){let r=Ni(e,t,n);return r?r.correlation:null}function ki(e){let{xArr:t,yArr:n,count:r}=_i(e);if(r<2)return null;let o=Ii(t.subarray(0,r)),i=Ii(n.subarray(0,r));return Ol(o,i,r)}function Mi(e){let t=e.length,n=0,r=0;for(let o=0;o<t;o++){let i=e[o];if(!i)continue;let s=$(i[0]),a=$(i[1]);s===null||a===null||(n+=s*a,r++)}return r>0?n:null}function Ui(e){let t=e.length,n=0,r=0,o=0;for(let i=0;i<t;i++){let s=e[i];if(!s)continue;let a=$(s[0]),l=$(s[1]);a===null||l===null||(n+=a*l,r+=l,o++)}return o===0||Math.abs(r)<1e-12?null:n/r}function Fi(e,t){let n=z(Math.floor(e||0),{min:0}),r=z(Math.floor(t||0),{min:0}),o=n*r;if(!At(o,{range:"UInt32"}))throw new N(`Cartesian product size (${o} rows) exceeds maximum JavaScript array capacity.`);let i=new Array(o),s=new Array(o),a=0;for(let l=0;l<n;l++)for(let c=0;c<r;c++)i[a]=l,s[a]=c,a++;return{leftIndices:i,rightIndices:s}}function fn(e,t,n={}){let r=n.side==="right",o=n.getValue,i=0,s=e.length;for(;i<s;){let a=i+s>>>1,l=o?o(a,e[a]):e[a];(r?l<=t:l<t)?i=a+1:s=a}return i}function ji(e){if(!V(e))return null;let{mean:t,count:n}=K(e);if(n<2||t===null)return null;let r=0,o=0,i=0,s=e.length;for(let a=0;a<s;a++){let l=$(e[a]);if(l===null)continue;let c=l-t,u=c*c;r+=u,o+=u*c,i+=u*u}return r<=0?null:{count:n,mean:t,m2Sum:r,m3Sum:o,m4Sum:i}}function vi(e,t={}){let n=ji(e);if(!n)return null;let{count:r,m2Sum:o,m3Sum:i}=n,s=o/r,l=i/r/Math.pow(s,1.5);if(t?.bias??!0)return M(l)?l:null;if(r<3)return null;let u=Math.sqrt(r*(r-1))/(r-2)*l;return M(u)?u:null}function Bi(e,t={}){let n=ji(e);if(!n)return null;let{count:r,m2Sum:o,m4Sum:i}=n,s=o/r,l=i/r/(s*s),c=l-3,u=t?.fisher??!0;if(t?.bias??!0){let y=u?c:l;return M(y)?y:null}if(r<4)return null;let p=(r-1)/((r-2)*(r-3))*((r+1)*c+6),m=u?p:p+3;return M(m)?m:null}function Pi(e,t={}){if(!e||e.length===0)return null;let{base:n=Math.E,normalize:r=!0}=t;if(n<=0||n===1)return null;let o=e.length,i=Math.log(n);if(r){let s=new Map,a=0;for(let c=0;c<o;c++){let u=e[c];if(u==null||Number.isNaN(u))continue;let f=lt(u);s.set(f,(s.get(f)||0)+1),a++}if(a===0)return null;let l=0;for(let c of s.values()){let u=c/a;u>0&&(l-=u*(Math.log(u)/i))}return M(l)?((l<0||Object.is(l,-0))&&(l=0),l):null}else{let s=[],a=0;for(let u=0;u<o;u++){let f=e[u];if(f==null||Number.isNaN(f))continue;let p=Number(f);if(!M(p)||p<0)return null;p>0&&(s.push(p),a+=p)}if(s.length===0||a<=0)return null;let l=0,c=s.length;for(let u=0;u<c;u++){let f=s[u]/a;f>0&&(l-=f*(Math.log(f)/i))}return M(l)?((l<0||Object.is(l,-0))&&(l=0),l):null}}function Ne(e,t){if(!e||e.length===0)return null;let n=null,r=e.length;for(let o=0;o<r;o++){let i=zt(e[o],{range:"Int64"});i!==null&&(n=n===null?i:t(n,i))}return n===null?null:n>=Number.St&&n<=Number.K?Number(n):n}function wr(e,t){if(!e||e.length===0)return null;let n=e.length,r=new Array(n),o=new Array(n);for(let s=0;s<n;s++){let a=e[s];r[s]=a?.[0],o[s]=a?.[1]}let i=K(o)[t];return i!==null?r[i]:null}function In(e,t,n={}){if(!e||e.length===0)return[];let r=e.length,{nullify:o=!1}=n,i=V(t);if(!i&&!t)return o?new Array(r).fill(null):[];let s=[];for(let a=0;a<r;a++)(i?t[a]:t)?s.push(e[a]):o&&s.push(null);return s}var Ei,Zn=j(()=>{"use strict";Rt();vt();Qn();mn();tt();Ei={sum:null,product:null,count:0,min:null,max:null,nanMin:null,nanMax:null,minIdx:null,maxIdx:null,mean:null,variance:0,std:0,nullCount:0,nanCount:0,len:0,hasNulls:!1,isNumeric:!1}});function Li(e,t={}){let n=t?.trim?pt(e)??"":e,r=n.length;if(r<2)return!1;let o=n[0],i=n[r-1];return o==="{"&&i==="}"||o==="["&&i==="]"}function te(e,t={}){let n="fallback"in t?t.fallback:e;if(typeof e!="string")return n;let{format:r="json",allowPrimitives:o=!1,trimBeforeParse:i=!1,reviver:s,ndjson:a={},guard:l,onError:c}=t,u=i?e.trim():e;try{let f;if(r==="ndjson"){let{skipInvalidLines:p=!1,maxLines:m,skipLines:y=0}=a,d=[],h=new RegExp(Jo,"g"),g=0,x=0;for(;m===void 0||d.length<m;){let O=h.exec(u),w=(O?u.substring(g,O.index):u.substring(g)).trim();if(O&&(g=h.lastIndex),w===""){if(!O)break;continue}if(x++,x<=y){if(!O)break;continue}if(!o&&!Li(w)){if(!p)throw new N("NDJSON line is not wrapped and primitives are disallowed");if(!O)break;continue}try{d.push(JSON.parse(w,s))}catch(A){if(!p)throw A}if(!O)break}let b=x>y;if(d.length===0&&b&&m!==0)throw new Ht("No valid NDJSON lines processed");f=d}else{if(!o&&!Li(u,{trim:!i}))throw new N("JSON string is not wrapped and primitives are disallowed");f=JSON.parse(u,s)}if(l&&!l(f))throw new N("Parsed value failed guard validation");return f}catch(f){try{c?.(f)}catch{}return n}}function Yt(e={}){let t=e.bigintStrategy??"string",n=e.handleCircular?new WeakSet:null,r=Array.isArray(e.replacer)?e.replacer.map(String):null;return function(i,s){let a=s;if(typeof e.replacer=="function")a=e.replacer.call(this,i,s);else if(r&&i!==""&&!Array.isArray(this)&&!r.includes(i))return;if(a===void 0)return;let l=a===s&&this!=null?this[i]:a;if(typeof e.onCustom=="function"){let f=e.onCustom.call(this,i,l);if(f!==l||f===void 0&&l!==void 0)return f}let c=a!==null&&typeof a=="object"||typeof a=="bigint"?a:l,u=v(c)?Q(c):c;if(u!==null&&typeof u!="object"&&typeof u!="bigint")return a;if(n&&(v(u)||Array.isArray(u))){if(i===""&&(n=new WeakSet),n.has(u))return e.onCircular?e.onCircular.call(this,i,u):"[Circular]";n.add(u)}return typeof u=="bigint"?e.voidBigIntReplacement?a:e.onBigInt?e.onBigInt(u):t==="number"&&Tn(u,{range:{min:BigInt(Number.St),max:BigInt(Number.K)}})?Number(u):u.toString():ot(u)?e.voidTypedArrayReplacement?a:e.onTypedArray?e.onTypedArray(u):Array.from(u):ge(u)?e.voidSetReplacement?a:e.onSet?e.onSet(u):Array.from(u):be(u)?e.voidMapReplacement?a:e.onMap?e.onMap(u):Array.from(u.entries()):mt(u)?e.voidRegExpReplacement?a:e.onRegExp?e.onRegExp(u):u.toString():L(u)?e.voidDateReplacement?a:e.onDate?e.onDate(u):e.formatDate?e.formatDate(u):u.toISOString():Ko(u)?e.onError?e.onError(u):{name:u.name,message:u.message,stack:u.stack}:$o(u)?e.onURLSearchParams?e.onURLSearchParams(u):u.toString():a}}function Tl(e){let t=e.trim().replace(/^\$/,"");if(!t)return[];let n=[],r=/\.\.\[\s*(?:'((?:\\.|[^'])*)'|"((?:\\.|[^"])*)"|(\*))\s*\]|\.\.([^\.\[]+)|\.([\w$-]+|\*)|\[\s*(?:'((?:\\.|[^'])*)'|"((?:\\.|[^"])*)"|(\*)|(-?\d*(?::-?\d*){0,2}))\s*\]/g,o,i=0;for(;(o=r.exec(t))!==null;){if(o.index!==i)return null;i=r.lastIndex;let[,s,a,l,c,u,f,p,m,y]=o,d=s??a,h=f??p;if(d!==void 0)n.push({type:"rec",key:$i(d)});else if(l!==void 0)n.push({type:"rec",key:Ar});else if(c!==void 0)n.push({type:"rec",key:c});else if(u!==void 0)n.push(u===Ar?{type:"wildcard"}:{type:"prop",key:u});else if(h!==void 0)n.push({type:"prop",key:$i(h)});else if(m!==void 0)n.push({type:"wildcard"});else if(y!==void 0)if(y.includes(":")){let[g,x,b]=y.split(":");n.push({type:"slice",start:gt(g)??void 0,end:gt(x)??void 0,step:gt(b)??1})}else{let g=gt(y);if(g===null)return null;n.push({type:"idx",idx:g})}}return i===t.length?n:null}function qi(e,t,n,r=new Set){if(e==null||!Ki(t.key)||typeof e!="object"||r.has(e))return;r.add(e);let o=Array.isArray(e);if(!o&&!v(e))return;t.key===Ar?Gi(e,{type:"wildcard"},n):!o&&Object.prototype.hasOwnProperty.call(e,t.key)&&n.push(e[t.key]);let i=o?e:Object.values(e);for(let s=0;s<i.length;s++)qi(i[s],t,n,r)}function Gi(e,t,n){if(e!=null)switch(t.type){case"prop":v(e)&&Ki(t.key)&&Object.prototype.hasOwnProperty.call(e,t.key)&&n.push(e[t.key]);break;case"idx":{if(!Array.isArray(e))break;let r=t.idx<0?e.length+t.idx:t.idx;r>=0&&r<e.length&&n.push(e[r]);break}case"slice":{if(!Array.isArray(e)||t.step===0)break;let r=t.step??1,o=t.start??(r>0?0:e.length-1),i=Ce(e,{step:r,offsetStart:o,offsetEnd:t.end,nullOnOob:!0});if(i)for(let s=0;s<i.length;s++)n.push(i[s]);break}case"wildcard":{let r=Array.isArray(e)?e:v(e)?Object.values(e):null;if(r)for(let o=0;o<r.length;o++)n.push(r[o]);break}case"rec":qi(e,t,n);break}}function Ji(e,t){if(e==null||Wi(t))return null;let n=e;if(typeof e=="string"){let s=e.trim();if(s==="")return null;let a=te(s,{allowPrimitives:!0,fallback:Vi});if(a===Vi)throw new N(`Invalid JSON string encountered in jsonPathMatch: "${e}"`);n=a}let r=Tl(t);if(r===null)return null;let o=[n];for(let s=0;s<r.length;s++){if(o.length===0)return null;let a=[];for(let l=0;l<o.length;l++)Gi(o[l],r[s],a);o=a}if(o.length===0||o[0]==null)return null;let i=o[0];if(v(i)||Array.isArray(i))try{return JSON.stringify(i,Yt({handleCircular:!0}))}catch{return null}return String(i)}var Vi,Ar,$i,Ki,ne=j(()=>{"use strict";Zn();Rt();vt();mn();tt();Ot();Vi=Symbol("invalid");Ar="*",$i=e=>e.replace(/\\(.)/g,(t,n)=>yi[n]??n),Ki=e=>e!==void 0&&e!=="__proto__"&&e!=="constructor"&&e!=="prototype"});function El(e){return!v(e)||xe(e)?!1:ArrayBuffer.isView(e)?ar(e)||Go(e)||qo(e):we(e)||Ae(e)}function Xi(e,t){if(e==null)return!1;try{if(El(e))return!0;if(t?.strict)return!1;if(typeof e=="string")return!0;if(ArrayBuffer.isView(e))return!xe(e);if(Array.isArray(e))return H(e,zi)}catch{return!1}return!1}function ke(e,t){if(e==null)return null;try{if(ar(e))return e;if(xe(e))return null;if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(we(e)||Ae(e))return new Uint8Array(e);if(t?.strict)return null;if(typeof e=="string")return Wt.encode(e);if(Array.isArray(e)&&H(e,zi))return Uint8Array.from(e)}catch{return null}return null}var Il,zi,Sr=j(()=>{"use strict";Rt();vt();Zn();Ot();Il={range:"UInt8"},zi=e=>At(e,Il)});function Wi(e){let t=Q(e);return typeof t=="string"?t.trim().length===0:!1}function Yi(e,t="both"){return t==="start"?e.trimStart():t==="end"?e.trimEnd():e.trim()}function pt(e,t=null,n={}){let{mode:r="both",returnStringOnNull:o=!1,maxScanStart:i=1,maxScanEnd:s=1,maxMatchesStart:a=1,maxMatchesEnd:l=1,trimFirst:c=!1,stringOptions:u}=n;if(e==null)return o?"":null;let f=R=>o||R.length>0?R:null;if(t==null)return f(Yi(e,r));let p=c?Yi(e,r):e,m=p.length;if(m===0)return o?"":null;let y=mt(t);if(!y&&typeof t!="string"||typeof t=="string"&&t.length===0)return f(p);let{literal:d=!1,caseInsensitive:h=!1}=u??{},g=y?t:d?Tt(t):`[${Tt(t)}]+`,x=y&&t.ignoreCase||h,b=ss(p,g,0,{asciiCaseInsensitive:x},()=>null),O=b.length;if(O===0)return f(p);let w=new Uint8Array(m),A=!1,I=(R,F,E)=>{if(E===0)return;let _=0,P=R?0:m,W=0,B=R?0:O-1,st=R?O:-1,kt=R?1:-1;for(let ct=B;ct!==st;ct+=kt){let ft=b[ct],$n=R?ft.start-P:P-ft.end;if($n>0&&(_+=$n,F!==null&&F>=0&&_>=F)||(($n>0||d||W===0)&&W++,E!==null&&E>=0&&W>E))break;for(let ln=ft.start;ln<ft.end;ln++)w[ln]=1;A=!0,P=R?ft.end:ft.start}};if((r==="both"||r==="start")&&I(!0,i,a),(r==="both"||r==="end")&&I(!1,s,l),!A)return f(p);let C="";for(let R=0;R<m;R++)w[R]===0&&(C+=p[R]);return f(C)}function lt(e,{depth:t=0,maxDepth:n=50}={}){if(t>n)return"v:circular";if(e===null)return"v:null";if(e===void 0)return"v:undefined";if(e=Q(e),L(e))return`d:${e.getTime()}`;if(ot(e)){let o=e.toString();return`u:${e.constructor.name}:${o.length}:${o}`}if(Array.isArray(e)){let o=e.length,i=new Array(o),s={depth:t+1,maxDepth:n};for(let a=0;a<o;a++)i[a]=lt(e[a],s);return`a:[${i.join(Yn)}]`}if(ge(e)){let o=Array.from(e),i=o.length,s=new Array(i),a={depth:t+1,maxDepth:n};for(let l=0;l<i;l++)s[l]=lt(o[l],a);return s.sort(),`set:[${s.join(Yn)}]`}if(be(e)){let o=Array.from(e.keys()),i=o.length,s=new Array(i),a={depth:t+1,maxDepth:n};for(let l=0;l<i;l++){let c=o[l],u;try{u=e.get(c)}catch{u="v:error"}s[l]=`${lt(c,a)}${Xn}${lt(u,a)}`}return s.sort(),`map:{${s.join(Yn)}}`}if(typeof e=="object"&&typeof e.toJSON=="function")try{let o=e.toJSON();if(o!==e)return`j:${lt(o,{depth:t+1,maxDepth:n})}`}catch{}if(mt(e)){let o=e.toString();return`r:${o.length}:${o}`}if(Ft(e)){let o=Object.keys(e).sort(),i=o.length,s=new Array(i),a={depth:t+1,maxDepth:n};for(let l=0;l<i;l++){let c=o[l],u;try{u=e[c]}catch{u="v:error"}s[l]=`${lt(c,a)}${Xn}${lt(u,a)}`}return`o:{${s.join(Yn)}}`}if(typeof e=="function"){let o=e.toString();return`f:${o.length}:${o}`}if(typeof e=="string")return`s:${e.length}:${e}`;if(typeof e=="symbol"){let o=e.toString();return`y:${o.length}:${o}`}if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return`${typeof e}:${e}`;let r=String(e);return`${typeof e}:${r.length}:${r}`}function _l(e){if(e==null)return[];let t=String(e);if(!t)return[];let r=t.normalize("NFC").replace(Dl,"$1").match(Cl)||[],o=[];for(let i=0;i<r.length;i++){let s=r[i];Rl.has(s)||o.push(s)}return o}function Or(e,t=0){let n=e.codePointAt(t);return n!=null&&n>65535?2:1}function Cn(e,t){let n=_l(e),r=n.length;if(r===0)return"";let{format:o}=t??{};if(o==="camel"||o==="pascal"||o==="title"){let i=o==="title"?" ":"",s=new Array(r);for(let a=0;a<r;a++){let l=n[a];if(a===0&&o==="camel")s[a]=l.toLowerCase();else{let c=Or(l,0);s[a]=l.slice(0,c).toUpperCase()+l.slice(c).toLowerCase()}}return s.join(i)}if(o==="kebab"||o==="snake"){let i=o==="kebab"?"-":"_",s=new Array(r);for(let a=0;a<r;a++)s[a]=n[a].toLowerCase();return s.join(i)}return n.join(" ")}function es(e){return typeof e!="string"&&(e=String(e)),Wt.encode(e)}function jl(e){let t=ke(e);if(!t)return"";if(ts&&typeof Uint8Array.prototype.toBase64=="function")return t.toBase64();if(Me)return ee.from(t).toString("base64");let n="",r=t.length;for(let o=0;o<r;o+=Hi){let i=t.subarray(o,o+Hi);n+=String.fromCharCode.apply(null,i)}return btoa(n)}function vl(e){if(typeof e!="string"&&(e=String(e)),Me)return ee.from(e,"utf-8").toString("hex");let t=es(e),n=t.length,r="";for(let o=0;o<n;o++)r+=ns[t[o]];return r}function Bl(e){typeof e!="string"&&(e=String(e));let t=es(e);return jl(t)}function rs(e,t){if(e==null)return null;let n=Pl[t];if(!n)throw new Error(`Unsupported encoding: '${t}'. Supported encodings are 'hex' and 'base64'.`);return n(String(e))}function Vl(e){typeof e!="string"&&(e=String(e));let t=e.replace(Ml,r=>kl[r]),n=t.length%4;return n===0?t:t.padEnd(t.length+(4-n),"=")}function Ll(e,t=!0){if(typeof e!="string"&&(e=String(e)),e!==""&&(e.length%4!==0||!Ul.test(e)))throw new Error("Invalid base64 encoding format");if(ts)return Uint8Array.fromBase64(e,{strict:t});if(Me)return new Uint8Array(ee.from(e,"base64"));let n=atob(e),r=n.length,o=new Uint8Array(r);for(let i=0;i<r;i++)o[i]=n.charCodeAt(i);return o}function $l(e){typeof e!="string"&&(e=String(e));let t=e.trim();if(t.length%2!==0||!Fl.test(t))throw new Error("Invalid hex string format");if(Nl)return Uint8Array.fromHex(t);if(Me){let r=ee.from(t,"hex");if(r.length!==t.length/2)throw new Error("Invalid hex string format");return new Uint8Array(r)}let n=new Uint8Array(t.length/2);for(let r=0;r<n.length;r++){let o=parseInt(t.substring(r*2,r*2+2),16);if(Number.isNaN(o))throw new Error("Invalid hex string format");n[r]=o}return n}function Kl(e,t=!0){if(e==null)return null;try{let n=$l(e);return(t?ur:lr).decode(n)}catch(n){if(t)throw n;return null}}function ql(e,t=!0){if(e==null)return null;try{let n=typeof e=="string"?e.trim():String(e).trim(),r=Vl(n),o=Ll(r,t);return(t?ur:lr).decode(o)}catch(n){if(t)throw n;return null}}function os(e,t,n={}){if(e==null)return null;let r=Gl[t];if(!r)throw new Error(`Unsupported encoding: '${t}'. Supported encodings are 'hex' and 'base64'.`);let o=typeof n=="boolean"?n:n.strict??!0;return r(String(e),o)}function Xl(e,t={}){if(!At(e,{range:"UInt16"}))return!1;let{type:n="all"}=t;switch(n){case"high":return e>=pr&&e<=mi;case"low":return e>=pi&&e<=yr;case"all":return e>=pr&&e<=yr;default:return!1}}function Zi(e){let t=e.codePointAt(0),n=t<=ci||t===fi,r=e.length===1&&Xl(t);if(n||r){let o=dr[t];if(o)return o;let i=t.toString(16);return n?`\\x${i.padStart(2,"0")}`:`\\u${i.padStart(4,"0")}`}return"\\"+e}function Tt(e,t){let n=Q(e);if(n==null)return"";let r=mt(n)?n.source:typeof n=="string"?n:String(n);return(t?.mode??"tc39")==="tc39"?typeof RegExp.escape=="function"&&!Jl.test(r)?RegExp.escape(r):r.replace(Wl,Zi):r.replace(zl,Zi)}function pn(e,t,n){if(e==null||t==null)return null;let r=typeof e=="string"?e:String(e),o=n?.global??!1;try{let i=mt(t),s=i?t.source:typeof t=="string"?t:String(t),a=i?t.flags.replace(/y/g,""):"";if(o?a.includes("g")||(a+="g"):a=a.replace(/g/g,""),n?.asciiCaseInsensitive!==void 0&&(a=n.asciiCaseInsensitive?a.includes("i")?a:a+"i":a.replace(/i/g,"")),(s.includes("\\p{")||s.includes("\\P{"))&&!a.includes("u")&&!a.includes("v"))try{let c=new RegExp(s,a+"u");return c.lastIndex=0,{reg:c,input:r}}catch{try{let c=new RegExp(s,a+"v");return c.lastIndex=0,{reg:c,input:r}}catch{}}let l=new RegExp(s,a);return l.lastIndex=0,{reg:l,input:r}}catch{return null}}function Qi(e){let t=Object.create(null);e.index!==void 0&&Object.defineProperty(t,"_index",{value:String(e.index),writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"_length",{value:e.length,writable:!0,enumerable:!1,configurable:!0});for(let n=0;n<e.length;n++)t[String(n)]=e[n]!==void 0?e[n]:null;if(e.groups)for(let n in e.groups){let r=e.groups[n];t[n]=r!==void 0?r:null}return t}function Tr(e,t){if(typeof t=="string")return t in e?e[t]:null;let n=Number(t);if(Number.isNaN(n))return null;let r=Math.trunc(n);if(r>=0)return e[String(r)]??null;let i=(e.It??0)+r;return i>=1?e[String(i)]??null:null}function ss(e,t,n,r,o){let{literal:i=!1,mode:s,asciiCaseInsensitive:a=!1}=r??{},l=i?Tt(t,{mode:s}):t,u=pn(e,l,{global:!0,asciiCaseInsensitive:a})?.reg??null;if(!u)return[];let f=[];u.lastIndex=0;let p;for(;(p=u.exec(e))!==null;){let m=p.index,y=u.lastIndex,d=o(p,m,y);if(f.push({start:m,end:y,patternIndex:n,payload:d}),m===y){if(m===e.length)break;u.lastIndex=m+Or(e,m)}}return f}function as(e){if(e.length<=1)return e;e.sort((o,i)=>{if(o.start!==i.start)return o.start-i.start;let s=o.patternIndex??o.i??0,a=i.patternIndex??i.i??0;return s-a});let t=[],n=0,r=e.length;for(let o=0;o<r;o++){let i=e[o];i.start>=n&&(t.push(i),n=i.end)}return t}function ls(e,t,n,r,o){let{overlapping:i=!1,leftmost:s,...a}=n??{},l=s??!0;if(i&&s)throw new N("Cannot specify both 'overlapping' and 'leftmost' as true.");if(e==null||t==null)return null;let c=bt(t),u=c.length;if(u===0)return[];if(i){let m=new Array(u);for(let y=0;y<u;y++)m[y]=r(c[y]);return m}let f=[];for(let m=0;m<u;m++){let y=Ue(e,c[m],{...a,global:!1});if(y&&y[0]&&y[0].At!=null){let d=Number(y[0].At),h=y[0][0]?.length??0;f.push({i:m,start:d,end:d+h,payload:o(y[0],d)})}}let p=new Array(u).fill(null);if(f.length===0)return p;if(l){let m=as(f);for(let y=0;y<m.length;y++){let d=m[y];p[d.i]=d.payload}}else{let m=[];f.sort((h,g)=>h.i-g.i);let y=f.length;for(let h=0;h<y;h++){let g=f[h],x=!1,b=m.length;for(let O=0;O<b;O++){let w=m[O],A=!1;if(g.start===g.end&&w.start===w.end?A=g.start===w.start:w.start===w.end?A=w.start>=g.start&&w.start<g.end:g.start===g.end?A=g.start>=w.start&&g.start<w.end:A=g.start<w.end&&g.end>w.start,A){x=!0;break}}x||m.push(g)}let d=m.length;for(let h=0;h<d;h++){let g=m[h];p[g.i]=g.payload}}return p}function Ue(e,t,n){let r=pn(e,t,n);if(!r)return null;if(!n?.global){let s=r.input.match(r.reg);return s?[Qi(s)]:null}let o=Array.from(r.input.matchAll(r.reg));if(o.length===0)return null;let i=new Array(o.length);for(let s=0;s<o.length;s++)i[s]=Qi(o[s]);return i}function Er(e,t,n){let r=Ue(e,t,n);return r?Tr(r[0],n?.groupIndex??1):null}function us(e,t,n){let r=Ue(e,t,{...n,global:!0});if(!r)return null;let o=n?.groupIndex??0,i=new Array(r.length);for(let s=0;s<r.length;s++)i[s]=Tr(r[s],o);return i}function cs(e,t,n){return Ue(e,t,n)?.[0]??null}function fs(e,t,n){let r=n?.groupIndex??0;return ls(e,t,n,o=>Er(e,o,{...n,groupIndex:r}),o=>Tr(o,r))}function Ir(e,t){return mt(e)?new RegExp(Tt(e,{mode:t}),e.flags):Tt(e,{mode:t})}function Dn(e,t,n){if(e==null||t==null)return null;let{literal:r=!1,mode:o,...i}=n??{},s=r?Ir(t,o):t,a=pn(e,s,{...i,global:!1});if(!a)return null;let l=a.input.match(a.reg);return!l||l.index==null?null:Wt.encode(a.input.slice(0,l.index)).length}function ms(e,t,n){if(n?.literal){if(e==null||t==null)return null;let r=bt(t),o=new Array(r.length);for(let i=0;i<r.length;i++)o[i]=Dn(e,r[i],n);return o}return ls(e,t,n,r=>Dn(e,r,n),(r,o)=>Wt.encode(e.slice(0,o)).length)}function ps(e,t,n){if(e==null||t==null)return null;let{literal:r=!0,inclusive:o=!1,limit:i,exact:s=!1,strict:a=!1,mode:l,...c}=n??{},u=r?Ir(t,l):t,f=pn(e,u,{...c,global:!0});if(!f)return null;let{reg:p}=f;p.lastIndex=0;let m=[],y=0,d=0,h=i!=null&&i>=0?i:1/0,g;for(;d<h&&(g=p.exec(e))!==null;){let b=g.index,O=p.lastIndex;if(b===O){if(b===e.length||b>0&&b>=y&&(m.push(e.slice(y,b)),d++,y=b,d>=h))break;p.lastIndex=b+Or(e,b);continue}m.push(e.slice(y,o?O:b)),y=O,d++}if(m.push(e.slice(y)),i==null||i<0)return m;let x=i+1;if(a&&m.length<x)throw new N(`split exact error: expected string to split into at least ${x} parts, but got ${m.length}`);if(s)for(;m.length<x;)m.push(null);return m}function ys(e,t,n,r,o,i){return e.includes("$")?e.replace(/\$\$|\$([$'`&]|\d{1,2}|<[^>]+>)/g,(s,a)=>{if(s==="$$"||a==="$")return"$";if(!a)return s;if(a==="&")return t;if(a==="`")return r.slice(0,n);if(a==="'")return r.slice(n+t.length);if(a.startsWith("<"))return i?i[a.slice(1,-1)]??"":s;let l=Number(a);if(l>0&&l<=o.length)return o[l-1]??"";if(a.length===2){let c=Number(a[0]);if(c>0&&c<=o.length)return(o[c-1]??"")+a[1]}return s}):e}function re(e,t,n,r){if(e==null||t==null||n==null)return null;let o=typeof e=="string"?e:String(e),{literal:i=!1,n:s,mode:a,...l}=r??{},c=s??(l?.global?1/0:1),u=M(c,{allowNonFiniteNumbers:!0,allowNaN:!1})?Math.trunc(c):1;if(u===0)return o;let f=i?Ir(t,a):t,p=pn(o,f,{...l,global:l?.global??u!==1});if(!p)return o;let{reg:m}=p,y=typeof n=="function";if(u===1||u<0||u===1/0){if(i&&!y){let g=String(n);return o.replace(m,()=>g)}return o.replace(m,n)}let d=0,h=y?"":String(n);return o.replace(m,(...g)=>{if(d++>=u)return g[0];if(y)return String(n(...g));if(i)return h;let x=g.length,b=typeof g[x-1]=="object"&&g[x-1]!==null,O=b?g[x-1]:void 0,w=b?g[x-3]:g[x-2],A=g.slice(1,b?x-3:x-2);return ys(h,g[0],w,o,A,O)})}function ds(e,t,n,r){if(e==null||t==null)return null;let o=typeof e=="string"?e:String(e),i=Ft(t);if(!i&&!Array.isArray(t))return o;let s=i?Object.keys(t):t,a=s.length;if(a===0)return o;let l=null,c=null;if(i)l=Object.values(t);else if(Array.isArray(n))if(n.length===1&&a>1)c=n[0];else{if(n.length!==a)throw new N(`replaceMany length mismatch: expected ${a} replacement strings, got ${n.length}`);l=n}else if(n!=null)c=n;else return o;let u=[];for(let d=0;d<a;d++){let h=s[d],g=l?l[d]:c;if(h==null||g==null)continue;let x=ss(o,h,d,r,(b,O)=>{let w=Array.prototype.slice.call(b,1);if(typeof g=="function"){let I=[b[0],...w,O,o];return b.groups!==void 0&&I.push(b.groups),String(g(...I))}let A=String(g);return r?.literal?A:ys(A,b[0],O,o,w,b.groups)});for(let b=0;b<x.length;b++)u.push(x[b])}if(u.length===0)return o;let f=as(u),p="",m=0,y=f.length;for(let d=0;d<y;d++){let h=f[d];p+=o.slice(m,h.start)+h.payload,m=h.end}return p+=o.slice(m),p}var Dl,Cl,Rl,ee,Me,Nl,ts,Hi,ns,kl,Ml,Ul,Fl,Wu,Pl,Gl,Jl,is,Wl,zl,mn=j(()=>{"use strict";Rt();Zn();ne();Sr();vt();Ot();tt();Dl=/(\p{L})['’]+(?=\p{L})/gu,Cl=new RegExp(["[\\p{Lu}\\p{M}]+s(?![\\p{Ll}\\p{M}])","[\\p{Lu}\\p{M}]+(?=[\\p{Lu}\\p{M}][\\p{Ll}\\p{M}])","[\\p{Lu}\\p{M}]+[\\p{Ll}\\p{M}]*","[\\p{Ll}\\p{M}]+","\\p{N}+","[\\p{L}\\p{M}]+"].join("|"),"gu"),Rl=new Set(["__proto__","proto","constructor","prototype"]);ee=typeof globalThis<"u"?globalThis.Buffer:void 0,Me=typeof ee<"u",Nl=typeof Uint8Array<"u"&&typeof Uint8Array.fromHex=="function",ts=typeof Uint8Array<"u"&&typeof Uint8Array.fromBase64=="function",Hi=8192,ns=new Array(256);for(let e=0;e<256;e++)ns[e]=e.toString(16).padStart(2,"0");kl={"-":"+",_:"/"},Ml=/[-_]/g,Ul=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,Fl=/^[0-9a-fA-F]*$/,Wu=Yt({handleCircular:!0});Pl={hex:vl,base64:Bl};Gl={hex:Kl,base64:ql};Jl=/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,is="\\x00-\\x1F\\x7F\\u{D800}-\\u{DFFF}",Wl=new RegExp(`[${is}\\\\^$*+?.()|[\\]{}/#,=<>&!%:;@~'"\`-]`,"gu"),zl=new RegExp(`[${is}]|[\\x20-\\x2F\\x3A-\\x40\\x5B-\\x5E\\x5F\\x60\\x7B-\\x7E]`,"gu")});function Zl(e){let t=hs.get(e);return t||(t=new Intl.DateTimeFormat("en-US",{timeZone:e,hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3}),hs.set(e,t)),t}function Ql(e,t){let n=`${e}_${t}`,r=gs.get(n);return r||(r=new Intl.DateTimeFormat(e,{timeZoneName:"short",timeZone:t}),gs.set(n,r)),r}function tu(e){let t=bs.get(e);if(t===void 0){try{Intl.DateTimeFormat(void 0,{timeZone:e}),t=!0}catch{t=!1}bs.set(e,t)}return t}function je(e){let t=!e||e==="local"?Intl.DateTimeFormat().resolvedOptions().timeZone:e;return tu(t)?t:"UTC"}function nt(e,t=0,n=1,r=0,o=0,i=0,s=0){let a=new Date(0);return a.setUTCFullYear(e,t,n),a.setUTCHours(r,o,i,s),a}function ve(e,t){let n=je(t);if(n.toUpperCase()==="UTC")return{year:e.getUTCFullYear(),month:e.getUTCMonth()+1,day:e.getUTCDate(),hour:e.getUTCHours(),minute:e.getUTCMinutes(),second:e.getUTCSeconds(),ms:e.getUTCMilliseconds(),dayOfWeek:e.getUTCDay(),timeZone:"UTC"};let o=Zl(n).formatToParts(e),i={year:"0",month:"0",day:"0",hour:"0",minute:"0",second:"0",fractionalSecond:"0"};for(let p=0,m=o.length;p<m;p++){let y=o[p];y.type in i&&(i[y.type]=y.value)}let s=parseInt(i.year,10),a=parseInt(i.month,10),l=parseInt(i.day,10),c=parseInt(i.hour,10);c===24&&(c=0);let u=Math.round(parseFloat("0."+i.fractionalSecond)*1e3)||0,f=nt(s,a-1,l).getUTCDay();return{year:s,month:a,day:l,hour:c,minute:parseInt(i.minute,10),second:parseInt(i.second,10),ms:u,dayOfWeek:f,timeZone:n}}function oe(e,t){if(t.toUpperCase()==="UTC")return 0;let n=ve(e,t),r=nt(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.ms).getTime();return Math.round((r-e.getTime())/Mt)}function X(e,t){let n=Q(e);if(n==null)return null;let r=null;if(L(n))r=n;else if(typeof n=="number"||typeof n=="bigint")r=new Date(nu(n));else if(typeof n=="string"){let o=n.trim();if(o.length===0)return null;r=new Date(o)}return!r||!L(r)?null:t?.dateOnly?nt(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()):r}function Be(e){let t=Q(e);if(t==null)return null;let n=null;if(typeof t=="string"){let o=t.trim();if(Yl.test(o)){let i=Hl.test(o);n=X(`1970-01-01T${o}${i?"":"Z"}`)}}let r=n??X(t);return r?ie(r,{format:"%H:%M:%S.%ms"}):null}function ws(e,t="ms"){let n=e.getTime();switch(t){case"s":return Math.floor(n/_t);case"ms":return n;case"us":return BigInt(n)*cr;case"ns":return BigInt(n)*fr}}function nu(e){if(typeof e=="bigint"){let n=e<0n?-e:e;return n<=30000000000n?Number(e)*_t:n<=100000000000000n?Number(e):n<=100000000000000000n?Number(e/cr):Number(e/fr)}let t=Math.abs(e);return t<=3e10?e*_t:t<=1e14?e:t<=1e17?Math.floor(e/Wn):Math.floor(e/zn)}function As(e){if(!L(e))return null;let t=nt(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()).getTime(),n=nt(e.getUTCFullYear(),0,1).getTime();return Math.floor((t-n)/St)+1}function xs(e,t,n,r="week"){let o=nt(e,t-1,n);if(o.setUTCDate(o.getUTCDate()+4-(o.getUTCDay()||7)),r==="year")return o.getUTCFullYear();let i=As(o);return i!=null?Math.floor((i-1)/7)+1:null}function Os(e){return e.replace(/%[FTRDh]/g,t=>ru[t]||t)}function ie(e,{format:t,locale:n,timeZone:r="UTC"}){if(!L(e)||typeof t!="string")return"";let o=je(r),i=n&&n.trim()||Intl.DateTimeFormat().resolvedOptions().locale||"en-US",s=Os(t),a=null,l=()=>a??(a=ve(e,o));return s.replace(Ss,(c,u)=>{if(u==="%")return"%";let f=Dr[u];return f?f.c(e,i,o,l()):c})}function ou(e){let t=e.replace(":",""),n=t[0]==="+"?1:-1,r=parseInt(t.slice(1,3),10)||0,o=parseInt(t.slice(3,5),10)||0;return n*(r*60+o)}function Ts(e,{format:t,strict:n=!0,defaultTimeZone:r="UTC"}){if(typeof e!="string"||typeof t!="string")return null;let o=Os(t),i=[],s=0,a="";o.replace(Ss,(m,y,d)=>{if(a+=Tt(o.slice(s,d)),s=d+m.length,y==="%")return a+="%",m;let h=Dr[y];return h?.g?(i.push(h),a+=`(${h.g})`):a+=Tt(m),m}),a+=Tt(o.slice(s));let l=e.match(new RegExp(`^\\s*${a}\\s*$`));if(!l)return n?null:X(e);let c={year:1970,month:1,day:1,hour:0,minute:0,second:0,ms:0,offset:null},u=null,f=!1;for(let m=0,y=i.length;m<y;m++){let d=l[m+1],h=i[m],g=h.D?h.D(d):parseInt(d,10);h.u==="j"&&(f=!0),h.x==="ampm"?u=g:h.x==="offset"?c.offset=g:h.x&&(c[h.x]=g)}if(u==="PM"&&c.hour<12&&(c.hour+=12),u==="AM"&&c.hour===12&&(c.hour=0),f){if(c.day<1)return null;let m=nt(c.year,0,c.day);if(m.getUTCFullYear()!==c.year)return null;c.month=m.getUTCMonth()+1,c.day=m.getUTCDate()}let p=nt(c.year,c.month-1,c.day,c.hour,c.minute,c.second,c.ms);if(!L(p)||p.getUTCFullYear()!==c.year||p.getUTCMonth()+1!==c.month||p.getUTCDate()!==c.day||p.getUTCHours()!==c.hour||p.getUTCMinutes()!==c.minute||p.getUTCSeconds()!==c.second||p.getUTCMilliseconds()!==c.ms)return null;if(c.offset)p=new Date(p.getTime()-ou(c.offset)*Mt);else if(r.toUpperCase()!=="UTC"){let m=je(r);p=new Date(p.getTime()-oe(p,m)*Mt)}return L(p)?p:null}function Es(e,t=[]){let n=new Set;if(!e)return n;let r=t.length>0;for(let o of e){let i=X(o,{dateOnly:!0});!i||r&&t.includes(i.getUTCDay())||n.add(i.getTime())}return n}function Fe(e,t,n){return t.length>0&&t.includes(e.getUTCDay())||n.has(e.getTime())}function Is(e,t,{excludeWeekdays:n=[],holidays:r=[],roll:o}={}){if(!At(t))throw new at(`The offset parameter 'n' must be a whole integer. Received: ${t}`);let i=Es(r,n);if(n.length===0&&i.size===0&&!o)return t;if(7-n.length<=0)throw new at("All weekdays are excluded; cannot offset.");let s=nt(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),a=new Date(s.getTime());if(o&&Fe(a,n,i)){if(o==="raise")throw new at("Start date falls on an excluded day or holiday.");let l=o==="forward"?1:-1;for(;Fe(a,n,i);)a.setUTCDate(a.getUTCDate()+l)}if(t!==0){let l=t>0?1:-1,c=Math.abs(t),u=0;for(;u<c;)a.setUTCDate(a.getUTCDate()+l),Fe(a,n,i)||u++}return Math.round((a.getTime()-s.getTime())/St)}function Ds(e,t={}){if(!L(e))return null;let n=t.excludeWeekdays??[0,6],r=Es(t.holidays,n),o=nt(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate());return!Fe(o,n,r)}function Cr(e,t,n){let r=je(t),o=n?.type??"total",i;if(o==="total")i=oe(e,r);else{let p=ve(e,r).year,m=oe(nt(p,0,1),r),y=oe(nt(p,6,1),r),d=Math.min(m,y);i=o==="daylightSavingTime"?oe(e,r)-d:d}let s=n?.format??"milliseconds";if(s==="minutes")return i;if(s==="hours")return i/60;if(s==="milliseconds")return i*Mt;let a=i>=0?"+":"-",l=Math.abs(i),c=String(Math.floor(l/60)).padStart(2,"0"),u=String(l%60).padStart(2,"0");return s==="iso"?`${a}${c}:${u}`:`${a}${c}${u}`}function Rn(e,t,n,r=!1){let o=e??t;return o<0?n+(r?1:0)+o:o}function Cs(e,t={}){let n=ve(e,t?.timeZone??void 0),r=t?.year??n.year,o=Rn(t?.month,n.month,12,!0)-1,i=nt(r,o+1,0).getUTCDate(),s=Rn(t?.day,n.day,i,!0),a=Rn(t?.hour,n.hour,24),l=Rn(t?.minute,n.minute,60),c=Rn(t?.second,n.second,60),u=Rn(t?.ms,n.ms,1e3);return nt(r,o,s,a,l,c,u)}var Yl,Hl,hs,gs,bs,Dr,eu,Ss,ru,Qn=j(()=>{"use strict";mn();tt();Rt();vt();Ot();Yl=/^\d{2}:\d{2}/,Hl=/(?:Z|[+-]\d{2}(?::?\d{2})?)$/i,hs=new Map;gs=new Map;bs=new Map;Dr={Y:{u:"Y",c:(e,t,n,r)=>{let o=r.year;return o>=0?String(o).padStart(4,"0"):"-"+String(Math.abs(o)).padStart(4,"0")},g:"[+-]?\\d{4,}",x:"year"},y:{u:"y",c:(e,t,n,r)=>String(Math.abs(r.year)%100).padStart(2,"0"),g:"\\d{2}",x:"year",D:e=>{let t=parseInt(e,10);return t+(t>=69?1900:2e3)}},m:{u:"m",c:(e,t,n,r)=>String(r.month).padStart(2,"0"),g:"\\d{2}",x:"month"},d:{u:"d",c:(e,t,n,r)=>String(r.day).padStart(2,"0"),g:"\\d{2}",x:"day"},e:{u:"e",c:(e,t,n,r)=>String(r.day).padStart(2," "),g:"\\s?\\d{1,2}",x:"day"},H:{u:"H",c:(e,t,n,r)=>String(r.hour).padStart(2,"0"),g:"\\d{2}",x:"hour"},I:{u:"I",c:(e,t,n,r)=>String(r.hour%12||12).padStart(2,"0"),g:"\\d{2}",x:"hour"},p:{u:"p",c:(e,t,n,r)=>r.hour>=12?"PM":"AM",g:"AM|PM|am|pm",x:"ampm",D:e=>e.toUpperCase()},M:{u:"M",c:(e,t,n,r)=>String(r.minute).padStart(2,"0"),g:"\\d{2}",x:"minute"},S:{u:"S",c:(e,t,n,r)=>String(r.second).padStart(2,"0"),g:"\\d{2}",x:"second"},A:{u:"A",c:(e,t,n)=>e.toLocaleDateString(t,{weekday:"long",timeZone:n})},a:{u:"a",c:(e,t,n)=>e.toLocaleDateString(t,{weekday:"short",timeZone:n})},B:{u:"B",c:(e,t,n)=>e.toLocaleDateString(t,{month:"long",timeZone:n})},b:{u:"b",c:(e,t,n)=>e.toLocaleDateString(t,{month:"short",timeZone:n})},j:{u:"j",c:(e,t,n,r)=>String(As(nt(r.year,r.month-1,r.day))??1).padStart(3,"0"),g:"\\d{3}",x:"day",D:e=>parseInt(e,10)},u:{u:"u",c:(e,t,n,r)=>String(r.dayOfWeek||7)},w:{u:"w",c:(e,t,n,r)=>String(r.dayOfWeek)},V:{u:"V",c:(e,t,n,r)=>String(xs(r.year,r.month,r.day,"week")??1).padStart(2,"0"),g:"\\d{2}",D:e=>parseInt(e,10)},G:{u:"G",c:(e,t,n,r)=>String(xs(r.year,r.month,r.day,"year")??r.year).padStart(4,"0"),g:"[+-]?\\d{4,}",D:e=>parseInt(e,10)},Z:{u:"Z",c:(e,t,n)=>{if(n.toUpperCase()==="UTC")return"UTC";let r=Ql(t,n).formatToParts(e);for(let o=0,i=r.length;o<i;o++)if(r[o].type==="timeZoneName")return r[o].value;return"UTC"}},z:{u:"z",c:(e,t,n)=>Cr(e,n,{format:"basic"}),g:"[+-]\\d{2}(?::?\\d{2})?",x:"offset",D:e=>e.replace(":","")},ms:{u:"ms",c:(e,t,n,r)=>String(r.ms).padStart(3,"0"),g:"\\d{1,3}",x:"ms",D:e=>parseInt(e.padEnd(3,"0").slice(0,3),10)},f:{u:"f",c:(e,t,n,r)=>String(r.ms).padStart(3,"0").padEnd(6,"0"),g:"\\d{1,9}",x:"ms",D:e=>parseInt(e.padEnd(6,"0").slice(0,3),10)}},eu=Object.keys(Dr).concat("%").sort((e,t)=>t.length-e.length),Ss=new RegExp("%("+eu.join("|")+")","g"),ru={"%F":"%Y-%m-%d","%T":"%H:%M:%S","%R":"%H:%M","%D":"%m/%d/%y","%h":"%b"}});var Z,Zt,_n,Bt,Pt,yn,Vt,dn,Pe=j(()=>{"use strict";Z=class e{matches(t){if(t==null)return!1;if(t instanceof e)return!!(this.equals(t)||this.name.startsWith("Decimal")&&t.name.startsWith("Decimal")&&t.precision===void 0&&t.scale===void 0);if(typeof t=="function"){if(t.prototype instanceof e)return this instanceof t;if(t.name==="Struct"||t.name==="StructType")return this.name==="Struct";if(t.name==="ArrayDataType"||t.name==="ArrayType"||t===Array)return this.name==="Array";try{let n=t();if(n instanceof e)return this.constructor===n.constructor}catch{}}return!1}get isNumeric(){return!1}get isInteger(){return!1}get isFloat(){return!1}get isSigned(){return!1}get isUnsigned(){return!1}get isTemporal(){return!1}get isNested(){return!1}get isBoolean(){return!1}get isString(){return!1}get isUtf8(){return!1}get isObject(){return!1}get isNull(){return!1}get isBinary(){return!1}},Zt=class extends Z{get isNumeric(){return!0}},_n=class extends Zt{get isInteger(){return!0}},Bt=class extends _n{get isSigned(){return!0}},Pt=class extends _n{get isUnsigned(){return!0}},yn=class extends Zt{get isFloat(){return!0}},Vt=class extends Z{get isTemporal(){return!0}},dn=class extends Z{get isNested(){return!0}}});var Rr,Rs,_r,_s,Nr,yt,kr,Ve,Mr,Ns,Ur,ks,Fr,Ms,jr,Us,Nn,Fs,kn,Le,Qt,vr,Un,Br,$e,Pr,js,Vr,vs,Lr,Bs,$r,Ps,Lt,Ke,Kr,Vs,Et,Ls,Mn,$s,se,Ks,Fn=j(()=>{"use strict";Pe();it();Rr=class extends Bt{constructor(){super(...arguments);T(this,"name","Int8")}coerce(n){return gt(n,{range:"Int8"})}equals(n){return n.name==="Int8"}allocate(n){return new Int8Array(n)}},Rs=new Rr,_r=class extends Bt{constructor(){super(...arguments);T(this,"name","Int16")}coerce(n){return gt(n,{range:"Int16"})}equals(n){return n.name==="Int16"}allocate(n){return new Int16Array(n)}},_s=new _r,Nr=class extends Bt{constructor(){super(...arguments);T(this,"name","Int32")}coerce(n){return gt(n,{range:"Int32"})}equals(n){return n.name==="Int32"}allocate(n){return new Int32Array(n)}},yt=new Nr,kr=class extends Bt{constructor(){super(...arguments);T(this,"name","Int64")}coerce(n){return zt(n,{truncate:!0})}equals(n){return n.name==="Int64"}allocate(n){return new BigInt64Array(n)}},Ve=new kr,Mr=class extends Pt{constructor(){super(...arguments);T(this,"name","UInt8")}coerce(n){return gt(n,{range:"UInt8"})}equals(n){return n.name==="UInt8"}allocate(n){return new Uint8Array(n)}},Ns=new Mr,Ur=class extends Pt{constructor(){super(...arguments);T(this,"name","UInt16")}coerce(n){return gt(n,{range:"UInt16"})}equals(n){return n.name==="UInt16"}allocate(n){return new Uint16Array(n)}},ks=new Ur,Fr=class extends Pt{constructor(){super(...arguments);T(this,"name","UInt32")}coerce(n){return gt(n,{range:"UInt32"})}equals(n){return n.name==="UInt32"}allocate(n){return new Uint32Array(n)}},Ms=new Fr,jr=class extends Pt{constructor(){super(...arguments);T(this,"name","UInt64")}coerce(n){return zt(n,{range:"UInt64"})}equals(n){return n.name==="UInt64"}allocate(n){return new BigUint64Array(n)}},Us=new jr,Nn=class extends yn{constructor(){super(...arguments);T(this,"name","Float32")}coerce(n){return hr(n,{floatPrecision:"Float32"})}equals(n){return n.name==="Float32"}allocate(n){return new Float32Array(n)}},Fs=new Nn,kn=class extends yn{constructor(){super(...arguments);T(this,"name","Float64")}coerce(n){return hr(n,{floatPrecision:"Float64"})}equals(n){return n.name==="Float64"}allocate(n){return new Float64Array(n)}},Le=new kn,Qt=class e extends Zt{constructor(n,r){super();T(this,"precision",n);T(this,"scale",r);T(this,"name");this.name=n!==void 0&&r!==void 0?`Decimal(${n}, ${r})`:"Decimal"}coerce(n){return De(n,{precision:this.precision,scale:this.scale})}equals(n){return n instanceof e&&this.precision===n.precision&&this.scale===n.scale}allocate(n){return new Array(n).fill(null)}},vr=class extends Z{constructor(){super(...arguments);T(this,"name","Boolean")}get isBoolean(){return!0}coerce(n){return n==null?null:!!n}equals(n){return n.name==="Boolean"}allocate(n){return new Array(n).fill(null)}},Un=new vr,Br=class extends Z{constructor(){super(...arguments);T(this,"name","Utf8")}get isString(){return!0}get isUtf8(){return!0}coerce(n){return n==null?null:String(n)}equals(n){return n.name==="Utf8"}allocate(n){return new Array(n).fill(null)}},$e=new Br,Pr=class extends Z{constructor(){super(...arguments);T(this,"name","Binary")}get isBinary(){return!0}coerce(n){return ke(n)}equals(n){return n.name==="Binary"}allocate(n){return new Array(n).fill(null)}},js=new Pr,Vr=class extends Z{constructor(){super(...arguments);T(this,"name","Null")}get isNull(){return!0}coerce(n){return null}equals(n){return n.name==="Null"}allocate(n){return new Array(n).fill(null)}},vs=new Vr,Lr=class extends Z{constructor(){super(...arguments);T(this,"name","Object")}get isObject(){return!0}coerce(n){return n===void 0?null:n}equals(n){return n.name==="Object"}allocate(n){return new Array(n).fill(null)}},Bs=new Lr,$r=class extends Vt{constructor(){super(...arguments);T(this,"name","Date")}coerce(n){return X(n,{dateOnly:!0})}equals(n){return n.name==="Date"}allocate(n){return new Array(n).fill(null)}},Ps=new $r,Lt=class e extends Vt{constructor(n="ms",r=null){super();T(this,"name","Datetime");T(this,"timeUnit");T(this,"timeZone");this.timeUnit=n,this.timeZone=r}coerce(n){return X(n)}equals(n){return n instanceof e&&n.timeUnit===this.timeUnit&&n.timeZone===this.timeZone}allocate(n){return new Array(n).fill(null)}},Ke=new Lt,Kr=class extends Vt{constructor(){super(...arguments);T(this,"name","Time")}coerce(n){return Be(n)}equals(n){return n.name==="Time"}allocate(n){return new Array(n).fill(null)}},Vs=new Kr,Et=class e extends Vt{constructor(n="ms"){super();T(this,"name","Duration");T(this,"timeUnit");this.timeUnit=n}coerce(n){return $(n)}equals(n){return n instanceof e&&n.timeUnit===this.timeUnit}allocate(n){return new Array(n).fill(null)}},Ls=new Et,Mn=class e extends dn{constructor(n){super();T(this,"innerType",n);T(this,"name","Array")}coerce(n){if(n==null)return null;let r=V(n)?Array.from(n):[n],o=r.length,i=new Array(o);for(let s=0;s<o;s++)i[s]=this.innerType.coerce(r[s]);return i}equals(n){return n instanceof e&&this.innerType.equals(n.innerType)}allocate(n){return new Array(n).fill(null)}},$s=e=>new Mn(e),se=class e extends dn{constructor(n){super();T(this,"fields",n);T(this,"name","Struct")}coerce(n){if(!v(n))return null;let r={},o=Object.keys(this.fields),i=o.length;for(let s=0;s<i;s++){let a=o[s],l=this.fields[a];r[a]=l.coerce(n[a])}return r}equals(n){if(!(n instanceof e))return!1;let r=Object.keys(this.fields),o=Object.keys(n.fields);if(r.length!==o.length)return!1;for(let i=0;i<r.length;i++){let s=r[i];if(!this.fields[s].equals(n.fields[s]))return!1}return!0}allocate(n){return new Array(n).fill(null)}},Ks=e=>new se(e)});var D,$t=j(()=>{"use strict";Pe();Fn();Fn();Pe();D={Int8:Rs,Int16:_s,Int32:yt,Int64:Ve,UInt8:Ns,UInt16:ks,UInt32:Ms,UInt64:Us,Float32:Fs,Float64:Le,Decimal:(e,t)=>new Qt(e,t),Boolean:Un,Utf8:$e,Binary:js,Date:Ps,Datetime:Ke,Time:Vs,Duration:Ls,Object:Bs,Null:vs,Array:$s,Struct:Ks,Numeric:Zt,Integer:_n,SignedInteger:Bt,UnsignedInteger:Pt,Float:yn,Temporal:Vt,Nested:dn}});function iu(e={}){let t=e.nullValue!==void 0?e.nullValue:"",n=Ai(e.numericFormatOptions),r=e.replacerOptions||{},o=e.datetimeFormat??e.dateFormat??e.timeFormat,s={formatDate:o?l=>L(l)?ie(l,{format:o}):t:l=>L(l)?l.toISOString():t,onBigInt:n,...r},a=Yt(s);return l=>{if(l==null||typeof l=="symbol"||typeof l=="function"||l instanceof Date&&!L(l))return{str:t,isNumeric:!1};let c=a.call(null,"",l),u=Q(c);return u==null||typeof u=="symbol"||typeof u=="function"?{str:t,isNumeric:!1}:typeof l=="bigint"||typeof l=="number"?{str:typeof u=="string"?u:n(u),isNumeric:!0}:typeof u=="number"||typeof u=="bigint"?{str:n(u),isNumeric:!0}:typeof u=="string"?{str:u,isNumeric:!1}:typeof u=="boolean"?{str:u?"true":"false",isNumeric:!1}:typeof u=="object"?{str:JSON.stringify(u,Yt(s)),isNumeric:!1}:{str:String(u),isNumeric:!1}}}function qe(e,t,n={}){let{separator:r=",",quoteChar:o='"',includeHeader:i=!0,lineTerminator:s=`
2
+ `,quoteStyle:a="necessary",includeBom:l=!1,onRow:c,...u}=n,f=Object.keys(e),p=f.length,m=[],y=!0,d=iu(u),h=(b,O=!1)=>{let w=O?{str:String(b),isNumeric:!1}:d(b),A=w.str;if(a==="never"||!(a==="always"||a==="non_numeric"&&(O||!w.isNumeric&&b!=null)||A.includes(r)||A.includes(o)||Wo.test(A)))return A;let C=re(A,o,o+o,{literal:!0,n:1/0});return o+C+o},g=b=>{let O=y?l?"\uFEFF":"":c?s:"";y=!1;let w=O+b;c?c(w):m.push(w)},x=(b,O)=>{let w=new Array(p);for(let A=0;A<p;A++)w[A]=h(b(A),O);g(w.join(r))};i&&x(b=>f[b],!0);for(let b=0;b<t;b++)x(O=>e[f[O]][b],!1);return c?l?"\uFEFF":"":m.join(s)}function Gs(e,t={}){let n=t.separator||",",r=t.quoteChar||'"',o=pt(e,"\uFEFF",{mode:"start",returnStringOnNull:!0})??"",i=[],s=[],a="",l=!1,c=!1,u=()=>{s.push(a),a=""},f=()=>{!c&&s.length===0&&a===""||(u(),i.push(s),s=[],c=!1)},p=o.length;for(let m=0;m<p;m++){let y=o[m];if(l){if(c=!0,y!==r){a+=y;continue}if(m+1<p&&o[m+1]===r){a+=r,m++;continue}l=!1;continue}if(y===r){if(c=!0,a.length===0){l=!0;continue}a+=r;continue}if(y===n){c=!0,u();continue}if(y==="\r"||y===`
3
+ `){y==="\r"&&m+1<p&&o[m+1]===`
4
+ `&&m++,f();continue}c=!0,a+=y}return f(),i}function Js(e,t={}){let n=new Set(t.nullValues??["","NA","null","NaN"]),r=e.length,o=[{type:Un,parse:u=>{let f=u.toLowerCase();return f==="true"||f==="1"?!0:f==="false"||f==="0"?!1:null},active:!0},{type:Ve,parse:u=>zt(u,{truncate:!1}),active:!0},{type:Le,parse:u=>$(u,{allowNonFiniteNumbers:!0}),active:!0},{type:Ke,parse:u=>X(u),active:!0}],i=!1;for(let u=0;u<r;u++){let f=pt(e[u],null,{returnStringOnNull:!0})??"";if(n.has(f))continue;i=!0;let p=!1;for(let m=0;m<o.length;m++){let y=o[m];y.active&&(y.parse(f)===null?y.active=!1:p=!0)}if(!p)break}let s=i?o.find(u=>u.active):void 0,a=s?.type??$e,l=s?.parse,c=new Array(r);for(let u=0;u<r;u++){let f=e[u],p=pt(f,null,{returnStringOnNull:!0})??"";c[u]=n.has(p)?null:l?l(p):f}return{type:a,values:c}}var Ws=j(()=>{"use strict";Qn();ne();vt();Ot();$t();Rt();mn()});function le(e){let t=pt(e);if(!t)throw new Error(`Invalid duration string: "${e}"`);let n=t.startsWith("-")||t.startsWith("+"),r=t.startsWith("-")?-1:1,o=n?pt(t.slice(1))??"":t;if(!o||Dn(o,su)!==null)throw new Error(`Cannot parse duration string: "${e}"`);Gr.lastIndex=0;let i,s=0,a=0,l=0,c=0,u=!1,f=!1,p=!1,m=0,y=!1,d=0;for(;(i=Gr.exec(o))!==null;){m++;let h=i[1],g=i[2];g||(y=!0);let x=parseFloat(h)*r,b=g!==void 0?g:"ms",O=b.toLowerCase();if(d=Gr.lastIndex,b==="i"){f=!0,c+=x;continue}let w=zs[b]??zs[O];if(w){u=!0,p=!0,w.kind==="month"?s+=x*w.factor:a+=x*w.factor;continue}let A=tn[b]??tn[O];if(A===void 0)throw new Error(`Unknown duration unit: "${g}" in "${e}"`);p=!0,l+=x*A}if(m===0||d!==o.length||y&&m>1)throw new Error(`Cannot parse duration string: "${e}"`);if(f&&p)throw new Error(`Cannot combine index unit 'i' with temporal duration units in "${e}"`);return{months:s,days:a,ms:l,indexUnits:c,isCalendar:u,isIndex:f}}function Jr(e,t,n=1){let r=X(e);if(!r)throw new Error(`Invalid date provided to addCalendarDuration: ${e}`);let o=typeof t=="string"?le(t):t,i=new Date(r.getTime()),s=o.months*n;if(s!==0){let c=i.getUTCFullYear(),u=i.getUTCMonth(),f=i.getUTCDate(),p=c*12+u+s,m=Math.floor(p/12),y=(p%12+12)%12,d=nt(m,y+1,0).getUTCDate();i.setUTCFullYear(m,y,Math.min(f,d))}let a=o.days*n;a!==0&&i.setUTCDate(i.getUTCDate()+a);let l=o.ms*n;return l!==0&&i.setTime(i.getTime()+l),i}function Wr(e,t={}){let n=t.to??"ms",r=tn[n]??tn[n.toLowerCase()];if(r===void 0)throw new Error(`Unknown target duration unit: "${n}"`);let o=le(e);if(o.isCalendar&&o.months!==0)throw new Error(`Cannot convert calendar duration containing months/years to a fixed duration without an anchor date: "${e}"`);if(o.isIndex){let a=o.indexUnits/r;return Object.is(a,-0)?0:a}let s=(o.ms+o.days*St)/r;return Object.is(s,-0)?0:s}function Ge(e,t={}){let{to:n="ms",fallback:r}=t;if(e==null)return r!==void 0?r:NaN;let o=Q(e);if(typeof o=="boolean")return NaN;if(typeof o=="string")try{let l=Wr(o,{to:n});return M(l)?l:NaN}catch{return NaN}let i=$(o);if(i===null)return NaN;let s=tn[n]??tn[n.toLowerCase()];if(s===void 0)throw new Error(`Unknown target duration unit: "${n}"`);let a=i/s;return Object.is(a,-0)?0:a}var zs,tn,Gr,su,Xs=j(()=>{"use strict";vt();mn();Rt();Qn();Ot();zs=Object.freeze({M:{kind:"month",factor:1},mo:{kind:"month",factor:1},month:{kind:"month",factor:1},months:{kind:"month",factor:1},q:{kind:"month",factor:3},quarter:{kind:"month",factor:3},quarters:{kind:"month",factor:3},y:{kind:"month",factor:12},yr:{kind:"month",factor:12},year:{kind:"month",factor:12},years:{kind:"month",factor:12},d:{kind:"day",factor:1},day:{kind:"day",factor:1},days:{kind:"day",factor:1},w:{kind:"day",factor:7},week:{kind:"day",factor:7},weeks:{kind:"day",factor:7}}),tn=Object.freeze({ns:Te,nanosecond:Te,nanoseconds:Te,us:On,\u00B5s:On,\u03BCs:On,microsecond:On,microseconds:On,ms:Oe,millisecond:Oe,milliseconds:Oe,s:_t,sec:_t,second:_t,seconds:_t,m:Mt,min:Mt,minute:Mt,minutes:Mt,h:Jn,hr:Jn,hour:Jn,hours:Jn,d:St,day:St,days:St,w:Se,week:Se,weeks:Se,i:1}),Gr=/(?:^|\s*,\s*|\s+)((?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?)\s*([a-zA-Zµμ]+)?/gy,su=/^,|,[\s]*,|,$|(?<![eE])[+-]|[a-zA-Zµμ]\./});var it=j(()=>{"use strict";Rt();vt();Qn();Zn();mn();ne();Ws();Sr();Xs()});function et(e,t,n,r=""){if(!(e in t))throw new nn(e,`${n} "${e}" does not exist${r}`)}function zr(e,t){let n=Object.keys(e),r=n.length,o=t;for(let i=0;i<r;i++){let s=n[i],a=e[s],l=V(a)?a.length:0;if(o===void 0)o=l;else if(l!==o)throw new ut(`Column height mismatch: Column "${s}" has length ${l}, but DataFrame height is ${o}`)}return o===void 0?0:o}function Je(e,t="Value cannot be null or undefined"){if(e==null)throw new N(t);return e}function Bc(e,t){if(!e)throw new N(t)}var Ys=j(()=>{"use strict";tt();it()});var en,Y,nn,hn,at,ut,N,Ht,tt=j(()=>{"use strict";Ys();en=class extends Error{constructor(t){super(t),this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},Y=class extends en{},nn=class extends Y{constructor(t,n){super(n||`Column "${t}" does not exist in the DataFrame.`)}},hn=class extends en{},at=class extends en{},ut=class extends en{},N=class extends en{},Ht=class extends en{}});function au(e,t,n){let r=n.length,o={},i=new Array(r);for(let s=0;s<r;s++){let a=n[s];if(typeof a=="string")et(a,e,"Partition key"," in the DataFrame."),o[a]=e[a],i[s]=a;else{let l=`__part_${s}`;o[l]=a.evaluate(e,t),i[s]=l}}return ce(o,i,t)}function Hs(e,t,n){let r=new Array(n);if(n===0)return r;let o=e.I||[],i=au(t,n,o),s=e.J(e.U,t,n);for(let a of i.values()){let l=a.length,c=new Array(l);for(let u=0;u<l;u++)c[u]=s[a[u]];if(e.R){for(let u=0;u<l;u++)r[a[u]]=e.R(c,a,u);continue}if(e.A){let u=e.A(c);for(let f=0;f<l;f++)r[a[f]]=u;continue}for(let u=0;u<l;u++)r[a[u]]=s[a[u]]}return e.Y(e.U,r,t)}function Zs(e){if(!Array.isArray(e)||e.length===0)return{columns:{},height:0};let t=e.length,n=new Set;for(let s=0;s<t;s++){let a=e[s];if(!v(a))continue;let l=Object.keys(a),c=l.length;for(let u=0;u<c;u++)n.add(l[u])}let r=Array.from(n),o=r.length,i={};for(let s=0;s<o;s++){let a=r[s],l=new Array(t);for(let c=0;c<t;c++){let u=e[c],f=u!=null?u[a]:null;l[c]=f===void 0?null:f}i[a]=l}return{columns:i,height:t}}function Xr(e,t,n){let r={};for(let o=0;o<n.length;o++){let i=n[o],s=e[i][t];r[i]=s===void 0?null:s}return r}function Qs(e,t){let n=Object.keys(e),r=new Array(t);for(let o=0;o<t;o++)r[o]=Xr(e,o,n);return r}function rn(e){if(e.length===0)return D.Utf8;let t=!0,n=!0,r=!0,o=!0,i=!0,s=!0,a=!0,l=!0,c=!1,u=!1,f=[];for(let p=0;p<e.length;p++){let m=e[p];if(m!=null){if(u=!0,m instanceof Uint8Array||(a=!1),!V(m)||m instanceof Uint8Array)s=!1;else{let y=m,d=y.length;for(let h=0;h<d;h++)f.push(y[h])}L(m)&&(c=!0),typeof m!="boolean"&&(t=!1),typeof m!="bigint"&&(o=!1),typeof m!="number"?(r=!1,n=!1):Number.isInteger(m)||(n=!1),!L(m)&&(typeof m!="string"||isNaN(Date.parse(m)))&&(i=!1),(!v(m)||m instanceof Uint8Array)&&(l=!1)}}if(!u)return D.Null;if(a)return D.Binary;if(s){let p=rn(f);return D.Array(p)}if(t)return D.Boolean;if(o)return D.Int64;if(r&&!n)return D.Float64;if(r&&n){let p=!0;for(let m=0;m<e.length;m++){let y=e[m];if(y!=null&&!At(y,{range:"Int32"})){p=!1;break}}return p?D.Int32:D.Float64}return i&&c?D.Datetime:l?D.Object:D.Utf8}function ue(e,t,n=un){let r=t.length,o=new Array(r);for(let i=0;i<r;i++){let s=t[i];o[i]=s!==null&&s!==n?e[s]:null}return o}function Yr(e,t,n=un){let r=Object.keys(e),o=r.length,i={};for(let s=0;s<o;s++){let a=r[s];i[a]=ue(e[a],t,n)}return i}function ce(e,t,n){let r=new Map;for(let o=0;o<n;o++){let i=jn(e,t,o),s=r.get(i);s===void 0&&r.set(i,s=[]),s.push(o)}return r}function jn(e,t,n){let r=t.length;if(r===1)return lt(e[t[0]][n]);let o=new Array(r);for(let i=0;i<r;i++)o[i]=lt(e[t[i]][n]);return o.join(Xn)}function Kt(e,t,n){let r=t.allocate?t.allocate(n):new Array(n);if(!ot(r)){for(let o=0;o<n;o++)r[o]=t.coerce(e[o]);return r}for(let o=0;o<n;o++){let i=t.coerce(e[o]);if(i!=null){r[o]=i;continue}let s=new Array(n);for(let a=0;a<o;a++)s[a]=r[a];s[o]=null;for(let a=o+1;a<n;a++)s[a]=t.coerce(e[a]);return s}return r}function ta(e,t){if(e)if(typeof e=="string"){if(typeof An!="function")throw new Ht("File writing is not supported in this environment (missing require('fs')).");An("fs").writeFileSync(e,t,"utf8")}else if(v(e)&&typeof e.write=="function")e.write(t);else throw new N("Invalid file argument. Expected a file path string or a writable stream/object with a write method.")}function Hr(e,t,n){if(t>0&&n>0)return null;let r=(e==="left"||e==="anti"||e==="outer")&&t>0,o=(e==="right"||e==="outer")&&n>0;if(!r&&!o)return{leftIndices:[],rightIndices:[]};let i=r?t:n,s=new Array(i),a=new Array(i);for(let l=0;l<i;l++)s[l]=r?l:un,a[l]=r?null:l;return{leftIndices:s,rightIndices:a}}function na(e,t,n,r){for(let o=0;o<r;o++)n[o]!==1&&(e.push(un),t.push(o))}function ea(e,t,n,r,o,i,s={}){let{how:a="inner",joinNulls:l=!1,maintainOrder:c}=s;if(a==="cross")return Fi(n,r);let u=Hr(a,n,r);if(u)return u;let f=o.length,p=i.length,m=(E,_,P,W)=>{if(!l){for(let B=0;B<P;B++)if(E[_[B]][W]==null)return null}return jn(E,_,W)},y=new Map;for(let E=0;E<r;E++){let _=m(t,i,p,E);if(_===null)continue;let P=y.get(_);P===void 0&&(P=[],y.set(_,P)),P.push(E)}let d=[],h=[];if(a==="semi"||a==="anti"){let E=a==="semi";for(let _=0;_<n;_++){let P=m(e,o,f,_),W=P===null?void 0:y.get(P),B=W!==void 0&&W.length>0;E===B&&(d.push(_),h.push(null))}return{leftIndices:d,rightIndices:h}}let g=a==="outer"||a==="right",x=g?new Uint8Array(r):null,b=a==="left"||a==="outer";for(let E=0;E<n;E++){let _=m(e,o,f,E),P=_===null?void 0:y.get(_);if(P===void 0){b&&(d.push(E),h.push(null));continue}let W=P.length;for(let B=0;B<W;B++){let st=P[B];g&&(x[st]=1),d.push(E),h.push(st)}}g&&na(d,h,x,r);let O=c||"none";if(O==="none"||O==="left")return{leftIndices:d,rightIndices:h};let w=d.length,A=new Int32Array(w);for(let E=0;E<w;E++)A[E]=E;let I=E=>d[E]===un?Number.K:d[E],C=E=>h[E]??Number.K;O==="right"?A.sort((E,_)=>C(E)-C(_)||E-_):O==="left_right"?A.sort((E,_)=>I(E)-I(_)||C(E)-C(_)||E-_):O==="right_left"&&A.sort((E,_)=>C(E)-C(_)||I(E)-I(_)||E-_);let R=new Array(w),F=new Array(w);for(let E=0;E<w;E++){let _=A[E];R[E]=d[_],F[E]=h[_]}return{leftIndices:R,rightIndices:F}}function ra(e,t,n,r,o,i,s,a,l={}){let c=Hr("left",n,r);if(c)return c;et(o,e,"Join on key"," in the left DataFrame."),et(i,t,"Join on key"," in the right DataFrame.");let u=l.strategy??"backward",f=l.allowExactMatches??!0,p=l.checkSorted??!0,m=e[o],y=t[i];if(p){let A=(I,C,R,F)=>{for(let E=1;E<C;E++){let _=$(I[E-1]),P=$(I[E]);if(M(_)&&M(P)&&P<_)throw new N(`${F} DataFrame key column "${R}" is not sorted in ascending order at row ${E}.`)}};A(m,n,o,"left"),A(y,r,i,"right")}let d=s.length>0,h=d?ce(t,a,r):null,g=new Array(r);if(!d)for(let A=0;A<r;A++)g[A]=A;let x=new Array(n),b=new Array(n),O=(A,I)=>{let C=I.length;if(C===0)return null;let R=(B,st)=>$(y[st])??NaN;if(u==="backward"){let B=fn(I,A,{side:f?"right":"left",getValue:R})-1;return B>=0?I[B]:null}if(u==="forward"){let B=fn(I,A,{side:f?"left":"right",getValue:R});return B<C?I[B]:null}let F=fn(I,A,{side:"right",getValue:R}),E=F-1,_=F;if(f||(E>=0&&R(E,I[E])===A&&E--,_<C&&R(_,I[_])===A&&_++),E<0)return _<C?I[_]:null;if(_>=C)return E>=0?I[E]:null;let P=R(E,I[E]),W=R(_,I[_]);return Math.abs(A-P)<=Math.abs(A-W)?I[E]:I[_]},w=l.tolerance!==void 0?$(l.tolerance):null;for(let A=0;A<n;A++){x[A]=A;let I=$(m[A]);if(!M(I)){b[A]=null;continue}let C=d?h.get(jn(e,s,A))||[]:g;if(C.length===0){b[A]=null;continue}let R=O(I,C);if(R!==null&&w!==null){let F=$(y[R]);(!M(w)||!M(F)||Math.abs(I-F)>w)&&(R=null)}b[A]=R}return{leftIndices:x,rightIndices:b}}function oa(e,t,n,r,o,i={}){let s=i.how??"inner",a=Hr(s,n,r);if(a)return a;let[l="",c="_right"]=i.suffixes??["","_right"],u=[],f=[],p=o.length,m=s==="right",y=m?new Uint8Array(r):null,d={},h=(I,C,R)=>{let F=Object.keys(I),E=F.length,_=new Array(E);for(let P=0;P<E;P++){let W=F[P],B=W in C&&R!==""?`${W}${R}`:W;_[P]=B,d[B]=new Array(1)}return _},g=h(e,t,l),x=h(t,e,c),b=Object.keys(e),O=Object.keys(t),w=b.length,A=O.length;for(let I=0;I<n;I++){let C=!1;for(let R=0;R<w;R++)d[g[R]][0]=e[b[R]][I];t:for(let R=0;R<r;R++){for(let F=0;F<A;F++)d[x[F]][0]=t[O[F]][R];for(let F=0;F<p;F++)if(o[F].evaluate(d,1)[0]!==!0)continue t;C=!0,u.push(I),f.push(R),m&&(y[R]=1)}!C&&s==="left"&&(u.push(I),f.push(null))}return m&&na(u,f,y,r),{leftIndices:u,rightIndices:f}}function We(e,t,n,r,o,i,s,a,l={}){let[c="",u="_right"]=l.suffixes||[],f=l.coalesce??!0,p=l.how||"inner",m=o.length,y={},d={},h=new Set(s),g=new Set(a),x=new Set,b=Object.keys(e),O=Object.keys(t),w=new Map;for(let I=0;I<s.length;I++)w.has(s[I])||w.set(s[I],a[I]);let A=(I,C)=>{let R=C||"_left",F=`${I}${R}`,E=1;for(;x.has(F);)F=`${I}${R}_${E++}`;return x.add(F),F};for(let I=0;I<b.length;I++){let C=b[I];(!(C in t)||h.has(C)||g.has(C))&&x.add(C)}for(let I=0;I<b.length;I++){let C=b[I],R=h.has(C),F;C in t&&!R&&!g.has(C)?c!==""?(x.add(C),F=A(C,c)):x.has(C)?F=A(C,c):(F=C,x.add(C)):F=C;let E=e[C],_=R?w.get(C):null,P=_?t[_]:null;if(R&&f){let W=new Array(m);for(let B=0;B<m;B++){let st=o[B],kt=i[B],ct=st!==un?E[st]:null,ft=kt!==null&&P?P[kt]:null;W[B]=ct??ft}y[F]=W}else y[F]=ue(E,o);n[C]?d[F]=n[C]:_&&r[_]&&(d[F]=r[_])}if(p!=="semi"&&p!=="anti")for(let I=0;I<O.length;I++){let C=O[I];if(f&&g.has(C))continue;let R=x.has(C)?A(C,u):C;x.add(R),y[R]=ue(t[C],i),r[C]&&(d[R]=r[C])}return q.S(y,d,m)}var ze=j(()=>{"use strict";vn();$t();Ot();it();tt()});function lu(e,t){if(e==null)return null;let n=L(e)?e.getTime():e;return t(n)}function ia(e,t,n){if(e==null||t==null)return null;let r=L(e)?e.getTime():e,o=L(t)?t.getTime():t;return n(r,o)}function It(e,t,n){return e.Ot?Hs(e,t,n):e.evaluate(t,n)}function Bn(e,t,n){return typeof e=="object"&&e!==null&&"_ops"in e?It(e,t||{},n):typeof e=="string"&&t!=null&&e in t?t[e]:e}function Pn(e,t,n,r){return!V(t)||t.length!==r?!1:typeof e=="object"&&e!==null&&"_ops"in e||typeof e=="string"&&n!=null&&e in n}function sa(e){let t=new Set,n=V(e)?e:[e];for(let r=0;r<n.length;r++)t.add(lt(n[r]));return t}function aa(e,t,n){let r=e.length,o=n&&typeof n=="object"&&"evaluate"in n,i=o?n.evaluate(t,r):null,s=o?null:sa(n),a=new Array(r);for(let l=0;l<r;l++){let c=e[l];if(c==null){a[l]=null;continue}let u=s??sa(i[l]);a[l]=u.has(lt(c))}return a}function la(e,t){let n=e.length,r=V(t),o=new Array(n);for(let i=0;i<n;i++){let s=e[i],a=r?t[i]:t;s==null||a==null?o[i]=s==null&&a==null:o[i]=s===a}return o}function Zr(e,t,n={}){if(t==null)return null;let r=n.dense?"_denseRankCache":"_rankCache",o=e[r];if(!o){let i=e;if(n.ignoreNulls){i=[];let l=e.length;for(let c=0;c<l;c++)e[c]!=null&&i.push(e[c])}n.dense&&(i=Array.from(new Set(i)));let s=Hn(i);o=new Map;let a=s.length;for(let l=0;l<a;l++){let c=s[l];o.has(c)||o.set(c,l+1)}e[r]=o}return o.get(t)??null}var k,G,qt=j(()=>{"use strict";it();Rt();ze();k=e=>t=>{let n=t.length,r=new Array(n);for(let o=0;o<n;o++)r[o]=lu(t[o],e);return r},G=(e,t,n)=>{let r=(o,i)=>{let s=o.length,a=e.v(t,i,s),l=new Array(s);if(V(a))for(let c=0;c<s;c++)l[c]=ia(o[c],a[c],n);else for(let c=0;c<s;c++)l[c]=ia(o[c],a,n);return l};return r.C={left:e,right:t},r}});var S,xt,on=j(()=>{"use strict";tt();qt();S=(e,t)=>{let n=e.constructor,r=e.G||e.f||"",o=new n(r);return Object.assign(o,e),o.p=t?[...e.p,t]:[...e.p],t&&t.C&&(o.C=t.C),o},xt=class e{constructor(){T(this,"p",[]);T(this,"O","");T(this,"B");T(this,"P");T(this,"A",null);T(this,"_");T(this,"C");T(this,"N");T(this,"U");T(this,"I",null);T(this,"R");T(this,"F");T(this,"Z");T(this,"Q")}Y(t,n,r){let o=this.p,i=t!==void 0?t:o.length,s=n;for(let a=i;a<o.length;a++)s=o[a](s,r);return s}J(t,n,r){let o=this.Tt(n,r),i=this.p,s=t!==void 0?t:i.length;for(let a=0;a<s;a++)o=i[a](o,n);return o}Tt(t,n){let r=this.f;if(r&&r!=="*"&&!r.startsWith("*")&&!(r in t))throw new nn(r);return(r&&r!=="*"?t[r]:null)||new Array(n).fill(null)}v(t,n,r){return t instanceof e?t.B&&t.p.length===1?t.P:It(t,n,r):t}alias(t){let n=S(this);return n.O=t,n}cast(t){let n=S(this,k(r=>t.coerce(r)));return n._=t,n}debug(t){return S(this,n=>n)}evaluate(t,n){return this.J(void 0,t,n)}}});var Xe,Qr=j(()=>{"use strict";on();qt();tt();it();Xe=class extends xt{V(t,n,r,o){return this.j(function(i,s,a){let l=n,c=!1,u=t?a:0,f=t?i.length-1:a;for(let p=u;p<=f;p++){let m=i[p];m!=null&&(l=r(l,m),c=!0)}return o?o(l,c):l})}o(t){let n=S(this);return n.A=t,n.N=this.p.length,n.U=this.p.length,n}k(t,n){let r=S(this,G(this,t,(o,i)=>[o,i])).o(n);return r.C=void 0,r}get Ot(){return this.I!==null||this.R!==void 0||this.A!==null}j(t){let n=S(this);return n.U=this.p.length,n.N=this.p.length,n.R=t,n}abs(){return S(this,k(Math.abs))}add(t){return S(this,G(this,t,(n,r)=>n+r))}all(){return this.o(t=>H(t,n=>!!n,{mode:"every"}))}allNull(){return this.o(t=>H(t,"nullish",{mode:"every"}))}and(t){return S(this,(n,r)=>{let o=n.length,i=this.v(t,r,o),s=V(i),a=new Array(o);for(let l=0;l<o;l++){let c=n[l],u=s?i[l]:i;c===!1||u===!1?a[l]=!1:c==null||u==null?a[l]=null:a[l]=!0}return a})}any(){return this.o(t=>H(t,n=>!!n,{mode:"some"}))}anyNull(){return this.o(t=>H(t,"nullish",{mode:"some"}))}arccos(){return S(this,k(t=>t<-1||t>1?null:Math.acos(t)))}arccosh(){return S(this,k(t=>t<1?null:Math.acosh(t)))}arcsin(){return S(this,k(t=>t<-1||t>1?null:Math.asin(t)))}arcsinh(){return S(this,k(Math.asinh))}arctan(){return S(this,k(Math.atan))}arctan2(t){return S(this,G(this,t,Math.atan2))}arctanh(){return S(this,k(t=>t<=-1||t>=1?null:Math.atanh(t)))}argMax(){return this.o(t=>K(t).maxIdx)}argMin(){return this.o(t=>K(t).minIdx)}avg(){return this.o(t=>K(t).mean)}between(t,n,r="both"){let o=r==="both"||r==="left"?this.ge(t):this.gt(t),i=r==="both"||r==="right"?this.le(n):this.lt(n);return o.and(i)}bitwiseAnd(){return this.o(t=>Ne(t,(n,r)=>n&r))}bitwiseOr(){return this.o(t=>Ne(t,(n,r)=>n|r))}bitwiseXor(){return this.o(t=>Ne(t,(n,r)=>n^r))}cbrt(){return S(this,k(Math.cbrt))}ceil(){return S(this,k(Math.ceil))}clip(t=null,n=null){return S(this,k(r=>z(r,{min:t,max:n})))}copysign(t){return S(this,G(this,t,(n,r)=>Math.abs(n)*(r>=0?1:-1)))}corr(t){return this.k(t,n=>xr(n)?.correlation??null)}cos(){return S(this,k(Math.cos))}cosh(){return S(this,k(Math.cosh))}cot(){return S(this,k(t=>{if(Number.isNaN(t))return NaN;if(!M(t))return null;let n=Math.tan(t);return n===0?null:1/n}))}count(t={}){return t.includeNulls?this.o(n=>n.length):this.o(n=>K(n).count)}cov(t){return this.k(t,n=>xr(n)?.covariance??null)}cumCount(t=!1){return this.V(t,0,n=>n+1)}cumMax(t=!1){return this.V(t,null,(n,r)=>n===null||r>n?r:n)}cumMin(t=!1){return this.V(t,null,(n,r)=>n===null||r<n?r:n)}cumProd(t=!1){return this.V(t,1,(n,r)=>n*r,(n,r)=>r?n:null)}cumSum(t=!1){return this.V(t,0,(n,r)=>n+r)}degrees(){return S(this,k(t=>t*(180/Math.PI)))}denseRank(){return this.rank({dense:!0})}div(t){return S(this,G(this,t,(n,r)=>r===0?null:n/r))}dot(t){return this.k(t,n=>Mi(n))}entropy(t={base:Math.E,normalize:!0}){return this.o(n=>Pi(n,t))}eq(t){return S(this,G(this,t,(n,r)=>n===r))}eqMissing(t){return S(this,(n,r)=>{let o=this.v(t,r,n.length);return la(n,o)})}exp(){return S(this,k(Math.exp))}expm1(){return S(this,k(Math.expm1))}fillNull({value:t=void 0,strategy:n=void 0,limit:r=void 0}={}){return n==="zero"?t=0:n==="one"&&(t=1),S(this,(o,i)=>{let s=o.length,a=Array.from(o);if(t!==void 0){let l=this.v(t,i,s),c=V(l);for(let u=0;u<s;u++)a[u]==null&&(a[u]=c?l[u]:l);return a}if(n==="min"||n==="max"||n==="mean"){let l=K(o)[n];for(let c=0;c<s;c++)a[c]==null&&(a[c]=l);return a}if(n==="forward"||n==="backward"){let l=n==="backward",c=null,u=0;for(let f=0;f<s;f++){let p=l?s-1-f:f,m=a[p];if(m!=null){c=m,u=0;continue}c!==null&&(r===void 0||u<r)&&(a[p]=c,u++)}return a}if(n!==void 0)throw new N(`Unsupported fillNull strategy: "${n}"`);return a})}filter(t){return S(this,(n,r)=>{let o=It(t,r,n.length);return In(n,o,{nullify:!0})})}first(){return this.o(t=>t[0]??null)}floor(){return S(this,k(Math.floor))}floordiv(t){return S(this,G(this,t,(n,r)=>r===0?null:Math.floor(n/r)))}ge(t){return S(this,G(this,t,(n,r)=>n>=r))}gt(t){return S(this,G(this,t,(n,r)=>n>r))}hasNulls(){return this.anyNull()}hypot(t){return S(this,G(this,t,Math.hypot))}implode(){return this.o(t=>t)}isClose(t,{absTol:n=1e-8,relTol:r=1e-8,nansEqual:o=!1}={}){return S(this,G(this,t,(i,s)=>{if(M(i)&&M(s)){let a=Math.abs(i-s),l=Math.max(r*Math.max(Math.abs(i),Math.abs(s)),n);return a<=l}return Number.isNaN(i)&&Number.isNaN(s)?o:i===s}))}isDuplicated(){return S(this,t=>{let{frequencies:n}=Xt(t,{strict:!0}),r=t.length,o=new Array(r);for(let i=0;i<r;i++)o[i]=(n.get(t[i])||0)>1;return o})}isFinite(){return S(this,k(Number.isFinite))}isIn(t){return S(this,(n,r)=>aa(n,r,t))}isInfinite(){return S(this,k(t=>t===1/0||t===-1/0))}isNan(){return S(this,k(Number.isNaN))}isNDistinct(t,n=!0){return S(this,(r,o)=>{let{values:i}=Xt(r,{strict:!0}),s=En(i,t,n);return this.eq(s).evaluate(o,r.length)})}isNotNan(){return this.isNan().not()}isNotNull(){return this.isNull().not()}isNull(){return this.eqMissing(null)}isUnique(){return this.isDuplicated().not()}kurtosis(t={}){return this.o(n=>Bi(n,t))}lag(t=1,n=null){return this.j(function(r,o,i){let s=n;return i-t>=0&&(s=r[i-t]),s})}last(){return this.o(t=>t[t.length-1]??null)}le(t){return S(this,G(this,t,(n,r)=>n<=r))}lead(t=1,n=null){return this.j(function(r,o,i){let s=n;return i+t<r.length&&(s=r[i+t]),s})}log(t=Math.E){return S(this,k(n=>n<=0?null:t===Math.E?Math.log(n):Math.log(n)/Math.log(t)))}log1p(){return S(this,k(t=>t<=-1?null:Math.log1p(t)))}lt(t){return S(this,G(this,t,(n,r)=>n<r))}max(){return this.o(t=>K(t).max)}maxBy(t){return this.k(t,n=>wr(n,"maxIdx"))}mean(){return this.avg()}median(){return this.o(t=>cn(t,.5))}min(){return this.o(t=>K(t).min)}minBy(t){return this.k(t,n=>wr(n,"minIdx"))}mod(t){return S(this,G(this,t,(n,r)=>r===0?null:n%r))}mode(){return this.o(t=>_e(t))}mul(t){return S(this,G(this,t,(n,r)=>n*r))}nanMax(){return this.o(t=>K(t).nanMax)}nanMin(){return this.o(t=>K(t).nanMin)}ne(t){return this.eq(t).not()}negate(){return S(this,k(t=>-t))}neMissing(t){return this.eqMissing(t).not()}not(){return S(this,k(t=>!t))}notIn(t){return this.isIn(t).not()}nullCount(){return this.o(t=>K(t).nullCount)}nUnique(t={}){return this.o(n=>Xt(n,t).count)}or(t){return S(this,(n,r)=>{let o=n.length,i=this.v(t,r,o),s=V(i),a=new Array(o);for(let l=0;l<o;l++){let c=n[l],u=s?i[l]:i;c===!0||u===!0?a[l]=!0:c==null||u==null?a[l]=null:a[l]=!1}return a})}over(t){let n=S(this),r=Array.isArray(t)?t:[t];return n.I=r,n}pow(t){return S(this,G(this,t,Math.pow))}product(){return this.o(t=>K(t).product)}quantile(t){if(t<0||t>1)throw new at("Quantile q must be between 0 and 1");return this.o(n=>cn(n,t))}radians(){return S(this,k(t=>t*(Math.PI/180)))}rand(t,{min:n=0,max:r=1,integer:o=!1}={}){return S(this,i=>{let s=i.length,a=new Float64Array(s),l=t!==void 0?Ti(t):Math.random,c=r-n;for(let u=0;u<s;u++){let f=l();a[u]=o?Math.floor(f*(c+1))+n:f*c+n}return a})}rank(t={}){return this.j(function(n,r,o){return Zr(n,n[o],t)})}reverse(){return S(this,t=>t.slice().reverse())}rolling(t,n){let r=typeof t=="number"?t:t?.windowSize??NaN;if(!Number.isFinite(r)||r<1)throw new N("rolling: windowSize must be a positive number >= 1");if(!n||typeof n!="function"&&typeof n.evaluate!="function")throw new N("rolling: second argument must be a reducer function or ColumnExpression");let o=Math.floor(r),i=n.f||this.f||"val",s=typeof n=="function"?n:n.A??(a=>{let l=It(n,{[i]:a},a.length);return Array.isArray(l)?l[l.length-1]:l});return this.j(function(a,l,c){let u=Math.max(0,c-o+1),f=c+1;return s(a.slice(u,f))})}rollingMax(t){return this.rolling(t,n=>K(n).max)}rollingMean(t){return this.rolling(t,n=>K(n).mean)}rollingMedian(t){return this.rolling(t,n=>cn(n,.5))}rollingMin(t){return this.rolling(t,n=>K(n).min)}rollingQuantile(t,n){return this.rolling(n,r=>cn(r,t))}rollingRank(t){return this.rolling(t,n=>Zr(n,n[n.length-1],{ignoreNulls:!0}))}rollingStd(t){return this.rolling(t,n=>K(n).std)}rollingSum(t){return this.rolling(t,n=>K(n).sum)}round(t=0){return S(this,k(n=>gr(n,t)))}roundSigFigs(t){return S(this,k(n=>M(n)?Number(n.toPrecision(t)):n))}rowNumber(){let t=this.j(function(n,r,o){return o+1});return t.O="row_number",t}sign(){return S(this,k(Math.sign))}sin(){return S(this,k(Math.sin))}sinh(){return S(this,k(Math.sinh))}skew(t={}){return this.o(n=>vi(n,t))}spearmanCorr(t){return this.k(t,n=>ki(n))}sqrt(){return S(this,k(t=>t<0?null:Math.sqrt(t)))}std(){return this.o(t=>K(t).std)}sub(t){return S(this,G(this,t,(n,r)=>n-r))}sum(){return this.o(t=>K(t).sum)}tan(){return S(this,k(Math.tan))}tanh(){return S(this,k(Math.tanh))}trunc(){return S(this,k(Math.trunc))}variance(){return this.o(t=>K(t).variance)}wAvg(t){return this.k(t,n=>Ui(n))}xor(t){return S(this,G(this,t,(n,r)=>!!n!=!!r))}}});var to,Ye,no=j(()=>{"use strict";on();qt();it();Gt();tt();to=class{constructor(t){T(this,"expr",t)}l(t){return S(this.expr,k(n=>V(n)?t(n):null))}ft(t,n){let r=S(this.expr,G(this.expr,t,(o,i)=>V(o)?n(o,i):null));return r.C=void 0,r}agg(t){return S(this.expr,(n,r)=>{let o=n.length,i=new Array(o),s=Object.create(r);for(let a=0;a<o;a++){let l=n[a];if(!V(l)){i[a]=null;continue}let c=l.length;s[Sn]=l;let u=It(t,s,c);i[a]=V(u)?u[0]??null:u}return i})}all(){return this.l(t=>H(t,n=>!!n,{mode:"every"}))}any(){return this.l(t=>H(t,n=>!!n,{mode:"some"}))}argMax(){return this.l(t=>K(t).maxIdx)}argMin(){return this.l(t=>K(t).minIdx)}contains(t){return this.ft(t,(n,r)=>Array.prototype.includes.call(n,r))}containsAll(t){return this.l(n=>H(t,r=>Array.prototype.includes.call(n,r),{mode:"every"}))}containsAny(t){return this.l(n=>H(t,r=>Array.prototype.includes.call(n,r),{mode:"some"}))}countMatches(t,n={}){return this.ft(t,(r,o)=>Xt(r,n).frequencies.get(o)??0)}filter(t){return S(this.expr,(n,r)=>{let o=n.length,i=new Array(o),s=Object.create(r);for(let a=0;a<o;a++){let l=n[a];if(!V(l)){i[a]=null;continue}let c=l.length;s[Sn]=l;let u=It(t,s,c);i[a]=In(l,u)}return i})}explode({emptyAsNull:t=!0,keepNulls:n=!0}={}){return S(this.expr,r=>{let o=r.length,i=0;for(let c=0;c<o;c++){let u=r[c];if(V(u)){i+=u.length||(t?1:0);continue}if(u!=null){i+=1;continue}n&&(i+=1)}let s=new Array(i),a=new Int32Array(i),l=0;for(let c=0;c<o;c++){let u=r[c];if(V(u)){let f=u.length;if(f>0){for(let p=0;p<f;p++)a[l]=c,s[l++]=u[p];continue}t&&(a[l]=c,s[l++]=null);continue}if(u!=null){a[l]=c,s[l++]=u;continue}n&&(a[l]=c,s[l++]=null)}return s.rowMap=a,s})}first(t=!0){return this.get(0,t)}gather(t,n=!0){return this.l(r=>{let o=typeof t=="number"?[t]:t,i=o.length,s=new Array(i);for(let a=0;a<i;a++)s[a]=En(r,o[a],n);return s})}gatherEvery(t={}){return this.l(n=>Ce(n,t))}get(t,n=!0){return this.l(r=>En(r,t,n))}join(t=",",n={}){return this.l(r=>Re(r,t,n))}last(t=!0){return this.get(-1,t)}len(){return this.lengths()}lengths(){return this.l(t=>t.length)}max(){return this.l(t=>K(t).max)}mean(){return this.l(t=>K(t).mean)}median(){return this.l(t=>cn(t,.5))}min(){return this.l(t=>K(t).min)}mode(){return this.l(t=>_e(t))}nUnique(t={}){return this.l(n=>Xt(n,t).count)}reverse(){return this.l(t=>t.slice().reverse())}shift(t=1){return this.l(n=>Ri(n,t))}slice(t,n){return this.l(r=>r.slice(t,n))}splice(t,n,...r){return this.l(o=>{let i=[...o];return i.splice(t,n??i.length,...r),i})}sort(t){return this.l(n=>Hn(n,t))}std(){return this.l(t=>K(t).std)}sum(){return this.l(t=>K(t).sum)}toStruct({upperBound:t,fields:n}={}){return S(this.expr,r=>{let o=r.length,i=new Array(o),s=0;if(Array.isArray(n))s=n.length;else if(typeof t=="number")s=t;else for(let l=0;l<o;l++){let c=r[l];V(c)&&c.length>s&&(s=c.length)}if(s===0)throw new at("toStruct cannot be evaluated: struct width is 0. Provide an upperBound, non-empty fields names, or non-empty lists.");let a=new Array(s);for(let l=0;l<s;l++)typeof n=="function"?a[l]=n(l):a[l]=(Array.isArray(n)?n[l]:null)??`field_${l}`;for(let l=0;l<o;l++){let c=r[l];if(!V(c)){i[l]=null;continue}let u={};for(let f=0;f<s;f++)u[a[f]]=En(c,f,!0);i[l]=u}return i})}unique(t={}){return this.l(n=>Xt(n,t).values)}variance(){return this.l(t=>K(t).variance)}eval(t){return S(this.expr,(n,r)=>{let o=n.length,i=new Array(o),s=Object.create(r);for(let a=0;a<o;a++){let l=n[a];if(!V(l)){i[a]=null;continue}let c=l.length;if(s[Sn]=l,t.A!=null&&(t.I==null||t.I.length===0)){let f=t.N!==void 0?t.N:t.p.length,p=t.J(f,s,c),m=t.A(Array.from(p));i[a]=t.Y(f,[m],s)}else i[a]=It(t,s,c)}return i})}},Ye=class extends xt{get arr(){return new to(this)}}});var eo,He,ro=j(()=>{"use strict";on();qt();Ot();it();eo=class{constructor(t){T(this,"expr",t)}e(t){return S(this.expr,k(n=>t(String(n))))}T(t,n){return t==null?S(this.expr,r=>new Array(r.length).fill(null)):n()}pt(t,n){return n==null?!1:mt(n)?(n.lastIndex=0,n.test(t)):t.includes(n)}concat(t){return S(this.expr,G(this.expr,t,(n,r)=>String(n)+String(r)))}contains(t){return this.T(t,()=>this.e(n=>this.pt(n,t)))}containsAny(t){return this.T(t,()=>{let n=bt(t),r=n.length;return this.e(o=>{for(let i=0;i<r;i++)if(this.pt(o,n[i]))return!0;return!1})})}countMatches(t,n={}){let r=typeof n=="boolean"?n:n?.literal??!1;return this.T(t,()=>this.e(o=>{let i=r?Tt(t):t,s=pn(o,i,{global:!0});if(!s)return 0;let a=s.input.match(s.reg);return a?a.length:0}))}escapeRegex(t={}){return this.e(n=>Tt(n,t))}decode(t){return this.e(n=>os(n,t.encoding,t))}encode(t){return this.e(n=>rs(n,t.encoding))}decodeUriComponent(){return this.e(t=>{try{return decodeURIComponent(t)}catch{return t}})}encodeUriComponent(){return this.e(t=>{try{return encodeURIComponent(t)}catch{return t}})}endsWith(t){return this.e(n=>n.endsWith(t))}explode(){return this.e(t=>t.split(""))}extract(t,n){return this.T(t,()=>this.e(r=>Er(r,t,n)))}extractAll(t,n){return this.T(t,()=>this.e(r=>us(r,t,n)??[]))}extractGroups(t,n={}){return this.T(t,()=>this.e(r=>cs(r,t,n)))}extractMany(t,n={}){return this.T(t,()=>this.e(r=>fs(r,t,n)))}find(t,n={}){return this.T(t,()=>this.e(r=>Dn(r,t,n)))}findMany(t,n={}){return this.T(t,()=>this.e(r=>ms(r,t,n)))}head(t=1){return this.slice(0,t)}join(t="",n={}){return S(this.expr,k(r=>{let o=bt(r);return o==null?null:Re(o,t,n)}))}jsonDecode(t={}){return this.e(n=>te(n,t))}jsonPathMatch(t){return this.e(n=>Ji(n,t))}len(){return this.lenChars()}lenBytes(){return this.e(t=>Wt.encode(t).length)}lenChars(){return this.e(t=>t.length)}lower(){return this.e(t=>t.toLowerCase())}lpad(t,n=" "){return this.e(r=>r.padStart(t,n))}normalize(t){return this.e(n=>n.normalize(t))}padEnd(t,n=" "){return this.rpad(t,n)}padStart(t,n=" "){return this.lpad(t,n)}replace(t,n,r){return this.T(t,()=>this.e(o=>re(o,t,n,{n:1,...r})??o))}replaceAll(t,n,r){return this.T(t,()=>this.e(o=>re(o,t,n,{...r,n:-1})??o))}replaceMany(t,n,r){return this.T(t,()=>this.e(o=>ds(o,t,n,r)??o))}reverse(){return this.e(t=>t.split("").reverse().join(""))}rpad(t,n=" "){return this.e(r=>r.padEnd(t,n))}slice(t,n){return this.e(r=>{let o=t<0?r.length+t:t,i=n!==void 0?o+n:void 0;return r.slice(o,i)})}split(t,n){return this.e(r=>ps(r,t,n))}startsWith(t){return this.e(n=>n.startsWith(t))}stripChars(t,n){return this.e(r=>pt(r,t,{mode:"both",...n}))}stripCharsEnd(t,n){return this.e(r=>pt(r,t,{mode:"end",...n}))}stripCharsStart(t,n){return this.e(r=>pt(r,t,{mode:"start",...n}))}stripPrefix(t){return this.e(n=>pt(n,t,{mode:"start",maxScanStart:1,maxMatchesStart:1,returnStringOnNull:!0,stringOptions:{literal:!0}}))}stripSuffix(t){return this.e(n=>pt(n,t,{mode:"end",maxScanEnd:1,maxMatchesEnd:1,returnStringOnNull:!0,stringOptions:{literal:!0}}))}tail(t=1){return this.slice(-t)}strptime(t){return this.e(n=>Ts(n,t))}toCamelCase(){return this.e(t=>Cn(t,{format:"camel"}))}toDate(){return this.e(t=>X(t,{dateOnly:!0}))}toDatetime(){return this.e(X)}toDecimal(t,n){return this.e(r=>De(r,{precision:t,scale:n}))}toInteger(){return this.e(t=>gt(t))}toKebabCase(){return this.e(t=>Cn(t,{format:"kebab"}))}toLowerCase(){return this.lower()}toPascalCase(){return this.e(t=>Cn(t,{format:"pascal"}))}toSnakeCase(){return this.e(t=>Cn(t,{format:"snake"}))}toTime(){return this.e(Be)}toTitleCase(){return this.e(t=>Cn(t,{format:"title"}))}toUpperCase(){return this.upper()}trim(){return this.stripChars()}trimEnd(){return this.stripCharsEnd()}trimStart(){return this.stripCharsStart()}upper(){return this.e(t=>t.toUpperCase())}zfill(t){return this.e(n=>n.padStart(t,"0"))}},He=class extends xt{get str(){return new eo(this)}}});function ua(e){return Je(e,"Column reference cannot be null or undefined."),Ze||(Ze=(Dt(),Eo(ca)).ColumnExpr),Ze.isColExpr(e)?e:new Ze(e)}var Ze,oo,Qe,io=j(()=>{"use strict";on();tt();Ze=null;oo=class{constructor(t){T(this,"expr",t);return new Proxy(this,{get(n,r,o){return r in n?Reflect.get(n,r,o):typeof r=="string"?n.field(r):Reflect.get(n,r,o)}})}field(t){let n=S(this.expr,r=>{let o=r.length,i=new Array(o);for(let s=0;s<o;s++){let a=r[s];i[s]=a!=null&&typeof a=="object"?a[t]:null}return i});return n.F=this.expr,n.Z=t,n.alias(t)}renameFields(t){return S(this.expr,n=>{let r=n.length,o=new Array(r),i=Object.keys(t),s=i.length;for(let a=0;a<r;a++){let l=n[a];if(l==null||typeof l!="object"){o[a]=null;continue}let c={},u=Object.keys(l),f=u.length;for(let p=0;p<f;p++){let m=u[p];c[m]=l[m]}for(let p=0;p<s;p++){let m=i[p];if(m in c){let y=t[m];c[y]=c[m],delete c[m]}}o[a]=c}return o})}withFields(t){return S(this.expr,(n,r)=>{let o=n.length,i=new Array(o),s=[];if(Array.isArray(t)){let c=t.length;for(let u=0;u<c;u++){let f=t[u],p=ua(f),m=p.O||p.f;if(!m)throw new N("Expressions passed to struct.withFields must have a name/alias.");s.push({name:m,expr:p})}}else if(t&&typeof t=="object"){let c=Object.keys(t),u=c.length;for(let f=0;f<u;f++){let p=c[f],m=ua(t[p]);s.push({name:p,expr:m})}}let a=s.length,l=new Array(a);for(let c=0;c<a;c++)l[c]=s[c].expr.evaluate(r,o);for(let c=0;c<o;c++){let u=n[c];if(u==null||typeof u!="object"){i[c]=null;continue}let f={},p=Object.keys(u),m=p.length;for(let y=0;y<m;y++){let d=p[y];f[d]=u[d]}for(let y=0;y<a;y++)f[s[y].name]=l[y][c];i[c]=f}return i})}unnest(){let t=S(this.expr);return t.Q=!0,t.F=this.expr,t}},Qe=class extends xt{get struct(){return new oo(this)}}});var ca={};To(ca,{ColumnExpr:()=>U,resolveColumnSelectors:()=>sn});function uu(e,t){for(let n of t)for(let r of Object.getOwnPropertyNames(n.prototype))r!=="constructor"&&Object.defineProperty(e.prototype,r,Object.getOwnPropertyDescriptor(n.prototype,r)||Object.create(null))}function cu(e,t,n,r){if(e instanceof U&&e.G?.length)return e.G;if(!(e instanceof U)&&(!v(e)||!("evaluate"in e)||e.f))return null;let o;if(!(e instanceof U))o=()=>!0;else if(e.f==="*"){let a=new Set(e.mt);o=l=>!a.has(l)}else if(e.z?.length){let a=e.z,l=a.length;o=c=>{for(let u=0;u<l;u++)if(a[u].lastIndex=0,a[u].test(c))return!0;return!1}}else if(e.W?.length){if(!r)throw new hn("Cannot resolve DataType column selector without DataFrame schema.");let a=e.W,l=a.length;o=c=>{let u=r[c];if(!u)return!1;for(let f=0;f<l;f++)if(u.matches(a[f]))return!0;return!1}}else return null;let i=[],s=t.length;for(let a=0;a<s;a++){let l=t[a];!n.has(l)&&o(l)&&i.push(l)}return i}function sn(e,t,n,r,o){let i=[],s=n?new Set(n):new Set;for(let a=0;a<e.length;a++){let l=e[a];if(typeof l=="string"){i.push(new U(l));continue}if(v(l)&&l.Q&&l.F){let u=l.F,f=[],p=l.f;if(typeof p=="string"&&r&&r[p]&&r[p].name==="Struct"&&(f=Object.keys(r[p].fields)),f.length===0&&o){let d=Object.keys(o)[0],h=d?o[d].length:0,g=u.evaluate(o,h),x=g.length;for(let b=0;b<x;b++){let O=g[b];if(O!=null&&typeof O=="object"){f=Object.keys(O);break}}}let m=f.length;if(m>0){for(let y=0;y<m;y++){let d=f[y],h=u.struct.field(d);i.push(h)}continue}}let c=cu(l,t,s,r);if(c!==null)for(let u=0;u<c.length;u++){let f=new U(c[u]);f.p=[...l.p||[]],f.A=l.A,f.U=l.U,f.N=l.N,f.I=l.I,l.R&&(f.R=l.R),l.O&&l.O!=="*"&&(f.O=l.O),i.push(f)}else i.push(l)}return i}var U,Dt=j(()=>{"use strict";on();Qr();ro();so();no();io();it();$t();tt();U=class e extends xt{constructor(n){super();T(this,"f","");T(this,"G");T(this,"mt",[]);T(this,"yt");T(this,"W");T(this,"Ct");T(this,"z");if(mt(n)){this.z=[n];return}if(n instanceof Z||typeof n=="function"){this.W=[n];return}if(!Array.isArray(n)){this.f=String(n),this.O=this.f;return}if(H(n,s=>s instanceof Z||typeof s=="function",{mode:"some"})){this.W=n;return}let r=n.length,o=[],i;for(let s=0;s<r;s++){let a=n[s];mt(a)?(i??(i=[])).push(a):o.push(String(a))}i&&(this.z=i),o.length>0&&(this.G=o)}static isColExpr(n){if(!v(n))return!1;try{return"evaluate"in n&&typeof n.evaluate=="function"}catch{return!1}}static toColExpr(n){return Je(n,"Column reference cannot be null or undefined."),e.isColExpr(n)?n:new e(n)}};uu(U,[Xe,He,tr,Ye,Qe])});function Vn(e,t={strict:!0}){let n=t,r=new U(Io);return r.P=e,n.name&&(r.O=n.name),r.p.push(o=>{let i=o.length,s=n.strict!==!1,a=(g,x)=>g===void 0?x:z(g<0?i+g:g,{min:0,max:i}),l=a(n.startIndex,0),c=a(n.endIndex,i),u=Math.max(0,c-l),f=n.n!==void 0?n.n:u;if(s){if(f!==i)throw new ut(`Column height mismatch: seqRange length ${f} does not match DataFrame height ${i}`)}else{let g=n.pad??!1,x=n.truncate??!1;if(g&&!x&&f>u)throw new ut(`Cannot pad seqRange output: specified length ${f} starting at index ${l} exceeds slice width ${u} (requires truncation).`);if(x&&!g&&f<u)throw new ut(`Cannot truncate seqRange output: specified length ${f} starting at index ${l} is less than slice width ${u} (requires padding).`)}let p=n.mode||"cumulative",m=n.step!==void 0?n.step:1,y=n.dtype?g=>n.dtype.coerce(g):g=>g,d=y(!s&&n.padValue!==void 0?n.padValue:null),h=s&&n.dtype?.allocate?n.dtype.allocate(i):new Array(i).fill(d);return Ci(h,e,{mode:p,step:m,coerce:y,startIndex:s?0:l,endIndex:s?i:Math.min(l+f,c)}),h}),r}var ao=j(()=>{"use strict";Dt();Gt();tt();it()});function an(e,t={}){let n=Vn(e,{...t,mode:"constant"});return n.B=!0,n}var nr=j(()=>{"use strict";ao()});var fa={};To(fa,{duration:()=>lo});function lo(e={}){if(typeof e=="string"){let s=Wr(e,{to:"ms"}),a=an(s).alias("duration");return a._=new Et("ms"),a}let t=0,n=null,r=!1,o=e;for(let s in o){let a=tn[s];if(a===void 0)continue;let l=o[s];if(l==null)continue;if(r=!0,M(l)){t+=l*a;continue}let c=U.toColExpr(l).mul(a);n=n?n.add(c):c}if(!r)throw new N("At least one duration component must be specified for $df.duration().");let i=n?t!==0?n.add(an(t)):n:an(t);return i._=new Et("ms"),i.alias("duration")}var uo=j(()=>{"use strict";Dt();nr();Fn();tt();it()});var co,tr,so=j(()=>{"use strict";Fn();tt();on();qt();it();Ot();co=class{constructor(t){T(this,"expr",t)}tt(){let t=this.expr._;return t instanceof Lt?t.timeZone:null}Et(){let t=this.expr._;return t instanceof Lt?t.timeUnit:null}nt(t){return S(this.expr,k(n=>{let r=X(n);return r?t(r):null}))}castTimeUnit(t){return this.expr.cast(new Lt(t,this.tt()))}century(t){return this.year(t).sub(1).floordiv(100).add(1)}convertTimeZone(t){let n=this.tt();if(this.expr._ instanceof Lt&&n===null)throw new N('convertTimeZone() requires a timezone-aware Datetime column. Use .dt.replace({ timeZone: "..." }) to assign a timezone first.');return this.expr.cast(new Lt(this.Et()??"ms",t))}date(){return this.replace({hour:0,minute:0,second:0,ms:0})}day(t){return this.strftime({format:"%d",timeZone:t}).cast(yt)}daysInMonth(t){return this.monthEnd().dt.day(t)}epoch(t="ms"){return this.nt(n=>ws(n,t))}hour(t){return this.strftime({format:"%H",timeZone:t}).cast(yt)}isBusinessDay(t={}){return this.nt(n=>Ds(n,t))}isLeapYear(t){let n=this.year(t);return n.mod(4).eq(0).and(n.mod(100).ne(0)).or(n.mod(400).eq(0)).cast(Un)}isoWeek(t){return this.strftime({format:"%V",timeZone:t}).cast(yt)}isoYear(t){return this.strftime({format:"%G",timeZone:t}).cast(yt)}microsecond(t){return this.strftime({format:"%f",timeZone:t}).cast(yt)}millennium(t){return this.year(t).sub(1).floordiv(1e3).add(1)}millisecond(t){return this.strftime({format:"%ms",timeZone:t}).cast(yt)}minute(t){return this.strftime({format:"%M",timeZone:t}).cast(yt)}month(t){return this.strftime({format:"%m",timeZone:t}).cast(yt)}monthEnd(){return this.replace({day:-1,hour:0,minute:0,second:0,ms:0})}monthStart(){return this.replace({day:1,hour:0,minute:0,second:0,ms:0})}nanosecond(t){return this.microsecond(t).mul(1e3)}offsetDay(t,n={}){let o=n?.excludeWeekdays?.length||n?.holidays||n?.roll?S(this.expr,G(this.expr,t,(s,a)=>{let l=X(s);return l?Is(l,a,n):null})):t,{duration:i}=(uo(),Eo(fa));return this.expr.add(i({days:o}))}ordinalDay(t){return this.strftime({format:"%j",timeZone:t}).cast(yt)}quarter(t){return this.month(t).div(3).ceil()}replace(t){return S(this.expr,k(n=>{let r=X(n);return r?Cs(r,t):null}))}second(){return this.strftime({format:"%S",timeZone:"UTC"}).cast(yt)}strftime(t){let n=this.tt(),r=n&&!t.timeZone?{...t,timeZone:n}:t;return this.nt(o=>ie(o,r))}time(){return this.strftime({format:"%H:%M:%S.%ms",timeZone:"UTC"})}timestamp(t="ms"){return this.epoch(t)}totalDays(){return this.totalHours().div(24)}totalHours(){return this.totalMinutes().div(60)}totalMicroseconds(){return this.totalMilliseconds().mul(Wn)}totalMilliseconds(){return this.expr}totalMinutes(){return this.totalSeconds().div(60)}totalNanoseconds(){return this.totalMilliseconds().mul(zn)}totalSeconds(){return this.totalMilliseconds().div(_t)}utcOffset(t,n={}){return S(this.expr,k(r=>{let o=X(r);return o?Cr(o,t,n):null}))}week(t){return this.isoWeek(t)}weekday(t){return this.strftime({format:"%u",timeZone:t}).cast(yt)}year(t){return this.strftime({format:"%Y",timeZone:t}).cast(yt)}},tr=class extends xt{get dt(){return new co(this)}}});function gn(){return new U("*")}var ma=j(()=>{"use strict";Dt()});function fe(e){let t=new U("*");return t.mt=Array.isArray(e)?e:[e],t}var pa=j(()=>{"use strict";Dt()});function ya(...e){let t=e.length===1&&Array.isArray(e[0])?e[0]:e,n=new U(Do);return n.p.push((r,o)=>{let i=r.length,s=t.length,a=new Array(s),l=new Array(s);for(let u=0;u<s;u++){let f=t[u],p=Bn(f,o,i);a[u]=p,l[u]=Pn(f,p,o,i)}let c=new Array(i);for(let u=0;u<i;u++){let f=null;for(let p=0;p<s;p++){let m=a[p],y=l[p]?m[u]:m;if(y!=null){f=y;break}}c[u]=f}return c}),n}var da=j(()=>{"use strict";Dt();qt();Gt()});function ha(e){return new er([e])}var er,fo,ga=j(()=>{"use strict";Dt();qt();Gt();er=class{constructor(t,n=[]){T(this,"_predicates",t);T(this,"_values",n)}then(t){return new fo(this.et,[...this.L,t])}},fo=class e extends U{constructor(n=[],r=[],o=null){super(Ro);T(this,"_predicates",n);T(this,"_values",r);T(this,"_otherwise",o);this.p=[(i,s)=>{let a=i.length,l=this.et,c=this.L,u=l.length,f=new Array(u),p=new Array(u),m=new Array(u),y=new Array(u);for(let b=0;b<u;b++){let O=l[b],w=c[b],A=Bn(O,s,a),I=Bn(w,s,a);f[b]=A,p[b]=I,m[b]=Pn(O,A,s,a),y[b]=Pn(w,I,s,a)}let d=this.rt,h=Bn(d,s,a),g=Pn(d,h,s,a),x=new Array(a);for(let b=0;b<a;b++){let O=!1;for(let w=0;w<u;w++)if((m[w]?f[w][b]:f[w])===!0){x[b]=y[w]?p[w][b]:p[w],O=!0;break}O||(x[b]=g?h[b]:h)}return x}]}get Rt(){return this.rt}get ot(){return this.rt!=null?[...this.L,this.rt]:this.L}when(n){return new er([...this.et,n],this.L)}otherwise(n){return new e(this.et,this.L,n)}}});function ba(e){return U.toColExpr(e).implode()}var xa=j(()=>{"use strict";Dt()});function wa(){return new U(Sn)}var Aa=j(()=>{"use strict";Dt();Gt()});function Sa(e,...t){let n;Array.isArray(e)||e&&typeof e=="object"&&!U.isColExpr(e)?n=e:n=[e,...t];let r=an({}).struct.withFields(n);return delete r.B,delete r.P,r.f=Co,r.alias("struct")}var Oa=j(()=>{"use strict";Dt();nr();Gt()});function Ln(e,t){if(e==null)return;if(e instanceof Z)return e;if(typeof e=="object"&&("_ops"in e||"_literalValue"in e||"_targetType"in e))return me(e,t);let n=Q(e);if(typeof n=="string")return t[n]??D.Utf8;if(typeof n=="boolean")return D.Boolean;if(typeof n=="bigint")return Tn(n,{range:"Int64"})?D.Int64:D.UInt64;if(M(n))return At(n,{range:"Int32"})?D.Int32:Number.isInteger(n)?D.Int64:D.Float64;if(L(n))return D.Datetime;if(Xi(n,{strict:!0}))return D.Binary;if(Array.isArray(n)){let r,o=n.length;for(let i=0;i<o;i++){let s=n[i];if(s!=null&&(r=Ln(s,t)))break}return D.Array(r??D.Utf8)}if(ot(n)){let r=Jt?Jt.call(n):n.constructor.name,o=fu[r];return o?D.Array(o):D.Binary}if(v(n))return D.Object}function Ta(e,t,n){if(!e||!t)return;if(n&&n.length>0){let a=!1;for(let l=0;l<n.length;l++){let c=n[l];if(c!=null){if(typeof c!="boolean"){a=!1;break}a=!0}}if(a)return D.Boolean}let r=e instanceof Et,o=t instanceof Et,i=e.isTemporal&&!r,s=t.isTemporal&&!o;if(i||s){if(i&&s){let a=e.timeUnit||t.timeUnit||"ms";return new Et(a)}return i?e:t}if(r||o)return r?e:t;if(e.isUtf8||t.isUtf8)return D.Utf8;if(e.isNumeric&&t.isNumeric){let a=e instanceof kn||t instanceof kn,l=e instanceof Nn||t instanceof Nn,c=e instanceof Qt||t instanceof Qt;if(a||l&&c)return D.Float64;if(l)return D.Float32;if(c)return e instanceof Qt?e:t;if(n!==void 0){let p={range:{min:-1/0,max:1/0}},m=n.length;for(let y=0;y<m;y++){let d=n[y];if(M(d)&&!At(d,p))return D.Float64}}if(e===t)return e;let u=e.name,f=t.name;return u.endsWith("64")||f.endsWith("64")?D.Int64:u.endsWith("32")||f.endsWith("32")?u==="UInt32"&&f==="UInt32"?D.UInt32:D.Int32:u.endsWith("16")||f.endsWith("16")?u==="UInt16"&&f==="UInt16"?D.UInt16:D.Int16:u==="UInt8"&&f==="UInt8"?D.UInt8:D.Int8}}function me(e,t,n){if(!e)return;if(e._)return e._;if(e.yt instanceof Z)return e.yt;if(e.B&&e.P!==void 0)return Ln(e.P,t);if(e.C)return Ta(Ln(e.C.left,t),Ln(e.C.right,t),n);if(e.ot){let s,a=e.ot.length;for(let l=0;l<a;l++){let c=Ln(e.ot[l],t);c&&(s?s!==c&&s.isNumeric&&c.isNumeric&&(s=Ta(s,c,n)??s):s=c)}if(s)return s}if(e.F&&e.Z){let s=Ln(e.F,t);if(s instanceof se)return s.fields?.[e.Z]}let r=e.f?t[e.f]:void 0,o=n?.[0],i=(!e.p||e.p.length===0)&&!e.A&&!e.R;if(r){if(r instanceof Mn&&(e.Q||n?.rowMap))return r.innerType;if(!(r instanceof Mn)&&Array.isArray(o))return D.Array(r);if(i||r.isTemporal&&e.A&&(L(o)||typeof o=="string")||r instanceof Et&&e.A&&M(o))return r}if(e.A&&M(o))return!Number.isInteger(o)||r?.isNumeric&&!(r instanceof Et)?D.Float64:D.Int32}var fu,Ea=j(()=>{"use strict";Fn();$t();it();fu={Int8Array:D.Int8,Uint8Array:D.UInt8,Uint8ClampedArray:D.UInt8,Int16Array:D.Int16,Uint16Array:D.UInt16,Int32Array:D.Int32,Uint32Array:D.UInt32,BigInt64Array:D.Int64,BigUint64Array:D.UInt64,Float32Array:D.Float32,Float64Array:D.Float64}});var pe=j(()=>{"use strict";Gt();_o();on();Qr();no();ro();so();io();Dt();nr();ma();pa();da();ga();xa();ao();Aa();Oa();uo();Ea();qt()});var ye,Ia=j(()=>{"use strict";vn();ze();pe();ye=class{constructor(t,n,r,o,i,s,a){T(this,"$");T(this,"it");T(this,"ht");T(this,"X");T(this,"bt");T(this,"H");T(this,"st");this.$=t,this.it=n,this.ht=r,this.X=o,this.bt=i,this.H=s,this.st=a}xt(t){let n=this.$.size,r=t.length,o={},i={};for(let a=0;a<r;a++){let l=t[a];o[l]=new Array(n),i[l]=this.H[l]}let s=0;for(let a of this.$.values()){if(a.length===0)continue;let l=a[0];for(let c=0;c<r;c++){let u=t[c],f=this.st?.[u]?this.st[u][s]:this.X[u]?.[l];o[u][s]=f===void 0?null:f}s++}return{newColumns:o,outSchema:i,groupCount:s}}ut(t){let n=t.length,r=new Array(n);for(let o=0;o<n;o++)r[o]=String(t[o]);return r}toDataframe(){let t=this.ut(this.it),{newColumns:n,outSchema:r,groupCount:o}=this.xt(t);return q.S(n,r,o)}agg(...t){let n=this.ut(this.ht),r=this.ut(this.it),o=sn(t.flat(),n,r,this.H,this.X),{newColumns:i,outSchema:s,groupCount:a}=this.xt(r),l=this.$.size;for(let c=0;c<o.length;c++){let u=o[c],f=u.O||u.f||"*";if(!u.A)i[f]=u.evaluate(i,l);else{let p=u.J(u.N,this.X,this.bt),m=new Array(l),y=0;for(let d of this.$.values()){if(d.length===0)continue;let h=new Array(d.length);for(let g=0;g<d.length;g++)h[g]=p[d[g]];m[y]=u.A(h),y++}i[f]=u.Y(u.N,m,i)}}for(let c of o){let u=c.O||c.f||"*",f=me(c,this.H,i[u])||rn(i[u]);s[u]=f,i[u]=Kt(i[u],f,a)}return q.S(i,s,a)}}});function Ca(e,t,n,r){if(ot(e)&&ot(t)){t.set(e,n);return}let o=t;for(let i=0;i<r;i++)o[n+i]=e[i]}function mu(e,t,n){if(e==null)throw new Y(`Invalid input to ${t} at index ${n}: item cannot be null or undefined.`);if(e instanceof q)return[e];if(Ft(e))return[new q(e)];if(V(e)){if(H(e,q,{mode:"every"}))return e;if(H(e,"plainObject",{mode:"every"}))return[new q(e)];let r=H(e,q,{mode:"some"});for(let o=0;o<e.length;o++)if(r?!(e[o]instanceof q):!Ft(e[o]))throw new Y(r?`Invalid input to ${t} at index ${n}, sub-index ${o}: nested array must contain only DataFrame instances.`:`Invalid input to ${t} at index ${n}, row ${o}: rows must be plain objects.`)}throw new Y(`Invalid input to ${t} at index ${n}: expected DataFrame, row array, or column dictionary.`)}function Da(e,t,n,r,o=!1){let i={};for(let a=0;a<t.length;a++){let l=t[a],c=n[l],u=!!(o&&c);if(u){for(let f=0;f<e.length;f++)if(!ot(e[f].t[l])){u=!1;break}}i[l]=u?c.allocate(r):new Array(r).fill(null)}let s=0;for(let a=0;a<e.length;a++){let l=e[a],c=l.height;if(c!==0){for(let u=0;u<t.length;u++){let f=t[u],p=l.t[f];p!==void 0&&Ca(p,i[f],s,c)}s+=c}}return q.S(i,n,r)}function de(e,{how:t="vertical",horizontal:n}={}){if(e==null)throw new Y("Invalid input to concat: rawItems cannot be null or undefined.");let r=Array.isArray(e)?e:[e],o=[];for(let i=0;i<r.length;i++)o.push(...mu(r[i],"concat",i));if(o.length===0)return q.S({},{},0);if(o.length===1&&t!=="horizontal")return o[0];switch(t){case"vertical":{let i=null,s=0;for(let l=0;l<o.length;l++)s+=o[l].height,!i&&o[l].height>0&&(i=o[l]);if(!i)return q.S({},{},0);let a=Object.keys(i.t);for(let l=0;l<o.length;l++){let c=o[l];if(c.height===0)continue;let u=Object.keys(c.t);if(a.length!==u.length)throw new Y(`[Strict Vertical] Column count mismatch at index ${l}.`);for(let f=0;f<a.length;f++){let p=a[f];if(p!==u[f])throw new Y(`[Strict Vertical] Schema mismatch at position ${f} in DF ${l}. Expected column "${p}", but found "${u[f]}".`);let m=i.schema[p],y=c.schema[p];if(m&&y&&!m.equals(y))throw new hn(`[Strict Type Check] Schema type mismatch for column "${p}": expected ${m.name}, found ${y.name}.`)}}return Da(o,a,i.schema,s,!0)}case"horizontal":{let i=n?.strict??!0,s=0;for(let u=0;u<o.length;u++)o[u].height>s&&(s=o[u].height);let a=new Set,l={},c={};for(let u=0;u<o.length;u++){let f=o[u],p=f.height;if(i&&p!==s)throw new ut(`[Horizontal] Row count mismatch at index ${u}. Expected ${s}, got ${p}. Set strict=false to allow padding.`);Object.assign(c,f.schema);let m=Object.keys(f.t);for(let y=0;y<m.length;y++){let d=m[y];if(a.has(d))throw new Y(`[Horizontal] Duplicate column name "${d}" detected. Horizontal concat requires unique names.`);a.add(d);let h=f.t[d];if(p===s)l[d]=ot(h)?Array.from(h):h;else{let g=new Array(s).fill(null);Ca(h,g,0,p),l[d]=g}}}return q.S(l,c,s)}case"diagonal":{let i=new Set,s=0;for(let c=0;c<o.length;c++){s+=o[c].height;for(let u of Object.keys(o[c].t))i.add(u)}let a=Array.from(i),l={};for(let c=0;c<a.length;c++){let u=a[c],f=null;for(let p=0;p<o.length;p++){let m=o[p].schema[u];if(m){if(f===null)f=m;else if(!f.equals(m))throw new hn(`[Strict Type Check] Schema type mismatch for column "${u}": expected ${f.name}, found ${m.name}.`)}}l[u]=f||D.Utf8}return Da(o,a,l,s,!1)}}}var mo=j(()=>{"use strict";vn();$t();it();tt()});var q,vn=j(()=>{"use strict";pe();Ia();Ot();ne();$t();it();tt();mo();ze();q=class e{constructor(t,n,r){T(this,"t");T(this,"r");T(this,"a",{});if(Array.isArray(t)){let{columns:o,height:i}=Zs(t);this.t=o,this.r=i}else v(t)?(this.t=t,this.r=zr(t,r)):(this.t={},this.r=0);n?this.wt(n):this.r>0||Object.keys(this.t).length>0?this.Dt():this.a={}}static S(t,n,r){zr(t,r);let o=Object.create(e.prototype);return o.t=t,o.a=n,o.r=r,o}wt(t){this.a=t;let n=Object.keys(t),r={};for(let o of n){let i=t[o],s=this.t[o];r[o]=s?Kt(s,i,this.r):Kt(new Array(this.r).fill(null),i,this.r)}this.t=r}Dt(){let t={},n=Object.keys(this.t),r=n.length;for(let o=0;o<r;o++){let i=n[o];t[i]=rn(this.t[i])}this.wt(t)}ct(t){let n=t.flat(1/0),r=[],o=n.length;for(let i=0;i<o;i++){let s=n[i];if(typeof s=="string")r.push(new U(s));else if(U.isColExpr(s))r.push(s);else if(s instanceof Z||typeof s=="function"||mt(s))r.push(new U(s));else if(v(s)){let a=Object.keys(s),l=a.length;for(let c=0;c<l;c++){let u=a[c],f=s[u];if(U.isColExpr(f))r.push(f.alias(u));else{let p=new U(u);p.evaluate=(m,y)=>new Array(y).fill(f),r.push(p)}}}}return r}clone(){return this.select(gn())}get columns(){return Object.keys(this.t)}concat(t,n={}){let r=H(t,e,{mode:"every",allowEmpty:!1})?t:[t];return de([this,...r],n)}drop(...t){return this.select(fe(t.flat()))}dropNulls(t){return this.filter(t?new U(t).isNotNull():gn().isNotNull())}get dtypes(){let t=Object.keys(this.t),n=t.length,r=new Array(n);for(let o=0;o<n;o++)r[o]=this.a[t[o]];return r}explode(t,n){let r=Array.isArray(t)?t:[t],o=this.ct(r),i=sn(o,Object.keys(this.t),void 0,this.a,this.t),s=new Set,a=i.length;for(let f=0;f<a;f++){let p=i[f],m=p.f||p.O;if(!m||m==="*")throw new Y("Expression passed to explode must have a column name.");et(m,this.t,"Explode column"),s.add(m)}let l=Object.keys(this.t),c=[],u=l.length;for(let f=0;f<u;f++){let p=l[f];c.push(s.has(p)?new U(p).arr.explode(n):new U(p))}return this.select(...c)}fillNull(t={}){return this.r===0?this:this.withColumns(gn().fillNull(t))}filter(...t){let n=this.r;if(n===0)return this;let r=Object.keys(this.t),o=[],i=[];for(let d=0;d<t.length;d++){let h=t[d];typeof h=="function"?i.push(h):o.push(h)}let s=sn(o,r,void 0,this.a,this.t),a=s.length,l=i.length,c=new Array(a);for(let d=0;d<a;d++)c[d]=s[d].evaluate(this.t,n);let u=0,f=null;if(l>0){let d=this.t;f={};for(let h=0;h<r.length;h++){let g=r[h],x=d[g];Object.defineProperty(f,g,{get(){let b=x[u];return b===void 0?null:b},enumerable:!0,configurable:!0})}}let p=new Array(n),m=0;t:for(let d=0;d<n;d++){for(let h=0;h<a;h++)if(!c[h][d]){p[d]=!1;continue t}if(f){u=d;for(let h=0;h<l;h++)if(!i[h](f)){p[d]=!1;continue t}}p[d]=!0,m++}let y={};for(let d=0;d<r.length;d++){let h=r[d];y[h]=In(this.t[h],p)}return e.S(y,this.a,m)}groupBy(t){let n=bt(t),r=Nt(t,"string");for(let s=0;s<r.length;s++)et(r[s],this.t,"Grouping key");let o=ce(this.t,r,this.r),i=Object.keys(this.t);return new ye(o,n,i,this.t,this.r,this.a)}groupByDynamic(t,n){if(!n||n.every==null)throw new N('groupByDynamic requires "every" option');let{every:r,period:o,offset:i=0,truncate:s=!0,closed:a="left",label:l="left",startBy:c="window",includeBoundaries:u=!1,checkSorted:f=!0,by:p,groupBy:m}=n,y=typeof t=="string"?t:U.isColExpr(t)?t.f??String(t):String(t);if(et(y,this.t,"Index column"),a!=="left"&&a!=="right"&&a!=="both"&&a!=="none")throw new N(`Invalid "closed" option: "${a}". Expected "left", "right", "both", or "none"`);if(l!=="left"&&l!=="right"&&l!=="datapoint")throw new N(`Invalid "label" option: "${l}". Expected "left", "right", or "datapoint"`);let d=typeof c=="string"?c.toLowerCase():"",h=d in mr;if(d!=="window"&&d!=="datapoint"&&!h)throw new N(`Invalid "startBy" option: "${c}". Expected "window", "datapoint", or a day of week`);let g=Ge(i,{fallback:0});if(!M(g))throw new N(`Invalid "offset" option: ${i}`);let x=a==="left"||a==="both",b=a==="right"||a==="both",O=x?"left":"right",w=b?"right":"left",A="_lower_boundary",I="_upper_boundary",C=typeof r=="string"?le(r):null,R=typeof o=="string"?le(o):null,F=m??p,E=F?Nt(bt(F),"string"):[],_=Array.from(new Set(E));for(let rt=0;rt<_.length;rt++){if(_[rt]===y)throw new N(`Cannot group by index column "${y}" in secondary grouping keys`);et(_[rt],this.t,"Secondary grouping key")}let P=this.r,W=this.t[y],B=new Float64Array(P),st=this.a[y]?.name==="Datetime";for(let rt=0;rt<P;rt++){let dt=W[rt],xn=$(dt),Kn=xn===null?X(dt):null;Kn&&(st=!0),B[rt]=xn??Kn?.getTime()??NaN}let kt=st&&!!(C?.months||R?.months),ct=0,ft=0;if(!kt){if(ct=Ge(r),ft=Ge(o,{fallback:ct}),!M(ct)||ct<=Number.EPSILON)throw new N(`"every" must be positive, got ${r}`);if(!M(ft)||ft<=Number.EPSILON)throw new N(`"period" must be positive, got ${o}`)}let $n=_.length>0&&P>0?ce(this.t,_,P):new Map([["",Array.from({length:P},(rt,dt)=>dt)]]),ln=[..._,y,...u?[A,I]:[]],ho=new Map,bn={};for(let rt=0;rt<ln.length;rt++)bn[ln[rt]]=[];let Ra=R??C,_a=0;for(let rt of $n.values()){let dt=[],xn=-1/0,Kn=!1;for(let J=0;J<rt.length;J++){let wt=rt[J],Ut=B[wt];if(M(Ut)){if(Ut<xn&&f)throw new Y(`Index column "${y}" is not sorted in ascending order`);Ut<xn&&(Kn=!0),dt.push(wt),xn=Ut}}let or=dt.length;if(or===0)continue;Kn&&dt.sort((J,wt)=>B[J]-B[wt]);let wn=B[dt[0]],go=B[dt[or-1]],bo=null,ir=0;if(kt){let J=new Date(wn),wt=C.months%12===0?0:J.getUTCMonth();bo=d==="datapoint"?J:nt(J.getUTCFullYear(),wt,1)}else{let J;if(d==="datapoint")J=wn+g;else if(h&&st){let wt=(new Date(wn).getUTCDay()-mr[d]+7)%7;J=Math.floor(wn/St)*St-wt*St+g}else J=Math.floor((wn-g)/ct)*ct+g;ir=!x&&wn-J<=1e-9?J-ct:J}let qn=0;for(;;){let J=kt?Jr(bo,C,qn).getTime():ir+qn*ct;if(x?J>go:J>=go)break;let wt=kt?Jr(new Date(J),Ra).getTime():J+ft;qn++;let Ut=fn(dt,J,{side:O,getValue:(Ct,Gn)=>B[Gn]}),xo=fn(dt,wt,{side:w,getValue:(Ct,Gn)=>B[Gn]});if(Ut>=xo){let Ct=!kt&&Ut<or?B[dt[Ut]]:NaN,Gn=M(Ct)&&Ct>=wt,ka=b?Ct-ft:Ct-ft+1e-9;Gn&&(qn=Math.max(qn,Math.floor((ka-ir)/ct)));continue}let wo=dt.slice(Ut,xo),Ao=wo[0],So=st?new Date(J):J,Oo=st?new Date(wt):wt;bn[y].push(!s||l==="datapoint"?W[Ao]:l==="right"?Oo:So),u&&(bn[A].push(So),bn[I].push(Oo));for(let Ct=0;Ct<_.length;Ct++)bn[_[Ct]].push(this.t[_[Ct]][Ao]);ho.set(`__dyn_${_a++}__`,wo)}}let rr=u?this.a[y]||(st?D.Datetime:D.Float64):null,Na=rr?{...this.a,[A]:rr,[I]:rr}:this.a;return new ye(ho,ln,Object.keys(this.t),this.t,this.r,Na,bn)}head(t=10){return this.limit(t,{offset:0,from:"start"})}get height(){return this.r}hstack(t,n={}){return this.concat(t,{how:"horizontal",horizontal:n})}insertColumn(t,n,r){let o=U.toColExpr(r).alias(n),i=Object.keys(this.t),s=i.length,a=[];for(let c=0;c<s;c++){let u=i[c];u!==n&&a.push(u)}let l=z(t,{min:0,max:a.length});return a.splice(l,0,o),this.select(...a)}item(t,n){let r=this.r,o=Object.keys(this.t),i=o.length;if(t===void 0&&n===void 0){if(r!==1||i!==1)throw new Y("DataFrame.item() can only be called without arguments if the shape is (1, 1).");return this.t[o[0]][0]}if(t===void 0||n===void 0)throw new Y("DataFrame.item() requires both row and column to be specified if not empty.");if(t<0||t>=r)throw new ut(`Row index ${t} is out of bounds for DataFrame height ${r}.`);let s=typeof n=="number"?o[n]:n;if(s===void 0||this.t[s]===void 0)throw typeof n=="number"?new ut(`Column index ${n} is out of bounds for DataFrame width ${i}.`):new nn(n);return this.t[s][t]}*iterColumns(){let t=Object.values(this.t),n=t.length;for(let r=0;r<n;r++)yield t[r]}*iterRows({named:t=!1}={}){let n=this.r;if(n===0)return;if(t){let i=this.t,s=Object.keys(i);for(let a=0;a<n;a++)yield Xr(i,a,s);return}let r=Object.values(this.t),o=r.length;for(let i=0;i<n;i++){let s=new Array(o);for(let a=0;a<o;a++)s[a]=r[a][i];yield s}}join(t,n={}){if(!t||!(t instanceof e))throw new N('join() requires a valid DataFrame in "other"');let{on:r,leftOn:o,rightOn:i,how:s="inner",suffixes:a=["","_right"],joinNulls:l=!1,coalesce:c=!0,maintainOrder:u="none"}=n,f=r!==void 0,p=o!==void 0||i!==void 0;if(s==="cross"&&(f||p))throw new N('Cannot specify "on", "leftOn", or "rightOn" when how is "cross"');if(f&&p)throw new N('Cannot specify both "on" and "leftOn"/"rightOn"');if(o!==void 0!=(i!==void 0))throw new N('join() requires both "leftOn" and "rightOn"');if(s!=="cross"&&!f&&!p)throw new N('join() requires "on" or "leftOn"/"rightOn"');let m=[],y=[];if(o!==void 0&&i!==void 0){if(m=Nt(o,"string"),y=Nt(i,"string"),m.length===0||y.length===0)throw new N("join() requires non-empty key arrays");if(m.length!==y.length)throw new N(`join() "leftOn" length (${m.length}) must match "rightOn" length (${y.length})`)}else if(r!==void 0&&(m=Nt(r,"string"),y=m,m.length===0))throw new N('join() requires at least one key column in "on"');let d=m.length;for(let O=0;O<d;O++)et(m[O],this.t,"Join key"," in the left DataFrame."),et(y[O],t.t,"Join key"," in the right DataFrame.");let g={...n,how:s,suffixes:a,joinNulls:l,coalesce:c,maintainOrder:typeof u=="boolean"?u?"left":"none":u??"none"},{leftIndices:x,rightIndices:b}=ea(this.t,t.t,this.r,t.r,m,y,g);return We(this.t,t.t,this.a,t.a,x,b,m,y,{suffixes:a,coalesce:c,how:s})}joinAsof(t,n){if(!t||!(t instanceof e))throw new N('joinAsof() requires a valid DataFrame in "other"');let{on:r,leftOn:o,rightOn:i,by:s,leftBy:a,rightBy:l,strategy:c="backward",tolerance:u,allowExactMatches:f=!0,suffixes:p=["","_right"],coalesce:m=!0,checkSorted:y=!0}=n??{},d=String(o??r??""),h=String(i??r??"");if(!d||!h)throw new N('joinAsof() requires "on" or "leftOn"/"rightOn"');let g=Nt(a??s,"string"),x=Nt(l??s,"string");if(g.length!==x.length)throw new N(`Partition key length mismatch: ${g.length} vs ${x.length}`);let b=g.length;for(let R=0;R<b;R++)et(g[R],this.t,"Partition key"," in the left DataFrame."),et(x[R],t.t,"Partition key"," in the right DataFrame.");let O={...n,strategy:c,tolerance:u,allowExactMatches:f,suffixes:p,coalesce:m,checkSorted:y},{leftIndices:w,rightIndices:A}=ra(this.t,t.t,this.r,t.r,d,h,g,x,O),I=[d,...g],C=[h,...x];return We(this.t,t.t,this.a,t.a,w,A,I,C,{suffixes:p,coalesce:m,how:"left"})}joinWhere(t,...n){if(!t||!(t instanceof e))throw new N('joinWhere() requires a valid DataFrame in "other"');let r={},o=[];for(let c=0;c<n.length;c++){let u=n[c];if(Array.isArray(u)){for(let f=0;f<u.length;f++)o.push(U.toColExpr(u[f]));continue}if(v(u)&&!U.isColExpr(u)&&!("_ops"in u)){r={...r,...u};continue}o.push(U.toColExpr(u))}let{how:i="inner",suffixes:s=["","_right"]}=r;if(i!=="inner"&&i!=="left"&&i!=="right")throw new N(`joinWhere() "how" must be one of "inner", "left", "right", got "${i}"`);let{leftIndices:a,rightIndices:l}=oa(this.t,t.t,this.r,t.r,o,{how:i,suffixes:s});return We(this.t,t.t,this.a,t.a,a,l,[],[],{suffixes:s,coalesce:!1,how:i})}limit(t,{offset:n=0,from:r="start"}={}){let o=this.r,i=z(Math.floor(t),{min:0,max:o}),s=z(Math.floor(n),{min:0,max:o}),a=s,l=z(s+i,{min:0,max:o});r==="end"&&(l=z(o-s,{min:0,max:o}),a=z(l-i,{min:0,max:o}));let c=z(l-a,{min:0}),u={},f=Object.keys(this.t),p=f.length;for(let m=0;m<p;m++){let y=f[m];u[y]=this.t[y].slice(a,l)}return e.S(u,this.a,c)}pivot(t){if(this.r===0)return e.S({},{},0);let{index:n,columns:r,values:o}=t,i=Nt(n,"string"),s=i.length;for(let w=0;w<s;w++)et(i[w],this.t,"Pivot index key");let a=String(r),l=String(o);et(a,this.t,"Pivot column key"),et(l,this.t,"Pivot values key");let c=new Map,u=[],f=new Set,p=this.r,m=this.t[a],y=this.t[l];for(let w=0;w<p;w++){let A=jn(this.t,i,w);f.add(String(m[w])),c.get(A)===void 0&&(c.set(A,c.size),u.push(w))}let d=c.size,h={},g={};for(let w=0;w<s;w++){let A=i[w];h[A]=this.t[A],this.a[A]&&(g[A]=this.a[A])}let x=Yr(h,u),b=Array.from(f),O=this.a[l]||D.Utf8;for(let w=0;w<b.length;w++){let A=b[w];x[A]=new Array(d).fill(null),g[A]=O}for(let w=0;w<p;w++){let A=jn(this.t,i,w),I=c.get(A),C=String(m[w]);x[C][I]=y[w]}return e.S(x,g,d)}rename(t={}){let n=Object.keys(this.t),r=n.length,o=new Array(r);for(let i=0;i<r;i++){let s=n[i],a=t[s];o[i]=a?new U(s).alias(a):s}return this.select(...o)}reverse(){return this.r===0?this:this.select(gn().reverse())}get schema(){return this.a}select(...t){let n=this.ct(t),r=Object.keys(this.t),o=sn(n,r,void 0,this.a,this.t),i=o.length;if(i===0)return e.S({},{},this.r);let s={},a={},l=new Array(i),c=new Array(i),u=new Set,f=null;for(let y=0;y<i;y++){let d=o[y],h=d.O||d.f||"*";if(u.has(h))throw new Y(`Duplicate column selection: "${h}"`);u.add(h);let g=It(d,this.t,this.r);l[y]=g,c[y]=h;let x=g&&g.rowMap;if(!x)continue;if(!f){f=x;continue}let b=x.length;if(b!==f.length)throw new ut(`Mismatched explode heights: Column "${h}" has length ${b}, but expected ${f.length}`);for(let O=0;O<b;O++)if(x[O]!==f[O])throw new ut(`Mismatched explode heights: Column "${h}" has mismatched row lengths`)}let p=f?f.length:this.r,m=i>0;for(let y=0;y<i;y++){let d=o[y];if(!(d.A!=null&&(!d.I||d.I.length===0))&&!d.B){m=!1;break}}for(let y=0;y<i;y++){let d=c[y],h=l[y],g=h&&h.rowMap,x=V(h)?h.length:0,b=f&&!g?this.r:p;if(x!==b)throw new ut(`Column height mismatch for "${d}": got ${x}, expected ${b}`);f&&!g&&(h=ue(h,f)),l[y]=h}m&&(p=1);for(let y=0;y<i;y++){let d=o[y],h=c[y],g=l[y],x=me(d,this.a,g)||rn(g);a[h]=x,s[h]=Kt(g,x,p)}return e.S(s,a,p)}get shape(){return[this.height,this.width]}slice(t,n){let r=this.r,o=z(t<0?r+t:t,{min:0,max:r}),i=z(n===void 0?r:n<0?r+n:n,{min:0,max:r}),s=z(i-o,{min:0});return this.limit(s,{offset:o})}sort(t){if(!t?.by||this.r===0)return this;let{by:n,descending:r=!1,nullsLast:o=!0,customComp:i}=t,s=bt(n),a=Object.values(this.select(...s).t),l=this.r;if(l===1)return this;let c=a.length,u=new Array(c),f=Array.isArray(r),p=typeof i=="function";for(let y=0;y<c;y++)u[y]={descending:f?!!r[y]:!!r,nullsLast:o,customComp:p?i:i?.[s[y]]};let m=new Array(l);for(let y=0;y<l;y++)m[y]=y;return m.sort((y,d)=>{for(let h=0;h<c;h++){let g=br(a[h][y],a[h][d],u[h]);if(g!==0)return g}return 0}),e.S(Yr(this.t,m),this.a,l)}tail(t=10){return this.limit(t,{offset:0,from:"end"})}toArray(t){return bt(Object.values(this.select(t).t)?.[0]??[])}toDict(){return{...this.t}}toDicts(){return Qs(this.t,this.r)}transpose({includeHeader:t=!1,headerName:n="column",columnNames:r}={}){if(this.r===0){let c=t?{[n]:Kt([],D.Utf8,0)}:{},u=t?{[n]:D.Utf8}:{};return e.S(c,u,0)}let o=this.columns,i;if(typeof r=="string"){et(r,this.t,"columnNames"),o=o.filter(u=>u!==r);let c=this.t[r];i=new Array(this.r);for(let u=0;u<this.r;u++){let f=c[u];if(f==null)throw new Y(`Transpose columnNames column "${r}" contains null/undefined at index ${u}`);i[u]=String(f)}}else if(r!=null){let c=Array.from(r);if(c.length!==this.r)throw new Y(`columnNames length (${c.length}) must match the height of the DataFrame (${this.r})`);i=c.map(String)}else{i=new Array(this.r);for(let c=0;c<this.r;c++)i[c]=`column_${c}`}let s=o.length,a={},l={};t&&(a[n]=Kt(o,D.Utf8,s),l[n]=D.Utf8);for(let c=0;c<this.r;c++){let u=i[c];if(a[u]!==void 0)throw new Y(`Duplicate column name in transposed DataFrame: "${u}"`);let f=new Array(s);for(let m=0;m<s;m++)f[m]=this.t[o[m]][c];let p=rn(f);a[u]=Kt(f,p,s),l[u]=p}return e.S(a,l,s)}unique(t){let n=t!==void 0?bt(t):Object.keys(this.t);return this.groupBy(n).agg(fe(n).first())}unpivot(t){let{idVars:n,valueVars:r,varName:o="variable",valueName:i="value"}=t,s=Nt(n,"string"),a=Nt(r,"string"),l=s.length,c=a.length;for(let y of s)et(y,this.t,"Unpivot id variable key");for(let y of a)et(y,this.t,"Unpivot value variable key");let u=this.r*c,f={};for(let y=0;y<l;y++)f[s[y]]=new Array(u);f[o]=new Array(u),f[i]=new Array(u);let p=0;for(let y=0;y<this.r;y++)for(let d=0;d<c;d++){let h=a[d];for(let g=0;g<l;g++){let x=s[g];f[x][p]=this.t[x][y]}f[o][p]=h,f[i][p]=this.t[h][y],p++}let m={};for(let y of s)m[y]=this.a[y];return m[o]=D.Utf8,m[i]=rn(f[i]),e.S(f,m,u)}vstack(t){return this.concat(t,{how:"vertical"})}get width(){return Object.keys(this.t).length}withColumns(...t){if(t.length===0)return this;let n=this.ct(t),r=Object.keys(this.t),o=sn(n,r,void 0,this.a,this.t),i=o.length;if(i===0)return this;let s=new Map;for(let c=0;c<i;c++){let u=o[c],f=u.O||u.f||"*";s.set(f,u)}let a=[],l=r.length;for(let c=0;c<l;c++){let u=r[c];a.push(s.get(u)||new U(u)),s.delete(u)}for(let c of s.values())a.push(c);return this.select(...a)}withRowIndex(t="index",n=0){let r=Vn(n,{mode:"independent",dtype:D.UInt32,step:1}),o=this.insertColumn(0,t,r);return o.a[t]=D.UInt32,o}writeCsv(t,n={}){if(t){if(typeof t=="string"){if(typeof An!="function")throw new Ht("File writing is not supported in this environment (missing require('fs')).");let r=An("fs"),o=r.openSync(t,"w");try{qe(this.t,this.r,{...n,onRow:i=>{r.writeSync(o,i,null,"utf8")}})}finally{r.closeSync(o)}}else if(v(t)&&typeof t.write=="function")qe(this.t,this.r,{...n,onRow:r=>{t.write(r)}});else throw new N("Invalid file argument. Expected a file path string or a writable stream/object with a write method.");return""}return qe(this.t,this.r,n)}writeJson(t,{format:n="json",replacerOptions:r}={}){if(n!=="json"&&n!=="ndjson")throw new N(`Unsupported JSON format: "${n}". Expected "json" or "ndjson".`);let o=r?.replacer===null?void 0:Yt(r),i;if(n==="ndjson"){let s=this.toDicts(),a=s.length,l=new Array(a);for(let c=0;c<a;c++)l[c]=JSON.stringify(s[c],o);i=l.join(`
5
+ `)}else i=JSON.stringify(this.toDicts(),o);return ta(t,i),i}}});pe();pe();$t();mo();vn();it();tt();function po(e,{format:t="json",trimBeforeParse:n=!0,schema:r,...o}={}){let i=te(e,{format:t,trimBeforeParse:n,...o});if(i===e)throw new Y(`Invalid JSON input: must be a valid, non-empty JSON ${t} string.`);let s=Array.isArray(i)?i:v(i)?[i]:[];return new q(s,r)}vn();it();function yo(e,t={}){let{hasHeader:n=!0,schema:r,inferSchema:o=!0}=t,i=Gs(e,t);if(i.length===0)return new q({});let s,a;n?(s=i[0],a=i.slice(1)):(s=i[0].map((p,m)=>`column_${m}`),a=i);let l=s.length,c=a.length,u={};for(let p=0;p<l;p++){let m=s[p],y=new Array(c);for(let d=0;d<c;d++)y[d]=a[d][p]!==void 0?a[d][p]:"";u[m]=y}let f={};for(let p=0;p<l;p++){let m=s[p],y=u[m];if(r&&r[m])f[m]=y;else if(o){let{values:d}=Js(y,t);f[m]=d}else f[m]=y}return new q(f,r)}function pu(e,t){return new q(e,t)}var Kp={all:gn,coalesce:ya,col:e=>new U(e),concat:de,data:pu,duration:lo,element:wa,exclude:fe,implode:ba,lit:an,readCsv:yo,readJson:po,seqRange:Vn,struct:Sa,when:ha,...D};$t();tt();export{Kp as $df,ht as ALL_COLUMNS_MARKER,$s as Array,$s as ArrayDataType,Ye as ArrayExpr,to as ArrayExprNamespace,Mn as ArrayType,js as Binary,Pr as BinaryType,Un as Boolean,Un as BooleanDataType,vr as BooleanType,Do as COALESCE_MARKER,U as ColumnExpr,nn as ColumnNotFoundError,at as ComputeError,en as DFScriptError,du as DURATION_MARKER,q as DataFrame,Y as DataFrameError,Z as DataType,D as DataTypeRegistry,Ps as Date,Ps as DateDataType,co as DateTimeExprNamespace,$r as DateType,Ke as Datetime,Lt as DatetimeType,Qt as DecimalType,Ls as Duration,Et as DurationType,Sn as ELEMENT_MARKER,xt as ExprBase,Fs as Float32,Nn as Float32Type,Le as Float64,kn as Float64Type,yn as FloatDataType,ye as GroupedData,Ht as IOStreamError,_s as Int16,_r as Int16Type,yt as Int32,Nr as Int32Type,Ve as Int64,kr as Int64Type,Rs as Int8,Rr as Int8Type,_n as IntegerDataType,N as InvalidArgumentError,Io as LITERAL_MARKER,dn as NestedDataType,vs as Null,Vr as NullType,Zt as NumericDataType,Bs as Object,Bs as ObjectDataType,Lr as ObjectType,Co as STRUCT_MARKER,hn as SchemaError,ut as ShapeError,Bt as SignedIntegerType,Xe as StandardExpr,He as StringExpr,eo as StringExprNamespace,Ks as Struct,Qe as StructExpr,oo as StructExprNamespace,se as StructType,Vt as TemporalDataType,tr as TemporalExpr,Vs as Time,Kr as TimeType,ks as UInt16,Ur as UInt16Type,Ms as UInt32,Fr as UInt32Type,Us as UInt64,jr as UInt64Type,Ns as UInt8,Mr as UInt8Type,Pt as UnsignedIntegerType,$e as Utf8,Br as Utf8Type,Ro as WHEN_MARKER,er as When,fo as WhenThen,er as WhenThenChain,ra as alignAsofIndices,ea as alignKeyIndices,oa as alignWhereIndices,gn as all,et as assertColumnExists,zr as assertHeight,Je as assertNotNull,Bc as assertValidArgument,sa as buildCanonicalSet,ce as buildGroupMap,ya as coalesce,Kt as coerceColumn,Qs as columnsToRows,la as compareMissing,aa as computeIsIn,Zr as computeRank,jn as computeRowHash,de as concat,Ta as deduceBinaryType,S as derive,lo as duration,wa as element,ia as evalBinaryOp,lu as evalUnaryOp,Bn as evaluateArg,It as evaluateExpression,fe as exclude,ue as gatherColumnByIndices,Yr as gatherColumnsByIndices,Xr as getRowFromColumns,ba as implode,rn as inferColumnType,Pn as isEvaluatedColumn,G as kleeneBinary,k as kleeneUnary,an as lit,We as materializeJoinedDataFrame,yo as readCsv,po as readJson,sn as resolveColumnSelectors,me as resolveExprOutputType,Ln as resolveOperandType,Hs as resolveWindowExpr,Zs as rowsToColumns,Vn as seqRange,Sa as struct,ha as when,ta as writeStringToFileOrStream};