@bicharts/shape-core 0.6.38 → 0.6.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-VAL2LI3T.mjs → chunk-GHO5PJBZ.mjs} +1 -1
- package/dist/chunk-M7OKMBJS.mjs +2 -0
- package/dist/chunk-WGT2OLMZ.mjs +2 -0
- package/dist/index.mjs +1 -1
- package/dist/indexedText.mjs +1 -1
- package/dist/ingest.mjs +1 -1
- package/dist/ordinalDetector.mjs +1 -1
- package/dist/types/fetchTransport.d.ts +2 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/vocab/calendarWords.d.ts +30 -0
- package/package.json +1 -1
- package/dist/chunk-NIFK72FA.mjs +0 -2
- package/dist/chunk-Q7UDK4PL.mjs +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
|
-
import{H as D,O as E}from"./chunk-
|
|
2
|
+
import{H as D,O as E}from"./chunk-M7OKMBJS.mjs";import{B as S}from"./chunk-4VN252CK.mjs";import P from"papaparse";function L(e){if(!e)return".";try{return new Intl.NumberFormat(e).formatToParts(1.5).find(t=>t.type==="decimal")?.value===","?",":"."}catch{return"."}}var x="[ \\u00A0\\u202F]",p="(?:[eE][+-]?\\d+)?",O=new RegExp(`^[+-]?(?:\\d{1,3}(?:,\\d{3})+|\\d+)(?:\\.\\d+)?${p}$`),k=new RegExp(`^[+-]?(?:\\d{1,3}(?:\\.\\d{3})+|\\d{1,3}(?:${x}\\d{3})+|\\d+)(?:,\\d+)?${p}$`),N=/^[+-]?\d{1,3}[.,]\d{3}$/,_=[/^[+-]?\d{1,3}(?:,\d{3}){2,}$/,new RegExp(`^[+-]?(?:\\d{1,3}(?:,\\d{3})+|\\d+)\\.\\d+${p}$`)],j=[/^[+-]?\d{1,3}(?:\.\d{3}){2,}$/,new RegExp(`^[+-]?(?:\\d{1,3}(?:\\.\\d{3})+|\\d{1,3}(?:${x}\\d{3})+|\\d+),\\d+${p}$`)];function T(e,i){let t=0,n=0;for(let c of e){if(typeof c!="string")continue;let o=c.trim();o===""||N.test(o)||(_.some(s=>s.test(o))?t++:j.some(s=>s.test(o))&&n++)}return n>0&&t===0?",":t>0?".":L(i)}function y(e,i){let t=String(e??"").trim();return t===""?null:i===","?k.test(t)?parseFloat(t.replace(/[. ]/g,"").replace(",",".")):null:O.test(t)?parseFloat(t.replace(/,/g,"")):null}function R(e,i){return y(e,i)!==null}var C=500,M=/^[+-]?\d{1,15}$/,q=/^\d{4}-\d{2}-\d{2}([T ]\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/,F=/^\d{1,2}[\/\-.]\d{1,2}[\/\-.]\d{2,4}$/;function V(e,i="."){let t=0,n=0,c=0,o=0;for(let s of e){if(s==null)continue;if(typeof s=="number"){o++,n++,Number.isInteger(s)&&t++;continue}if(s instanceof Date){o++,c++;continue}if(typeof s=="boolean"){o++;continue}let l=String(s).trim();if(l!==""){if(o++,M.test(l)){t++,n++;continue}if(R(l,i)){n++;continue}if((q.test(l)||F.test(l))&&!isNaN(Date.parse(l))){c++;continue}}}return o===0?"String":c===o?"DateTime":t===o?"Integer":n===o?"Decimal":"String"}function v(e,i,t="."){if(e==null)return null;if(typeof e=="number")return i==="String"?String(e):e;if(e instanceof Date)return i==="DateTime"?e:e.toISOString();if(typeof e=="boolean")return String(e);let n=String(e).trim();if(n==="")return null;switch(i){case"Integer":return M.test(n)?parseInt(n,10):null;case"Decimal":return y(n,t);case"DateTime":return S(n);default:return n}}function B(e){let i=(e||"").toLowerCase().replace(/\(.*$/,"").trim();return/^(tinyint|smallint|int|integer|int2|int4|int8|bigint|serial|bigserial)$/.test(i)?"Integer":/^(decimal|numeric|money|smallmoney|float|real|double|double precision|number)$/.test(i)?"Decimal":/^(date|datetime|datetime2|smalldatetime|datetimeoffset|timestamp|timestamptz|time)$/.test(i)?"DateTime":(/^(bit|bool|boolean)$/.test(i),"String")}function f(e,i,t){if(e.length===0)throw new Error("ingest: no columns were resolved from the source. Supply column descriptors, or use a source shape that carries them (grid/table/objects/sql).");let n=e.length,c=e.map((r,a)=>i.slice(0,C).map(m=>m?.[a])),o=c.map(r=>T(r,t.locale)),s=e.map((r,a)=>r.dataType??V(c[a],o[a])),l=new Set((t.measures??[]).map(r=>r.toLowerCase())),A=new Set((t.dimensions??[]).map(r=>r.toLowerCase())),I=new Set((t.nonAdditive??[]).map(r=>r.toLowerCase())),$=e.map((r,a)=>{let m=r.name.toLowerCase(),u=r.isMeasure??((s[a]==="Integer"||s[a]==="Decimal")&&!D(r.name));l.has(m)&&(u=!0),A.has(m)&&(u=!1);let b={name:r.name,dataType:s[a],isMeasure:u};return u&&I.has(m)&&(b.discourageAggregationAcrossGroups=!0),b}),d=new E;d.dedupRows=t.dedup!==!1,d.setColumns($);for(let r=0;r<i.length;r++){let a=i[r];d.addRow(Array.from({length:n},(m,u)=>v(a?.[u],s[u],o[u])),r)}let w=d.getColumnsWithStats(t.privacyLevel??"20",t.locale??"en"),g=new Map(w.map(r=>[r.name,r]));e.forEach(r=>{let a=g.get(r.name);a&&(r.format&&(a.modelFormat=r.format),r.description&&(a.modelDesc=r.description))});for(let[r,a]of Object.entries(t.formats??{})){let m=g.get(r);m&&(m.modelFormat=a)}for(let[r,a]of Object.entries(t.descriptions??{})){let m=g.get(r);m&&(m.modelDesc=a)}for(let r of t.groupBy??[]){let a=g.get(r);a&&(a.isGrouping=!0)}return{columns:w,rows:d.toObjectArray(),totalRows:d.getRowCount(),index:d}}function h(e,i){return e.map(t=>Array.isArray(t)?t:i.map(n=>t[n]))}function U(e,i){let t=[],n=new Set,c=Math.min(e.length,Math.max(1,i));for(let o=0;o<c;o++){let s=e[o];if(!(!s||typeof s!="object"))for(let l of Object.keys(s))n.has(l)||(n.add(l),t.push(l))}return t}function Y(e,i={}){switch(e.kind){case"csv":{let t=P.parse(e.text,{skipEmptyLines:!0});if(t.errors?.length&&t.data.length===0)throw new Error(`ingest: CSV parse failed - ${t.errors[0].message}`);let n=t.data;if(n.length<2)throw new Error("ingest: CSV needs a header line plus at least one data row.");let c=n[0].map(o=>(o??"").trim());return f(c.map(o=>({name:o})),n.slice(1),i)}case"grid":{if(!e.header?.length)throw new Error("ingest: 'grid' needs a non-empty header.");return f(e.header.map(t=>({name:(t??"").trim()})),e.rows??[],i)}case"table":{if(!e.columns?.length)throw new Error("ingest: 'table' needs at least one column descriptor.");let t=e.columns.map(n=>n.name);return f(e.columns,h(e.rows??[],t),i)}case"objects":{let t=e.rows??[],n=e.columns?.length?e.columns:U(t,i.columnScanLimit??C).map(c=>({name:c}));if(!n.length)throw new Error("ingest: 'objects' produced no columns - the rows array is empty or holds no object keys.");return f(n,h(t,n.map(c=>c.name)),i)}case"sql":{if(!e.schema?.length)throw new Error("ingest: 'sql' needs at least one schema column.");let t=e.schema.map(n=>{let c=B(n.dataType);return{name:n.name,dataType:c,isMeasure:n.isMeasure,format:n.format,description:n.description}});return f(t,h(e.rows??[],t.map(n=>n.name)),i)}default:{let t=e;throw new Error(`ingest: unknown source kind '${t?.kind}'. Expected one of: csv, grid, table, objects, sql.`)}}}export{L as a,T as b,y as c,B as d,Y as e};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
|
+
import{a as re}from"./chunk-U3H6UBOO.mjs";import{a as se,b as oe}from"./chunk-2LR73DNS.mjs";import{c as ve}from"./chunk-VIWJJUDA.mjs";import{b as Ne,f as Ee}from"./chunk-TPVDJHU6.mjs";import{e as xe,g as Re,h as Te,i as ie}from"./chunk-WGT2OLMZ.mjs";import{B as ce,D as Me,h as ye,i as X,j as Se,v as _e,w as Y,x as Ae,y as Ce}from"./chunk-4VN252CK.mjs";var at=[[24.4,49.4,-125,-66.9],[51.2,71.5,-168,-129.9],[18.9,22.3,-160.3,-154.8]],ut=[7,72,-172,-52];function Ie(t,e,n){return t>=n[0]&&t<=n[1]&&e>=n[2]&&e<=n[3]}var Z=t=>Math.round(t*10)/10;function Le(t,e=3){let n=[],r=[],i=0,s=0;for(let l of t){let u=l?.lat,c=l?.lon;if(typeof u!="number"||typeof c!="number"||!isFinite(u)||!isFinite(c)||u<-90||u>90||c<-180||c>180)continue;n.push(u),r.push(c);let d=l?.country?String(l.country).trim().toUpperCase():"",f=d?ae(d):null;f?((d==="US"||d==="USA")&&i++,f==="north-america"&&s++):(at.some(m=>Ie(u,c,m))&&i++,Ie(u,c,ut)&&s++)}let o=n.length;return o<e?null:(n.sort((l,u)=>l-u),r.sort((l,u)=>l-u),{pctUsa:Z(i/o*100),pctNa:Z(s/o*100),latP5:Z(Y(n,.05)),latP95:Z(Y(n,.95)),lonP5:Z(Y(r,.05)),lonP95:Z(Y(r,.95)),n:o})}var we={"north-america":"AG AI AW BB BL BM BQ BS BZ CA CR CU CW DM DO GD GL GP GT HN HT JM KN KY LC MF MQ MS MX NI PA PM PR SV SX TC TT US VC VG VI","south-america":"AR BO BR CL CO EC FK GF GY PE PY SR UY VE",europe:"AD AL AT AX BA BE BG BY CH CY CZ DE DK EE ES FI FO FR GB GG GI GR HR HU IE IM IS IT JE LI LT LU LV MC MD ME MK MT NL NO PL PT RO RS RU SE SI SJ SK SM UA VA",africa:"AO BF BI BJ BW CD CF CG CI CM CV DJ DZ EG EH ER ET GA GH GM GN GQ GW KE KM LR LS LY MA MG ML MR MU MW MZ NA NE NG RE RW SC SD SH SL SN SO SS ST SZ TD TG TN TZ UG YT ZA ZM ZW",asia:"AE AF AM AZ BD BH BN BT CC CN CX GE HK ID IL IN IO IQ IR JO JP KG KH KP KR KW KZ LA LB LK MM MN MO MV MY NP OM PH PK PS QA SA SG SY TH TJ TL TM TR TW UZ VN YE",oceania:"AS AU CK FJ FM GU KI MH MP NC NF NR NU NZ PF PG PN PW SB TK TO TV UM VU WF WS",antarctica:"AQ BV GS HM TF"},J=(()=>{let t=new Map;for(let e of Object.keys(we))for(let n of we[e].split(/\s+/))n&&t.set(n,e);return t})();function lt(t){for(let[e,n]of t){let r=J.get(e);r&&!J.has(n)&&J.set(n,r)}}lt(Ne);function ae(t){if(!t)return null;let e=String(t).trim().toUpperCase();if(!e)return null;let n=J.get(e);if(n)return n;let r=Ee(String(t));return r?J.get(r)??null:null}function vn(t,e=2){return me(t.map(n=>[n,1]),e)}function me(t,e=2){let n=new Map,r=0;for(let[o,l]of t){let u=ae(o);if(!u)continue;let c=typeof l=="number"&&isFinite(l)&&l>0?l:1;n.set(u,(n.get(u)??0)+c),r+=c}if(r<e||!n.size)return null;let i="europe",s=-1;for(let o of Array.from(n.keys()).sort()){let l=n.get(o);l>s&&(i=o,s=l)}return{dominantGeoRegion:i,dominantGeoRegionPct:Z(s/r*100),regionCount:n.size,n:r}}import nt from"papaparse";var ct=[["Lu",/^\p{Lu}$/u],["Ll",/^\p{Ll}$/u],["Lt",/^\p{Lt}$/u],["Lm",/^\p{Lm}$/u],["Lo",/^\p{Lo}$/u],["Mn",/^\p{Mn}$/u],["Mc",/^\p{Mc}$/u],["Nd",/^\p{Nd}$/u]];function ue(t){for(let[e,n]of ct)if(n.test(t))return e;return null}var mt=[{id:"ascii",test:/^[A-Za-z]$/,ranges:[[65,90],[97,122]]},{id:"latin",test:/^[\u00C0-\u017F]$/u,ranges:[[192,383]]},{id:"cyrillic",test:/^[\u0400-\u045F\u0490-\u0491]$/u,ranges:[[1024,1119],[1168,1169]]},{id:"greek",test:/^[\u0386-\u03CE]$/u,ranges:[[902,974]]},{id:"han",test:/^[\u4E00-\u9FFF]$/u,ranges:[[19968,40959]]},{id:"hiragana",test:/^\p{Script=Hiragana}$/u,ranges:[[12353,12447]]},{id:"katakana",test:/^\p{Script=Katakana}$/u,ranges:[[12448,12543]]},{id:"hangul",test:/^[\uAC00-\uD7A3]$/u,ranges:[[44032,55203]]},{id:"arabic",test:/^[\u0620-\u0652\u0671-\u06D3]$/u,ranges:[[1568,1618],[1649,1747]]},{id:"hebrew",test:/^[\u05B0-\u05EA]$/u,ranges:[[1456,1514]]},{id:"devanagari",test:/^\p{Script=Devanagari}$/u,ranges:[[2304,2431]]},{id:"thai",test:/^\p{Script=Thai}$/u,ranges:[[3585,3662]]}],le=new Map;function De(t,e,n,r){let i=le.get(t);if(i)return i;let s=[];for(let[o,l]of e)for(let u=o;u<=l;u++){let c=String.fromCodePoint(u);ue(c)===n&&(r&&!r.test(c)||s.push(c))}return le.set(t,s),s}function dt(t){let n=t.codePointAt(0);for(let o=0;o<9&&ue(String.fromCodePoint(n-1))==="Nd";o++)n--;let r="nd:"+n.toString(16),i=le.get(r);if(i)return i;let s=[];for(let o=n;o<n+10;o++){let l=String.fromCodePoint(o);ue(l)==="Nd"&&s.push(l)}return le.set(r,s),s}function ft(t,e){if(e==="Nd")return dt(t);for(let i of mt)if(i.test.test(t))return De(i.id+":"+e,i.ranges,e,i.id==="ascii"?null:i.test);let r=t.codePointAt(0)&-128;return De("block:"+r.toString(16)+":"+e,[[r,r+127]],e,null)}function gt(t,e,n,r){let i=t.filter(s=>!e.has(s));return i.length===0&&(i=t.filter(s=>s!==n)),i.length===0?n:i[Math.min(i.length-1,Math.floor(r()*i.length))]}var pt=/^[\p{L}\p{M}\p{Nd}]$/u,Oe=/^[\p{L}\p{Nd}]$/u;function Pe(t,e){if(!t)return t??"";let n=new Set(Array.from(t)),r=d=>{let f=ue(d);return!f||!pt.test(d)?d:gt(ft(d,f),n,d,e)},i=d=>{let f=[];for(let m of d)f.push(r(m)),Oe.test(m)&&e()<.2&&f.push(r(m));if(f.length>6){let m=Math.floor(e()*Math.min(3,f.length-6));for(let R=0;R<m;R++)for(let A=0;A<5;A++){let O=Math.floor(e()*f.length);if(Oe.test(f[O])){f.splice(O,1);break}}}return f.join("")};if(!(t.includes("@")&&t.includes(".")))return i(t);let[o,l=""]=t.split("@"),u=l.endsWith(".com"),c=u?l.slice(0,-4):l;return`${i(o)}@${i(c)}${u?".com":""}`}var ht=["rate","ratio","pct","percent","percentage","rating","share","score","index","nps","csat","margin","yield","coverage","utilization","utilisation","z[_-]?score","average","avg","mean","median","stddev","variance","gpa","percentile","quantile","efficiency","accuracy","probability","multiplier","coefficient","correlation","occupancy","age","bmi","temperature","density","pressure","humidity","ph","velocity","speed","elevation","altitude","latency","throughput","bandwidth","iops","ppm","ppb","dpmo","bps","temperatuur","temperatur","temperatura","teplota","lampotila","homerseklet","sicaklik","pression","presion","pressao","pressione","druck","tryck","tlak","paine","nyomas","presiune","humidite","humedad","umidade","umidita","feuchtigkeit","vochtigheid","kosteus","vlhkost","vitesse","velocidad","velocidade","velocita","geschwindigkeit","snelheid","hastighet","hastighed","rychlost","nopeus","sebesseg","brzina","predkosc","densite","densidad","densidade","densita","dichte","dichtheid","hustota","tiheys","gustoca","moyenne","mediane","promedio","mediana","gemiddelde","durchschnitt","mittelwert","genomsnitt","gennemsnit","gjennomsnitt","keskiarvo","atlag","ortalama","prosjek","srednia","prumer","priemer","medie","taux","tasa","taxa","tasso","verhaltnis","verhouding","aandeel","anteil","andel","osuus","podil","udzial","udio","pourcentage","porcentaje","percentual","prozent","procent","prosentti","szazalek","yuzde","participacion","participacao","pondere","omjer","arany","oran","rata","leeftijd","edad","idade","wiek","eletkor","varsta","puntuacion","pontuacao","punteggio","betyg","ocena","indice","indeks","wskaznik","puan"],bt=["pct","percent","percentage","rate","ratio","rating","share","score","index","nps","csat","margin","yield","coverage","utilization","utilisation","gpa","percentile","quantile","bmi","density","pressure","humidity","velocity","efficiency","occupancy","latency","throughput","bandwidth","iops","ppm","ppb","dpmo","bps"],yt=["latitude","longitude"],St=["latitude","longitude"];function j(t){return ye(t)}var de=["somme de","suma de","soma de","summe von","som van","somma di","summa av","sum av","sum af","soucet z","suma z","totaal van","total de","toplam","osszeg","nombre de","recuento de","contagem de","anzahl von","aantal van","conteggio di","antal av","lukumaara","pocet z"],Fe=["moyenne de","promedio de","media de","media di","durchschnitt von","gemiddelde van","medelvarde av","genomsnitt av","gennemsnit af","keskiarvo","atlag","ortalama","prumer z","srednia z","medie de","minimum de","minimo de","minimo di","minimum von","maximum de","maximo de","massimo di","maximum von"];function _t(t){return[...t].sort((e,n)=>n.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\s+/g,"\\s+")).join("|")}var Ge=new RegExp("^\\s*(?:(?:sum|count|count\\s+distinct|distinct\\s+count)\\s+of\\s+|(?:"+_t(de)+")\\s+)","i"),At=/(?<=[a-z0-9])(?=[A-Z])|(?<=[A-Za-z])(?=[0-9])|(?<=[0-9])(?=[A-Za-z])/g,Ct=new RegExp("\\b("+ht.join("|")+")\\b|("+bt.join("|")+")$","i"),Mt=new RegExp("\\b("+yt.join("|")+")\\b|("+St.join("|")+")$","i");function We(t){if(!t)return"";let e=String(t),n=Ge.exec(j(e));return(n?e.slice(n[0].length):e).trim()}function xt(t){return!!t&&Ge.test(j(String(t)))}var Rt=["count (distinct)","count distinct","distinct count","standard deviation","average","variance","median","product","stddev","std dev","count","sum","avg","min","minimum","max","maximum","var"],ke=new RegExp("^\\s*("+[...Rt].sort((t,e)=>e.length-t.length).map(t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\s+/g,"\\s+")).join("|")+")\\s+of\\s+","i");function Be(t){if(t==null)return"";let e=String(t),n=ke.exec(e);if(!n)return e;let r=l=>l.toLowerCase().replace(/\s+/g," ").trim(),i=r(n[1]),s=e.slice(n[0].length),o=0;for(;o<8;){let l=ke.exec(s);if(!l||r(l[1])!==i)break;let u=s.slice(l[0].length);if(u.trim()==="")break;s=u,o++}return o===0?e:e.slice(0,n[0].length)+s}function fe(t,e){if(!t||!e)return!1;let n=String(t);for(let r of e){let i=r?.hostName;if(i&&i!==r?.name&&n.includes(i))return!0}return!1}var ze={Sum:["Sum of "],Avg:["Average of "],Average:["Average of "],Count:["Count of "],CountNonNull:["Count of "],Min:["Min of ","First ","Earliest "],Max:["Max of ","Last ","Latest "],Median:["Median of "],StandardDeviation:["Standard deviation of "],Variance:["Variance of "]},Tt=new RegExp("^("+Object.keys(ze).join("|")+")\\((.+)\\)$");function $e(t){if(!t)return[];let e=Tt.exec(String(t).trim());if(!e)return[];let n=ze[e[1]],r=e[2],i=[];for(let s=r.indexOf(".");s>=0;s=r.indexOf(".",s+1)){if(s===0)continue;let o=r.slice(s+1);if(o.trim()!=="")for(let l of n){let u=l+o;i.includes(u)||i.push(u)}}return i}function Nt(t){let e=We(t);return e.length===0?"":e.replace(At," ")}function Ue(t,e){if(!e)return!1;let n=We(e);return t.test(j(Nt(e)))||t.test(j(n))||t.test(j(X(n).join(" ")))}function Ve(t){return Ue(Mt,t)}function Et(t){return Ue(Ct,t)||Ve(t)}var Ke=/int|double|decimal|single|float|number|currency|money/i;function vt(t){let e=String(t?.valueNature??"").trim().toLowerCase();return e==="categorical"?"Categorical":e==="ordinal"?"Ordinal":e==="continuous"||t?.isMeasure===!0||Ke.test(String(t?.dataType??""))?"Continuous":"Categorical"}function It(t){return t?.isMeasure===!0||Ke.test(String(t?.dataType??""))}function Ye(t){let e=t??{},n=vt(e);if(n!=="Continuous")return{nature:n,additivity:"unknown",basis:"role",suppressed:!1};if(Ve(e.name))return{nature:n,additivity:"positional",basis:"name",suppressed:!0};let r=String(e.additivity??"").trim().toLowerCase();if(!(r==="additive"&&xt(e.name))){if(r==="additive")return{nature:n,additivity:"additive",basis:"measured",suppressed:!1};if(r==="part_of_whole")return{nature:n,additivity:"part_of_whole",basis:"measured",suppressed:!1};if(r==="intensive_rate")return{nature:n,additivity:"intensive_rate",basis:"measured",suppressed:!1}}return e.discourageAggregationAcrossGroups===!0?{nature:n,additivity:"intensive_rate",basis:"host-flag",suppressed:!1}:Et(e.name)?{nature:n,additivity:"intensive_rate",basis:"name",suppressed:!1}:{nature:n,additivity:"additive",basis:"default",suppressed:!1}}function He(t){let e=Ye(t),n=t??{};if(e.nature==="Categorical")return["first","distinctcount","count"];if(e.nature==="Ordinal")return It(n)?["median","average","min","max","first","distinctcount","count"]:["first","distinctcount","count"];switch(e.additivity){case"positional":return["min","max","count","distinctcount","first"];case"intensive_rate":return["average","median","min","max","count","distinctcount","first"];default:return["sum","average","median","min","max","count","distinctcount","first"]}}function On(t){return He(t)[0]}function Pn(t,e){return He(t).indexOf(e)>=0}function kn(t,e){if(e!=="sum"&&e!=="count")return!1;if(e==="count")return!0;let n=Ye(t);return n.additivity==="additive"||n.additivity==="part_of_whole"||n.additivity==="unknown"}var wt=/^[A-Za-z_$][A-Za-z0-9_$]*$/,Lt=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Dt=new RegExp([String.raw`\bisMeasure\b`,String.raw`\bdataType\b`,String.raw`\bcolumns\s*\[\s*-?\d`,String.raw`\.iloc\s*\[[^\]]*,`,String.raw`\.iat\s*\[`,String.raw`\bselect_dtypes\b`,String.raw`\b_get_numeric_data\b`,String.raw`\bis_numeric_dtype\b`,String.raw`\bfor\s+\w+\s+in\s+(?:list\s*\(\s*)?df\.columns\b`,String.raw`\bdf\.columns\s*\.\s*(?:tolist|to_list|difference|drop)\b`,String.raw`\bdf\.dtypes\b`,String.raw`\bObject\s*\.\s*(?:keys|values|entries)\s*\(\s*(?:rows|data|df)?\s*\[\s*0\s*\]`,String.raw`\b(?:row|rw|r)\s*\[\s*\d+\s*\]`].join("|"));function ee(t,e){if(!t||!e)return!1;let n=Lt(e);return new RegExp("['\"`]"+n+"['\"`]").test(t)?!0:wt.test(e)&&new RegExp("\\."+n+"(?![A-Za-z0-9_$])").test(t)}function Ot(t){return!!t&&Dt.test(t)}function Gn(t,e,n){return t?Ot(t)?[...e]:[...n,...e].some(r=>ee(t,r))?e.filter(r=>ee(t,r)):[...e]:[]}var Pt=5,kt=6,Ft=3,Q=864e5,Gt=/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?(?:\.\d+)?Z?)?$/,Wt=/^(\d{4})[-/](\d{1,2})$/,Bt=/^(\d{4})[-\s]?Q([1-4])$/i,zt=/^Q([1-4])[-\s](\d{4})$/i,$t=/^(\d{4})$/,Ut=/^(\d{4})(0[1-9]|1[0-2])$/,Vt=/^(\d{4})(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])$/,Kt=/^(\D+?)[\s\-/.,']*((?:19|20)\d{2})$/u,Yt=/^((?:19|20)\d{2})[\s\-/.,']+(\D+)$/u;function Xe(t,e){let n=se(t);if(!n)return 0;if(n==="sept")return 9;for(let r of e&&!/^en\b/i.test(e)?["en",e]:["en"]){let i=oe(r)[n];if(i!==void 0)return i+1}return 0}function K(t,e,n,r=0,i=0,s=0){if(!(t>=1&&e>=1&&e<=12&&n>=1&&n<=31))return null;let o=Date.UTC(t,e-1,n,r,i,s);if(!Number.isFinite(o))return null;let l=u=>u<10?"0"+u:String(u);return{ms:o,y:t,m:e,d:n,iso:`${t}-${l(e)}-${l(n)}`}}function Ht(t,e){let n=[],r="";for(let u=0;u<e.length;u++){if(e[u]!=="%"){r+=e[u].replace(/[.*+?^${}()|[\]\\]/g,"\\$&");continue}switch(e[++u]){case"Y":n.push("Y"),r+="(\\d{4})";break;case"m":n.push("m"),r+="(\\d{1,2})";break;case"d":n.push("d"),r+="(\\d{1,2})";break;case"H":case"M":case"S":r+="\\d{1,2}";break;case"%":r+="%";break;default:return null}}let i=new RegExp("^"+r+"$").exec(t);if(!i)return null;let s=0,o=1,l=1;return n.forEach((u,c)=>{let d=+i[c+1];u==="Y"?s=d:u==="m"?o=d:l=d}),s?K(s,o,l):null}function ge(t,e,n){let r=(t??"").trim();if(r==="")return null;if(e){let s=Ht(r,e);return s||null}let i=Gt.exec(r);if(i)return K(+i[1],+i[2],+i[3],+(i[4]??0),+(i[5]??0),+(i[6]??0));if(i=Bt.exec(r),i)return K(+i[1],(+i[2]-1)*3+1,1);if(i=zt.exec(r),i)return K(+i[2],(+i[1]-1)*3+1,1);if(i=Wt.exec(r),i&&+i[2]>=1&&+i[2]<=12)return K(+i[1],+i[2],1);if(i=Vt.exec(r),i)return K(+i[1],+i[2],+i[3]);if(i=Ut.exec(r),i)return K(+i[1],+i[2],1);if(i=$t.exec(r),i){let s=+i[1];return s>=1900&&s<=2100?K(s,1,1):null}if(i=Kt.exec(r),i){let s=Xe(i[1],n);return s?K(+i[2],s,1):null}if(i=Yt.exec(r),i){let s=Xe(i[2],n);return s?K(+i[1],s,1):null}return null}function Ze(t){let e=new Date(t).getUTCDay();return e>=1&&e<=5}function je(t,e){if(e<=t)return 0;let n=Math.round((e-t)/Q),r=Math.floor(n/7),i=r*5,s=t+r*7*Q;for(;s<e;)Ze(s)&&i++,s+=Q;return i}function Xt(t){if(t.length===0)return 0;let e=[...t].sort((r,i)=>r-i),n=e.length>>1;return e.length%2?e[n]:(e[n-1]+e[n])/2}function Zt(t){return t>0?t<.95?"hour":t<=1.05?"day":t>=6.5&&t<=7.5?"week":t>=27&&t<=31.5?"month":t>=88&&t<=93?"quarter":t>=362&&t<=368?"year":"irregular":"irregular"}function te(t,e,n,r){switch(n){case"year":return e.y-t.y;case"quarter":return e.y*4+Math.floor((e.m-1)/3)-(t.y*4+Math.floor((t.m-1)/3));case"month":return e.y*12+e.m-(t.y*12+t.m);case"week":return Math.round((e.ms-t.ms)/(7*Q));case"weekday":return je(t.ms,e.ms);case"day":return Math.round((e.ms-t.ms)/Q);default:return r>0?Math.round((e.ms-t.ms)/r):0}}function Qe(t,e){return pe(t,e)?.cadence??null}function pe(t,e){let n=e?.gapFactor??Pt,r=0,i=0,s=new Map;for(let h of t){if(h==null||h==="")continue;r++;let W=ge(String(h),e?.pattern,e?.locale);W&&(i++,s.set(W.ms,W))}let o=[...s.values()].sort((h,W)=>h.ms-W.ms);if(o.length<Ft||r>0&&i/r<.8)return null;let l=o[o.length-1].ms-o[0].ms;if(l<=0)return null;let u=[];for(let h=1;h<o.length;h++)u.push(o[h].ms-o[h-1].ms);let c=Xt(u);if(!(c>0))return null;let d=Zt(c/Q);d==="day"&&l>=7*Q&&o.every(h=>Ze(h.ms))&&je(o[0].ms,o[o.length-1].ms)+1>o.length*.5&&(d="weekday");let f=d==="irregular"?o.length:te(o[0],o[o.length-1],d,c)+1,m=1,R=1,A=[],O=o[0],S=1;for(let h=1;h<o.length;h++){let W=te(o[h-1],o[h],d,c);W>m&&(m=W),d!=="irregular"&&W>n?(R++,A.push({from:O.iso,to:o[h-1].iso,points:S}),O=o[h],S=1):S++}A.push({from:O.iso,to:o[o.length-1].iso,points:S});let w={grain:d,points:o.length,expectedPoints:Math.max(f,o.length),coveragePct:Math.round(o.length/Math.max(f,o.length)*1e3)/10,runs:R,largestGapUnits:m,gapFactor:n};return e?.includeBounds&&A.length<=kt&&(w.runBounds=A),{cadence:w,points:o,stepMs:c}}var jt=8,Qt=.5,qt=200,Jt=new Set(["category","categories","subcategory","type","types","kind","class","classes","classification","segment","segments","tier","status","priority","severity","grade","level","band","bucket","group","channel","method","mode","stage","phase","period","shift","gender","sex","result","outcome","reason","flag","genre","sector","source"]),en=["category","classification","segment","status","priority","severity","channel"],tn=new Set(["UUID","EMAIL_LIKE","URL_LIKE","PHONE_LIKE","NUMERIC_ID","HEX_ID","OPAQUE_ID_ALPHANUMERIC","DATE_STR","BOOLEAN"]);function nn(t){let e=X(t);if(e.length===0)return!1;let n=e[e.length-1];return Jt.has(n)?!0:en.some(r=>n.length>r.length&&n.endsWith(r))}function rn(t){if(t.isMeasure)return"measure";if(t.isTemporal||t.isDatePart||t.isReassembledDate)return"temporal";let e=Array.from(t.values).filter(n=>n!==""&&n!==null&&n!==void 0);return e.length<2||e.length>qt?"cardinality":t.rows>0&&e.length>=t.rows?"row-identity":t.isBinaryFlag?"flag":ie(e,t.locale)!==null?"ordinal":t.identifierNamed||t.dataType==="String"&&tn.has(re(e))?"identifier":!t.geoKind&&nn(t.name)?"attribute":"entity"}function et(t){let e=-1,n=1/0,r=!1;return t.forEach((i,s)=>{if(rn(i)!=="entity")return;let o=new Set(Array.from(i.values).filter(u=>u!=="")).size,l=!!i.geoKind;(o<n||o===n&&l&&!r)&&(e=s,n=o,r=l)}),e}var qe=t=>t<10?"0"+t:String(t);function Je(t,e){switch(e){case"year":return`${t.y}-01-01`;case"quarter":return`${t.y}-${qe(Math.floor((t.m-1)/3)*3+1)}-01`;case"month":return`${t.y}-${qe(t.m)}-01`;case"hour":return new Date(t.ms).toISOString().replace(/\.\d{3}Z$/,"Z");default:return t.iso}}function tt(t){let{periods:e,series:n}=t,r=Math.min(e.length,n.length),i=new Set;for(let v=0;v<r;v++)e[v]&&i.add(e[v]);let s=pe(i,{pattern:t.pattern,locale:t.locale});if(!s)return null;let o=s.cadence.grain;if(o==="irregular")return null;let l=s.points[0],u=te(l,s.points[s.points.length-1],o,s.stepMs)+1;if(u!==s.cadence.expectedPoints)return null;let c=new Map;for(let v of i){let b=ge(v,t.pattern,t.locale);if(!b)continue;let P=te(l,b,o,s.stepMs);P>=0&&P<u&&c.set(v,{idx:P,stamp:b})}let d=new Map;for(let v=0;v<r;v++){let b=n[v];if(!b)continue;let P=c.get(e[v]);if(!P)continue;let B=d.get(b);B||(B={seen:new Set,lo:P.idx,hi:P.idx,loStamp:P.stamp,hiStamp:P.stamp,order:d.size},d.set(b,B)),B.seen.add(P.idx),P.idx<B.lo&&(B.lo=P.idx,B.loStamp=P.stamp),P.idx>B.hi&&(B.hi=P.idx,B.hiStamp=P.stamp)}if(d.size<2)return null;let f=0;for(let v of d.values())f+=v.seen.size;if(f/(d.size*u)<(t.minFill??Qt))return null;let m=[],R=new Set,A=0,O=0,S=0,w=0,h=0,W=1;for(let[v,b]of d){for(let z of b.seen)R.add(z);if(b.seen.size>=u)continue;let P=[...b.seen].sort((z,a)=>z-a),B=1;for(let z=1;z<P.length;z++)B=Math.max(B,P[z]-P[z-1]);let H={key:v,acc:b,coverage:b.seen.size/u,before:b.lo,after:u-1-b.hi,interior:b.hi-b.lo+1-b.seen.size,gap:B};m.push(H),H.before>0&&A++,H.after>0&&O++,H.interior>0&&S++,w=Math.max(w,H.before),h=Math.max(h,H.after),W=Math.max(W,B)}if(m.length===0)return null;m.sort((v,b)=>v.coverage-b.coverage||v.acc.order-b.acc.order);let U=m.slice(0,t.maxListed??jt);return{seriesColumn:t.seriesColumn,grain:o,periods:u,seriesCount:d.size,incompleteSeries:m.length,lateStarts:A,earlyEnds:O,withHoles:S,columnWideMissing:u-R.size,maxMissingBefore:w,maxMissingAfter:h,largestGap:W,series:U.map(v=>{let b={};return t.includeNames&&(b.name=v.key),t.includeDates&&(b.first=Je(v.acc.loStamp,o),b.last=Je(v.acc.hiStamp,o)),b.missingBefore=v.before,b.missingAfter=v.after,b.missingInterior=v.interior,b.largestGap=v.gap,b.coverage=Math.round(v.coverage*1e3)/1e3,b}),more:m.length-U.length}}var sn=12,on=100,an=.3,un=.9,ln=120,cn=1900,mn=2100,dn=0,fn=20,gn=new Set(["id","ids","uuid","guid","key","zip","zipcode","postal","postalcode","ssn","code","codes","sku","isbn","msisdn","imei"]);function st(t){if(!t)return!1;let e=X(t);return e.length===0?!1:gn.has(e[e.length-1])}var pn=new Set(["year","yr","fy"]),hn=t=>X(t).some(e=>pn.has(e))||xe(t)!==null,bn=/^(?:(?:19|20)\d{2}(?:[-/ ]?(?:q[1-4]|w(?:0?[1-9]|[1-4]\d|5[0-3])|(?:0?[1-9]|1[0-2])))?|q[1-4][-/ ](?:19|20)\d{2}|(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)[a-z]*[-/ ]?(?:19|20)?\d{2})$/i;function he(t){if(!Number.isInteger(t)||t<190001||t>210012)return!1;let e=t%100;return e>=1&&e<=12}function be(t){if(!Number.isInteger(t)||t<19000101||t>21001231)return!1;let e=Math.floor(t/100)%100,n=t%100;return e>=1&&e<=12&&n>=1&&n<=31}var yn=/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?(?:\.\d+)?Z?)?$/,Sn=/^(\d{4})([\/.])(\d{1,2})\2(\d{1,2})$/,_n=/^(\d{1,2})([\/.\-])(\d{1,2})\2(\d{4})(?:[ T](\d{2}):(\d{2})(?::(\d{2}))?)?$/;function An(t){let e=(t||"").toLowerCase();return e==="en-us"||e==="en"||e.startsWith("en-us-")||e==="en-ph"||e==="en-bz"}function ot(t,e){let n=0,r=0,i=0,s=0,o=0,l="",u=0,c="",d=0,f=0,m=0,R=0,A=!1;for(let U of t){if(U==null)continue;let v=String(U).trim();if(v==="")continue;n++;let b;if(b=yn.exec(v)){let P=+b[2],B=+b[3];P>=1&&P<=12&&B>=1&&B<=31&&(r++,b[4]!==void 0&&i++,b[6]!==void 0&&s++)}else if(b=Sn.exec(v)){let P=+b[3],B=+b[4];P>=1&&P<=12&&B>=1&&B<=31&&(l&&l!==b[2]&&(A=!0),l=b[2],o++)}else if(b=_n.exec(v)){let P=+b[1],B=+b[3];P>=1&&P<=31&&B>=1&&B<=31&&(P<=12||B<=12)&&(c&&c!==b[2]&&(A=!0),c=b[2],u++,P>12&&m++,B>12&&R++,b[5]!==void 0&&d++,b[7]!==void 0&&f++)}if(n>=200)break}if(n<2||(r+o+u)/n<.8||(r>0?1:0)+(o>0?1:0)+(u>0?1:0)!==1||A)return null;if(r>0)return i===r?{pattern:s===r?"%Y-%m-%dT%H:%M:%S":"%Y-%m-%dT%H:%M",orderFrom:"iso"}:{pattern:"%Y-%m-%d",orderFrom:"iso"};if(o>0)return{pattern:`%Y${l}%m${l}%d`,orderFrom:"iso"};if(m>0&&R>0)return null;let w,h;m>0?(w=!0,h="values"):R>0?(w=!1,h="values"):(w=!An(e),h="locale");let W=w?`%d${c}%m${c}%Y`:`%m${c}%d${c}%Y`;return d===u?{pattern:W+(f===u?" %H:%M:%S":" %H:%M"),orderFrom:h}:{pattern:W,orderFrom:h}}function Cn(t,e){if(!e||!/\b(?:19|20)\d{2}\b/.test(t))return!1;let n=t.replace(/\b(?:19|20)\d{2}\b/g,"").replace(/[-/.,]/g," ").trim();if(!n)return!1;let r=se(n);return r.length>0&&e[r]!==void 0}function Mn(t){let{dataType:e,name:n,isMeasure:r,distinctCount:i}=t;if(e==="DateTime")return!0;if(r)return!1;if(e==="Integer"||e==="Decimal"){let s=t.minNum,o=t.maxNum;if(!(s!=null&&o!=null&&Number.isFinite(s)&&Number.isFinite(o)&&Number.isInteger(s)&&Number.isInteger(o)&&o>=s))return!1;let u=s>=1900&&o<=2100;if(u&&i>=2&&hn(n)||u&&i>=3&&i===o-s+1)return!0;let c=he(s)&&he(o),d=be(s)&&be(o);if(c||d){if(!t.sampleValues)return!0;let f=0,m=0;for(let R of t.sampleValues){if(R==null||R==="")continue;f++;let A=Number(String(R).trim());if(Number.isFinite(A)&&(c?he(A):be(A))&&m++,f>=60)break}if(f>=2&&m===f)return!0}return!1}if(t.sampleValues){let s=t.locale?oe(t.locale):null,o=0,l=0,u=[];for(let c of t.sampleValues){if(c==null||c==="")continue;o++;let d=String(c).trim();if(u.push(d),(bn.test(d)||Cn(d,s))&&l++,o>=60)break}if(o>=2&&l/o>=.8||ot(u,t.locale)!==null)return!0}return!1}function xn(t){let e=j((t||"").trim().toLowerCase());return e.startsWith("sum ")||e.startsWith("total ")?"sum":e.startsWith("average ")||e.startsWith("avg. ")?"avg":e.startsWith("count ")||e.startsWith("distinct count ")||e.startsWith("count (distinct) ")?"count":e.startsWith("min ")||e.startsWith("minimum ")?"min":e.startsWith("max ")||e.startsWith("maximum ")?"max":Fe.some(n=>e.startsWith(n+" "))?/^(minimum|minimo)\b/.test(e)?"min":/^(maximum|maximo|massimo)\b/.test(e)?"max":"avg":de.some(n=>e.startsWith(n+" ")||e===n)?/^(nombre|recuento|contagem|anzahl|aantal|conteggio|antal|lukumaara|pocet)\b/.test(e)?"count":"sum":null}function Rn(t){let{rows:e,measureColIdx:n,measureName:r,candidateDims:i,minNum:s,maxNum:o,discourageAgg:l}=t,u=100,c=.01,d="";for(let m of i){if(m.distinct<2||m.distinct>u)continue;let R=i.filter(h=>h.idx!==m.idx).map(h=>h.idx),A=new Map;for(let h of e){let W=h[n];if(typeof W!="number"||!Number.isFinite(W))continue;let U=R.length?R.map(b=>String(h[b])).join(d):"",v=A.get(U);v||(v={sum:0,cset:new Set},A.set(U,v)),v.sum+=W,v.cset.add(String(h[m.idx]))}let O=0,S=0,w=0;for(let h of A.values())h.cset.size<2||(w++,Math.abs(h.sum-100)<=100*c?O++:Math.abs(h.sum-1)<=1*c&&S++);if(w>=2&&(O/w>=.9||S/w>=.9))return{additivity:"part_of_whole",partOfWholeDim:m.name}}if(l)return{additivity:"intensive_rate"};let f=xn(r);return f==="avg"||f==="min"||f==="max"?{additivity:"intensive_rate"}:f==="count"?{additivity:"additive"}:f==="sum"?{additivity:"unknown"}:s!=null&&o!=null&&Number.isFinite(s)&&Number.isFinite(o)&&s>=0&&o<=1.0001&&o>0?{additivity:"intensive_rate"}:{additivity:"unknown"}}function it(t){let{dataType:e,isMeasure:n,name:r,distinct:i,nonblank:s,prec:o,maxval:l,minval:u}=t,c=l-u+1,d=c>0?i/c:1,f=s>0?i/s:0,m=e==="Decimal"||o>0;return st(r)?"Categorical":d>=un&&(Re(r)&&i<=ln||u>=cn&&l<=mn||u>=dn&&l<=fn)?"Ordinal":n||i>sn&&(m||i>=on||f>=an)?"Continuous":"Categorical"}function Tn(t){let e=null;for(let n=0;n<t.length;n++){let r=t[n];if(typeof r!="string"||r.length===0)continue;let i=r.trim();i.length!==r.length&&(e||(e=t.slice()),e[n]=i)}return e||t}var rt=class{_computedStatsForLevel=null;_cols=[];_rows=[];_origIndices=[];_rowHashes=new Set;_hostQueryNames=[];_englishAliases=new Map;dedupRows=!0;emitLegacyAggAliases=!1;STR(e){return e==null?"":e instanceof Date?this.wholeDayIso(e)??(isNaN(e.getTime())?"":e.toISOString()):e.toString()}getPrecision(e){if(!isFinite(e))return 0;let r=e.toString().split(".")[1];return r?r.length:0}getColumns(){return this._cols}wholeDayIso(e){return Me(e)}hasTimeComponent(e){return!(e instanceof Date)||isNaN(e.getTime())?!1:this.wholeDayIso(e)===null}getColumnsWithStats(e,n){if(this._computedStatsForLevel==e)return this._cols;let r=0,i=parseInt(e),s=[];for(let a of this._cols){let p=new Map,D=[],N=0,g=0,T=0,I=null,E=null,x=null,F=!1,k=!0,C=!0,M=null,G=!1;for(let _ of this._rows){let y=_[r],L=this.STR(y);if(L!=""){if(N+=L.length,p.set(L,(p.get(L)||0)+1),g++,a.dataType=="Integer"||a.dataType=="Decimal"||a.dataType=="DateTime")if((I===null||y<I)&&(I=y),(E===null||y>E)&&(E=y),a.dataType=="Integer"||a.dataType=="Decimal"){if(x===null?x=y:x+=y,a.dataType=="Decimal"){let $=this.getPrecision(y);$>T&&(T=$)}D.push(y)}else F=F||this.hasTimeComponent(y);G&&(y<M?k=!1:y>M&&(C=!1)),M=y,G=!0}}if(g>=3&&(k&&!C?a.sortedDirection="asc":C&&!k?a.sortedDirection="desc":a.sortedDirection="none"),g>0&&p.size>0&&!a.isMeasure){let _=0,y=Number.MAX_SAFE_INTEGER;for(let L of p.values())L>_&&(_=L),L<y&&(y=L);if(a.modalShare=_/g,a.minGroupCount=y===Number.MAX_SAFE_INTEGER?null:y,p.size===2){let L=[...p.keys()].map(ne=>_e(ne).trim().toLowerCase()).sort(),V=[["false","true"],["no","yes"],["n","y"],["0","1"],["f","t"]].some(ne=>L[0]===ne[0]&&L[1]===ne[1]),q=/^(is|has)[_\p{L}\p{N}]|(?:default|churn|fraud|approv|convert|active|cancel|delinquen|flag|paid|win|pass|fail)/iu.test(a.name);(V||q)&&(a.isBinaryFlag=!0)}}if(a.dataType=="DateTime"&&(a.dateWithTime=F),a.isTemporal=Mn({dataType:a.dataType,name:a.name,isMeasure:a.isMeasure,distinctCount:p.size,minNum:typeof I=="number"?I:null,maxNum:typeof E=="number"?E:null,sampleValues:p.keys(),locale:n}),a.isTemporal&&a.dataType==="String"&&!a.isMeasure){let _=ot(p.keys(),n);_&&(a.temporalTextPattern=_.pattern)}if(a.isTemporal&&!a.isMeasure){let _=Qe(p.keys(),{includeBounds:i>=20,pattern:a.temporalTextPattern,locale:n});_&&(a.temporalCadence=_)}this.updateColumnStats10(i,a,g,p,T,E,I),this.updateColumnStats20(i,D,g,x,a,N,F,I,E,T,p,n),!a.isMeasure&&(a.dataType==="Integer"||a.dataType==="Decimal")&&it({dataType:a.dataType,isMeasure:!1,name:a.name,distinct:p.size,nonblank:g,prec:T,maxval:typeof E=="number"?E:0,minval:typeof I=="number"?I:0})==="Continuous"&&(a.isMeasure=!0,a.geoKind=void 0,a.geoMatchPct=void 0,a.geoAmbiguous=void 0,a.dominantGeoRegion=void 0,a.dominantGeoRegionPct=void 0,a.geoRegionCount=void 0),s[r]=a.isMeasure||p.size>2e3?null:new Set(p.keys()),r++}let o=[];this._cols.forEach((a,p)=>{a.isMeasure||o.push({idx:p,distinct:a.distinctCount??0,name:a.name})}),this._cols.forEach((a,p)=>{if(!a.isMeasure)return;let D=typeof a.lowValue=="number"?a.lowValue:null,N=typeof a.highValue=="number"?a.highValue:null,g=Rn({rows:this._rows,measureColIdx:p,measureName:a.name,candidateDims:o,minNum:D,maxNum:N,discourageAgg:!!a.discourageAggregationAcrossGroups});a.additivity=g.additivity,g.partOfWholeDim&&(a.partOfWholeDim=g.partOfWholeDim)});let l=50,u=4,c=o.filter(a=>a.distinct>=2&&a.distinct<=l);this._cols.forEach((a,p)=>{if(!a.isMeasure)return;let D=[];for(let C of this._rows){let M=C[p];if(M==null||M==="")continue;let G=typeof M=="number"?M:parseFloat(M);isNaN(G)||D.push(G)}if(D.length===0)return;let N=[...D].sort((C,M)=>C-M);if(N[0]===N[N.length-1])a.relativeDispersion=0;else if(N.length>=u){let C=Y(N,.5),M=Y(N,.1),G=Y(N,.9);a.relativeDispersion=Math.abs(C)>1e-9?Math.round((G-M)/Math.abs(C)*1e3)/1e3:void 0}else a.relativeDispersion=void 0;let g=[];for(let C of c){let M=new Set;for(let G of this._rows){let _=G[p];_==null||_===""||M.add(this.STR(G[C.idx])+"")}g.push({otherColumn:C.name,nonBlankGroupCount:M.size})}g.length>0&&(a.nonBlankGroups=g);let T=0;for(let C of D)T+=C;T/=D.length;let I=0;for(let C of D)I+=(C-T)*(C-T);if(I<=1e-12)return;let E=[],x=[],F=C=>{if(C.length<4)return NaN;let M=[...C].sort((_,y)=>_-y),G=_=>M[Math.min(M.length-1,Math.max(0,Math.floor(_*(M.length-1))))];return G(.75)-G(.25)},k=F(D);for(let C of c){let M=new Map;for(let y of this._rows){let L=y[p];if(L==null||L==="")continue;let $=typeof L=="number"?L:parseFloat(L);if(isNaN($))continue;let V=this.STR(y[C.idx])+"",q=M.get(V);q?(q.s+=$,q.n++,q.vals.push($)):M.set(V,{s:$,n:1,vals:[$]})}let G=0;for(let y of M.values()){let L=y.s/y.n;G+=y.n*(L-T)*(L-T)}E.push({otherColumn:C.name,eta2:Math.round(G/I*1e4)/1e4});let _=[];for(let y of M.values()){let L=F(y.vals);isNaN(L)||_.push(L)}if(_.length>=2&&isFinite(k)&&k>1e-9){let y=(Math.max(..._)-Math.min(..._))/k;x.push({otherColumn:C.name,spreadRatio:Math.round(y*1e4)/1e4})}}E.length>0&&(a.groupDiscrimination=E),x.length>0&&(a.spreadDiscrimination=x)});let d=.97,f=.8,m=8,R=5,A=this._cols.map((a,p)=>({c:a,i:p})).filter(a=>a.c.isMeasure);for(let a=0;a<A.length;a++)for(let p=a+1;p<A.length;p++){let D=A[a].i,N=A[p].i,g=0,T=0,I=0,E=0,x=0,F=0;for(let _ of this._rows){let y=_[D],L=_[N];if(y==null||y===""||L===null||L===void 0||L==="")continue;let $=typeof y=="number"?y:parseFloat(y),V=typeof L=="number"?L:parseFloat(L);isNaN($)||isNaN(V)||(g++,T+=$,I+=V,E+=$*$,x+=V*V,F+=$*V)}if(g<R)continue;let k=g*E-T*T,C=g*x-I*I;if(k<=1e-12||C<=1e-12)continue;let M=(g*F-T*I)/Math.sqrt(k*C),G=Math.min(1,Math.round(Math.abs(M)*1e3)/1e3);for(let _ of[A[a].c,A[p].c])(_.maxAbsMeasureCorrelation===void 0||G>_.maxAbsMeasureCorrelation)&&(_.maxAbsMeasureCorrelation=G);if(Math.abs(M)>=d){let _=A[a].c,y=A[p].c;_.collinearWithMeasures||(_.collinearWithMeasures=[]),y.collinearWithMeasures||(y.collinearWithMeasures=[]),_.collinearWithMeasures.push(y.name),y.collinearWithMeasures.push(_.name)}else if(Math.abs(M)>=f){let _=A[a].c,y=A[p].c,L=Math.round(M*1e3)/1e3;_.correlatedWithMeasures||(_.correlatedWithMeasures=[]),y.correlatedWithMeasures||(y.correlatedWithMeasures=[]),_.correlatedWithMeasures.push({otherColumn:y.name,r:L}),y.correlatedWithMeasures.push({otherColumn:_.name,r:L})}}for(let{c:a}of A)a.correlatedWithMeasures&&(a.correlatedWithMeasures.sort((p,D)=>Math.abs(D.r)-Math.abs(p.r)||(p.otherColumn<D.otherColumn?-1:1)),a.correlatedWithMeasures.length=Math.min(a.correlatedWithMeasures.length,m));for(let a=0;a<this._cols.length;a++){let p=s[a];if(!p||p.size===0)continue;let D=[];for(let N=0;N<this._cols.length;N++){if(N===a)continue;let g=s[N];if(!g||g.size===0)continue;let T=0;for(let E of p)g.has(E)&&T++;let I=Math.round(T/p.size*100);I>0&&D.push({otherColumn:this._cols[N].name,percentShared:I})}D.length>0&&(this._cols[a].sharedValueRatioWithOthers=D)}let O=50,S=[];for(let a=0;a<this._cols.length;a++){let p=s[a];p&&p.size>=2&&p.size<=O&&S.push(a)}if(S.length>=2){let a=new Map,p=(N,g)=>N+":"+g;for(let N=0;N<S.length;N++)for(let g=N+1;g<S.length;g++)a.set(p(S[N],S[g]),new Map);for(let N of this._rows)for(let g=0;g<S.length;g++){let T=this.STR(N[S[g]])+"";for(let I=g+1;I<S.length;I++){let E=""+this.STR(N[S[I]]),x=a.get(p(S[g],S[I])),F=T+""+E;x.set(F,(x.get(F)??0)+1)}}let D=new Map;for(let N=0;N<S.length;N++)for(let g=N+1;g<S.length;g++){let T=S[N],I=S[g],E=s[T].size,x=s[I].size,F=a.get(p(T,I)),k=F.size,C=0;for(let y of F.values())(C===0||y<C)&&(C=y);let M=Math.round(k/(E*x)*100),G=k===E,_=k===x;if((this._cols[T].categoricalPairStats||=[]).push({otherColumn:this._cols[I].name,fillPct:M,determinesOther:G,minCellCount:C,distinctCombinations:k}),(this._cols[I].categoricalPairStats||=[]).push({otherColumn:this._cols[T].name,fillPct:M,determinesOther:_,minCellCount:C,distinctCombinations:k}),G&&E>x){let y=D.get(T);(!y||x<y.card)&&D.set(T,{name:this._cols[I].name,card:x,ratio:x/E})}if(_&&x>E){let y=D.get(I);(!y||E<y.card)&&D.set(I,{name:this._cols[T].name,card:E,ratio:E/x})}}for(let[N,g]of D)this._cols[N].primaryParentColumn=g.name,this._cols[N].nestingRatio=Math.round(g.ratio*100)/100}let w=6,h=this._rows.length;for(let a=0;a<this._cols.length;a++){let p=this._cols[a];if(p.isMeasure||p.primaryParentColumn)continue;let D=p.distinctCount??0;if(D<=O||h>0&&D>=h)continue;let N=[];for(let g=0;g<this._cols.length;g++){if(g===a)continue;let T=this._cols[g];if(T.isMeasure)continue;let I=T.distinctCount??0;I<2||I>=D||N.push(g)}N.sort((g,T)=>(this._cols[g].distinctCount??0)-(this._cols[T].distinctCount??0));for(let g of N.slice(0,w)){let T=new Map,I=!0;for(let x of this._rows){let F=this.STR(x[a])+"",k=this.STR(x[g])+"",C=T.get(F);if(C===void 0)T.set(F,k);else if(C!==k){I=!1;break}}if(!I)continue;let E=this._cols[g].distinctCount??0;p.primaryParentColumn=this._cols[g].name,p.nestingRatio=Math.round(E/D*100)/100;break}}let W=.01,U=.05,v=.95,b=8,P=8,B=6,H=500,z=[];for(let a=0;a<this._cols.length&&z.length<P;a++){let p=this._cols[a].dataType;(p==="Double"||p==="Integer"||p==="Decimal")&&z.push(a)}if(z.length>=3&&this._rows.length>=b){let a=Math.min(this._rows.length,H),p=z.map(E=>{let x=[];for(let C=0;C<a;C++){let M=this._rows[C][E],G=typeof M=="number"?M:parseFloat(String(M).replace(/,/g,""));if(M==null||M===""||!isFinite(G))return null;x.push(G)}let F=x[0],k=!1;for(let C of x)if(C!==F){k=!0;break}return k?x:null}),D=z.map((E,x)=>x).filter(E=>p[E]!==null),N=E=>{let x=E.slice().sort((k,C)=>k-C),F=x.length>>1;return x.length%2?x[F]:(x[F-1]+x[F])/2},g=null,T=[],I=E=>{if(T.length>=3){let x=T.map(M=>p[M]),F=x[0].length,k=new Array(F);for(let M=0;M<F;M++){let G=0;for(let _ of x)G+=_[M];k[M]=G}let C=N(k);if(C>0){let M=0;for(let _ of k)Math.abs(_-C)<=C*W&&M++;let G=M/F;if(G>=v){let _=1;for(let y of x){let L=N(y)/C;L<_&&(_=L)}_>=U&&(!g||T.length>g.cols.length)&&(g={cols:T.slice(),total:C,matched:G})}}}if(!(T.length>=B))for(let x=E;x<D.length;x++)T.push(D[x]),I(x+1),T.pop()};if(I(0),g){let E=g,F={columns:E.cols.map(k=>this._cols[z[k]].name),total:Math.round(E.total*1e3)/1e3,matchedPct:Math.round(E.matched*100)/100};for(let k of E.cols)this._cols[z[k]].constantSumGroup=F}}return this.applySeriesCompleteness(i,n,s),this._computedStatsForLevel=e,this._cols}applySeriesCompleteness(e,n,r){for(let m of this._cols)m.seriesCompleteness!==void 0&&delete m.seriesCompleteness;let i=this._cols.map((m,R)=>({c:m,i:R})).filter(({c:m})=>m.isTemporal&&!m.isMeasure&&m.temporalCadence&&m.temporalCadence.grain!=="irregular");if(i.length===0)return;let s=[],o=[];this._cols.forEach((m,R)=>{let A=r[R];A&&(s.push(R),o.push({name:m.name,dataType:m.dataType,isMeasure:!!m.isMeasure,isTemporal:!!m.isTemporal,isDatePart:!!m.isDatePart,isReassembledDate:!!m.isReassembledDate,isBinaryFlag:!!m.isBinaryFlag,geoKind:m.geoKind,identifierNamed:st(m.name),values:A,rows:this._rows.length,locale:n}))});let l=et(o);if(l<0)return;let u=s[l],c=this._cols[u],d=this._rows.map(m=>this.STR(m[u])),f=e>=20&&(c.dataType!=="String"||Array.isArray(c.safeDistinctValues));for(let{c:m,i:R}of i){let A=tt({periods:this._rows.map(O=>this.STR(O[R])),series:d,seriesColumn:c.name,pattern:m.temporalTextPattern,locale:n,includeDates:e>=20,includeNames:f});A&&(m.seriesCompleteness=A)}}updateColumnStats20(e,n,r,i,s,o,l,u,c,d,f,m){if(e>=20){let R=[...n].sort((S,w)=>S-w),A=Math.floor(R.length/2);if(r>0&&i!=null?s.avgValue=s.dataType=="Integer"?Math.round(i/r):i/r:s.avgValue=null,r>0&&(s.avgLength=o/r),this._rows.length>0){let S=w=>{let h=w instanceof Date?w:typeof w=="string"?ce(w)??new Date(w):new Date(w),W=this.wholeDayIso(h);return W?W+"T00:00:00.000Z":isNaN(h.getTime())?w:h.toISOString().slice(0,10)+"T00:00:00.000Z"};s.dataType!="DateTime"||l||!u?s.lowValue=u:s.lowValue=S(u),s.dataType!="DateTime"||l||!c?s.highValue=c:s.highValue=S(c),s.medianValue=R.length===0?null:R.length%2===0?s.dataType=="Integer"?Math.round((R[A-1]+R[A])/2):(R[A-1]+R[A])/2:R[A],s.numericPrecision=d}if(R.length>0){let S=s.avgValue??0,w=R.length,h=0,W=0;for(let v of R){let b=v-S;h+=b*b,W+=b*b*b}let U=h/w;s.skewness=U===0?0:W/w/Math.pow(Math.sqrt(U),3),s.stdDev=Math.sqrt(U)}i!==null&&(s.sum=i);let O=Array.from(f.entries()).sort((S,w)=>w[1]-S[1]);if(s.topCategories=O.slice(0,10).map(S=>S[1]),!s.isMeasure&&O.length>0){if(s.dataType==="String"){let S=O.map(h=>h[0]);s.formatSignature=re(S);let w=/^(UUID|EMAIL_LIKE|URL_LIKE|PHONE_LIKE|NUMERIC_ID|HEX_ID|OPAQUE_ID_ALPHANUMERIC|DATE_STR|BOOLEAN)$/;s.formatSignature&&!w.test(s.formatSignature)&&(s.avgLength===void 0||s.avgLength>=3)&&(s.isFreeText=!0)}else s.topCategoryValues=O.slice(0,5).map(S=>S[0]);if(e>=20){let S=O.map(h=>h[0]),w=ie(S,m);if(w!==null)s.ordinalPattern=w.pattern,s.orderedDomain=w.orderedDomain;else if(s.dataType==="String"){let h=Te(S);h!==null&&(s.safeDistinctValues=h)}}}if(R.length>=8&&(s.dataType==="Integer"||s.dataType==="Decimal")){let S=w=>R[Math.floor((R.length-1)*w)];s.quantiles={p05:S(.05),p25:S(.25),p75:S(.75),p95:S(.95)}}}if(!s.isMeasure&&f.size>0){let R=Array.from(f.entries()).sort((O,S)=>S[1]-O[1]),A=ve(R.map(O=>O[0]),s.name,m);if(A!==null&&(s.geoKind=A.geoKind,s.geoMatchPct=A.geoMatchPct,A.geoAmbiguous&&(s.geoAmbiguous=!0),A.geoKind.indexOf("country")===0)){let O=me(R);O&&(s.dominantGeoRegion=O.dominantGeoRegion,s.dominantGeoRegionPct=O.dominantGeoRegionPct,s.geoRegionCount=O.regionCount)}}}updateColumnStats10(e,n,r,i,s,o,l){e>=10&&(n.blankCount=this._rows.length-r,n.distinctCount=i.size+(n.blankCount!=0?1:0),n.valueNature="Categorical",r>0&&(n.dataType==="Integer"||n.dataType==="Decimal"?n.valueNature=it({dataType:n.dataType,isMeasure:!!n.isMeasure,name:n.name,distinct:i.size,nonblank:r,prec:s,maxval:o,minval:l}):n.dataType==="DateTime"&&(n.valueNature=n.dateWithTime?"Continuous":"Ordinal")))}getRowCount(){return this._rows.length}getLeafCardinality(){if(this._leafCardinality!==null)return this._leafCardinality;let e=[];if(this._cols.forEach((r,i)=>{r.isMeasure||e.push(i)}),e.length===0)return this._leafCardinality=this._rows.length,this._leafCardinality;let n=new Set;for(let r of this._rows)n.add(JSON.stringify(e.map(i=>r[i])));return this._leafCardinality=n.size,this._leafCardinality}_leafCardinality=null;getGeoExtent(){if(this._geoExtentComputed)return this._geoExtent;this._geoExtentComputed=!0,this._geoExtent=null;let e=o=>Se(o,{camel:!0}),n=-1,r=-1,i=-1;if(this._cols.forEach((o,l)=>{let u=e(o.name),c=o.dataType==="Integer"||o.dataType==="Decimal";c&&n<0&&u.some(d=>d==="lat"||d==="latitude")?n=l:c&&r<0&&u.some(d=>d==="lon"||d==="lng"||d==="long"||d==="longitude")&&(r=l),i<0&&!o.isMeasure&&typeof o.geoKind=="string"&&o.geoKind.indexOf("country")===0&&(i=l)}),n<0||r<0)return null;let s=[];for(let o of this._rows){let l=o[n],u=o[r],c=l==null||l===""?null:Number(l),d=u==null||u===""?null:Number(u);s.push({lat:c,lon:d,country:i>=0&&ae(this.STR(o[i]))?this.STR(o[i]):null})}return this._geoExtent=Le(s),this._geoExtent}_geoExtent=null;_geoExtentComputed=!1;obfuscateString(e){return Pe(e,Ce)}toObjectArray(){let e=this.liveEnglishAliases();return this._rows.map(n=>{let r={};this._cols.forEach((i,s)=>{r[i.name]=n[s],this.emitLegacyAggAliases&&i.hostName&&i.hostName!==i.name&&!Object.prototype.hasOwnProperty.call(r,i.hostName)&&(r[i.hostName]=n[s])});for(let[i,s]of e)Object.prototype.hasOwnProperty.call(r,s.alias)||(r[s.alias]=n[i]);return r})}async getCSVAsync(e){let n=[],r=e?25:1e7,i=e?4e3:1e7,s=new Map;for(let l of this._rows){let u={};for(let c=0;c<this._cols.length;c++){let d=this._cols[c],f=l[c];if(this.STR(f)!=""){if(e&&d.dataType=="String")if(s.has(f))f=s.get(f);else{let m=this.obfuscateString(f);s.set(f,m),f=m}else if(d.dataType=="DateTime"&&!d.dateWithTime){let m=f instanceof Date?f:typeof f=="string"?ce(f)??new Date(f):new Date(f);f=(this.wholeDayIso(m)??m.toISOString().slice(0,10))+"T00:00:00.000Z"}i-=this.STR(f).length}else f=null;u[c]=f,--i}if(n.push(u),--r,r<=0||i<=0)break}return await nt.unparse(n,{header:!1})}getCSVHeaderLine(){let e=this.liveEnglishAliases();return nt.unparse([this._cols.map((n,r)=>{if(this.emitLegacyAggAliases&&n.hostName)return this.STR(n.hostName);let i=e.get(r);return this.STR(i&&i.headerName?i.alias:n.name)})])}setHostQueryNames(e){this._hostQueryNames=(e??[]).map(n=>n==null?null:this.STR(n)),this._englishAliases=new Map}aliasesForCode(e){let n=fe(e,this._cols)?this.legacyAliases():[];for(let r of this.englishAliasesFor(e).values())n.push({name:r.name,alias:r.alias,reason:"english-implicit-agg"});return n}armAliasesForCode(e){return this.emitLegacyAggAliases=fe(e,this._cols),this._englishAliases=this.englishAliasesFor(e),this.getArmedAliases()}getArmedAliases(){let e=this.emitLegacyAggAliases?this.legacyAliases():[];for(let n of this.liveEnglishAliases().values())e.push({name:n.name,alias:n.alias,reason:"english-implicit-agg"});return e}legacyAliases(){let e=[];for(let n of this._cols)n&&n.hostName&&n.hostName!==n.name&&e.push({name:this.STR(n.name),alias:this.STR(n.hostName),reason:"doubled-agg-prefix"});return e}englishAliasesFor(e){let n=new Map;if(!e||this._hostQueryNames.length===0||!this._cols||this._cols.length===0)return n;let r=String(e),i=new Set;for(let o of this._cols)o&&(i.add(this.STR(o.name)),o.hostName&&i.add(this.STR(o.hostName)));let s=new Map;for(let o=0;o<this._cols.length;o++){if(!this._cols[o])continue;let l=$e(this._hostQueryNames[o]).filter(u=>!i.has(u)&&ee(r,u));l.length===1&&s.set(l[0],[...s.get(l[0])??[],o])}for(let[o,l]of s){if(l.length!==1)continue;let u=this.STR(this._cols[l[0]].name);n.set(l[0],{name:u,alias:o,headerName:!ee(r,u)})}return n}liveEnglishAliases(){let e=new Map;for(let[n,r]of this._englishAliases){let i=this._cols?this._cols[n]:null;i&&this.STR(i.name)===r.name&&e.set(n,r)}return e}addRow(e,n){if(this.dedupRows){let r="";for(let s of e)r+=this.STR(s)+"~";let i=Ae(r);if(this._rowHashes.has(i))return!1;this._rowHashes.add(i)}return this._rows.push(Tn(e)),this._origIndices.push(n??-1),!0}getOriginalRowIndex(e){return e<0||e>=this._origIndices.length?-1:this._origIndices[e]}reset(){this._cols=[],this._rows=[],this._origIndices=[],this._rowHashes=new Set,this._leafCardinality=null,this._hostQueryNames=[],this._englishAliases=new Map}setColumns(e){if(this._cols=e,!e||e.length===0)return;let n=new Set(e.map(r=>this.STR(r?.name)));for(let r of e){if(!r)continue;let i=this.STR(r.name),s=Be(i);!s||s===i||n.has(s)||(n.delete(i),n.add(s),r.hostName=i,r.name=s)}}};export{Le as a,lt as b,ae as c,vn as d,ht as e,bt as f,yt as g,St as h,We as i,xt as j,Be as k,fe as l,$e as m,Ve as n,Et as o,Ye as p,He as q,On as r,Pn as s,kn as t,ee as u,Ot as v,Gn as w,Pt as x,kt as y,ge as z,Qe as A,jt as B,Qt as C,qt as D,rn as E,et as F,tt as G,st as H,ot as I,Mn as J,xn as K,Rn as L,it as M,Tn as N,rt as O};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
|
+
import{f as h,i as y,k as p,n as k,o as b,u as w}from"./chunk-4VN252CK.mjs";var ne=Object.freeze({hour:24,weekday:7,month:12,quarter:4,week:53,season:4}),z={nl:["jaar"],de:["jahr"],fr:["ann\xE9e"],es:["a\xF1o"],pt:["ano"],it:["anno"],pl:["rok"],cs:["rok"],sk:["rok"],sv:["\xE5r"],da:["\xE5r"],nb:["\xE5r"],fi:["vuosi"],hu:["\xE9v"],tr:["y\u0131l"],ro:["anul"],hr:["godina"],id:["tahun"],vi:["n\u0103m"],ru:["\u0433\u043E\u0434"],uk:["\u0440\u0456\u043A"],el:["\u03AD\u03C4\u03BF\u03C2"],zh:["\u5E74\u4EFD","\u5E74\u5EA6"],ja:["\u5E74\u5EA6"],ko:["\uC5F0\uB3C4","\uB144\uB3C4"],ar:["\u0633\u0646\u0629"],he:["\u05E9\u05E0\u05D4"],hi:["\u0935\u0930\u094D\u0937","\u0938\u093E\u0932"],th:["\u0E1B\u0E35\u0E07\u0E1A\u0E1B\u0E23\u0E30\u0E21\u0E32\u0E13"],fa:["\u0633\u0627\u0644"]},v={hour:{de:["stunde"],fr:["heure"],es:["hora"],pt:["hora"],it:["ora"],pl:["godzina"],cs:["hodina"],sk:["hodina"],sv:["timme"],fi:["tunti"],hu:["\xF3ra"],ro:["ora"],vi:["gi\u1EDD"],ru:["\u0447\u0430\u0441"],uk:["\u0433\u043E\u0434\u0438\u043D\u0430"],el:["\u03CE\u03C1\u03B1"],zh:["\u5C0F\u65F6"],ar:["\u0633\u0627\u0639\u0629"],he:["\u05E9\u05E2\u05D4"],hi:["\u0918\u0902\u091F\u093E"],th:["\u0E0A\u0E31\u0E48\u0E27\u0E42\u0E21\u0E07"],fa:["\u0633\u0627\u0639\u062A"]},weekday:{nl:["weekdag"],de:["wochentag"],sv:["veckodag"],da:["ugedag"],nb:["ukedag"],fi:["viikonp\xE4iv\xE4"],zh:["\u661F\u671F"],ja:["\u66DC\u65E5"],ko:["\uC694\uC77C"]},month:{nl:["maand"],de:["monat"],fr:["mois"],es:["mes"],pt:["m\xEAs"],it:["mese"],pl:["miesi\u0105c"],cs:["m\u011Bs\xEDc"],sk:["mesiac"],sv:["m\xE5nad"],da:["m\xE5ned"],nb:["m\xE5ned"],fi:["kuukausi"],hu:["h\xF3nap"],hr:["mjesec"],id:["bulan"],vi:["th\xE1ng"],ru:["\u043C\u0435\u0441\u044F\u0446"],uk:["\u043C\u0456\u0441\u044F\u0446\u044C"],el:["\u03BC\u03AE\u03BD\u03B1\u03C2"],zh:["\u6708\u4EFD"],ar:["\u0634\u0647\u0631"],he:["\u05D7\u05D5\u05D3\u05E9"],hi:["\u092E\u0939\u0940\u0928\u093E","\u092E\u093E\u0939"],th:["\u0E40\u0E14\u0E37\u0E2D\u0E19"],fa:["\u0645\u0627\u0647"]},quarter:{nl:["kwartaal"],de:["quartal"],fr:["trimestre"],es:["trimestre"],pt:["trimestre"],it:["trimestre"],pl:["kwarta\u0142"],cs:["\u010Dtvrtlet\xED"],sk:["\u0161tvr\u0165rok"],sv:["kvartal"],da:["kvartal"],nb:["kvartal"],fi:["vuosinelj\xE4nnes"],hu:["negyed\xE9v"],tr:["\xE7eyrek"],ro:["trimestru"],hr:["tromjese\u010Dje"],id:["kuartal","triwulan"],vi:["qu\xFD"],ru:["\u043A\u0432\u0430\u0440\u0442\u0430\u043B"],uk:["\u043A\u0432\u0430\u0440\u0442\u0430\u043B"],el:["\u03C4\u03C1\u03AF\u03BC\u03B7\u03BD\u03BF"],zh:["\u5B63\u5EA6"],ja:["\u56DB\u534A\u671F"],ko:["\uBD84\uAE30"],ar:["\u0631\u0628\u0639"],he:["\u05E8\u05D1\u05E2\u05D5\u05DF"],hi:["\u0924\u093F\u092E\u093E\u0939\u0940"],th:["\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A"]},week:{de:["woche"],fr:["semaine"],es:["semana"],pt:["semana"],it:["settimana"],pl:["tydzie\u0144"],cs:["t\xFDden"],sk:["t\xFD\u017Ede\u0148"],sv:["vecka"],da:["uge"],nb:["uke"],fi:["viikko"],hu:["h\xE9t"],tr:["hafta"],ro:["s\u0103pt\u0103m\xE2n\u0103"],hr:["tjedan"],id:["minggu"],vi:["tu\u1EA7n"],ru:["\u043D\u0435\u0434\u0435\u043B\u044F"],uk:["\u0442\u0438\u0436\u0434\u0435\u043D\u044C"],el:["\u03B5\u03B2\u03B4\u03BF\u03BC\u03AC\u03B4\u03B1"],ar:["\u0623\u0633\u0628\u0648\u0639"],he:["\u05E9\u05D1\u05D5\u05E2"],hi:["\u0938\u092A\u094D\u0924\u093E\u0939"],th:["\u0E2A\u0E31\u0E1B\u0E14\u0E32\u0E2B\u0E4C"],fa:["\u0647\u0641\u062A\u0647"]},season:{nl:["seizoen"],de:["jahreszeit"],fr:["saison"],es:["temporada"],it:["stagione"],pl:["sezon"],cs:["sez\xF3na"],sk:["sez\xF3na"],sv:["s\xE4song","\xE5rstid"],da:["s\xE6son","\xE5rstid"],nb:["sesong","\xE5rstid"],fi:["vuodenaika"],hu:["\xE9vszak"],tr:["mevsim"],ro:["anotimp"],vi:["m\xF9a"],ru:["\u0441\u0435\u0437\u043E\u043D"],uk:["\u0441\u0435\u0437\u043E\u043D"],el:["\u03B5\u03C0\u03BF\u03C7\u03AE"],zh:["\u5B63\u8282"],ja:["\u5B63\u7BC0"],ko:["\uACC4\uC808"],ar:["\u0645\u0648\u0633\u0645"],he:["\u05E2\u05D5\u05E0\u05D4"],hi:["\u092E\u094C\u0938\u092E"],th:["\u0E24\u0E14\u0E39"],fa:["\u0641\u0635\u0644"]}},j=["\xE5r","\xE9v","h\xE9t","\xF3ra"];function E(n,t,r){let e=h(r);if(!e)return null;let a=t.normalize("NFC").toLowerCase(),i=p(n).words;return i.includes(a)?"word":e.compounds&&i.some(s=>b(s,a,k))?"suffix":null}function M(n,t){let r=String(n??"");if(!r.trim())return null;for(let[e,a]of Object.entries(t))for(let i of a){let s=j.includes(i)?E(r,i,e):w(r,i,e);if(s)return{lang:e,word:i,view:s}}return null}function _(n){return M(n,z)}function C(n){let t=null;for(let r of Object.keys(v)){let e=M(n,v[r]);if(e){if(t&&t.concept!==r)return null;t={concept:r,hit:e}}}return t}var D=[{name:"likert7_agreement",minMatches:5,canonical:["strongly disagree","disagree","slightly disagree","neutral","slightly agree","agree","strongly agree"]},{name:"likert5_agreement",minMatches:3,canonical:["strongly disagree","disagree","neutral","agree","strongly agree"]},{name:"likert3_agreement",minMatches:2,canonical:["disagree","neutral","agree"]},{name:"likert5_satisfaction",minMatches:3,canonical:["very dissatisfied","dissatisfied","neutral","satisfied","very satisfied"]},{name:"likert3_satisfaction",minMatches:2,canonical:["dissatisfied","neutral","satisfied"]},{name:"likert5_quality",minMatches:3,canonical:["poor","fair","good","very good","excellent"]},{name:"likert3_quality",minMatches:2,canonical:["poor","fair","good"]},{name:"frequency5",minMatches:3,canonical:["never","rarely","sometimes","often","always"]},{name:"intensity5",minMatches:3,canonical:["not at all","slightly","moderately","very","extremely"]},{name:"importance5",minMatches:3,canonical:["not important","slightly important","moderately important","very important","extremely important"]},{name:"severity_low_critical",minMatches:3,canonical:["low","medium","high","critical"]},{name:"severity_low_urgent",minMatches:3,canonical:["low","medium","high","urgent"]},{name:"severity_none_critical",minMatches:3,canonical:["none","mild","moderate","severe","critical"]},{name:"priority_p4_p1",minMatches:3,canonical:["p4","p3","p2","p1","p0"]},{name:"severity_trivial_blocker",minMatches:3,canonical:["trivial","minor","major","critical","blocker"]},{name:"severity_minor_severe",minMatches:3,canonical:["minor","moderate","major","severe"]},{name:"magnitude5_medium",minMatches:3,canonical:["very low","low","medium","high","very high"]},{name:"magnitude5_moderate",minMatches:3,canonical:["very low","low","moderate","high","very high"]},{name:"speed5",minMatches:3,canonical:["very slow","slow","moderate","fast","very fast"]},{name:"temperature6",minMatches:3,canonical:["freezing","cold","cool","mild","warm","hot"]},{name:"experience6",minMatches:3,canonical:["novice","beginner","intermediate","advanced","expert","master"]},{name:"tier_metal",minMatches:3,canonical:["bronze","silver","gold","platinum","diamond"]},{name:"tshirt_letter_sizes",minMatches:4,canonical:["xxs","xs","s","m","l","xl","xxl","xxxl"]},{name:"tshirt_word_sizes",minMatches:3,canonical:["extra small","small","medium","large","extra large"]},{name:"nps_bands",minMatches:2,canonical:["detractor","passive","promoter"]},{name:"likelihood5",minMatches:3,canonical:["very unlikely","unlikely","neutral","likely","very likely"]},{name:"education",minMatches:3,canonical:["none","primary","secondary","bachelors","masters","doctoral"]},{name:"grades_a_to_f",minMatches:3,canonical:["a","b","c","d","f"]},{name:"grades_a_to_f_plusminus",minMatches:4,canonical:["a+","a","a-","b+","b","b-","c+","c","c-","d+","d","d-","f"]}],L={seldom:"rarely",infrequently:"rarely","hardly ever":"rarely",occasionally:"sometimes",periodically:"sometimes","now and then":"sometimes",frequently:"often",frequent:"often",regularly:"often",commonly:"often",usually:"often",constantly:"always","every time":"always","all the time":"always",consistently:"always",continually:"always",bad:"poor",weak:"poor",subpar:"poor",mediocre:"fair",passable:"fair","so so":"fair",decent:"good",solid:"good",outstanding:"excellent",superb:"excellent",exceptional:"excellent",stellar:"excellent",unsatisfied:"dissatisfied",unhappy:"dissatisfied",displeased:"dissatisfied",happy:"satisfied",content:"satisfied",pleased:"satisfied",delighted:"very satisfied","highly satisfied":"very satisfied","extremely satisfied":"very satisfied","highly dissatisfied":"very dissatisfied","extremely dissatisfied":"very dissatisfied",neither:"neutral",undecided:"neutral","no opinion":"neutral","neither agree nor disagree":"neutral","completely agree":"strongly agree","totally agree":"strongly agree","completely disagree":"strongly disagree","totally disagree":"strongly disagree","highly unlikely":"very unlikely","extremely unlikely":"very unlikely","highly likely":"very likely","extremely likely":"very likely","almost certain":"very likely",bachelor:"bachelors","bachelor's":"bachelors",undergraduate:"bachelors","bachelor degree":"bachelors","master's":"masters",graduate:"masters","master degree":"masters",doctorate:"doctoral",phd:"doctoral"},A=(()=>{let n=new Set;for(let t of D)for(let r of t.canonical)n.add(m(r));return n})(),I=(()=>{let n=new Map;for(let[t,r]of Object.entries(L)){let e=m(t);A.has(e)||n.has(e)||n.set(e,m(r))}return n})();function x(n){return I.get(n)??n}var T=new Set(["hour","hr","day","dow","dom","weekday","week","wk","woy","month","mth","quarter","qtr","year","yr","semester","trimester","decade","period","fiscal","fy","rank","level","lvl","tier","grade","band","decile","percentile","quartile","quintile","score","rating","stars","step","stage","phase","round","wave","episode","chapter","age","cohort","generation","seniority","position","sequence","seq","priority"]);function ie(n){if(!n)return!1;for(let t of y(n))if(T.has(t))return!0;return C(n)!==null||_(n)!==null}function m(n){return n.toLowerCase().replace(/[-_]+/g," ").replace(/\s+/g," ").trim()}function g(n){let t=new Map;for(let[r,e]of n)for(let a of r)t.set(m(a),e);return t}var R=[{name:"weekday_mon_sun",minMatches:4,dict:g([[["monday","mon"],0],[["tuesday","tue","tues"],1],[["wednesday","wed","weds"],2],[["thursday","thu","thur","thurs","thr"],3],[["friday","fri"],4],[["saturday","sat"],5],[["sunday","sun"],6]])},{name:"month_jan_dec",minMatches:4,dict:g([[["january","jan"],0],[["february","feb"],1],[["march","mar"],2],[["april","apr"],3],[["may"],4],[["june","jun"],5],[["july","jul"],6],[["august","aug"],7],[["september","sep","sept"],8],[["october","oct"],9],[["november","nov"],10],[["december","dec"],11]])},{name:"quarter_q1_q4",minMatches:3,dict:g([[["q1","qtr 1","qtr1","quarter 1","q 1"],0],[["q2","qtr 2","qtr2","quarter 2","q 2"],1],[["q3","qtr 3","qtr3","quarter 3","q 3"],2],[["q4","qtr 4","qtr4","quarter 4","q 4"],3]])}],q={};function V(n){let t=n||"";if(!t)return{weekday:new Map,month:new Map};let r=q[t];if(r)return r;let e=new Map,a=new Map,i=(o,l,u)=>{let d=m(l);d&&o.set(d,u);let c=m(l.replace(/\./g,""));c&&c!==d&&o.set(c,u)};try{let o=new Intl.DateTimeFormat(t,{weekday:"long"}),l=new Intl.DateTimeFormat(t,{weekday:"short"});for(let c=0;c<7;++c){let f=new Date(Date.UTC(2024,0,1+c));i(e,o.format(f),c),i(e,l.format(f),c)}let u=new Intl.DateTimeFormat(t,{month:"long"}),d=new Intl.DateTimeFormat(t,{month:"short"});for(let c=0;c<12;++c){let f=new Date(Date.UTC(2020,c,15));i(a,u.format(f),c),i(a,d.format(f),c)}}catch{}let s={weekday:e,month:a};return q[t]=s,s}function N(n,t){if(t.size===0)return n;let r=new Map(n);for(let[e,a]of t)r.has(e)||r.set(e,a);return r}function F(n,t){let r=V(t);for(let e of R){let a=e.name==="weekday_mon_sun"?N(e.dict,r.weekday):e.name==="month_jan_dec"?N(e.dict,r.month):e.dict,i=!0,s=new Map;for(let[l,u]of n){let d=a.get(l);if(d===void 0){i=!1;break}s.has(d)||s.set(d,u)}if(!i||s.size<e.minMatches)continue;let o=[...s.entries()].sort((l,u)=>l[0]-u[0]).map(l=>l[1]);return{pattern:e.name,orderedDomain:o}}return null}function S(n){let t=new Map;for(let r of n){if(r==null)continue;let e=String(r);if(e.length===0)continue;let a=m(e);t.has(a)||t.set(a,e)}return t}var W=15,P=10,Y=(()=>{let n=["xxs","xs","s","sm","small","m","med","medium","l","lg","large","xl","xlarge","xxl","xxxl","2xl","3xl","4xl","y","n","yes","no","t","f","true","false","na","n/a","n a","none","null","unknown","other","all","both","low","medium","med","high","very low","very high","minimal","critical","urgent"],t=new Set(n.map(m));for(let r of R)for(let e of r.dict.keys())t.add(e);return t})();function U(n){let t=n.trim();return t.length===0||t.length>P||(t.match(/\p{L}/gu)||[]).length>1?!1:/\p{Nd}/u.test(t)}function K(n){let t=n.trim();return t.length===1&&/[\p{L}\p{Nd}]/u.test(t)}function oe(n){if(!n||n.length===0)return null;let t=new Set,r=[];for(let e of n){if(e==null)continue;let a=String(e);if(t.has(a))continue;let i=m(a);if(!(i===""||Y.has(i)||U(a)||K(a))||(t.add(a),r.push(a),r.length>W))return null}return r.length>0?r:null}var H=/^(\p{L}{0,3}) ?([0-9]+)\s*[-–—:.)]\s*(.+)$/u;function X(n){let t=null,r=new Set,e=[];for(let a of n.values()){let i=H.exec(a.trim());if(!i)return null;let s=i[1].toLowerCase();if(t===null)t=s;else if(s!==t)return null;let o=Number(i[2]);if(r.has(o)||m(i[3])==="")return null;r.add(o),e.push({code:o,original:a,label:i[3]})}return e}function B(n,t){let r=O(S(n.map(o=>o.label)),t);if(r===null)return;if(r.orderedDomain.length!==n.length)return null;let e=new Map;for(let o of n)e.set(o.label,o);let a=r.orderedDomain.map(o=>e.get(o));if(a.some(o=>o===void 0))return null;let i=!0,s=!0;for(let o=1;o<a.length;++o)a[o].code<=a[o-1].code&&(i=!1),a[o].code>=a[o-1].code&&(s=!1);return!i&&!s?null:{pattern:r.pattern,orderedDomain:a.map(o=>o.original)}}function se(n,t){if(!n||n.length<2)return null;let r=S(n);if(r.size<2)return null;let e=X(r);if(e!==null){let i=B(e,t);if(i!==void 0)return i}let a=O(r,t);return a!==null?a:e!==null?Q(r):null}var $=/^([0-9]+)\s*(?:\.|\)|-)\s*([^\s\d].*)$/u,G=3,J=20;function Q(n){if(n.size<G||n.size>J)return null;let t=new Set,r=[];for(let e of n.values()){let a=$.exec(e.trim());if(!a||m(a[2])==="")return null;let i=Number(a[1]);if(t.has(i))return null;t.add(i),r.push({n:i,original:e})}return r.sort((e,a)=>e.n-a.n),{pattern:"numeric_rank_prefix",orderedDomain:r.map(e=>e.original)}}function O(n,t){let r=new Map;for(let[a,i]of n){let s=x(a);r.has(s)||r.set(s,i)}let e=null;for(let a of D){let i=[];for(let u of a.canonical){let d=r.get(u);d!==void 0&&i.push(d)}if(i.length<a.minMatches)continue;let s=new Set(a.canonical),o=!0;for(let u of n.keys())if(!s.has(x(u))){o=!1;break}if(!o)continue;let l;e===null||i.length>e.matched||i.length===e.matched&&a.canonical.length<e.pattern.canonical.length?l=!0:l=!1,l&&(e={pattern:a,matched:i.length,orderedDomain:i})}return e?{pattern:e.pattern.name,orderedDomain:e.orderedDomain}:F(n,t)}export{ne as a,z as b,v as c,M as d,_ as e,C as f,ie as g,oe as h,se as i};
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
|
-
import{a as gn,b as hn}from"./chunk-UQU75XXR.mjs";import{a as Cn,b as O,c as bn,d as k,e as h,f as Tn,g as Y,h as Q}from"./chunk-HMLAY26J.mjs";import{a as dn,b as mn,c as fn,d as pn,e as yn}from"./chunk-VAL2LI3T.mjs";import{A as Qt,B as Xt,C as Jt,D as Zt,E as en,F as tn,G as nn,H as rn,I as on,J as sn,K as an,L as ln,M as un,O as cn,a as Et,b as St,c as Rt,d as xt,e as Lt,f as Mt,g as _t,h as At,i as Ot,j as Nt,k as It,l as Ft,m as kt,n as Gt,o as Vt,p as Dt,q as Ut,r as Wt,s as qt,t as zt,u as Kt,v as $t,w as Bt,x as jt,y as Ht,z as Yt}from"./chunk-Q7UDK4PL.mjs";import{a as wt}from"./chunk-U3H6UBOO.mjs";import{a as vt,b as Pt}from"./chunk-2LR73DNS.mjs";import{a as ae,b as le,c as ht,d as Ct,e as bt,f as Tt}from"./chunk-VIWJJUDA.mjs";import{a as D,f as U,g as A,h as W,i as j,j as at,k as lt,l as se,m as M,n as ut,o as ct,p as dt,q,r as mt,s as ft,t as pt,u as yt,v as H,w as gt}from"./chunk-TPVDJHU6.mjs";import"./chunk-5MRZID36.mjs";import{a as ot,b as it,c as st}from"./chunk-NIFK72FA.mjs";import{A as Xe,B as Je,C as Ze,D as et,E as tt,F as nt,G as rt,a as Le,b as Me,c as _e,d as Ae,e as Oe,f as $,g as Ne,h as Ie,i as Fe,j as ke,k as Ge,l as Ve,m as De,n as Ue,o as We,p as qe,q as ze,r as Ke,s as $e,t as Be,u as je,v as He,x as B,y as Ye,z as Qe}from"./chunk-4VN252CK.mjs";var X=2,de=400;function Z(t){return!!U(t)}function F(t){let e=new Set;for(let n of t){if(n==null)continue;let o=D(String(n));if(!W(o)&&!e.has(o)&&(e.add(o),e.size>=de))break}return Array.from(e)}function I(t){let e=F(t);if(e.length===0||ee(t)<95)return!1;let n=e.filter(u=>Z(u)&&!M(u)).length,o=e.filter(u=>!Z(u)&&!!M(u)).length;return n>=1&&n>=o}function ue(t,e){if(!M(t))return!1;let n=U(t);return n?e==="world"?!0:se.has(n):!1}function ee(t){let e=F(t);if(e.length===0)return 0;let n=0;for(let o of e)Z(o)&&n++;return Math.round(n/e.length*1e3)/10}function z(t){let e=F(t);if(e.length===0)return 0;let n=0;for(let o of e)M(o)&&n++;return Math.round(n/e.length*1e3)/10}function ne(t){let e=new Set;for(let n of t){if(n==null)continue;let o=String(n).trim();if(!W(D(o))&&!e.has(o)&&(e.add(o),e.size>=de))break}return Array.from(e)}function te(t){let e=ne(t);if(e.length===0)return 0;let n=0;for(let o of e)q(o).length>0&&n++;return Math.round(n/e.length*1e3)/10}function ce(t,e){return le(e,ae)?!0:ne(t).some(n=>/^\d{5}(-\d{4})?$/.test(n.replace(/\.0+$/,"")))}function En(t,e){let n=F(t);if(n.length===0)return 0;let o=0;for(let u of n)H(u,e)&&o++;return Math.round(o/n.length*1e3)/10}function J(t,e){let n=0;for(let o of F(t))e(o)&&n++;return n}function Sn(t,e){let n=0;for(let o of ne(t))e(o)&&n++;return n}function Rn(t,e,n,o,u){let l=[],a=[],i={},S={},T=new Set(t),b=s=>e.map(d=>d[s]);for(let s of["city","country"]){let d=n?.[s];d&&T.has(d)&&(i[s]=d)}let y=new Set(u??t);for(let s of["lat","lon"]){let d=n?.[s];d&&y.has(d)&&(i[s]=d)}let m=n?.zip;if(m&&T.has(m)){let s=b(m),d=te(s);d<95?a.push(`zip=${m} (only ${d}% of values read as ZIPs)`):ce(s,m)?i.zip=m:a.push(`zip=${m} (all values are 3-4 digits with nothing to say they are postal)`)}let p=n?.state;if(p&&T.has(p)){let s=b(p),d=F(s);d.length>0&&d.every(E=>ue(E,o))?a.push(`state=${p} (every value is "CA", which is both Canada and California)`):I(s)?(a.push(`state=${p} (every value is a country, not a state)`),i.country||(i.country=p)):z(s)<95?a.push(`state=${p} (only ${z(s)}% of values are states/provinces)`):i.state=p}let c=new Set(Object.values(i).filter(Boolean)),C=t.filter(s=>!c.has(s)&&!s.startsWith("__"));if(!i.state){let s=null;for(let d of C){let E=b(d);if(I(E))continue;let P=z(E);if(P<95)continue;let K=J(E,V=>!!M(V)),Pe=J(E,V=>!!M(V)&&!ue(V,o));K<X&&Pe<1||(!s||P>s.pct)&&(s={name:d,pct:P})}s&&(i.state=s.name,c.add(s.name),l.push(`state=${s.name} (${s.pct}% states/provinces)`))}if(!i.zip)for(let s of C){if(c.has(s))continue;let d=b(s),E=te(d);if(!(E<95)&&ce(d,s)&&!(Sn(d,P=>q(P).length>0)<X)){i.zip=s,c.add(s),l.push(`zip=${s} (${E}% ZIP codes)`);break}}let R=i.country;if(!R||!I(b(R))){let s=null;for(let d of C){if(c.has(d)||!I(b(d)))continue;let E=ee(b(d));(!s||E>s.pct)&&(s={name:d,pct:E})}s&&(R&&(a.push(`country=${R} (only ${ee(b(R))}% of values are country identifiers; using ${s.name} instead)`),S.country=R),i.country=s.name,c.add(s.name),l.push(`country=${s.name}`))}if(!i.city){let s=null;for(let d of C){if(c.has(d))continue;let E=b(d),P=En(E,o);P<j||J(E,K=>H(K,o))<X||(!s||P>s.pct)&&(s={name:d,pct:P})}s&&(i.city=s.name,l.push(`city=${s.name} (${s.pct}% known cities)`))}let w=i.country?b(i.country):[],v=!!i.country&&I(w),_=v?new Set(w.map(s=>U(s==null?null:String(s))).filter(Boolean)).size:0,x=v&&_>=2,g=!!(i.lat&&i.lon)&&e.some(s=>{let d=+String(s[i.lat]??"").trim(),E=+String(s[i.lon]??"").trim();return isFinite(d)&&isFinite(E)&&d>=-90&&d<=90&&E>=-180&&E<=180&&String(s[i.lat]??"").trim()!==""&&String(s[i.lon]??"").trim()!==""});return i.lat&&i.lon&&!g&&a.push(`lat/lon=${i.lat}/${i.lon} (no row holds a usable coordinate pair)`),i.country&&!x&&!(i.city||i.state||i.zip||g)&&a.push(v?`country=${i.country} (every row resolves to the same country - nothing to place apart)`:`country=${i.country} (values are not country identifiers)`),{bind:!!(i.city||i.state||i.zip||x||g)?i:null,backfilled:l,refused:a,...Object.keys(S).length?{labelFallback:S}:{}}}var r=(t,...e)=>({part:t,langs:Object.freeze(e)}),re=Object.freeze({jaar:r("year","nl"),kwartaal:r("quarter","nl"),maand:r("month","nl"),dag:r("day","nl","sv","da","nb"),jahr:r("year","de"),quartal:r("quarter","de"),monat:r("month","de"),tag:r("day","de"),ann\u00E9e:r("year","fr"),mois:r("month","fr"),jour:r("day","fr"),trimestre:r("quarter","fr","es","pt","it"),a\u00F1o:r("year","es"),mes:r("month","es"),d\u00EDa:r("day","es"),ano:r("year","pt"),m\u00EAs:r("month","pt"),dia:r("day","pt"),anno:r("year","it"),mese:r("month","it"),giorno:r("day","it"),\u0433\u043E\u0434:r("year","ru"),\u043C\u0435\u0441\u044F\u0446:r("month","ru"),\u0440\u0456\u043A:r("year","uk"),\u043C\u0456\u0441\u044F\u0446\u044C:r("month","uk"),\u043A\u0432\u0430\u0440\u0442\u0430\u043B:r("quarter","ru","uk"),\u0434\u0435\u043D\u044C:r("day","ru","uk"),rok:r("year","pl","cs","sk"),kwarta\u0142:r("quarter","pl"),miesi\u0105c:r("month","pl"),dzie\u0144:r("day","pl"),\u010Dtvrtlet\u00ED:r("quarter","cs"),m\u011Bs\u00EDc:r("month","cs"),den:r("day","cs"),\u0161tvr\u0165rok:r("quarter","sk"),mesiac:r("month","sk"),de\u0148:r("day","sk"),\u00E5r:r("year","sv","da","nb"),kvartal:r("quarter","sv","da","nb"),m\u00E5nad:r("month","sv"),m\u00E5ned:r("month","da","nb"),vuosi:r("year","fi"),vuosinelj\u00E4nnes:r("quarter","fi"),kuukausi:r("month","fi"),p\u00E4iv\u00E4:r("day","fi"),\u00E9v:r("year","hu"),negyed\u00E9v:r("quarter","hu"),h\u00F3nap:r("month","hu"),nap:r("day","hu"),y\u0131l:r("year","tr"),\u00E7eyrek:r("quarter","tr"),ay:r("month","tr"),g\u00FCn:r("day","tr"),\u03AD\u03C4\u03BF\u03C2:r("year","el"),\u03C4\u03C1\u03AF\u03BC\u03B7\u03BD\u03BF:r("quarter","el"),\u03BC\u03AE\u03BD\u03B1\u03C2:r("month","el"),\u03B7\u03BC\u03AD\u03C1\u03B1:r("day","el"),an:r("year","ro"),trimestru:r("quarter","ro"),lun\u0103:r("month","ro"),zi:r("day","ro"),godina:r("year","hr"),tromjese\u010Dje:r("quarter","hr"),mjesec:r("month","hr"),dan:r("day","hr"),\u5E74:r("year","ja","zh"),\u56DB\u534A\u671F:r("quarter","ja"),\u5B63\u5EA6:r("quarter","zh"),\u6708:r("month","ja","zh"),\u65E5:r("day","ja","zh"),\uC5F0\uB3C4:r("year","ko"),\uBD84\uAE30:r("quarter","ko"),\uC6D4:r("month","ko"),\uC77C:r("day","ko"),tahun:r("year","id"),kuartal:r("quarter","id"),triwulan:r("quarter","id"),bulan:r("month","id"),hari:r("day","id"),n\u0103m:r("year","vi"),qu\u00FD:r("quarter","vi"),th\u00E1ng:r("month","vi"),ng\u00E0y:r("day","vi"),\u0E1B\u0E35:r("year","th"),\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A:r("quarter","th"),\u0E40\u0E14\u0E37\u0E2D\u0E19:r("month","th"),\u0E27\u0E31\u0E19:r("day","th"),\u0627\u0644\u0633\u0646\u0629:r("year","ar"),\u0633\u0646\u0629:r("year","ar"),\u0627\u0644\u0639\u0627\u0645:r("year","ar"),\u0639\u0627\u0645:r("year","ar"),\u0627\u0644\u0631\u0628\u0639:r("quarter","ar"),\u0631\u0628\u0639:r("quarter","ar"),"\u0631\u0628\u0639 \u0627\u0644\u0633\u0646\u0629":r("quarter","ar"),\u0627\u0644\u0634\u0647\u0631:r("month","ar"),\u0634\u0647\u0631:r("month","ar"),\u0627\u0644\u064A\u0648\u0645:r("day","ar"),\u064A\u0648\u0645:r("day","ar"),\u05E9\u05E0\u05D4:r("year","he"),\u05E8\u05D1\u05E2\u05D5\u05DF:r("quarter","he"),\u05D7\u05D5\u05D3\u05E9:r("month","he"),\u05D9\u05D5\u05DD:r("day","he"),\u0935\u0930\u094D\u0937:r("year","hi"),\u0938\u093E\u0932:r("year","hi"),\u0924\u093F\u092E\u093E\u0939\u0940:r("quarter","hi"),\u092E\u0939\u0940\u0928\u093E:r("month","hi"),\u092E\u093E\u0939:r("month","hi"),\u0926\u093F\u0928:r("day","hi"),\u0633\u0627\u0644:r("year","fa"),\u0645\u0627\u0647:r("month","fa"),\u0631\u0648\u0632:r("day","fa")}),xn=Object.freeze(Array.from(new Set(Object.values(re).flatMap(t=>t.langs)))),me=Object.freeze(["fa","ar","he","th"]),fe=1900,pe=2100;function wn(t,e){let n=[],o=$(e);try{o&&n.push(t.toLocaleLowerCase(o.intl))}catch{}let u=t.toLowerCase();return n.includes(u)||n.push(u),n}function vn(t,e){let n=String(t??"").trim().normalize("NFC");if(!n)return null;for(let o of wn(n,e)){let u=re[o];if(u&&u.langs.includes(e))return u.part}return null}function Pn(t,e){return me.includes(t)?typeof e=="number"&&Number.isFinite(e)&&e>=fe&&e<=pe:!0}function ye(t,e){let n=e?.freemiumMaxShapeColumns;return typeof n!="number"||!isFinite(n)||n<1?null:!isFinite(t)||t<=n?0:Math.round(t-n)}function Ln(t,e,n){let o=ye(t,e);if(o===null||o<=0)return null;let u=typeof e?.freemiumColumnCapPivot=="number"?e.freemiumColumnCapPivot:4,l=o>u?e?.freemiumColumnCapMessageMany:e?.freemiumColumnCapMessageFew;if(typeof l!="string"||l.trim().length===0)return null;let a=l.split("{n}").join(String(o)).split("{fields}").join(o===1?"field":"fields"),i=ge(n);return i.length===0?a:a+" "+i.join(" ")}function ge(t){if(!t||t.length===0)return[];let e=[],n=new Map,o=new Map;for(let l of t){let a=typeof l?.dateGroupId=="string"?l.dateGroupId.trim():"";if(a!==""&&(n.has(a)||(e.push(a),n.set(a,0)),l.isDatePart===!0&&n.set(a,n.get(a)+1),l.isReassembledDate===!0&&!o.has(a))){let i=typeof l.sourceField=="string"?l.sourceField.trim():"",S=typeof l.name=="string"?l.name.trim():"",T=i!==""?i:S;T!==""&&o.set(a,T)}}let u=[];for(let l of e){let a=o.get(l),i=n.get(l)??0;!a||i===0||u.push(`'${a}' is a date hierarchy and counts as ${i+1} fields - bind the date itself instead of its hierarchy.`)}return u}var f=t=>t==null?"":String(t),N=t=>t===!0,he=t=>{if(typeof t=="number")return Number.isFinite(t)?t:null;if(typeof t=="string"&&t.trim()!==""){let e=Number(t);return Number.isFinite(e)?e:null}return null},Mn=[["city","CityColumn"],["state","StateColumn"],["zip","ZipColumn"],["lat","LatColumn"],["lon","LonColumn"],["country","CountryColumn"]];function Ce(t,e){let n={};for(let[o,u]of Mn){let l=f(h(t,e+u));l&&(n[o]=l)}return n}function _n(t){return Array.isArray(t)?t.map(e=>({code:f(h(e,"code")),severity:f(h(e,"severity")),text:f(h(e,"text"))})).filter(e=>e.text!==""):[]}function An(t){let e=S=>h(t,S),n=e("retryAfterSeconds"),o=e("overrideThumbnailUpload"),u=e("forceThumbnailUpload"),l=Ce(t,"point"),a=Ce(t,"destPoint");Object.keys(a).length&&(l.dest=a);let i=e("retryable");return{errorMessage:f(e("errorMessage")),errorCode:f(e("errorCode")),refusalCode:f(e("refusalCode")),retryable:typeof i=="boolean"?i:null,notices:_n(e("notices")),freemiumStatusCode:f(e("freemiumStatusCode")),code:f(e("code")),language:f(e("language")),version:Number(e("version")??0),codeSummary:f(e("codeSummary")),chartName:f(e("chartName")??e("chartType")),finalChartName:f(e("finalChartName")),warningMessage:f(e("warningMessage")),outputHash:f(e("outputHash")),validatorToken:f(e("validatorToken")),editCodeKey:f(e("editCodeKey")),signedLLMRequestID:f(e("signedLLMRequestID")),userReply:f(e("userReply")),userReplyOutcome:f(e("userReplyOutcome")),improvementSuggestion:f(e("improvementSuggestion")),geoColumn:f(e("geoColumn")),geoKind:f(e("geoKind")),geoPointCols:Object.keys(l).length?l:null,creditBalanceBefore:he(e("creditBalanceBefore")),creditCost:he(e("creditCost")),isServiceError:N(e("isServiceError")),isRateLimited:N(e("isRateLimited")),isRefusal:N(e("isRefusal")),isVersionNotFound:N(e("isVersionNotFound")),isGenerationCancelled:N(e("isGenerationCancelled")),retryAfterSeconds:typeof n=="number"&&Number.isFinite(n)?n:null,servedCorrelationId:f(e("servedCorrelationId")),...typeof o=="boolean"?{overrideThumbnailUpload:o}:{},...typeof u=="boolean"?{forceThumbnailUpload:u}:{}}}var be=t=>t==null?void 0:Number(t),G=t=>f(t)||void 0;function On(t){let e=h(t,"charts"),n=h(t,"refused"),o=Array.isArray(e)?e.map(l=>{let a=S=>h(l,S),i=a("recommended");return{name:f(a("chartTypeName")??a("name")),description:f(a("description")??a("chartDesc")),rank:be(a("rank")),score:be(a("score")),renderer:G(a("renderer")),language:G(a("language")),isPreview:N(a("isPreview")),recommended:typeof i=="boolean"?i:void 0,viaProjection:G(a("viaProjection")),viaProjectionKey:G(a("viaProjectionKey")),detailNote:G(a("detailNote"))}}).filter(l=>l.name):null,u=Array.isArray(n)?n.map(l=>({name:f(h(l,"chartTypeName")??h(l,"name")),reason:f(h(l,"reason")),reasonCode:f(h(l,"reasonCode")),isVeto:N(h(l,"isVeto"))})).filter(l=>l.name):[];return{errorMessage:f(h(t,"errorMessage")),errorCode:f(h(t,"errorCode")),charts:o,refused:u,noFitSummary:f(h(t,"noFitSummary"))}}function Nn(t){return!t||typeof t!="object"?null:{status:String(h(t,"status")??""),verdictReason:h(t,"verdictReason")??null,instruction:h(t,"instruction")??null,fix:h(t,"fix")??null,errorMessage:h(t,"errorMessage")??null,errorCode:h(t,"errorCode")??null}}var Te=["working","analyze","generate","refine","review"];function In(t,e){let n=String(t??"").trim().toLowerCase();if(Te.includes(n))return n;let o=String(e??"").toLowerCase();return o.includes("analyz")?"analyze":o.includes("generat")?"generate":o.includes("refin")?"refine":o.includes("review")?"review":null}var Fn="FREEMIUM_ATTEMPT_SPENT",kn="CLIENT_SECRET_MISMATCH",Gn="FREEMIUM_COLUMN_CAP";function Vn(t){let e=t?.retryable;return typeof e=="boolean"?e:null}function Dn(t){let e=t.linkNonce?(t.linkNonce()??"").trim():null,n=e?{licensee:"",licenseKey:"",secretKey:""}:t.triple();return{request:{licenseKey:n.licenseKey,licensee:n.licensee,secretKey:n.secretKey,freemiumKey:t.freemiumKey?.()??""},linkNonce:e}}function Un(t){let{width:e,height:n}=t.measure();return{request:{height:n,width:e},hints:{viewportWidth:e,viewportHeight:n}}}function Wn(t){let e=0;for(let n of t){if(n.isMeasure)continue;let o=n.distinctCount;typeof o=="number"&&o>e&&(e=o)}return e}function Ee(t){if(t.recoveryFetchByCorrelation)return{version:null,fetchOnly:!0};if(t.recoveryFetchVersion!=null)return{version:t.recoveryFetchVersion,fetchOnly:!0};let e=t.settingVersion??null;if(t.genNew)return{version:e,fetchOnly:void 0};let n=(e??0)>0?e:null,o=(t.codeVersion??0)>0?t.codeVersion:null,u=n??o??e;return{version:u,fetchOnly:u!=null&&u>0?!0:void 0}}function qn(t){let e=t.fetchCorrelationId!=null,o=e||t.recoveryFetchVersion!=null?!1:t.genNew,u=Ee({genNew:o,recoveryFetchVersion:t.recoveryFetchVersion,recoveryFetchByCorrelation:e,settingVersion:t.settingVersion,codeVersion:t.codeVersion});return{genNew:o,version:u.version,fetchOnly:u.fetchOnly,fetchCorrelationId:t.fetchCorrelationId??void 0}}function zn(t){let e=n=>t.renderers.has(n);return{supportsD3:e("D3"),supportsPlotly:e("PLOTLY"),supportsVega:e("VEGA")}}function Kn(t){let e=t.cap!=null&&t.budget>t.cap?t.cap:t.budget;return{triesLeft:t.triesLeft??e,maxTries:e}}function $n(t){return t&&t>0?{leafCardinality:Math.round(t)}:{}}function Se(t,e){return t!=null&&e!=null&&t!==e}function Bn(t,e){return t?Se(e.capturedFor,e.now)?{shortlist:void 0,stale:!0}:{shortlist:{...t,ageMs:e.atMs>0?Math.max(0,Math.round(e.nowMs-e.atMs)):void 0},stale:!1}:{shortlist:void 0,stale:!1}}var jn=Object.freeze({integer:"number",decimal:"number",double:"number",datetime:"date",date:"date",boolean:"boolean",string:"text"});function Re(t){let e=String(t??"").trim().toLowerCase();return jn[e]??e}function xe(t){let e="";for(let n of t)e+=JSON.stringify([String(n.name??""),n.isMeasure?"M":"D",Re(n.dataType)]);return e}function Hn(t){return B(xe(t))}var Yn=2,Qn=3,Xn=4,Jn=64,Zn=8e3,er=6e4,tr=Object.freeze({RENDER_START:"render-start",RENDER_OK:"render-ok",RENDER_ERROR:"render-error",VIEW:"view",VIEW_VERDICT:"view-verdict"});function nr(t){return!!t&&!t.includes("|")&&!t.includes(",")}function oe(t,e,n,o){let u=`${t},${e}|${n}`;return o?`${u}|${Math.max(0,Math.round(o.count))}|${o.nonce}`:u}function rr(t,e){let n=t;if(!n||!n.signer||typeof n.signer.sign!="function")throw new TypeError("createTelemetryClient needs the host's signer");if(!n.transport||typeof n.transport.post!="function")throw new TypeError("createTelemetryClient needs the host's transport");if(!n.clock||typeof n.clock.now!="function")throw new TypeError("createTelemetryClient needs the host's clock");if(!e||typeof e.baseUrl!="string"&&typeof e.baseUrl!="function")throw new TypeError("createTelemetryClient needs the service's base URL");if(typeof e.baseUrl=="string"&&e.baseUrl==="")throw new TypeError("createTelemetryClient needs the service's base URL");if(typeof e.clientVersion!="string"||e.clientVersion==="")throw new TypeError("createTelemetryClient needs the client version");if(typeof e.timeoutMs!="number"||!Number.isFinite(e.timeoutMs)||e.timeoutMs<=0)throw new TypeError("createTelemetryClient needs a positive deadline in milliseconds");let{signer:o,transport:u,clock:l}=n,a=e.apiPath??"/api",i=e.timeoutMs,S=()=>typeof e.baseUrl=="function"?e.baseUrl():e.baseUrl,T=y=>{try{e.onFailure?.(y)}catch{}},b=async(y,m,p,c)=>{let C;try{let R=await u.post(m,p,c,{timeoutMs:i});C=R.status;try{R.body?.cancel().catch(()=>{})}catch{}}catch(R){T({channel:y,stage:"post",status:null,error:R});return}(C<200||C>299)&&T({channel:y,stage:"status",status:C,error:null})};return{async sendClientMessage(y){let m,p,c;try{m=`${S()}${a}/LogClientMsg/?nocache=${l.now()}`,p=O(y),c=k(p,o)}catch(C){T({channel:"client-message",stage:"build",status:null,error:C});return}await b("client-message",m,p,{"Content-Type":"text/plain","X-Signature":c})},async countEvent(y,m,p){let c,C;try{c=`${S()}${a}/eventlog`,C=oe(y,e.clientVersion,m,p)}catch(R){T({channel:"event-count",stage:"build",status:null,error:R});return}await b("event-count",c,C,{"Content-Type":"text/plain"})}}}function we(t){return Object.assign(new Error(`The request did not finish within ${t} ms.`),{name:"TimeoutError"})}function or(t,e={}){if(typeof t!="function")throw new TypeError("fetchTransport needs the host's fetch");let n=t,o=e.credentials??"omit";return{async post(u,l,a,i){let S=i.timeoutMs,T=new AbortController,b=!1,y=setTimeout(()=>{b=!0,T.abort(we(S))},S),m=()=>T.abort(i.signal?.reason);i.signal&&(i.signal.aborted?m():i.signal.addEventListener("abort",m,{once:!0}));let p=!1,c=()=>{p||(p=!0,clearTimeout(y),i.signal?.removeEventListener("abort",m))},C=g=>b?we(S):g,R;try{R=await n(u,{method:"POST",body:l,headers:a,credentials:o,signal:T.signal})}catch(g){throw c(),C(g)}let w=Y(R),v=w.statusText!==void 0?{statusText:w.statusText}:{};if(!w.body)return{status:w.status,...v,contentType:w.contentType,body:null,text:async()=>{try{return await w.text()}catch(g){throw C(g)}finally{c()}}};let _=w.body.getReader(),x=new ReadableStream({async pull(g){try{let L=await _.read();if(L.done){c(),g.close();return}g.enqueue(L.value)}catch(L){c(),g.error(C(L))}},cancel(g){return c(),_.cancel(g)}});return{status:w.status,...v,contentType:w.contentType,body:x,text:()=>new Response(x).text()}}}}var ve=300,ir="/LLMChart/",sr="/LLMChart/qualify",ar="/VisionReview/",lr="/LLMChart/sample",ur=t=>!!t&&typeof t=="object"&&t.name==="TimeoutError",ie=async t=>JSON.parse(await t.text());function cr(t){try{t.body?t.body.cancel().catch(()=>{}):t.text().catch(()=>{})}catch{}}function dr(t,e){let n=t;if(!n||!n.signer||typeof n.signer.sign!="function")throw new TypeError("createGenerateClient needs the host's signer");if(!n.transport||typeof n.transport.post!="function")throw new TypeError("createGenerateClient needs the host's transport");if(!n.clock||typeof n.clock.now!="function")throw new TypeError("createGenerateClient needs the host's clock");if(!e||typeof e.baseUrl!="string"&&typeof e.baseUrl!="function")throw new TypeError("createGenerateClient needs the service's base URL");if(typeof e.baseUrl=="string"&&e.baseUrl==="")throw new TypeError("createGenerateClient needs the service's base URL");if(e.apiPath!==void 0&&typeof e.apiPath!="string")throw new TypeError("createGenerateClient's apiPath must be a string");if(e.nocache!==void 0&&e.nocache!==null&&typeof e.nocache!="function")throw new TypeError("createGenerateClient's nocache must be a function");let{signer:o,transport:u,clock:l}=n,a=e.apiPath??"/api",i=()=>typeof e.baseUrl=="function"?e.baseUrl():e.baseUrl,S=y=>e.nocache?e.nocache(y):String(l.now());async function T(y,m,p,c,C){let R=`${i()}${a}${m}?nocache=${S(y)}`,w={"Content-Type":"text/plain","X-Signature":k(p,o)},v=c.signal??void 0,_=(g,L)=>{let s=!!v?.aborted;return{kind:"transport",headersReceived:g,timedOut:!s&&ur(L),cancelled:s,error:L}},x;try{x=await u.post(R,p,w,v?{timeoutMs:c.timeoutMs,signal:v}:{timeoutMs:c.timeoutMs})}catch(g){return _(!1,g)}if(x.status<200||x.status>299){let g="";if(c.readErrorBody===!1)cr(x);else try{g=(await x.text()).slice(0,ve)}catch{}return{kind:"http",status:x.status,statusText:x.statusText??"",bodyStart:g}}try{return{kind:"answer",status:x.status,value:await C(x)}}catch(g){return _(!0,g)}}function b(y,m){if(!m||typeof m.timeoutMs!="number"||!Number.isFinite(m.timeoutMs)||m.timeoutMs<=0)throw new TypeError(`The ${y} call needs a positive deadline in milliseconds`);return m}return{async generate(y,m){let p=b("generate",m),c=p.onStage??void 0;return T("generate",ir,O(y),p,C=>Q(C,c))},async qualify(y,m){let p=b("qualify",m),c=p.route??sr;if(typeof c!="string"||!c.startsWith("/"))throw new TypeError("The qualify route must start with '/'");return T("qualify",c,O(y),p,ie)},async review(y,m){let p=b("review",m),c=JSON.stringify(y);if(typeof c!="string")throw new TypeError("The review wire did not serialize to JSON");return T("review",ar,c,p,ie)},async sample(y,m){let p=b("sample",m);return T("sample",lr,O(y),p,ie)}}}export{j as CITY_ROLE_MATCH_PCT,tr as CLIENT_EVENT_KINDS,kn as CLIENT_SECRET_MISMATCH,Ue as COMPOUND_MIN_STEM,pe as DATE_LEVEL_GREGORIAN_YEAR_MAX,fe as DATE_LEVEL_GREGORIAN_YEAR_MIN,xn as DATE_LEVEL_LANGUAGES,re as DATE_LEVEL_NAMES,me as DATE_LEVEL_NON_GREGORIAN_LANGUAGES,jt as DEFAULT_GAP_FACTOR,Xe as DEFAULT_TEMPERATURE,Fn as FREEMIUM_ATTEMPT_SPENT,Gn as FREEMIUM_COLUMN_CAP,Ye as GET_RANDOM,qe as GLUED_STEM_MIN,Ke as HANGUL_MIN_STEM,ve as HTTP_BODY_START_CHARS,Mt as INTENSIVE_SUFFIX_TOKENS,Lt as INTENSIVE_WORD_TOKENS,cn as IndexedText,Ht as MAX_RUN_BOUNDS,At as POSITIONAL_SUFFIX_TOKENS,_t as POSITIONAL_WORD_TOKENS,gn as PREVIEW_OMITTED_FIELDS,Te as PROGRESS_STAGE_IDS,A as ROLE_MATCH_PCT,Xt as SERIES_COMPLETENESS_MAX_LISTED,Jt as SERIES_COMPLETENESS_MIN_FILL,Zt as SERIES_KEY_MAX_DISTINCT,Xn as SEV_ERROR,Yn as SEV_INFO,Jn as SEV_USER_PRESENTED,Qn as SEV_WARNING,B as SIMPLE_STRING_HASH,He as STR,Be as SUBSTRING_MIN,Le as SUPPORTED_LANGUAGES,Me as SUPPORTED_LANGUAGE_CODES,er as TELEMETRY_TIMEOUT_DEV_MS,Zn as TELEMETRY_TIMEOUT_MS,Oe as VOCABULARY_LANGUAGE_CODES,Ae as VOCABULARY_ONLY_LANGUAGES,z as admin1MatchPct,Ut as allowedAggregations,Vn as answerIsRetryable,Tt as buildGeoIsoColumn,pt as buildGeoPointColumns,zn as capabilityFields,gt as cityMatchPct,yt as cityTagsFor,ln as classifyAdditivity,Dt as classifyForAggregation,un as classifyNumericValueNature,sn as classifyTemporal,Ft as codeNeedsLegacyAggNames,Kt as codeReadsColumn,$t as codeReadsColumnsByRoleOrPosition,It as collapseRepeatedAggPrefix,Bt as columnsTheCodeReads,Rt as countryRegion,dr as createGenerateClient,rr as createTelemetryClient,Dn as credentialFields,vn as dateLevelPart,Pn as dateLevelYearAdmits,dn as decimalSeparatorOf,Wt as defaultAggregation,mn as detectDecimalSeparator,wt as detectFormatSignature,ht as detectGeo,st as detectOrdinalDomain,on as detectTextDatePattern,O as encodePayload,pn as engineTypeForSqlType,kt as englishImplicitAggNames,oe as eventLogLine,qn as fetchFields,or as fetchTransport,Ie as foldName,Ln as freemiumColumnCapRefusal,ye as freemiumColumnsOverCap,ge as freemiumDateHierarchyClauses,ze as gluedPrefixStems,Cn as gzipWireText,$e as hangulWordEndsWith,Nt as hasDefaultAggPrefix,Ve as hasUnsegmentedScript,an as hostAggHint,yn as ingest,qt as isAggregationAllowed,W as isBlankLike,lt as isCityTableLoaded,Qe as isDeterministicRefusal,nr as isEventLogCode,mt as isGeoPointAmbiguity,rn as isIdentifierName,bt as isJoinGeoKind,Tn as isNdjsonContentType,ot as isOrdinalFriendlyName,bn as keyedSigner,$n as leafCardinalityField,nt as localMidnightDateColumns,tt as localMidnightToUtcDay,I as looksLikeCountryColumn,je as matchNameToken,Wn as maxNonMeasureCardinality,Qt as measureCadence,nn as measureSeriesCompleteness,k as messageSignature,Pt as monthLookupFor,ke as nameLetterRuns,Vt as nameLooksIntensiveRate,Gt as nameLooksPositional,Fe as nameWords,ut as normalizeCountry,rt as normalizeLocalMidnightDates,vt as normalizeMonthKey,D as normalizePlaceName,dt as normalizeZip5,Bn as offeredShortlistFor,Je as parseDateStable,An as parseGenerateResponse,fn as parseNumberText,On as parseQualifyResponse,Nn as parseReviewVerdict,Yt as parseTemporalPoint,hn as payloadPreview,tn as pickSeriesColumn,In as progressStageOf,Q as readGenerateStream,Ge as readName,h as readWireField,at as registerCityTable,St as registerIso3Regions,M as resolveAdmin1,Ee as resolveFetchVersion,ft as resolveGeoPoint,Ne as resolveLanguage,Rn as resolvePointRoles,Kn as retryFields,it as safeDistinctValuesToShip,xe as schemaIdentity,Hn as schemaIdentityKey,Re as schemaTypeFamily,en as seriesKeyVerdict,zt as shareOfTotalIsHonest,Se as shortlistIsStale,Ot as stripHostAggPrefix,xt as summarizeCountryRegions,Et as summarizeGeoExtent,_e as supportedLanguage,Ct as toGeoIso,De as unsegmentedRuns,Un as viewportFields,$ as vocabularyLanguage,Ze as wholeDayFrame,et as wholeDayIso,Y as wireResponseFromFetch,We as wordEndsWith,te as zipMatchPct,q as zipPrefixCandidates,ct as zipToPrefix3};
|
|
2
|
+
import{a as Rn,b as xn}from"./chunk-UQU75XXR.mjs";import{a as wn,b as O,c as vn,d as k,e as h,f as Pn,g as Y,h as Q}from"./chunk-HMLAY26J.mjs";import{a as Cn,b as bn,c as Tn,d as En,e as Sn}from"./chunk-GHO5PJBZ.mjs";import{A as rn,B as on,C as sn,D as an,E as ln,F as un,G as cn,H as dn,I as mn,J as fn,K as pn,L as yn,M as gn,O as hn,a as Mt,b as Lt,c as _t,d as At,e as Ft,f as kt,g as Gt,h as Vt,i as Dt,j as Ut,k as Wt,l as qt,m as zt,n as $t,o as Kt,p as Bt,q as jt,r as Ht,s as Yt,t as Qt,u as Xt,v as Jt,w as Zt,x as en,y as tn,z as nn}from"./chunk-M7OKMBJS.mjs";import{a as Ot}from"./chunk-U3H6UBOO.mjs";import{a as Nt,b as It}from"./chunk-2LR73DNS.mjs";import{a as ae,b as le,c as xt,d as wt,e as vt,f as Pt}from"./chunk-VIWJJUDA.mjs";import{a as D,f as U,g as A,h as W,i as j,j as pt,k as yt,l as se,m as M,n as gt,o as ht,p as Ct,q,r as bt,s as Tt,t as Et,u as St,v as H,w as Rt}from"./chunk-TPVDJHU6.mjs";import"./chunk-5MRZID36.mjs";import{a as it,b as st,c as at,d as lt,e as ut,f as ct,g as dt,h as mt,i as ft}from"./chunk-WGT2OLMZ.mjs";import{A as Je,B as Ze,C as et,D as tt,E as nt,F as rt,G as ot,a as Le,b as _e,c as Ae,d as Oe,e as Ne,f as K,g as Ie,h as Fe,i as ke,j as Ge,k as Ve,l as De,m as Ue,n as We,o as qe,p as ze,q as $e,r as Ke,s as Be,t as je,u as He,v as Ye,x as B,y as Qe,z as Xe}from"./chunk-4VN252CK.mjs";var X=2,de=400;function Z(t){return!!U(t)}function F(t){let e=new Set;for(let n of t){if(n==null)continue;let o=D(String(n));if(!W(o)&&!e.has(o)&&(e.add(o),e.size>=de))break}return Array.from(e)}function I(t){let e=F(t);if(e.length===0||ee(t)<95)return!1;let n=e.filter(u=>Z(u)&&!M(u)).length,o=e.filter(u=>!Z(u)&&!!M(u)).length;return n>=1&&n>=o}function ue(t,e){if(!M(t))return!1;let n=U(t);return n?e==="world"?!0:se.has(n):!1}function ee(t){let e=F(t);if(e.length===0)return 0;let n=0;for(let o of e)Z(o)&&n++;return Math.round(n/e.length*1e3)/10}function z(t){let e=F(t);if(e.length===0)return 0;let n=0;for(let o of e)M(o)&&n++;return Math.round(n/e.length*1e3)/10}function ne(t){let e=new Set;for(let n of t){if(n==null)continue;let o=String(n).trim();if(!W(D(o))&&!e.has(o)&&(e.add(o),e.size>=de))break}return Array.from(e)}function te(t){let e=ne(t);if(e.length===0)return 0;let n=0;for(let o of e)q(o).length>0&&n++;return Math.round(n/e.length*1e3)/10}function ce(t,e){return le(e,ae)?!0:ne(t).some(n=>/^\d{5}(-\d{4})?$/.test(n.replace(/\.0+$/,"")))}function Mn(t,e){let n=F(t);if(n.length===0)return 0;let o=0;for(let u of n)H(u,e)&&o++;return Math.round(o/n.length*1e3)/10}function J(t,e){let n=0;for(let o of F(t))e(o)&&n++;return n}function Ln(t,e){let n=0;for(let o of ne(t))e(o)&&n++;return n}function _n(t,e,n,o,u){let l=[],a=[],s={},b={},T=new Set(t),C=i=>e.map(c=>c[i]);for(let i of["city","country"]){let c=n?.[i];c&&T.has(c)&&(s[i]=c)}let y=new Set(u??t);for(let i of["lat","lon"]){let c=n?.[i];c&&y.has(c)&&(s[i]=c)}let f=n?.zip;if(f&&T.has(f)){let i=C(f),c=te(i);c<95?a.push(`zip=${f} (only ${c}% of values read as ZIPs)`):ce(i,f)?s.zip=f:a.push(`zip=${f} (all values are 3-4 digits with nothing to say they are postal)`)}let d=n?.state;if(d&&T.has(d)){let i=C(d),c=F(i);c.length>0&&c.every(S=>ue(S,o))?a.push(`state=${d} (every value is "CA", which is both Canada and California)`):I(i)?(a.push(`state=${d} (every value is a country, not a state)`),s.country||(s.country=d)):z(i)<95?a.push(`state=${d} (only ${z(i)}% of values are states/provinces)`):s.state=d}let p=new Set(Object.values(s).filter(Boolean)),g=t.filter(i=>!p.has(i)&&!i.startsWith("__"));if(!s.state){let i=null;for(let c of g){let S=C(c);if(I(S))continue;let P=z(S);if(P<95)continue;let $=J(S,V=>!!M(V)),Me=J(S,V=>!!M(V)&&!ue(V,o));$<X&&Me<1||(!i||P>i.pct)&&(i={name:c,pct:P})}i&&(s.state=i.name,p.add(i.name),l.push(`state=${i.name} (${i.pct}% states/provinces)`))}if(!s.zip)for(let i of g){if(p.has(i))continue;let c=C(i),S=te(c);if(!(S<95)&&ce(c,i)&&!(Ln(c,P=>q(P).length>0)<X)){s.zip=i,p.add(i),l.push(`zip=${i} (${S}% ZIP codes)`);break}}let E=s.country;if(!E||!I(C(E))){let i=null;for(let c of g){if(p.has(c)||!I(C(c)))continue;let S=ee(C(c));(!i||S>i.pct)&&(i={name:c,pct:S})}i&&(E&&(a.push(`country=${E} (only ${ee(C(E))}% of values are country identifiers; using ${i.name} instead)`),b.country=E),s.country=i.name,p.add(i.name),l.push(`country=${i.name}`))}if(!s.city){let i=null;for(let c of g){if(p.has(c))continue;let S=C(c),P=Mn(S,o);P<j||J(S,$=>H($,o))<X||(!i||P>i.pct)&&(i={name:c,pct:P})}i&&(s.city=i.name,l.push(`city=${i.name} (${i.pct}% known cities)`))}let L=s.country?C(s.country):[],R=!!s.country&&I(L),_=R?new Set(L.map(i=>U(i==null?null:String(i))).filter(Boolean)).size:0,x=R&&_>=2,w=!!(s.lat&&s.lon)&&e.some(i=>{let c=+String(i[s.lat]??"").trim(),S=+String(i[s.lon]??"").trim();return isFinite(c)&&isFinite(S)&&c>=-90&&c<=90&&S>=-180&&S<=180&&String(i[s.lat]??"").trim()!==""&&String(i[s.lon]??"").trim()!==""});return s.lat&&s.lon&&!w&&a.push(`lat/lon=${s.lat}/${s.lon} (no row holds a usable coordinate pair)`),s.country&&!x&&!(s.city||s.state||s.zip||w)&&a.push(R?`country=${s.country} (every row resolves to the same country - nothing to place apart)`:`country=${s.country} (values are not country identifiers)`),{bind:!!(s.city||s.state||s.zip||x||w)?s:null,backfilled:l,refused:a,...Object.keys(b).length?{labelFallback:b}:{}}}var r=(t,...e)=>({part:t,langs:Object.freeze(e)}),re=Object.freeze({jaar:r("year","nl"),kwartaal:r("quarter","nl"),maand:r("month","nl"),dag:r("day","nl","sv","da","nb"),jahr:r("year","de"),quartal:r("quarter","de"),monat:r("month","de"),tag:r("day","de"),ann\u00E9e:r("year","fr"),mois:r("month","fr"),jour:r("day","fr"),trimestre:r("quarter","fr","es","pt","it"),a\u00F1o:r("year","es"),mes:r("month","es"),d\u00EDa:r("day","es"),ano:r("year","pt"),m\u00EAs:r("month","pt"),dia:r("day","pt"),anno:r("year","it"),mese:r("month","it"),giorno:r("day","it"),\u0433\u043E\u0434:r("year","ru"),\u043C\u0435\u0441\u044F\u0446:r("month","ru"),\u0440\u0456\u043A:r("year","uk"),\u043C\u0456\u0441\u044F\u0446\u044C:r("month","uk"),\u043A\u0432\u0430\u0440\u0442\u0430\u043B:r("quarter","ru","uk"),\u0434\u0435\u043D\u044C:r("day","ru","uk"),rok:r("year","pl","cs","sk"),kwarta\u0142:r("quarter","pl"),miesi\u0105c:r("month","pl"),dzie\u0144:r("day","pl"),\u010Dtvrtlet\u00ED:r("quarter","cs"),m\u011Bs\u00EDc:r("month","cs"),den:r("day","cs"),\u0161tvr\u0165rok:r("quarter","sk"),mesiac:r("month","sk"),de\u0148:r("day","sk"),\u00E5r:r("year","sv","da","nb"),kvartal:r("quarter","sv","da","nb"),m\u00E5nad:r("month","sv"),m\u00E5ned:r("month","da","nb"),vuosi:r("year","fi"),vuosinelj\u00E4nnes:r("quarter","fi"),kuukausi:r("month","fi"),p\u00E4iv\u00E4:r("day","fi"),\u00E9v:r("year","hu"),negyed\u00E9v:r("quarter","hu"),h\u00F3nap:r("month","hu"),nap:r("day","hu"),y\u0131l:r("year","tr"),\u00E7eyrek:r("quarter","tr"),ay:r("month","tr"),g\u00FCn:r("day","tr"),\u03AD\u03C4\u03BF\u03C2:r("year","el"),\u03C4\u03C1\u03AF\u03BC\u03B7\u03BD\u03BF:r("quarter","el"),\u03BC\u03AE\u03BD\u03B1\u03C2:r("month","el"),\u03B7\u03BC\u03AD\u03C1\u03B1:r("day","el"),an:r("year","ro"),trimestru:r("quarter","ro"),lun\u0103:r("month","ro"),zi:r("day","ro"),godina:r("year","hr"),tromjese\u010Dje:r("quarter","hr"),mjesec:r("month","hr"),dan:r("day","hr"),\u5E74:r("year","ja","zh"),\u56DB\u534A\u671F:r("quarter","ja"),\u5B63\u5EA6:r("quarter","zh"),\u6708:r("month","ja","zh"),\u65E5:r("day","ja","zh"),\uC5F0\uB3C4:r("year","ko"),\uBD84\uAE30:r("quarter","ko"),\uC6D4:r("month","ko"),\uC77C:r("day","ko"),tahun:r("year","id"),kuartal:r("quarter","id"),triwulan:r("quarter","id"),bulan:r("month","id"),hari:r("day","id"),n\u0103m:r("year","vi"),qu\u00FD:r("quarter","vi"),th\u00E1ng:r("month","vi"),ng\u00E0y:r("day","vi"),\u0E1B\u0E35:r("year","th"),\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A:r("quarter","th"),\u0E40\u0E14\u0E37\u0E2D\u0E19:r("month","th"),\u0E27\u0E31\u0E19:r("day","th"),\u0627\u0644\u0633\u0646\u0629:r("year","ar"),\u0633\u0646\u0629:r("year","ar"),\u0627\u0644\u0639\u0627\u0645:r("year","ar"),\u0639\u0627\u0645:r("year","ar"),\u0627\u0644\u0631\u0628\u0639:r("quarter","ar"),\u0631\u0628\u0639:r("quarter","ar"),"\u0631\u0628\u0639 \u0627\u0644\u0633\u0646\u0629":r("quarter","ar"),\u0627\u0644\u0634\u0647\u0631:r("month","ar"),\u0634\u0647\u0631:r("month","ar"),\u0627\u0644\u064A\u0648\u0645:r("day","ar"),\u064A\u0648\u0645:r("day","ar"),\u05E9\u05E0\u05D4:r("year","he"),\u05E8\u05D1\u05E2\u05D5\u05DF:r("quarter","he"),\u05D7\u05D5\u05D3\u05E9:r("month","he"),\u05D9\u05D5\u05DD:r("day","he"),\u0935\u0930\u094D\u0937:r("year","hi"),\u0938\u093E\u0932:r("year","hi"),\u0924\u093F\u092E\u093E\u0939\u0940:r("quarter","hi"),\u092E\u0939\u0940\u0928\u093E:r("month","hi"),\u092E\u093E\u0939:r("month","hi"),\u0926\u093F\u0928:r("day","hi"),\u0633\u0627\u0644:r("year","fa"),\u0645\u0627\u0647:r("month","fa"),\u0631\u0648\u0632:r("day","fa")}),An=Object.freeze(Array.from(new Set(Object.values(re).flatMap(t=>t.langs)))),me=Object.freeze(["fa","ar","he","th"]),fe=1900,pe=2100;function On(t,e){let n=[],o=K(e);try{o&&n.push(t.toLocaleLowerCase(o.intl))}catch{}let u=t.toLowerCase();return n.includes(u)||n.push(u),n}function Nn(t,e){let n=String(t??"").trim().normalize("NFC");if(!n)return null;for(let o of On(n,e)){let u=re[o];if(u&&u.langs.includes(e))return u.part}return null}function In(t,e){return me.includes(t)?typeof e=="number"&&Number.isFinite(e)&&e>=fe&&e<=pe:!0}function ye(t,e){let n=e?.freemiumMaxShapeColumns;return typeof n!="number"||!isFinite(n)||n<1?null:!isFinite(t)||t<=n?0:Math.round(t-n)}function Fn(t,e,n){let o=ye(t,e);if(o===null||o<=0)return null;let u=typeof e?.freemiumColumnCapPivot=="number"?e.freemiumColumnCapPivot:4,l=o>u?e?.freemiumColumnCapMessageMany:e?.freemiumColumnCapMessageFew;if(typeof l!="string"||l.trim().length===0)return null;let a=l.split("{n}").join(String(o)).split("{fields}").join(o===1?"field":"fields"),s=ge(n);return s.length===0?a:a+" "+s.join(" ")}function ge(t){if(!t||t.length===0)return[];let e=[],n=new Map,o=new Map;for(let l of t){let a=typeof l?.dateGroupId=="string"?l.dateGroupId.trim():"";if(a!==""&&(n.has(a)||(e.push(a),n.set(a,0)),l.isDatePart===!0&&n.set(a,n.get(a)+1),l.isReassembledDate===!0&&!o.has(a))){let s=typeof l.sourceField=="string"?l.sourceField.trim():"",b=typeof l.name=="string"?l.name.trim():"",T=s!==""?s:b;T!==""&&o.set(a,T)}}let u=[];for(let l of e){let a=o.get(l),s=n.get(l)??0;!a||s===0||u.push(`'${a}' is a date hierarchy and counts as ${s+1} fields - bind the date itself instead of its hierarchy.`)}return u}var m=t=>t==null?"":String(t),N=t=>t===!0,he=t=>{if(typeof t=="number")return Number.isFinite(t)?t:null;if(typeof t=="string"&&t.trim()!==""){let e=Number(t);return Number.isFinite(e)?e:null}return null},kn=[["city","CityColumn"],["state","StateColumn"],["zip","ZipColumn"],["lat","LatColumn"],["lon","LonColumn"],["country","CountryColumn"]];function Ce(t,e){let n={};for(let[o,u]of kn){let l=m(h(t,e+u));l&&(n[o]=l)}return n}function Gn(t){return Array.isArray(t)?t.map(e=>({code:m(h(e,"code")),severity:m(h(e,"severity")),text:m(h(e,"text"))})).filter(e=>e.text!==""):[]}function Vn(t){let e=b=>h(t,b),n=e("retryAfterSeconds"),o=e("overrideThumbnailUpload"),u=e("forceThumbnailUpload"),l=Ce(t,"point"),a=Ce(t,"destPoint");Object.keys(a).length&&(l.dest=a);let s=e("retryable");return{errorMessage:m(e("errorMessage")),errorCode:m(e("errorCode")),refusalCode:m(e("refusalCode")),retryable:typeof s=="boolean"?s:null,notices:Gn(e("notices")),freemiumStatusCode:m(e("freemiumStatusCode")),code:m(e("code")),language:m(e("language")),version:Number(e("version")??0),codeSummary:m(e("codeSummary")),chartName:m(e("chartName")??e("chartType")),finalChartName:m(e("finalChartName")),warningMessage:m(e("warningMessage")),outputHash:m(e("outputHash")),validatorToken:m(e("validatorToken")),editCodeKey:m(e("editCodeKey")),signedLLMRequestID:m(e("signedLLMRequestID")),userReply:m(e("userReply")),userReplyOutcome:m(e("userReplyOutcome")),improvementSuggestion:m(e("improvementSuggestion")),geoColumn:m(e("geoColumn")),geoKind:m(e("geoKind")),geoPointCols:Object.keys(l).length?l:null,creditBalanceBefore:he(e("creditBalanceBefore")),creditCost:he(e("creditCost")),isServiceError:N(e("isServiceError")),isRateLimited:N(e("isRateLimited")),isRefusal:N(e("isRefusal")),isVersionNotFound:N(e("isVersionNotFound")),isGenerationCancelled:N(e("isGenerationCancelled")),retryAfterSeconds:typeof n=="number"&&Number.isFinite(n)?n:null,servedCorrelationId:m(e("servedCorrelationId")),...typeof o=="boolean"?{overrideThumbnailUpload:o}:{},...typeof u=="boolean"?{forceThumbnailUpload:u}:{}}}var be=t=>t==null?void 0:Number(t),G=t=>m(t)||void 0;function Dn(t){let e=h(t,"charts"),n=h(t,"refused"),o=Array.isArray(e)?e.map(l=>{let a=b=>h(l,b),s=a("recommended");return{name:m(a("chartTypeName")??a("name")),description:m(a("description")??a("chartDesc")),rank:be(a("rank")),score:be(a("score")),renderer:G(a("renderer")),language:G(a("language")),isPreview:N(a("isPreview")),recommended:typeof s=="boolean"?s:void 0,viaProjection:G(a("viaProjection")),viaProjectionKey:G(a("viaProjectionKey")),detailNote:G(a("detailNote"))}}).filter(l=>l.name):null,u=Array.isArray(n)?n.map(l=>({name:m(h(l,"chartTypeName")??h(l,"name")),reason:m(h(l,"reason")),reasonCode:m(h(l,"reasonCode")),isVeto:N(h(l,"isVeto"))})).filter(l=>l.name):[];return{errorMessage:m(h(t,"errorMessage")),errorCode:m(h(t,"errorCode")),charts:o,refused:u,noFitSummary:m(h(t,"noFitSummary"))}}function Un(t){return!t||typeof t!="object"?null:{status:String(h(t,"status")??""),verdictReason:h(t,"verdictReason")??null,instruction:h(t,"instruction")??null,fix:h(t,"fix")??null,errorMessage:h(t,"errorMessage")??null,errorCode:h(t,"errorCode")??null}}var Te=["working","analyze","generate","refine","review"];function Wn(t,e){let n=String(t??"").trim().toLowerCase();if(Te.includes(n))return n;let o=String(e??"").toLowerCase();return o.includes("analyz")?"analyze":o.includes("generat")?"generate":o.includes("refin")?"refine":o.includes("review")?"review":null}var qn="FREEMIUM_ATTEMPT_SPENT",zn="CLIENT_SECRET_MISMATCH",$n="FREEMIUM_COLUMN_CAP";function Kn(t){let e=t?.retryable;return typeof e=="boolean"?e:null}function Bn(t){let e=t.linkNonce?(t.linkNonce()??"").trim():null,n=e?{licensee:"",licenseKey:"",secretKey:""}:t.triple();return{request:{licenseKey:n.licenseKey,licensee:n.licensee,secretKey:n.secretKey,freemiumKey:t.freemiumKey?.()??""},linkNonce:e}}function jn(t){let{width:e,height:n}=t.measure();return{request:{height:n,width:e},hints:{viewportWidth:e,viewportHeight:n}}}function Hn(t){let e=0;for(let n of t){if(n.isMeasure)continue;let o=n.distinctCount;typeof o=="number"&&o>e&&(e=o)}return e}function Ee(t){if(t.recoveryFetchByCorrelation)return{version:null,fetchOnly:!0};if(t.recoveryFetchVersion!=null)return{version:t.recoveryFetchVersion,fetchOnly:!0};let e=t.settingVersion??null;if(t.genNew)return{version:e,fetchOnly:void 0};let n=(e??0)>0?e:null,o=(t.codeVersion??0)>0?t.codeVersion:null,u=n??o??e;return{version:u,fetchOnly:u!=null&&u>0?!0:void 0}}function Yn(t){let e=t.fetchCorrelationId!=null,o=e||t.recoveryFetchVersion!=null?!1:t.genNew,u=Ee({genNew:o,recoveryFetchVersion:t.recoveryFetchVersion,recoveryFetchByCorrelation:e,settingVersion:t.settingVersion,codeVersion:t.codeVersion});return{genNew:o,version:u.version,fetchOnly:u.fetchOnly,fetchCorrelationId:t.fetchCorrelationId??void 0}}function Qn(t){let e=n=>t.renderers.has(n);return{supportsD3:e("D3"),supportsPlotly:e("PLOTLY"),supportsVega:e("VEGA")}}function Xn(t){let e=t.cap!=null&&t.budget>t.cap?t.cap:t.budget;return{triesLeft:t.triesLeft??e,maxTries:e}}function Jn(t){return t&&t>0?{leafCardinality:Math.round(t)}:{}}function Se(t,e){return t!=null&&e!=null&&t!==e}function Zn(t,e){return t?Se(e.capturedFor,e.now)?{shortlist:void 0,stale:!0}:{shortlist:{...t,ageMs:e.atMs>0?Math.max(0,Math.round(e.nowMs-e.atMs)):void 0},stale:!1}:{shortlist:void 0,stale:!1}}var er=Object.freeze({integer:"number",decimal:"number",double:"number",datetime:"date",date:"date",boolean:"boolean",string:"text"});function Re(t){let e=String(t??"").trim().toLowerCase();return er[e]??e}function xe(t){let e="";for(let n of t)e+=JSON.stringify([String(n.name??""),n.isMeasure?"M":"D",Re(n.dataType)]);return e}function tr(t){return B(xe(t))}var nr=2,rr=3,or=4,ir=64,sr=8e3,ar=6e4,lr=Object.freeze({RENDER_START:"render-start",RENDER_OK:"render-ok",RENDER_ERROR:"render-error",VIEW:"view",VIEW_VERDICT:"view-verdict"});function ur(t){return!!t&&!t.includes("|")&&!t.includes(",")}function oe(t,e,n,o){let u=`${t},${e}|${n}`;return o?`${u}|${Math.max(0,Math.round(o.count))}|${o.nonce}`:u}function cr(t,e){let n=t;if(!n||!n.signer||typeof n.signer.sign!="function")throw new TypeError("createTelemetryClient needs the host's signer");if(!n.transport||typeof n.transport.post!="function")throw new TypeError("createTelemetryClient needs the host's transport");if(!n.clock||typeof n.clock.now!="function")throw new TypeError("createTelemetryClient needs the host's clock");if(!e||typeof e.baseUrl!="string"&&typeof e.baseUrl!="function")throw new TypeError("createTelemetryClient needs the service's base URL");if(typeof e.baseUrl=="string"&&e.baseUrl==="")throw new TypeError("createTelemetryClient needs the service's base URL");if(typeof e.clientVersion!="string"||e.clientVersion==="")throw new TypeError("createTelemetryClient needs the client version");if(typeof e.timeoutMs!="number"||!Number.isFinite(e.timeoutMs)||e.timeoutMs<=0)throw new TypeError("createTelemetryClient needs a positive deadline in milliseconds");let{signer:o,transport:u,clock:l}=n,a=e.apiPath??"/api",s=e.timeoutMs,b=()=>typeof e.baseUrl=="function"?e.baseUrl():e.baseUrl,T=y=>{try{e.onFailure?.(y)}catch{}},C=async(y,f,d,p)=>{let g;try{let E=await u.post(f,d,p,{timeoutMs:s});g=E.status;try{E.body?.cancel().catch(()=>{})}catch{}}catch(E){T({channel:y,stage:"post",status:null,error:E});return}(g<200||g>299)&&T({channel:y,stage:"status",status:g,error:null})};return{async sendClientMessage(y){let f,d,p;try{f=`${b()}${a}/LogClientMsg/?nocache=${l.now()}`,d=O(y),p=k(d,o)}catch(g){T({channel:"client-message",stage:"build",status:null,error:g});return}await C("client-message",f,d,{"Content-Type":"text/plain","X-Signature":p})},async countEvent(y,f,d){let p,g;try{p=`${b()}${a}/eventlog`,g=oe(y,e.clientVersion,f,d)}catch(E){T({channel:"event-count",stage:"build",status:null,error:E});return}await C("event-count",p,g,{"Content-Type":"text/plain"})}}}var we=2**31-1;function ve(t){return Object.assign(new Error(`The request did not finish within ${t} ms.`),{name:"TimeoutError"})}function dr(t){return typeof t=="number"&&t>0&&t<=we?null:new RangeError(`fetchTransport cannot keep a deadline of ${String(t)} ms: it must be a number of milliseconds above 0 and at most ${we} (about 24.8 days), the longest a timer can wait. Nothing was sent.`)}function mr(t,e={}){if(typeof t!="function")throw new TypeError("fetchTransport needs the host's fetch");let n=t,o=e.credentials??"omit";return{async post(u,l,a,s){let b=s.timeoutMs,T=dr(b);if(T)throw T;let C=new AbortController,y=!1,f=setTimeout(()=>{y=!0,C.abort(ve(b))},b),d=()=>C.abort(s.signal?.reason);s.signal&&(s.signal.aborted?d():s.signal.addEventListener("abort",d,{once:!0}));let p=!1,g=()=>{p||(p=!0,clearTimeout(f),s.signal?.removeEventListener("abort",d))},E=v=>y?ve(b):v,L;try{L=await n(u,{method:"POST",body:l,headers:a,credentials:o,signal:C.signal})}catch(v){throw g(),E(v)}let R=Y(L),_=R.statusText!==void 0?{statusText:R.statusText}:{};if(!R.body)return{status:R.status,..._,contentType:R.contentType,body:null,text:async()=>{try{return await R.text()}catch(v){throw E(v)}finally{g()}}};let x=R.body.getReader(),w=new ReadableStream({async pull(v){try{let i=await x.read();if(i.done){g(),v.close();return}v.enqueue(i.value)}catch(i){g(),v.error(E(i))}},cancel(v){return g(),x.cancel(v)}});return{status:R.status,..._,contentType:R.contentType,body:w,text:()=>new Response(w).text()}}}}var Pe=300,fr="/LLMChart/",pr="/LLMChart/qualify",yr="/VisionReview/",gr="/LLMChart/sample",hr=t=>!!t&&typeof t=="object"&&t.name==="TimeoutError",ie=async t=>JSON.parse(await t.text());function Cr(t){try{t.body?t.body.cancel().catch(()=>{}):t.text().catch(()=>{})}catch{}}function br(t,e){let n=t;if(!n||!n.signer||typeof n.signer.sign!="function")throw new TypeError("createGenerateClient needs the host's signer");if(!n.transport||typeof n.transport.post!="function")throw new TypeError("createGenerateClient needs the host's transport");if(!n.clock||typeof n.clock.now!="function")throw new TypeError("createGenerateClient needs the host's clock");if(!e||typeof e.baseUrl!="string"&&typeof e.baseUrl!="function")throw new TypeError("createGenerateClient needs the service's base URL");if(typeof e.baseUrl=="string"&&e.baseUrl==="")throw new TypeError("createGenerateClient needs the service's base URL");if(e.apiPath!==void 0&&typeof e.apiPath!="string")throw new TypeError("createGenerateClient's apiPath must be a string");if(e.nocache!==void 0&&e.nocache!==null&&typeof e.nocache!="function")throw new TypeError("createGenerateClient's nocache must be a function");let{signer:o,transport:u,clock:l}=n,a=e.apiPath??"/api",s=()=>typeof e.baseUrl=="function"?e.baseUrl():e.baseUrl,b=y=>e.nocache?e.nocache(y):String(l.now());async function T(y,f,d,p,g){let E=`${s()}${a}${f}?nocache=${b(y)}`,L={"Content-Type":"text/plain","X-Signature":k(d,o)},R=p.signal??void 0,_=(w,v)=>{let i=!!R?.aborted;return{kind:"transport",headersReceived:w,timedOut:!i&&hr(v),cancelled:i,error:v}},x;try{x=await u.post(E,d,L,R?{timeoutMs:p.timeoutMs,signal:R}:{timeoutMs:p.timeoutMs})}catch(w){return _(!1,w)}if(x.status<200||x.status>299){let w="";if(p.readErrorBody===!1)Cr(x);else try{w=(await x.text()).slice(0,Pe)}catch{}return{kind:"http",status:x.status,statusText:x.statusText??"",bodyStart:w}}try{return{kind:"answer",status:x.status,value:await g(x)}}catch(w){return _(!0,w)}}function C(y,f){if(!f||typeof f.timeoutMs!="number"||!Number.isFinite(f.timeoutMs)||f.timeoutMs<=0)throw new TypeError(`The ${y} call needs a positive deadline in milliseconds`);return f}return{async generate(y,f){let d=C("generate",f),p=d.onStage??void 0;return T("generate",fr,O(y),d,g=>Q(g,p))},async qualify(y,f){let d=C("qualify",f),p=d.route??pr;if(typeof p!="string"||!p.startsWith("/"))throw new TypeError("The qualify route must start with '/'");return T("qualify",p,O(y),d,ie)},async review(y,f){let d=C("review",f),p=JSON.stringify(y);if(typeof p!="string")throw new TypeError("The review wire did not serialize to JSON");return T("review",yr,p,d,ie)},async sample(y,f){let d=C("sample",f);return T("sample",gr,O(y),d,ie)}}}export{j as CITY_ROLE_MATCH_PCT,lr as CLIENT_EVENT_KINDS,zn as CLIENT_SECRET_MISMATCH,We as COMPOUND_MIN_STEM,it as CYCLE_MEMBERS,at as CYCLE_WORDS,pe as DATE_LEVEL_GREGORIAN_YEAR_MAX,fe as DATE_LEVEL_GREGORIAN_YEAR_MIN,An as DATE_LEVEL_LANGUAGES,re as DATE_LEVEL_NAMES,me as DATE_LEVEL_NON_GREGORIAN_LANGUAGES,en as DEFAULT_GAP_FACTOR,Je as DEFAULT_TEMPERATURE,qn as FREEMIUM_ATTEMPT_SPENT,$n as FREEMIUM_COLUMN_CAP,Qe as GET_RANDOM,ze as GLUED_STEM_MIN,Ke as HANGUL_MIN_STEM,Pe as HTTP_BODY_START_CHARS,kt as INTENSIVE_SUFFIX_TOKENS,Ft as INTENSIVE_WORD_TOKENS,hn as IndexedText,tn as MAX_RUN_BOUNDS,Vt as POSITIONAL_SUFFIX_TOKENS,Gt as POSITIONAL_WORD_TOKENS,Rn as PREVIEW_OMITTED_FIELDS,Te as PROGRESS_STAGE_IDS,A as ROLE_MATCH_PCT,on as SERIES_COMPLETENESS_MAX_LISTED,sn as SERIES_COMPLETENESS_MIN_FILL,an as SERIES_KEY_MAX_DISTINCT,or as SEV_ERROR,nr as SEV_INFO,ir as SEV_USER_PRESENTED,rr as SEV_WARNING,B as SIMPLE_STRING_HASH,Ye as STR,je as SUBSTRING_MIN,Le as SUPPORTED_LANGUAGES,_e as SUPPORTED_LANGUAGE_CODES,ar as TELEMETRY_TIMEOUT_DEV_MS,sr as TELEMETRY_TIMEOUT_MS,Ne as VOCABULARY_LANGUAGE_CODES,Oe as VOCABULARY_ONLY_LANGUAGES,st as YEAR_WORDS,z as admin1MatchPct,jt as allowedAggregations,Kn as answerIsRetryable,Pt as buildGeoIsoColumn,Et as buildGeoPointColumns,lt as calendarWordIn,Qn as capabilityFields,Rt as cityMatchPct,St as cityTagsFor,yn as classifyAdditivity,Bt as classifyForAggregation,gn as classifyNumericValueNature,fn as classifyTemporal,qt as codeNeedsLegacyAggNames,Xt as codeReadsColumn,Jt as codeReadsColumnsByRoleOrPosition,Wt as collapseRepeatedAggPrefix,Zt as columnsTheCodeReads,_t as countryRegion,br as createGenerateClient,cr as createTelemetryClient,Bn as credentialFields,Nn as dateLevelPart,In as dateLevelYearAdmits,Cn as decimalSeparatorOf,Ht as defaultAggregation,bn as detectDecimalSeparator,Ot as detectFormatSignature,xt as detectGeo,ft as detectOrdinalDomain,mn as detectTextDatePattern,O as encodePayload,En as engineTypeForSqlType,zt as englishImplicitAggNames,oe as eventLogLine,Yn as fetchFields,mr as fetchTransport,Fe as foldName,Fn as freemiumColumnCapRefusal,ye as freemiumColumnsOverCap,ge as freemiumDateHierarchyClauses,$e as gluedPrefixStems,wn as gzipWireText,Be as hangulWordEndsWith,Ut as hasDefaultAggPrefix,De as hasUnsegmentedScript,pn as hostAggHint,Sn as ingest,Yt as isAggregationAllowed,W as isBlankLike,yt as isCityTableLoaded,Xe as isDeterministicRefusal,ur as isEventLogCode,bt as isGeoPointAmbiguity,dn as isIdentifierName,vt as isJoinGeoKind,Pn as isNdjsonContentType,dt as isOrdinalFriendlyName,vn as keyedSigner,Jn as leafCardinalityField,rt as localMidnightDateColumns,nt as localMidnightToUtcDay,ct as localizedCycleIn,ut as localizedYearWordIn,I as looksLikeCountryColumn,He as matchNameToken,Hn as maxNonMeasureCardinality,rn as measureCadence,cn as measureSeriesCompleteness,k as messageSignature,It as monthLookupFor,Ge as nameLetterRuns,Kt as nameLooksIntensiveRate,$t as nameLooksPositional,ke as nameWords,gt as normalizeCountry,ot as normalizeLocalMidnightDates,Nt as normalizeMonthKey,D as normalizePlaceName,Ct as normalizeZip5,Zn as offeredShortlistFor,Ze as parseDateStable,Vn as parseGenerateResponse,Tn as parseNumberText,Dn as parseQualifyResponse,Un as parseReviewVerdict,nn as parseTemporalPoint,xn as payloadPreview,un as pickSeriesColumn,Wn as progressStageOf,Q as readGenerateStream,Ve as readName,h as readWireField,pt as registerCityTable,Lt as registerIso3Regions,M as resolveAdmin1,Ee as resolveFetchVersion,Tt as resolveGeoPoint,Ie as resolveLanguage,_n as resolvePointRoles,Xn as retryFields,mt as safeDistinctValuesToShip,xe as schemaIdentity,tr as schemaIdentityKey,Re as schemaTypeFamily,ln as seriesKeyVerdict,Qt as shareOfTotalIsHonest,Se as shortlistIsStale,Dt as stripHostAggPrefix,At as summarizeCountryRegions,Mt as summarizeGeoExtent,Ae as supportedLanguage,wt as toGeoIso,Ue as unsegmentedRuns,jn as viewportFields,K as vocabularyLanguage,et as wholeDayFrame,tt as wholeDayIso,Y as wireResponseFromFetch,qe as wordEndsWith,te as zipMatchPct,q as zipPrefixCandidates,ht as zipToPrefix3};
|
package/dist/indexedText.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
|
-
import{H as a,I as b,J as c,K as d,L as e,M as f,N as g,O as h}from"./chunk-
|
|
2
|
+
import{H as a,I as b,J as c,K as d,L as e,M as f,N as g,O as h}from"./chunk-M7OKMBJS.mjs";import"./chunk-U3H6UBOO.mjs";import"./chunk-2LR73DNS.mjs";import"./chunk-VIWJJUDA.mjs";import"./chunk-TPVDJHU6.mjs";import"./chunk-5MRZID36.mjs";import"./chunk-WGT2OLMZ.mjs";import"./chunk-4VN252CK.mjs";export{h as IndexedText,e as classifyAdditivity,f as classifyNumericValueNature,c as classifyTemporal,b as detectTextDatePattern,d as hostAggHint,a as isIdentifierName,g as trimmedCells};
|
package/dist/ingest.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
|
-
import{d as a,e as b}from"./chunk-
|
|
2
|
+
import{d as a,e as b}from"./chunk-GHO5PJBZ.mjs";import"./chunk-M7OKMBJS.mjs";import"./chunk-U3H6UBOO.mjs";import"./chunk-2LR73DNS.mjs";import"./chunk-VIWJJUDA.mjs";import"./chunk-TPVDJHU6.mjs";import"./chunk-5MRZID36.mjs";import"./chunk-WGT2OLMZ.mjs";import"./chunk-4VN252CK.mjs";export{a as engineTypeForSqlType,b as ingest};
|
package/dist/ordinalDetector.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
|
-
import{a,b,c}from"./chunk-
|
|
2
|
+
import{g as a,h as b,i as c}from"./chunk-WGT2OLMZ.mjs";import"./chunk-4VN252CK.mjs";export{c as detectOrdinalDomain,a as isOrdinalFriendlyName,b as safeDistinctValuesToShip};
|
|
@@ -15,6 +15,7 @@ export interface FetchTransportOptions {
|
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* A WireTransport over `fetchFn`. Every request is a POST; each call's `timeoutMs` covers the headers
|
|
18
|
-
* and the body; the caller's `signal`, when given, cancels as well.
|
|
18
|
+
* and the body; the caller's `signal`, when given, cancels as well. A `timeoutMs` that is not above 0
|
|
19
|
+
* and at most 2^31-1 rejects with a RangeError, and the fetch is never called.
|
|
19
20
|
*/
|
|
20
21
|
export declare function fetchTransport(fetchFn: FetchFunction, options?: FetchTransportOptions): WireTransport;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -29,6 +29,8 @@ export { SUPPORTED_LANGUAGES, SUPPORTED_LANGUAGE_CODES, supportedLanguage, resol
|
|
|
29
29
|
export type { SupportedLanguage, SupportedLanguageCode, LanguageScript, ResolvedLanguage, VocabularyLanguage, VocabularyLanguageCode, VocabularyOnlyLanguageCode, } from "./languages";
|
|
30
30
|
export { DATE_LEVEL_NAMES, DATE_LEVEL_LANGUAGES, DATE_LEVEL_NON_GREGORIAN_LANGUAGES, DATE_LEVEL_GREGORIAN_YEAR_MIN, DATE_LEVEL_GREGORIAN_YEAR_MAX, dateLevelPart, dateLevelYearAdmits, } from "./vocab/dateLevels";
|
|
31
31
|
export type { DateLevelPart, DateLevelEntry } from "./vocab/dateLevels";
|
|
32
|
+
export { YEAR_WORDS, CYCLE_WORDS, CYCLE_MEMBERS, calendarWordIn, localizedYearWordIn, localizedCycleIn, } from "./vocab/calendarWords";
|
|
33
|
+
export type { CycleConcept, CalendarWordHit } from "./vocab/calendarWords";
|
|
32
34
|
export { foldName, readName, matchNameToken, wordEndsWith, gluedPrefixStems, unsegmentedRuns, hasUnsegmentedScript, hangulWordEndsWith, nameLetterRuns, COMPOUND_MIN_STEM, GLUED_STEM_MIN, SUBSTRING_MIN, HANGUL_MIN_STEM, } from "./nameReader";
|
|
33
35
|
export type { NameReading, NameTokenView } from "./nameReader";
|
|
34
36
|
export { detectDecimalSeparator, decimalSeparatorOf, parseNumberText } from "./numberText";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type NameTokenView } from "../nameReader";
|
|
2
|
+
import { type VocabularyLanguageCode } from "../languages";
|
|
3
|
+
/** The cycles a calendar name can name, each with its natural number of members. */
|
|
4
|
+
export type CycleConcept = "hour" | "weekday" | "month" | "quarter" | "week" | "season";
|
|
5
|
+
/** Members of each cycle - the ceiling a cyclical axis of that kind cannot exceed. */
|
|
6
|
+
export declare const CYCLE_MEMBERS: Readonly<Record<CycleConcept, number>>;
|
|
7
|
+
type Vocab = Partial<Record<VocabularyLanguageCode, readonly string[]>>;
|
|
8
|
+
export declare const YEAR_WORDS: Vocab;
|
|
9
|
+
export declare const CYCLE_WORDS: Readonly<Record<CycleConcept, Vocab>>;
|
|
10
|
+
/** Words matched as written, never folded: the fold of `år` and `év` is an English abbreviation
|
|
11
|
+
* (AR, EV), of `hét` the Dutch "the", and `óra` without its accent ends `Aurora` and `Pandora`. */
|
|
12
|
+
export declare const UNFOLDED: readonly string[];
|
|
13
|
+
/** Where a calendar word was found. */
|
|
14
|
+
export interface CalendarWordHit {
|
|
15
|
+
lang: VocabularyLanguageCode;
|
|
16
|
+
word: string;
|
|
17
|
+
view: NameTokenView;
|
|
18
|
+
}
|
|
19
|
+
/** The first word of `vocab` the name carries, in list order (language, then word), or null. */
|
|
20
|
+
export declare function calendarWordIn(name: string | null | undefined, vocab: Vocab): CalendarWordHit | null;
|
|
21
|
+
/** Does the name carry another language's word for YEAR? English is the caller's own test, first. */
|
|
22
|
+
export declare function localizedYearWordIn(name: string | null | undefined): CalendarWordHit | null;
|
|
23
|
+
/** Which cycle the name names in another language, or null. English is the caller's own test. When
|
|
24
|
+
* a name carries words of two cycles (a quarter-hour bucket), the answer is null - no opinion,
|
|
25
|
+
* exactly as for English. */
|
|
26
|
+
export declare function localizedCycleIn(name: string | null | undefined): {
|
|
27
|
+
concept: CycleConcept;
|
|
28
|
+
hit: CalendarWordHit;
|
|
29
|
+
} | null;
|
|
30
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bicharts/shape-core",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.40",
|
|
4
4
|
"description": "Host-agnostic data-shape profiler: ingest a dataset's rows through IValueCollection.addRow and read back the measured shape as an LLMColumnWithValue[] payload — types, cardinality, temporal/ordinal detection, geographic region and point resolution, cross-column signals. MEASUREMENT only: the policy that decides what a measured shape means for chart selection lives server-side.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
package/dist/chunk-NIFK72FA.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
|
-
import{i as h}from"./chunk-4VN252CK.mjs";var b=[{name:"likert7_agreement",minMatches:5,canonical:["strongly disagree","disagree","slightly disagree","neutral","slightly agree","agree","strongly agree"]},{name:"likert5_agreement",minMatches:3,canonical:["strongly disagree","disagree","neutral","agree","strongly agree"]},{name:"likert3_agreement",minMatches:2,canonical:["disagree","neutral","agree"]},{name:"likert5_satisfaction",minMatches:3,canonical:["very dissatisfied","dissatisfied","neutral","satisfied","very satisfied"]},{name:"likert3_satisfaction",minMatches:2,canonical:["dissatisfied","neutral","satisfied"]},{name:"likert5_quality",minMatches:3,canonical:["poor","fair","good","very good","excellent"]},{name:"likert3_quality",minMatches:2,canonical:["poor","fair","good"]},{name:"frequency5",minMatches:3,canonical:["never","rarely","sometimes","often","always"]},{name:"intensity5",minMatches:3,canonical:["not at all","slightly","moderately","very","extremely"]},{name:"importance5",minMatches:3,canonical:["not important","slightly important","moderately important","very important","extremely important"]},{name:"severity_low_critical",minMatches:3,canonical:["low","medium","high","critical"]},{name:"severity_low_urgent",minMatches:3,canonical:["low","medium","high","urgent"]},{name:"severity_none_critical",minMatches:3,canonical:["none","mild","moderate","severe","critical"]},{name:"priority_p4_p1",minMatches:3,canonical:["p4","p3","p2","p1","p0"]},{name:"severity_trivial_blocker",minMatches:3,canonical:["trivial","minor","major","critical","blocker"]},{name:"severity_minor_severe",minMatches:3,canonical:["minor","moderate","major","severe"]},{name:"magnitude5_medium",minMatches:3,canonical:["very low","low","medium","high","very high"]},{name:"magnitude5_moderate",minMatches:3,canonical:["very low","low","moderate","high","very high"]},{name:"speed5",minMatches:3,canonical:["very slow","slow","moderate","fast","very fast"]},{name:"temperature6",minMatches:3,canonical:["freezing","cold","cool","mild","warm","hot"]},{name:"experience6",minMatches:3,canonical:["novice","beginner","intermediate","advanced","expert","master"]},{name:"tier_metal",minMatches:3,canonical:["bronze","silver","gold","platinum","diamond"]},{name:"tshirt_letter_sizes",minMatches:4,canonical:["xxs","xs","s","m","l","xl","xxl","xxxl"]},{name:"tshirt_word_sizes",minMatches:3,canonical:["extra small","small","medium","large","extra large"]},{name:"nps_bands",minMatches:2,canonical:["detractor","passive","promoter"]},{name:"likelihood5",minMatches:3,canonical:["very unlikely","unlikely","neutral","likely","very likely"]},{name:"education",minMatches:3,canonical:["none","primary","secondary","bachelors","masters","doctoral"]},{name:"grades_a_to_f",minMatches:3,canonical:["a","b","c","d","f"]},{name:"grades_a_to_f_plusminus",minMatches:4,canonical:["a+","a","a-","b+","b","b-","c+","c","c-","d+","d","d-","f"]}],v={seldom:"rarely",infrequently:"rarely","hardly ever":"rarely",occasionally:"sometimes",periodically:"sometimes","now and then":"sometimes",frequently:"often",frequent:"often",regularly:"often",commonly:"often",usually:"often",constantly:"always","every time":"always","all the time":"always",consistently:"always",continually:"always",bad:"poor",weak:"poor",subpar:"poor",mediocre:"fair",passable:"fair","so so":"fair",decent:"good",solid:"good",outstanding:"excellent",superb:"excellent",exceptional:"excellent",stellar:"excellent",unsatisfied:"dissatisfied",unhappy:"dissatisfied",displeased:"dissatisfied",happy:"satisfied",content:"satisfied",pleased:"satisfied",delighted:"very satisfied","highly satisfied":"very satisfied","extremely satisfied":"very satisfied","highly dissatisfied":"very dissatisfied","extremely dissatisfied":"very dissatisfied",neither:"neutral",undecided:"neutral","no opinion":"neutral","neither agree nor disagree":"neutral","completely agree":"strongly agree","totally agree":"strongly agree","completely disagree":"strongly disagree","totally disagree":"strongly disagree","highly unlikely":"very unlikely","extremely unlikely":"very unlikely","highly likely":"very likely","extremely likely":"very likely","almost certain":"very likely",bachelor:"bachelors","bachelor's":"bachelors",undergraduate:"bachelors","bachelor degree":"bachelors","master's":"masters",graduate:"masters","master degree":"masters",doctorate:"doctoral",phd:"doctoral"},x=(()=>{let n=new Set;for(let t of b)for(let r of t.canonical)n.add(d(r));return n})(),q=(()=>{let n=new Map;for(let[t,r]of Object.entries(v)){let e=d(t);x.has(e)||n.has(e)||n.set(e,d(r))}return n})();function y(n){return q.get(n)??n}var D=new Set(["hour","hr","day","dow","dom","weekday","week","wk","woy","month","mth","quarter","qtr","year","yr","semester","trimester","decade","period","fiscal","fy","rank","level","lvl","tier","grade","band","decile","percentile","quartile","quintile","score","rating","stars","step","stage","phase","round","wave","episode","chapter","age","cohort","generation","seniority","position","sequence","seq","priority"]);function K(n){if(!n)return!1;for(let t of h(n))if(D.has(t))return!0;return!1}function d(n){return n.toLowerCase().replace(/[-_]+/g," ").replace(/\s+/g," ").trim()}function g(n){let t=new Map;for(let[r,e]of n)for(let a of r)t.set(d(a),e);return t}var _=[{name:"weekday_mon_sun",minMatches:4,dict:g([[["monday","mon"],0],[["tuesday","tue","tues"],1],[["wednesday","wed","weds"],2],[["thursday","thu","thur","thurs","thr"],3],[["friday","fri"],4],[["saturday","sat"],5],[["sunday","sun"],6]])},{name:"month_jan_dec",minMatches:4,dict:g([[["january","jan"],0],[["february","feb"],1],[["march","mar"],2],[["april","apr"],3],[["may"],4],[["june","jun"],5],[["july","jul"],6],[["august","aug"],7],[["september","sep","sept"],8],[["october","oct"],9],[["november","nov"],10],[["december","dec"],11]])},{name:"quarter_q1_q4",minMatches:3,dict:g([[["q1","qtr 1","qtr1","quarter 1","q 1"],0],[["q2","qtr 2","qtr2","quarter 2","q 2"],1],[["q3","qtr 3","qtr3","quarter 3","q 3"],2],[["q4","qtr 4","qtr4","quarter 4","q 4"],3]])}],p={};function C(n){let t=n||"";if(!t)return{weekday:new Map,month:new Map};let r=p[t];if(r)return r;let e=new Map,a=new Map,i=(s,l,m)=>{let u=d(l);u&&s.set(u,m);let c=d(l.replace(/\./g,""));c&&c!==u&&s.set(c,m)};try{let s=new Intl.DateTimeFormat(t,{weekday:"long"}),l=new Intl.DateTimeFormat(t,{weekday:"short"});for(let c=0;c<7;++c){let f=new Date(Date.UTC(2024,0,1+c));i(e,s.format(f),c),i(e,l.format(f),c)}let m=new Intl.DateTimeFormat(t,{month:"long"}),u=new Intl.DateTimeFormat(t,{month:"short"});for(let c=0;c<12;++c){let f=new Date(Date.UTC(2020,c,15));i(a,m.format(f),c),i(a,u.format(f),c)}}catch{}let o={weekday:e,month:a};return p[t]=o,o}function M(n,t){if(t.size===0)return n;let r=new Map(n);for(let[e,a]of t)r.has(e)||r.set(e,a);return r}function N(n,t){let r=C(t);for(let e of _){let a=e.name==="weekday_mon_sun"?M(e.dict,r.weekday):e.name==="month_jan_dec"?M(e.dict,r.month):e.dict,i=!0,o=new Map;for(let[l,m]of n){let u=a.get(l);if(u===void 0){i=!1;break}o.has(u)||o.set(u,m)}if(!i||o.size<e.minMatches)continue;let s=[...o.entries()].sort((l,m)=>l[0]-m[0]).map(l=>l[1]);return{pattern:e.name,orderedDomain:s}}return null}function w(n){let t=new Map;for(let r of n){if(r==null)continue;let e=String(r);if(e.length===0)continue;let a=d(e);t.has(a)||t.set(a,e)}return t}var S=15,R=10,O=(()=>{let n=["xxs","xs","s","sm","small","m","med","medium","l","lg","large","xl","xlarge","xxl","xxxl","2xl","3xl","4xl","y","n","yes","no","t","f","true","false","na","n/a","n a","none","null","unknown","other","all","both","low","medium","med","high","very low","very high","minimal","critical","urgent"],t=new Set(n.map(d));for(let r of _)for(let e of r.dict.keys())t.add(e);return t})();function A(n){let t=n.trim();return t.length===0||t.length>R||(t.match(/\p{L}/gu)||[]).length>1?!1:/\p{Nd}/u.test(t)}function E(n){let t=n.trim();return t.length===1&&/[\p{L}\p{Nd}]/u.test(t)}function V(n){if(!n||n.length===0)return null;let t=new Set,r=[];for(let e of n){if(e==null)continue;let a=String(e);if(t.has(a))continue;let i=d(a);if(!(i===""||O.has(i)||A(a)||E(a))||(t.add(a),r.push(a),r.length>S))return null}return r.length>0?r:null}var I=/^(\p{L}{0,3}) ?([0-9]+)\s*[-–—:.)]\s*(.+)$/u;function T(n){let t=null,r=new Set,e=[];for(let a of n.values()){let i=I.exec(a.trim());if(!i)return null;let o=i[1].toLowerCase();if(t===null)t=o;else if(o!==t)return null;let s=Number(i[2]);if(r.has(s)||d(i[3])==="")return null;r.add(s),e.push({code:s,original:a,label:i[3]})}return e}function L(n,t){let r=k(w(n.map(s=>s.label)),t);if(r===null)return;if(r.orderedDomain.length!==n.length)return null;let e=new Map;for(let s of n)e.set(s.label,s);let a=r.orderedDomain.map(s=>e.get(s));if(a.some(s=>s===void 0))return null;let i=!0,o=!0;for(let s=1;s<a.length;++s)a[s].code<=a[s-1].code&&(i=!1),a[s].code>=a[s-1].code&&(o=!1);return!i&&!o?null:{pattern:r.pattern,orderedDomain:a.map(s=>s.original)}}function Y(n,t){if(!n||n.length<2)return null;let r=w(n);if(r.size<2)return null;let e=T(r);if(e!==null){let i=L(e,t);if(i!==void 0)return i}let a=k(r,t);return a!==null?a:e!==null?P(r):null}var F=/^([0-9]+)\s*(?:\.|\)|-)\s*([^\s\d].*)$/u,j=3,z=20;function P(n){if(n.size<j||n.size>z)return null;let t=new Set,r=[];for(let e of n.values()){let a=F.exec(e.trim());if(!a||d(a[2])==="")return null;let i=Number(a[1]);if(t.has(i))return null;t.add(i),r.push({n:i,original:e})}return r.sort((e,a)=>e.n-a.n),{pattern:"numeric_rank_prefix",orderedDomain:r.map(e=>e.original)}}function k(n,t){let r=new Map;for(let[a,i]of n){let o=y(a);r.has(o)||r.set(o,i)}let e=null;for(let a of b){let i=[];for(let m of a.canonical){let u=r.get(m);u!==void 0&&i.push(u)}if(i.length<a.minMatches)continue;let o=new Set(a.canonical),s=!0;for(let m of n.keys())if(!o.has(y(m))){s=!1;break}if(!s)continue;let l;e===null||i.length>e.matched||i.length===e.matched&&a.canonical.length<e.pattern.canonical.length?l=!0:l=!1,l&&(e={pattern:a,matched:i.length,orderedDomain:i})}return e?{pattern:e.pattern.name,orderedDomain:e.orderedDomain}:N(n,t)}export{K as a,V as b,Y as c};
|
package/dist/chunk-Q7UDK4PL.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
|
-
import{a as re}from"./chunk-U3H6UBOO.mjs";import{a as se,b as oe}from"./chunk-2LR73DNS.mjs";import{c as Ee}from"./chunk-VIWJJUDA.mjs";import{b as Te,f as Ne}from"./chunk-TPVDJHU6.mjs";import{a as xe,b as Re,c as ie}from"./chunk-NIFK72FA.mjs";import{B as ce,D as Me,h as ye,i as X,j as Se,v as _e,w as Y,x as Ae,y as Ce}from"./chunk-4VN252CK.mjs";var ot=[[24.4,49.4,-125,-66.9],[51.2,71.5,-168,-129.9],[18.9,22.3,-160.3,-154.8]],at=[7,72,-172,-52];function ve(t,e,n){return t>=n[0]&&t<=n[1]&&e>=n[2]&&e<=n[3]}var Z=t=>Math.round(t*10)/10;function we(t,e=3){let n=[],r=[],i=0,s=0;for(let l of t){let u=l?.lat,c=l?.lon;if(typeof u!="number"||typeof c!="number"||!isFinite(u)||!isFinite(c)||u<-90||u>90||c<-180||c>180)continue;n.push(u),r.push(c);let d=l?.country?String(l.country).trim().toUpperCase():"",f=d?ae(d):null;f?((d==="US"||d==="USA")&&i++,f==="north-america"&&s++):(ot.some(m=>ve(u,c,m))&&i++,ve(u,c,at)&&s++)}let o=n.length;return o<e?null:(n.sort((l,u)=>l-u),r.sort((l,u)=>l-u),{pctUsa:Z(i/o*100),pctNa:Z(s/o*100),latP5:Z(Y(n,.05)),latP95:Z(Y(n,.95)),lonP5:Z(Y(r,.05)),lonP95:Z(Y(r,.95)),n:o})}var Ie={"north-america":"AG AI AW BB BL BM BQ BS BZ CA CR CU CW DM DO GD GL GP GT HN HT JM KN KY LC MF MQ MS MX NI PA PM PR SV SX TC TT US VC VG VI","south-america":"AR BO BR CL CO EC FK GF GY PE PY SR UY VE",europe:"AD AL AT AX BA BE BG BY CH CY CZ DE DK EE ES FI FO FR GB GG GI GR HR HU IE IM IS IT JE LI LT LU LV MC MD ME MK MT NL NO PL PT RO RS RU SE SI SJ SK SM UA VA",africa:"AO BF BI BJ BW CD CF CG CI CM CV DJ DZ EG EH ER ET GA GH GM GN GQ GW KE KM LR LS LY MA MG ML MR MU MW MZ NA NE NG RE RW SC SD SH SL SN SO SS ST SZ TD TG TN TZ UG YT ZA ZM ZW",asia:"AE AF AM AZ BD BH BN BT CC CN CX GE HK ID IL IN IO IQ IR JO JP KG KH KP KR KW KZ LA LB LK MM MN MO MV MY NP OM PH PK PS QA SA SG SY TH TJ TL TM TR TW UZ VN YE",oceania:"AS AU CK FJ FM GU KI MH MP NC NF NR NU NZ PF PG PN PW SB TK TO TV UM VU WF WS",antarctica:"AQ BV GS HM TF"},J=(()=>{let t=new Map;for(let e of Object.keys(Ie))for(let n of Ie[e].split(/\s+/))n&&t.set(n,e);return t})();function ut(t){for(let[e,n]of t){let r=J.get(e);r&&!J.has(n)&&J.set(n,r)}}ut(Te);function ae(t){if(!t)return null;let e=String(t).trim().toUpperCase();if(!e)return null;let n=J.get(e);if(n)return n;let r=Ne(String(t));return r?J.get(r)??null:null}function En(t,e=2){return me(t.map(n=>[n,1]),e)}function me(t,e=2){let n=new Map,r=0;for(let[o,l]of t){let u=ae(o);if(!u)continue;let c=typeof l=="number"&&isFinite(l)&&l>0?l:1;n.set(u,(n.get(u)??0)+c),r+=c}if(r<e||!n.size)return null;let i="europe",s=-1;for(let o of Array.from(n.keys()).sort()){let l=n.get(o);l>s&&(i=o,s=l)}return{dominantGeoRegion:i,dominantGeoRegionPct:Z(s/r*100),regionCount:n.size,n:r}}import tt from"papaparse";var lt=[["Lu",/^\p{Lu}$/u],["Ll",/^\p{Ll}$/u],["Lt",/^\p{Lt}$/u],["Lm",/^\p{Lm}$/u],["Lo",/^\p{Lo}$/u],["Mn",/^\p{Mn}$/u],["Mc",/^\p{Mc}$/u],["Nd",/^\p{Nd}$/u]];function ue(t){for(let[e,n]of lt)if(n.test(t))return e;return null}var ct=[{id:"ascii",test:/^[A-Za-z]$/,ranges:[[65,90],[97,122]]},{id:"latin",test:/^[\u00C0-\u017F]$/u,ranges:[[192,383]]},{id:"cyrillic",test:/^[\u0400-\u045F\u0490-\u0491]$/u,ranges:[[1024,1119],[1168,1169]]},{id:"greek",test:/^[\u0386-\u03CE]$/u,ranges:[[902,974]]},{id:"han",test:/^[\u4E00-\u9FFF]$/u,ranges:[[19968,40959]]},{id:"hiragana",test:/^\p{Script=Hiragana}$/u,ranges:[[12353,12447]]},{id:"katakana",test:/^\p{Script=Katakana}$/u,ranges:[[12448,12543]]},{id:"hangul",test:/^[\uAC00-\uD7A3]$/u,ranges:[[44032,55203]]},{id:"arabic",test:/^[\u0620-\u0652\u0671-\u06D3]$/u,ranges:[[1568,1618],[1649,1747]]},{id:"hebrew",test:/^[\u05B0-\u05EA]$/u,ranges:[[1456,1514]]},{id:"devanagari",test:/^\p{Script=Devanagari}$/u,ranges:[[2304,2431]]},{id:"thai",test:/^\p{Script=Thai}$/u,ranges:[[3585,3662]]}],le=new Map;function Le(t,e,n,r){let i=le.get(t);if(i)return i;let s=[];for(let[o,l]of e)for(let u=o;u<=l;u++){let c=String.fromCodePoint(u);ue(c)===n&&(r&&!r.test(c)||s.push(c))}return le.set(t,s),s}function mt(t){let n=t.codePointAt(0);for(let o=0;o<9&&ue(String.fromCodePoint(n-1))==="Nd";o++)n--;let r="nd:"+n.toString(16),i=le.get(r);if(i)return i;let s=[];for(let o=n;o<n+10;o++){let l=String.fromCodePoint(o);ue(l)==="Nd"&&s.push(l)}return le.set(r,s),s}function dt(t,e){if(e==="Nd")return mt(t);for(let i of ct)if(i.test.test(t))return Le(i.id+":"+e,i.ranges,e,i.id==="ascii"?null:i.test);let r=t.codePointAt(0)&-128;return Le("block:"+r.toString(16)+":"+e,[[r,r+127]],e,null)}function ft(t,e,n,r){let i=t.filter(s=>!e.has(s));return i.length===0&&(i=t.filter(s=>s!==n)),i.length===0?n:i[Math.min(i.length-1,Math.floor(r()*i.length))]}var gt=/^[\p{L}\p{M}\p{Nd}]$/u,De=/^[\p{L}\p{Nd}]$/u;function Oe(t,e){if(!t)return t??"";let n=new Set(Array.from(t)),r=d=>{let f=ue(d);return!f||!gt.test(d)?d:ft(dt(d,f),n,d,e)},i=d=>{let f=[];for(let m of d)f.push(r(m)),De.test(m)&&e()<.2&&f.push(r(m));if(f.length>6){let m=Math.floor(e()*Math.min(3,f.length-6));for(let R=0;R<m;R++)for(let A=0;A<5;A++){let O=Math.floor(e()*f.length);if(De.test(f[O])){f.splice(O,1);break}}}return f.join("")};if(!(t.includes("@")&&t.includes(".")))return i(t);let[o,l=""]=t.split("@"),u=l.endsWith(".com"),c=u?l.slice(0,-4):l;return`${i(o)}@${i(c)}${u?".com":""}`}var pt=["rate","ratio","pct","percent","percentage","rating","share","score","index","nps","csat","margin","yield","coverage","utilization","utilisation","z[_-]?score","average","avg","mean","median","stddev","variance","gpa","percentile","quantile","efficiency","accuracy","probability","multiplier","coefficient","correlation","occupancy","age","bmi","temperature","density","pressure","humidity","ph","velocity","speed","elevation","altitude","latency","throughput","bandwidth","iops","ppm","ppb","dpmo","bps","temperatuur","temperatur","temperatura","teplota","lampotila","homerseklet","sicaklik","pression","presion","pressao","pressione","druck","tryck","tlak","paine","nyomas","presiune","humidite","humedad","umidade","umidita","feuchtigkeit","vochtigheid","kosteus","vlhkost","vitesse","velocidad","velocidade","velocita","geschwindigkeit","snelheid","hastighet","hastighed","rychlost","nopeus","sebesseg","brzina","predkosc","densite","densidad","densidade","densita","dichte","dichtheid","hustota","tiheys","gustoca","moyenne","mediane","promedio","mediana","gemiddelde","durchschnitt","mittelwert","genomsnitt","gennemsnit","gjennomsnitt","keskiarvo","atlag","ortalama","prosjek","srednia","prumer","priemer","medie","taux","tasa","taxa","tasso","verhaltnis","verhouding","aandeel","anteil","andel","osuus","podil","udzial","udio","pourcentage","porcentaje","percentual","prozent","procent","prosentti","szazalek","yuzde","participacion","participacao","pondere","omjer","arany","oran","rata","leeftijd","edad","idade","wiek","eletkor","varsta","puntuacion","pontuacao","punteggio","betyg","ocena","indice","indeks","wskaznik","puan"],ht=["pct","percent","percentage","rate","ratio","rating","share","score","index","nps","csat","margin","yield","coverage","utilization","utilisation","gpa","percentile","quantile","bmi","density","pressure","humidity","velocity","efficiency","occupancy","latency","throughput","bandwidth","iops","ppm","ppb","dpmo","bps"],bt=["latitude","longitude"],yt=["latitude","longitude"];function j(t){return ye(t)}var de=["somme de","suma de","soma de","summe von","som van","somma di","summa av","sum av","sum af","soucet z","suma z","totaal van","total de","toplam","osszeg","nombre de","recuento de","contagem de","anzahl von","aantal van","conteggio di","antal av","lukumaara","pocet z"],ke=["moyenne de","promedio de","media de","media di","durchschnitt von","gemiddelde van","medelvarde av","genomsnitt av","gennemsnit af","keskiarvo","atlag","ortalama","prumer z","srednia z","medie de","minimum de","minimo de","minimo di","minimum von","maximum de","maximo de","massimo di","maximum von"];function St(t){return[...t].sort((e,n)=>n.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\s+/g,"\\s+")).join("|")}var Fe=new RegExp("^\\s*(?:(?:sum|count|count\\s+distinct|distinct\\s+count)\\s+of\\s+|(?:"+St(de)+")\\s+)","i"),_t=/(?<=[a-z0-9])(?=[A-Z])|(?<=[A-Za-z])(?=[0-9])|(?<=[0-9])(?=[A-Za-z])/g,At=new RegExp("\\b("+pt.join("|")+")\\b|("+ht.join("|")+")$","i"),Ct=new RegExp("\\b("+bt.join("|")+")\\b|("+yt.join("|")+")$","i");function Ge(t){if(!t)return"";let e=String(t),n=Fe.exec(j(e));return(n?e.slice(n[0].length):e).trim()}function Mt(t){return!!t&&Fe.test(j(String(t)))}var xt=["count (distinct)","count distinct","distinct count","standard deviation","average","variance","median","product","stddev","std dev","count","sum","avg","min","minimum","max","maximum","var"],Pe=new RegExp("^\\s*("+[...xt].sort((t,e)=>e.length-t.length).map(t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\s+/g,"\\s+")).join("|")+")\\s+of\\s+","i");function We(t){if(t==null)return"";let e=String(t),n=Pe.exec(e);if(!n)return e;let r=l=>l.toLowerCase().replace(/\s+/g," ").trim(),i=r(n[1]),s=e.slice(n[0].length),o=0;for(;o<8;){let l=Pe.exec(s);if(!l||r(l[1])!==i)break;let u=s.slice(l[0].length);if(u.trim()==="")break;s=u,o++}return o===0?e:e.slice(0,n[0].length)+s}function fe(t,e){if(!t||!e)return!1;let n=String(t);for(let r of e){let i=r?.hostName;if(i&&i!==r?.name&&n.includes(i))return!0}return!1}var Be={Sum:["Sum of "],Avg:["Average of "],Average:["Average of "],Count:["Count of "],CountNonNull:["Count of "],Min:["Min of ","First ","Earliest "],Max:["Max of ","Last ","Latest "],Median:["Median of "],StandardDeviation:["Standard deviation of "],Variance:["Variance of "]},Rt=new RegExp("^("+Object.keys(Be).join("|")+")\\((.+)\\)$");function ze(t){if(!t)return[];let e=Rt.exec(String(t).trim());if(!e)return[];let n=Be[e[1]],r=e[2],i=[];for(let s=r.indexOf(".");s>=0;s=r.indexOf(".",s+1)){if(s===0)continue;let o=r.slice(s+1);if(o.trim()!=="")for(let l of n){let u=l+o;i.includes(u)||i.push(u)}}return i}function Tt(t){let e=Ge(t);return e.length===0?"":e.replace(_t," ")}function $e(t,e){if(!e)return!1;let n=Ge(e);return t.test(j(Tt(e)))||t.test(j(n))||t.test(j(X(n).join(" ")))}function Ue(t){return $e(Ct,t)}function Nt(t){return $e(At,t)||Ue(t)}var Ve=/int|double|decimal|single|float|number|currency|money/i;function Et(t){let e=String(t?.valueNature??"").trim().toLowerCase();return e==="categorical"?"Categorical":e==="ordinal"?"Ordinal":e==="continuous"||t?.isMeasure===!0||Ve.test(String(t?.dataType??""))?"Continuous":"Categorical"}function vt(t){return t?.isMeasure===!0||Ve.test(String(t?.dataType??""))}function Ke(t){let e=t??{},n=Et(e);if(n!=="Continuous")return{nature:n,additivity:"unknown",basis:"role",suppressed:!1};if(Ue(e.name))return{nature:n,additivity:"positional",basis:"name",suppressed:!0};let r=String(e.additivity??"").trim().toLowerCase();if(!(r==="additive"&&Mt(e.name))){if(r==="additive")return{nature:n,additivity:"additive",basis:"measured",suppressed:!1};if(r==="part_of_whole")return{nature:n,additivity:"part_of_whole",basis:"measured",suppressed:!1};if(r==="intensive_rate")return{nature:n,additivity:"intensive_rate",basis:"measured",suppressed:!1}}return e.discourageAggregationAcrossGroups===!0?{nature:n,additivity:"intensive_rate",basis:"host-flag",suppressed:!1}:Nt(e.name)?{nature:n,additivity:"intensive_rate",basis:"name",suppressed:!1}:{nature:n,additivity:"additive",basis:"default",suppressed:!1}}function Ye(t){let e=Ke(t),n=t??{};if(e.nature==="Categorical")return["first","distinctcount","count"];if(e.nature==="Ordinal")return vt(n)?["median","average","min","max","first","distinctcount","count"]:["first","distinctcount","count"];switch(e.additivity){case"positional":return["min","max","count","distinctcount","first"];case"intensive_rate":return["average","median","min","max","count","distinctcount","first"];default:return["sum","average","median","min","max","count","distinctcount","first"]}}function Dn(t){return Ye(t)[0]}function On(t,e){return Ye(t).indexOf(e)>=0}function Pn(t,e){if(e!=="sum"&&e!=="count")return!1;if(e==="count")return!0;let n=Ke(t);return n.additivity==="additive"||n.additivity==="part_of_whole"||n.additivity==="unknown"}var It=/^[A-Za-z_$][A-Za-z0-9_$]*$/,wt=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Lt=new RegExp([String.raw`\bisMeasure\b`,String.raw`\bdataType\b`,String.raw`\bcolumns\s*\[\s*-?\d`,String.raw`\.iloc\s*\[[^\]]*,`,String.raw`\.iat\s*\[`,String.raw`\bselect_dtypes\b`,String.raw`\b_get_numeric_data\b`,String.raw`\bis_numeric_dtype\b`,String.raw`\bfor\s+\w+\s+in\s+(?:list\s*\(\s*)?df\.columns\b`,String.raw`\bdf\.columns\s*\.\s*(?:tolist|to_list|difference|drop)\b`,String.raw`\bdf\.dtypes\b`,String.raw`\bObject\s*\.\s*(?:keys|values|entries)\s*\(\s*(?:rows|data|df)?\s*\[\s*0\s*\]`,String.raw`\b(?:row|rw|r)\s*\[\s*\d+\s*\]`].join("|"));function ee(t,e){if(!t||!e)return!1;let n=wt(e);return new RegExp("['\"`]"+n+"['\"`]").test(t)?!0:It.test(e)&&new RegExp("\\."+n+"(?![A-Za-z0-9_$])").test(t)}function Dt(t){return!!t&&Lt.test(t)}function Fn(t,e,n){return t?Dt(t)?[...e]:[...n,...e].some(r=>ee(t,r))?e.filter(r=>ee(t,r)):[...e]:[]}var Ot=5,Pt=6,kt=3,Q=864e5,Ft=/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?(?:\.\d+)?Z?)?$/,Gt=/^(\d{4})[-/](\d{1,2})$/,Wt=/^(\d{4})[-\s]?Q([1-4])$/i,Bt=/^Q([1-4])[-\s](\d{4})$/i,zt=/^(\d{4})$/,$t=/^(\d{4})(0[1-9]|1[0-2])$/,Ut=/^(\d{4})(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])$/,Vt=/^(\D+?)[\s\-/.,']*((?:19|20)\d{2})$/u,Kt=/^((?:19|20)\d{2})[\s\-/.,']+(\D+)$/u;function He(t,e){let n=se(t);if(!n)return 0;if(n==="sept")return 9;for(let r of e&&!/^en\b/i.test(e)?["en",e]:["en"]){let i=oe(r)[n];if(i!==void 0)return i+1}return 0}function K(t,e,n,r=0,i=0,s=0){if(!(t>=1&&e>=1&&e<=12&&n>=1&&n<=31))return null;let o=Date.UTC(t,e-1,n,r,i,s);if(!Number.isFinite(o))return null;let l=u=>u<10?"0"+u:String(u);return{ms:o,y:t,m:e,d:n,iso:`${t}-${l(e)}-${l(n)}`}}function Yt(t,e){let n=[],r="";for(let u=0;u<e.length;u++){if(e[u]!=="%"){r+=e[u].replace(/[.*+?^${}()|[\]\\]/g,"\\$&");continue}switch(e[++u]){case"Y":n.push("Y"),r+="(\\d{4})";break;case"m":n.push("m"),r+="(\\d{1,2})";break;case"d":n.push("d"),r+="(\\d{1,2})";break;case"H":case"M":case"S":r+="\\d{1,2}";break;case"%":r+="%";break;default:return null}}let i=new RegExp("^"+r+"$").exec(t);if(!i)return null;let s=0,o=1,l=1;return n.forEach((u,c)=>{let d=+i[c+1];u==="Y"?s=d:u==="m"?o=d:l=d}),s?K(s,o,l):null}function ge(t,e,n){let r=(t??"").trim();if(r==="")return null;if(e){let s=Yt(r,e);return s||null}let i=Ft.exec(r);if(i)return K(+i[1],+i[2],+i[3],+(i[4]??0),+(i[5]??0),+(i[6]??0));if(i=Wt.exec(r),i)return K(+i[1],(+i[2]-1)*3+1,1);if(i=Bt.exec(r),i)return K(+i[2],(+i[1]-1)*3+1,1);if(i=Gt.exec(r),i&&+i[2]>=1&&+i[2]<=12)return K(+i[1],+i[2],1);if(i=Ut.exec(r),i)return K(+i[1],+i[2],+i[3]);if(i=$t.exec(r),i)return K(+i[1],+i[2],1);if(i=zt.exec(r),i){let s=+i[1];return s>=1900&&s<=2100?K(s,1,1):null}if(i=Vt.exec(r),i){let s=He(i[1],n);return s?K(+i[2],s,1):null}if(i=Kt.exec(r),i){let s=He(i[2],n);return s?K(+i[1],s,1):null}return null}function Xe(t){let e=new Date(t).getUTCDay();return e>=1&&e<=5}function Ze(t,e){if(e<=t)return 0;let n=Math.round((e-t)/Q),r=Math.floor(n/7),i=r*5,s=t+r*7*Q;for(;s<e;)Xe(s)&&i++,s+=Q;return i}function Ht(t){if(t.length===0)return 0;let e=[...t].sort((r,i)=>r-i),n=e.length>>1;return e.length%2?e[n]:(e[n-1]+e[n])/2}function Xt(t){return t>0?t<.95?"hour":t<=1.05?"day":t>=6.5&&t<=7.5?"week":t>=27&&t<=31.5?"month":t>=88&&t<=93?"quarter":t>=362&&t<=368?"year":"irregular":"irregular"}function te(t,e,n,r){switch(n){case"year":return e.y-t.y;case"quarter":return e.y*4+Math.floor((e.m-1)/3)-(t.y*4+Math.floor((t.m-1)/3));case"month":return e.y*12+e.m-(t.y*12+t.m);case"week":return Math.round((e.ms-t.ms)/(7*Q));case"weekday":return Ze(t.ms,e.ms);case"day":return Math.round((e.ms-t.ms)/Q);default:return r>0?Math.round((e.ms-t.ms)/r):0}}function je(t,e){return pe(t,e)?.cadence??null}function pe(t,e){let n=e?.gapFactor??Ot,r=0,i=0,s=new Map;for(let h of t){if(h==null||h==="")continue;r++;let W=ge(String(h),e?.pattern,e?.locale);W&&(i++,s.set(W.ms,W))}let o=[...s.values()].sort((h,W)=>h.ms-W.ms);if(o.length<kt||r>0&&i/r<.8)return null;let l=o[o.length-1].ms-o[0].ms;if(l<=0)return null;let u=[];for(let h=1;h<o.length;h++)u.push(o[h].ms-o[h-1].ms);let c=Ht(u);if(!(c>0))return null;let d=Xt(c/Q);d==="day"&&l>=7*Q&&o.every(h=>Xe(h.ms))&&Ze(o[0].ms,o[o.length-1].ms)+1>o.length*.5&&(d="weekday");let f=d==="irregular"?o.length:te(o[0],o[o.length-1],d,c)+1,m=1,R=1,A=[],O=o[0],S=1;for(let h=1;h<o.length;h++){let W=te(o[h-1],o[h],d,c);W>m&&(m=W),d!=="irregular"&&W>n?(R++,A.push({from:O.iso,to:o[h-1].iso,points:S}),O=o[h],S=1):S++}A.push({from:O.iso,to:o[o.length-1].iso,points:S});let w={grain:d,points:o.length,expectedPoints:Math.max(f,o.length),coveragePct:Math.round(o.length/Math.max(f,o.length)*1e3)/10,runs:R,largestGapUnits:m,gapFactor:n};return e?.includeBounds&&A.length<=Pt&&(w.runBounds=A),{cadence:w,points:o,stepMs:c}}var Zt=8,jt=.5,Qt=200,qt=new Set(["category","categories","subcategory","type","types","kind","class","classes","classification","segment","segments","tier","status","priority","severity","grade","level","band","bucket","group","channel","method","mode","stage","phase","period","shift","gender","sex","result","outcome","reason","flag","genre","sector","source"]),Jt=["category","classification","segment","status","priority","severity","channel"],en=new Set(["UUID","EMAIL_LIKE","URL_LIKE","PHONE_LIKE","NUMERIC_ID","HEX_ID","OPAQUE_ID_ALPHANUMERIC","DATE_STR","BOOLEAN"]);function tn(t){let e=X(t);if(e.length===0)return!1;let n=e[e.length-1];return qt.has(n)?!0:Jt.some(r=>n.length>r.length&&n.endsWith(r))}function nn(t){if(t.isMeasure)return"measure";if(t.isTemporal||t.isDatePart||t.isReassembledDate)return"temporal";let e=Array.from(t.values).filter(n=>n!==""&&n!==null&&n!==void 0);return e.length<2||e.length>Qt?"cardinality":t.rows>0&&e.length>=t.rows?"row-identity":t.isBinaryFlag?"flag":ie(e,t.locale)!==null?"ordinal":t.identifierNamed||t.dataType==="String"&&en.has(re(e))?"identifier":!t.geoKind&&tn(t.name)?"attribute":"entity"}function Je(t){let e=-1,n=1/0,r=!1;return t.forEach((i,s)=>{if(nn(i)!=="entity")return;let o=new Set(Array.from(i.values).filter(u=>u!=="")).size,l=!!i.geoKind;(o<n||o===n&&l&&!r)&&(e=s,n=o,r=l)}),e}var Qe=t=>t<10?"0"+t:String(t);function qe(t,e){switch(e){case"year":return`${t.y}-01-01`;case"quarter":return`${t.y}-${Qe(Math.floor((t.m-1)/3)*3+1)}-01`;case"month":return`${t.y}-${Qe(t.m)}-01`;case"hour":return new Date(t.ms).toISOString().replace(/\.\d{3}Z$/,"Z");default:return t.iso}}function et(t){let{periods:e,series:n}=t,r=Math.min(e.length,n.length),i=new Set;for(let v=0;v<r;v++)e[v]&&i.add(e[v]);let s=pe(i,{pattern:t.pattern,locale:t.locale});if(!s)return null;let o=s.cadence.grain;if(o==="irregular")return null;let l=s.points[0],u=te(l,s.points[s.points.length-1],o,s.stepMs)+1;if(u!==s.cadence.expectedPoints)return null;let c=new Map;for(let v of i){let b=ge(v,t.pattern,t.locale);if(!b)continue;let P=te(l,b,o,s.stepMs);P>=0&&P<u&&c.set(v,{idx:P,stamp:b})}let d=new Map;for(let v=0;v<r;v++){let b=n[v];if(!b)continue;let P=c.get(e[v]);if(!P)continue;let B=d.get(b);B||(B={seen:new Set,lo:P.idx,hi:P.idx,loStamp:P.stamp,hiStamp:P.stamp,order:d.size},d.set(b,B)),B.seen.add(P.idx),P.idx<B.lo&&(B.lo=P.idx,B.loStamp=P.stamp),P.idx>B.hi&&(B.hi=P.idx,B.hiStamp=P.stamp)}if(d.size<2)return null;let f=0;for(let v of d.values())f+=v.seen.size;if(f/(d.size*u)<(t.minFill??jt))return null;let m=[],R=new Set,A=0,O=0,S=0,w=0,h=0,W=1;for(let[v,b]of d){for(let z of b.seen)R.add(z);if(b.seen.size>=u)continue;let P=[...b.seen].sort((z,a)=>z-a),B=1;for(let z=1;z<P.length;z++)B=Math.max(B,P[z]-P[z-1]);let H={key:v,acc:b,coverage:b.seen.size/u,before:b.lo,after:u-1-b.hi,interior:b.hi-b.lo+1-b.seen.size,gap:B};m.push(H),H.before>0&&A++,H.after>0&&O++,H.interior>0&&S++,w=Math.max(w,H.before),h=Math.max(h,H.after),W=Math.max(W,B)}if(m.length===0)return null;m.sort((v,b)=>v.coverage-b.coverage||v.acc.order-b.acc.order);let U=m.slice(0,t.maxListed??Zt);return{seriesColumn:t.seriesColumn,grain:o,periods:u,seriesCount:d.size,incompleteSeries:m.length,lateStarts:A,earlyEnds:O,withHoles:S,columnWideMissing:u-R.size,maxMissingBefore:w,maxMissingAfter:h,largestGap:W,series:U.map(v=>{let b={};return t.includeNames&&(b.name=v.key),t.includeDates&&(b.first=qe(v.acc.loStamp,o),b.last=qe(v.acc.hiStamp,o)),b.missingBefore=v.before,b.missingAfter=v.after,b.missingInterior=v.interior,b.largestGap=v.gap,b.coverage=Math.round(v.coverage*1e3)/1e3,b}),more:m.length-U.length}}var rn=12,sn=100,on=.3,an=.9,un=120,ln=1900,cn=2100,mn=0,dn=20,fn=new Set(["id","ids","uuid","guid","key","zip","zipcode","postal","postalcode","ssn","code","codes","sku","isbn","msisdn","imei"]);function rt(t){if(!t)return!1;let e=X(t);return e.length===0?!1:fn.has(e[e.length-1])}var gn=new Set(["year","yr","fy"]),pn=t=>X(t).some(e=>gn.has(e)),hn=/^(?:(?:19|20)\d{2}(?:[-/ ]?(?:q[1-4]|w(?:0?[1-9]|[1-4]\d|5[0-3])|(?:0?[1-9]|1[0-2])))?|q[1-4][-/ ](?:19|20)\d{2}|(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)[a-z]*[-/ ]?(?:19|20)?\d{2})$/i;function he(t){if(!Number.isInteger(t)||t<190001||t>210012)return!1;let e=t%100;return e>=1&&e<=12}function be(t){if(!Number.isInteger(t)||t<19000101||t>21001231)return!1;let e=Math.floor(t/100)%100,n=t%100;return e>=1&&e<=12&&n>=1&&n<=31}var bn=/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?(?:\.\d+)?Z?)?$/,yn=/^(\d{4})([\/.])(\d{1,2})\2(\d{1,2})$/,Sn=/^(\d{1,2})([\/.\-])(\d{1,2})\2(\d{4})(?:[ T](\d{2}):(\d{2})(?::(\d{2}))?)?$/;function _n(t){let e=(t||"").toLowerCase();return e==="en-us"||e==="en"||e.startsWith("en-us-")||e==="en-ph"||e==="en-bz"}function st(t,e){let n=0,r=0,i=0,s=0,o=0,l="",u=0,c="",d=0,f=0,m=0,R=0,A=!1;for(let U of t){if(U==null)continue;let v=String(U).trim();if(v==="")continue;n++;let b;if(b=bn.exec(v)){let P=+b[2],B=+b[3];P>=1&&P<=12&&B>=1&&B<=31&&(r++,b[4]!==void 0&&i++,b[6]!==void 0&&s++)}else if(b=yn.exec(v)){let P=+b[3],B=+b[4];P>=1&&P<=12&&B>=1&&B<=31&&(l&&l!==b[2]&&(A=!0),l=b[2],o++)}else if(b=Sn.exec(v)){let P=+b[1],B=+b[3];P>=1&&P<=31&&B>=1&&B<=31&&(P<=12||B<=12)&&(c&&c!==b[2]&&(A=!0),c=b[2],u++,P>12&&m++,B>12&&R++,b[5]!==void 0&&d++,b[7]!==void 0&&f++)}if(n>=200)break}if(n<2||(r+o+u)/n<.8||(r>0?1:0)+(o>0?1:0)+(u>0?1:0)!==1||A)return null;if(r>0)return i===r?{pattern:s===r?"%Y-%m-%dT%H:%M:%S":"%Y-%m-%dT%H:%M",orderFrom:"iso"}:{pattern:"%Y-%m-%d",orderFrom:"iso"};if(o>0)return{pattern:`%Y${l}%m${l}%d`,orderFrom:"iso"};if(m>0&&R>0)return null;let w,h;m>0?(w=!0,h="values"):R>0?(w=!1,h="values"):(w=!_n(e),h="locale");let W=w?`%d${c}%m${c}%Y`:`%m${c}%d${c}%Y`;return d===u?{pattern:W+(f===u?" %H:%M:%S":" %H:%M"),orderFrom:h}:{pattern:W,orderFrom:h}}function An(t,e){if(!e||!/\b(?:19|20)\d{2}\b/.test(t))return!1;let n=t.replace(/\b(?:19|20)\d{2}\b/g,"").replace(/[-/.,]/g," ").trim();if(!n)return!1;let r=se(n);return r.length>0&&e[r]!==void 0}function Cn(t){let{dataType:e,name:n,isMeasure:r,distinctCount:i}=t;if(e==="DateTime")return!0;if(r)return!1;if(e==="Integer"||e==="Decimal"){let s=t.minNum,o=t.maxNum;if(!(s!=null&&o!=null&&Number.isFinite(s)&&Number.isFinite(o)&&Number.isInteger(s)&&Number.isInteger(o)&&o>=s))return!1;let u=s>=1900&&o<=2100;if(u&&i>=2&&pn(n)||u&&i>=3&&i===o-s+1)return!0;let c=he(s)&&he(o),d=be(s)&&be(o);if(c||d){if(!t.sampleValues)return!0;let f=0,m=0;for(let R of t.sampleValues){if(R==null||R==="")continue;f++;let A=Number(String(R).trim());if(Number.isFinite(A)&&(c?he(A):be(A))&&m++,f>=60)break}if(f>=2&&m===f)return!0}return!1}if(t.sampleValues){let s=t.locale?oe(t.locale):null,o=0,l=0,u=[];for(let c of t.sampleValues){if(c==null||c==="")continue;o++;let d=String(c).trim();if(u.push(d),(hn.test(d)||An(d,s))&&l++,o>=60)break}if(o>=2&&l/o>=.8||st(u,t.locale)!==null)return!0}return!1}function Mn(t){let e=j((t||"").trim().toLowerCase());return e.startsWith("sum ")||e.startsWith("total ")?"sum":e.startsWith("average ")||e.startsWith("avg. ")?"avg":e.startsWith("count ")||e.startsWith("distinct count ")||e.startsWith("count (distinct) ")?"count":e.startsWith("min ")||e.startsWith("minimum ")?"min":e.startsWith("max ")||e.startsWith("maximum ")?"max":ke.some(n=>e.startsWith(n+" "))?/^(minimum|minimo)\b/.test(e)?"min":/^(maximum|maximo|massimo)\b/.test(e)?"max":"avg":de.some(n=>e.startsWith(n+" ")||e===n)?/^(nombre|recuento|contagem|anzahl|aantal|conteggio|antal|lukumaara|pocet)\b/.test(e)?"count":"sum":null}function xn(t){let{rows:e,measureColIdx:n,measureName:r,candidateDims:i,minNum:s,maxNum:o,discourageAgg:l}=t,u=100,c=.01,d="";for(let m of i){if(m.distinct<2||m.distinct>u)continue;let R=i.filter(h=>h.idx!==m.idx).map(h=>h.idx),A=new Map;for(let h of e){let W=h[n];if(typeof W!="number"||!Number.isFinite(W))continue;let U=R.length?R.map(b=>String(h[b])).join(d):"",v=A.get(U);v||(v={sum:0,cset:new Set},A.set(U,v)),v.sum+=W,v.cset.add(String(h[m.idx]))}let O=0,S=0,w=0;for(let h of A.values())h.cset.size<2||(w++,Math.abs(h.sum-100)<=100*c?O++:Math.abs(h.sum-1)<=1*c&&S++);if(w>=2&&(O/w>=.9||S/w>=.9))return{additivity:"part_of_whole",partOfWholeDim:m.name}}if(l)return{additivity:"intensive_rate"};let f=Mn(r);return f==="avg"||f==="min"||f==="max"?{additivity:"intensive_rate"}:f==="count"?{additivity:"additive"}:f==="sum"?{additivity:"unknown"}:s!=null&&o!=null&&Number.isFinite(s)&&Number.isFinite(o)&&s>=0&&o<=1.0001&&o>0?{additivity:"intensive_rate"}:{additivity:"unknown"}}function nt(t){let{dataType:e,isMeasure:n,name:r,distinct:i,nonblank:s,prec:o,maxval:l,minval:u}=t,c=l-u+1,d=c>0?i/c:1,f=s>0?i/s:0,m=e==="Decimal"||o>0;return rt(r)?"Categorical":d>=an&&(xe(r)&&i<=un||u>=ln&&l<=cn||u>=mn&&l<=dn)?"Ordinal":n||i>rn&&(m||i>=sn||f>=on)?"Continuous":"Categorical"}function Rn(t){let e=null;for(let n=0;n<t.length;n++){let r=t[n];if(typeof r!="string"||r.length===0)continue;let i=r.trim();i.length!==r.length&&(e||(e=t.slice()),e[n]=i)}return e||t}var it=class{_computedStatsForLevel=null;_cols=[];_rows=[];_origIndices=[];_rowHashes=new Set;_hostQueryNames=[];_englishAliases=new Map;dedupRows=!0;emitLegacyAggAliases=!1;STR(e){return e==null?"":e instanceof Date?this.wholeDayIso(e)??(isNaN(e.getTime())?"":e.toISOString()):e.toString()}getPrecision(e){if(!isFinite(e))return 0;let r=e.toString().split(".")[1];return r?r.length:0}getColumns(){return this._cols}wholeDayIso(e){return Me(e)}hasTimeComponent(e){return!(e instanceof Date)||isNaN(e.getTime())?!1:this.wholeDayIso(e)===null}getColumnsWithStats(e,n){if(this._computedStatsForLevel==e)return this._cols;let r=0,i=parseInt(e),s=[];for(let a of this._cols){let p=new Map,D=[],N=0,g=0,T=0,I=null,E=null,x=null,F=!1,k=!0,C=!0,M=null,G=!1;for(let _ of this._rows){let y=_[r],L=this.STR(y);if(L!=""){if(N+=L.length,p.set(L,(p.get(L)||0)+1),g++,a.dataType=="Integer"||a.dataType=="Decimal"||a.dataType=="DateTime")if((I===null||y<I)&&(I=y),(E===null||y>E)&&(E=y),a.dataType=="Integer"||a.dataType=="Decimal"){if(x===null?x=y:x+=y,a.dataType=="Decimal"){let $=this.getPrecision(y);$>T&&(T=$)}D.push(y)}else F=F||this.hasTimeComponent(y);G&&(y<M?k=!1:y>M&&(C=!1)),M=y,G=!0}}if(g>=3&&(k&&!C?a.sortedDirection="asc":C&&!k?a.sortedDirection="desc":a.sortedDirection="none"),g>0&&p.size>0&&!a.isMeasure){let _=0,y=Number.MAX_SAFE_INTEGER;for(let L of p.values())L>_&&(_=L),L<y&&(y=L);if(a.modalShare=_/g,a.minGroupCount=y===Number.MAX_SAFE_INTEGER?null:y,p.size===2){let L=[...p.keys()].map(ne=>_e(ne).trim().toLowerCase()).sort(),V=[["false","true"],["no","yes"],["n","y"],["0","1"],["f","t"]].some(ne=>L[0]===ne[0]&&L[1]===ne[1]),q=/^(is|has)[_\p{L}\p{N}]|(?:default|churn|fraud|approv|convert|active|cancel|delinquen|flag|paid|win|pass|fail)/iu.test(a.name);(V||q)&&(a.isBinaryFlag=!0)}}if(a.dataType=="DateTime"&&(a.dateWithTime=F),a.isTemporal=Cn({dataType:a.dataType,name:a.name,isMeasure:a.isMeasure,distinctCount:p.size,minNum:typeof I=="number"?I:null,maxNum:typeof E=="number"?E:null,sampleValues:p.keys(),locale:n}),a.isTemporal&&a.dataType==="String"&&!a.isMeasure){let _=st(p.keys(),n);_&&(a.temporalTextPattern=_.pattern)}if(a.isTemporal&&!a.isMeasure){let _=je(p.keys(),{includeBounds:i>=20,pattern:a.temporalTextPattern,locale:n});_&&(a.temporalCadence=_)}this.updateColumnStats10(i,a,g,p,T,E,I),this.updateColumnStats20(i,D,g,x,a,N,F,I,E,T,p,n),!a.isMeasure&&(a.dataType==="Integer"||a.dataType==="Decimal")&&nt({dataType:a.dataType,isMeasure:!1,name:a.name,distinct:p.size,nonblank:g,prec:T,maxval:typeof E=="number"?E:0,minval:typeof I=="number"?I:0})==="Continuous"&&(a.isMeasure=!0,a.geoKind=void 0,a.geoMatchPct=void 0,a.geoAmbiguous=void 0,a.dominantGeoRegion=void 0,a.dominantGeoRegionPct=void 0,a.geoRegionCount=void 0),s[r]=a.isMeasure||p.size>2e3?null:new Set(p.keys()),r++}let o=[];this._cols.forEach((a,p)=>{a.isMeasure||o.push({idx:p,distinct:a.distinctCount??0,name:a.name})}),this._cols.forEach((a,p)=>{if(!a.isMeasure)return;let D=typeof a.lowValue=="number"?a.lowValue:null,N=typeof a.highValue=="number"?a.highValue:null,g=xn({rows:this._rows,measureColIdx:p,measureName:a.name,candidateDims:o,minNum:D,maxNum:N,discourageAgg:!!a.discourageAggregationAcrossGroups});a.additivity=g.additivity,g.partOfWholeDim&&(a.partOfWholeDim=g.partOfWholeDim)});let l=50,u=4,c=o.filter(a=>a.distinct>=2&&a.distinct<=l);this._cols.forEach((a,p)=>{if(!a.isMeasure)return;let D=[];for(let C of this._rows){let M=C[p];if(M==null||M==="")continue;let G=typeof M=="number"?M:parseFloat(M);isNaN(G)||D.push(G)}if(D.length===0)return;let N=[...D].sort((C,M)=>C-M);if(N[0]===N[N.length-1])a.relativeDispersion=0;else if(N.length>=u){let C=Y(N,.5),M=Y(N,.1),G=Y(N,.9);a.relativeDispersion=Math.abs(C)>1e-9?Math.round((G-M)/Math.abs(C)*1e3)/1e3:void 0}else a.relativeDispersion=void 0;let g=[];for(let C of c){let M=new Set;for(let G of this._rows){let _=G[p];_==null||_===""||M.add(this.STR(G[C.idx])+"")}g.push({otherColumn:C.name,nonBlankGroupCount:M.size})}g.length>0&&(a.nonBlankGroups=g);let T=0;for(let C of D)T+=C;T/=D.length;let I=0;for(let C of D)I+=(C-T)*(C-T);if(I<=1e-12)return;let E=[],x=[],F=C=>{if(C.length<4)return NaN;let M=[...C].sort((_,y)=>_-y),G=_=>M[Math.min(M.length-1,Math.max(0,Math.floor(_*(M.length-1))))];return G(.75)-G(.25)},k=F(D);for(let C of c){let M=new Map;for(let y of this._rows){let L=y[p];if(L==null||L==="")continue;let $=typeof L=="number"?L:parseFloat(L);if(isNaN($))continue;let V=this.STR(y[C.idx])+"",q=M.get(V);q?(q.s+=$,q.n++,q.vals.push($)):M.set(V,{s:$,n:1,vals:[$]})}let G=0;for(let y of M.values()){let L=y.s/y.n;G+=y.n*(L-T)*(L-T)}E.push({otherColumn:C.name,eta2:Math.round(G/I*1e4)/1e4});let _=[];for(let y of M.values()){let L=F(y.vals);isNaN(L)||_.push(L)}if(_.length>=2&&isFinite(k)&&k>1e-9){let y=(Math.max(..._)-Math.min(..._))/k;x.push({otherColumn:C.name,spreadRatio:Math.round(y*1e4)/1e4})}}E.length>0&&(a.groupDiscrimination=E),x.length>0&&(a.spreadDiscrimination=x)});let d=.97,f=.8,m=8,R=5,A=this._cols.map((a,p)=>({c:a,i:p})).filter(a=>a.c.isMeasure);for(let a=0;a<A.length;a++)for(let p=a+1;p<A.length;p++){let D=A[a].i,N=A[p].i,g=0,T=0,I=0,E=0,x=0,F=0;for(let _ of this._rows){let y=_[D],L=_[N];if(y==null||y===""||L===null||L===void 0||L==="")continue;let $=typeof y=="number"?y:parseFloat(y),V=typeof L=="number"?L:parseFloat(L);isNaN($)||isNaN(V)||(g++,T+=$,I+=V,E+=$*$,x+=V*V,F+=$*V)}if(g<R)continue;let k=g*E-T*T,C=g*x-I*I;if(k<=1e-12||C<=1e-12)continue;let M=(g*F-T*I)/Math.sqrt(k*C),G=Math.min(1,Math.round(Math.abs(M)*1e3)/1e3);for(let _ of[A[a].c,A[p].c])(_.maxAbsMeasureCorrelation===void 0||G>_.maxAbsMeasureCorrelation)&&(_.maxAbsMeasureCorrelation=G);if(Math.abs(M)>=d){let _=A[a].c,y=A[p].c;_.collinearWithMeasures||(_.collinearWithMeasures=[]),y.collinearWithMeasures||(y.collinearWithMeasures=[]),_.collinearWithMeasures.push(y.name),y.collinearWithMeasures.push(_.name)}else if(Math.abs(M)>=f){let _=A[a].c,y=A[p].c,L=Math.round(M*1e3)/1e3;_.correlatedWithMeasures||(_.correlatedWithMeasures=[]),y.correlatedWithMeasures||(y.correlatedWithMeasures=[]),_.correlatedWithMeasures.push({otherColumn:y.name,r:L}),y.correlatedWithMeasures.push({otherColumn:_.name,r:L})}}for(let{c:a}of A)a.correlatedWithMeasures&&(a.correlatedWithMeasures.sort((p,D)=>Math.abs(D.r)-Math.abs(p.r)||(p.otherColumn<D.otherColumn?-1:1)),a.correlatedWithMeasures.length=Math.min(a.correlatedWithMeasures.length,m));for(let a=0;a<this._cols.length;a++){let p=s[a];if(!p||p.size===0)continue;let D=[];for(let N=0;N<this._cols.length;N++){if(N===a)continue;let g=s[N];if(!g||g.size===0)continue;let T=0;for(let E of p)g.has(E)&&T++;let I=Math.round(T/p.size*100);I>0&&D.push({otherColumn:this._cols[N].name,percentShared:I})}D.length>0&&(this._cols[a].sharedValueRatioWithOthers=D)}let O=50,S=[];for(let a=0;a<this._cols.length;a++){let p=s[a];p&&p.size>=2&&p.size<=O&&S.push(a)}if(S.length>=2){let a=new Map,p=(N,g)=>N+":"+g;for(let N=0;N<S.length;N++)for(let g=N+1;g<S.length;g++)a.set(p(S[N],S[g]),new Map);for(let N of this._rows)for(let g=0;g<S.length;g++){let T=this.STR(N[S[g]])+"";for(let I=g+1;I<S.length;I++){let E=""+this.STR(N[S[I]]),x=a.get(p(S[g],S[I])),F=T+""+E;x.set(F,(x.get(F)??0)+1)}}let D=new Map;for(let N=0;N<S.length;N++)for(let g=N+1;g<S.length;g++){let T=S[N],I=S[g],E=s[T].size,x=s[I].size,F=a.get(p(T,I)),k=F.size,C=0;for(let y of F.values())(C===0||y<C)&&(C=y);let M=Math.round(k/(E*x)*100),G=k===E,_=k===x;if((this._cols[T].categoricalPairStats||=[]).push({otherColumn:this._cols[I].name,fillPct:M,determinesOther:G,minCellCount:C,distinctCombinations:k}),(this._cols[I].categoricalPairStats||=[]).push({otherColumn:this._cols[T].name,fillPct:M,determinesOther:_,minCellCount:C,distinctCombinations:k}),G&&E>x){let y=D.get(T);(!y||x<y.card)&&D.set(T,{name:this._cols[I].name,card:x,ratio:x/E})}if(_&&x>E){let y=D.get(I);(!y||E<y.card)&&D.set(I,{name:this._cols[T].name,card:E,ratio:E/x})}}for(let[N,g]of D)this._cols[N].primaryParentColumn=g.name,this._cols[N].nestingRatio=Math.round(g.ratio*100)/100}let w=6,h=this._rows.length;for(let a=0;a<this._cols.length;a++){let p=this._cols[a];if(p.isMeasure||p.primaryParentColumn)continue;let D=p.distinctCount??0;if(D<=O||h>0&&D>=h)continue;let N=[];for(let g=0;g<this._cols.length;g++){if(g===a)continue;let T=this._cols[g];if(T.isMeasure)continue;let I=T.distinctCount??0;I<2||I>=D||N.push(g)}N.sort((g,T)=>(this._cols[g].distinctCount??0)-(this._cols[T].distinctCount??0));for(let g of N.slice(0,w)){let T=new Map,I=!0;for(let x of this._rows){let F=this.STR(x[a])+"",k=this.STR(x[g])+"",C=T.get(F);if(C===void 0)T.set(F,k);else if(C!==k){I=!1;break}}if(!I)continue;let E=this._cols[g].distinctCount??0;p.primaryParentColumn=this._cols[g].name,p.nestingRatio=Math.round(E/D*100)/100;break}}let W=.01,U=.05,v=.95,b=8,P=8,B=6,H=500,z=[];for(let a=0;a<this._cols.length&&z.length<P;a++){let p=this._cols[a].dataType;(p==="Double"||p==="Integer"||p==="Decimal")&&z.push(a)}if(z.length>=3&&this._rows.length>=b){let a=Math.min(this._rows.length,H),p=z.map(E=>{let x=[];for(let C=0;C<a;C++){let M=this._rows[C][E],G=typeof M=="number"?M:parseFloat(String(M).replace(/,/g,""));if(M==null||M===""||!isFinite(G))return null;x.push(G)}let F=x[0],k=!1;for(let C of x)if(C!==F){k=!0;break}return k?x:null}),D=z.map((E,x)=>x).filter(E=>p[E]!==null),N=E=>{let x=E.slice().sort((k,C)=>k-C),F=x.length>>1;return x.length%2?x[F]:(x[F-1]+x[F])/2},g=null,T=[],I=E=>{if(T.length>=3){let x=T.map(M=>p[M]),F=x[0].length,k=new Array(F);for(let M=0;M<F;M++){let G=0;for(let _ of x)G+=_[M];k[M]=G}let C=N(k);if(C>0){let M=0;for(let _ of k)Math.abs(_-C)<=C*W&&M++;let G=M/F;if(G>=v){let _=1;for(let y of x){let L=N(y)/C;L<_&&(_=L)}_>=U&&(!g||T.length>g.cols.length)&&(g={cols:T.slice(),total:C,matched:G})}}}if(!(T.length>=B))for(let x=E;x<D.length;x++)T.push(D[x]),I(x+1),T.pop()};if(I(0),g){let E=g,F={columns:E.cols.map(k=>this._cols[z[k]].name),total:Math.round(E.total*1e3)/1e3,matchedPct:Math.round(E.matched*100)/100};for(let k of E.cols)this._cols[z[k]].constantSumGroup=F}}return this.applySeriesCompleteness(i,n,s),this._computedStatsForLevel=e,this._cols}applySeriesCompleteness(e,n,r){for(let m of this._cols)m.seriesCompleteness!==void 0&&delete m.seriesCompleteness;let i=this._cols.map((m,R)=>({c:m,i:R})).filter(({c:m})=>m.isTemporal&&!m.isMeasure&&m.temporalCadence&&m.temporalCadence.grain!=="irregular");if(i.length===0)return;let s=[],o=[];this._cols.forEach((m,R)=>{let A=r[R];A&&(s.push(R),o.push({name:m.name,dataType:m.dataType,isMeasure:!!m.isMeasure,isTemporal:!!m.isTemporal,isDatePart:!!m.isDatePart,isReassembledDate:!!m.isReassembledDate,isBinaryFlag:!!m.isBinaryFlag,geoKind:m.geoKind,identifierNamed:rt(m.name),values:A,rows:this._rows.length,locale:n}))});let l=Je(o);if(l<0)return;let u=s[l],c=this._cols[u],d=this._rows.map(m=>this.STR(m[u])),f=e>=20&&(c.dataType!=="String"||Array.isArray(c.safeDistinctValues));for(let{c:m,i:R}of i){let A=et({periods:this._rows.map(O=>this.STR(O[R])),series:d,seriesColumn:c.name,pattern:m.temporalTextPattern,locale:n,includeDates:e>=20,includeNames:f});A&&(m.seriesCompleteness=A)}}updateColumnStats20(e,n,r,i,s,o,l,u,c,d,f,m){if(e>=20){let R=[...n].sort((S,w)=>S-w),A=Math.floor(R.length/2);if(r>0&&i!=null?s.avgValue=s.dataType=="Integer"?Math.round(i/r):i/r:s.avgValue=null,r>0&&(s.avgLength=o/r),this._rows.length>0){let S=w=>{let h=w instanceof Date?w:typeof w=="string"?ce(w)??new Date(w):new Date(w),W=this.wholeDayIso(h);return W?W+"T00:00:00.000Z":isNaN(h.getTime())?w:h.toISOString().slice(0,10)+"T00:00:00.000Z"};s.dataType!="DateTime"||l||!u?s.lowValue=u:s.lowValue=S(u),s.dataType!="DateTime"||l||!c?s.highValue=c:s.highValue=S(c),s.medianValue=R.length===0?null:R.length%2===0?s.dataType=="Integer"?Math.round((R[A-1]+R[A])/2):(R[A-1]+R[A])/2:R[A],s.numericPrecision=d}if(R.length>0){let S=s.avgValue??0,w=R.length,h=0,W=0;for(let v of R){let b=v-S;h+=b*b,W+=b*b*b}let U=h/w;s.skewness=U===0?0:W/w/Math.pow(Math.sqrt(U),3),s.stdDev=Math.sqrt(U)}i!==null&&(s.sum=i);let O=Array.from(f.entries()).sort((S,w)=>w[1]-S[1]);if(s.topCategories=O.slice(0,10).map(S=>S[1]),!s.isMeasure&&O.length>0){if(s.dataType==="String"){let S=O.map(h=>h[0]);s.formatSignature=re(S);let w=/^(UUID|EMAIL_LIKE|URL_LIKE|PHONE_LIKE|NUMERIC_ID|HEX_ID|OPAQUE_ID_ALPHANUMERIC|DATE_STR|BOOLEAN)$/;s.formatSignature&&!w.test(s.formatSignature)&&(s.avgLength===void 0||s.avgLength>=3)&&(s.isFreeText=!0)}else s.topCategoryValues=O.slice(0,5).map(S=>S[0]);if(e>=20){let S=O.map(h=>h[0]),w=ie(S,m);if(w!==null)s.ordinalPattern=w.pattern,s.orderedDomain=w.orderedDomain;else if(s.dataType==="String"){let h=Re(S);h!==null&&(s.safeDistinctValues=h)}}}if(R.length>=8&&(s.dataType==="Integer"||s.dataType==="Decimal")){let S=w=>R[Math.floor((R.length-1)*w)];s.quantiles={p05:S(.05),p25:S(.25),p75:S(.75),p95:S(.95)}}}if(!s.isMeasure&&f.size>0){let R=Array.from(f.entries()).sort((O,S)=>S[1]-O[1]),A=Ee(R.map(O=>O[0]),s.name,m);if(A!==null&&(s.geoKind=A.geoKind,s.geoMatchPct=A.geoMatchPct,A.geoAmbiguous&&(s.geoAmbiguous=!0),A.geoKind.indexOf("country")===0)){let O=me(R);O&&(s.dominantGeoRegion=O.dominantGeoRegion,s.dominantGeoRegionPct=O.dominantGeoRegionPct,s.geoRegionCount=O.regionCount)}}}updateColumnStats10(e,n,r,i,s,o,l){e>=10&&(n.blankCount=this._rows.length-r,n.distinctCount=i.size+(n.blankCount!=0?1:0),n.valueNature="Categorical",r>0&&(n.dataType==="Integer"||n.dataType==="Decimal"?n.valueNature=nt({dataType:n.dataType,isMeasure:!!n.isMeasure,name:n.name,distinct:i.size,nonblank:r,prec:s,maxval:o,minval:l}):n.dataType==="DateTime"&&(n.valueNature=n.dateWithTime?"Continuous":"Ordinal")))}getRowCount(){return this._rows.length}getLeafCardinality(){if(this._leafCardinality!==null)return this._leafCardinality;let e=[];if(this._cols.forEach((r,i)=>{r.isMeasure||e.push(i)}),e.length===0)return this._leafCardinality=this._rows.length,this._leafCardinality;let n=new Set;for(let r of this._rows)n.add(JSON.stringify(e.map(i=>r[i])));return this._leafCardinality=n.size,this._leafCardinality}_leafCardinality=null;getGeoExtent(){if(this._geoExtentComputed)return this._geoExtent;this._geoExtentComputed=!0,this._geoExtent=null;let e=o=>Se(o,{camel:!0}),n=-1,r=-1,i=-1;if(this._cols.forEach((o,l)=>{let u=e(o.name),c=o.dataType==="Integer"||o.dataType==="Decimal";c&&n<0&&u.some(d=>d==="lat"||d==="latitude")?n=l:c&&r<0&&u.some(d=>d==="lon"||d==="lng"||d==="long"||d==="longitude")&&(r=l),i<0&&!o.isMeasure&&typeof o.geoKind=="string"&&o.geoKind.indexOf("country")===0&&(i=l)}),n<0||r<0)return null;let s=[];for(let o of this._rows){let l=o[n],u=o[r],c=l==null||l===""?null:Number(l),d=u==null||u===""?null:Number(u);s.push({lat:c,lon:d,country:i>=0&&ae(this.STR(o[i]))?this.STR(o[i]):null})}return this._geoExtent=we(s),this._geoExtent}_geoExtent=null;_geoExtentComputed=!1;obfuscateString(e){return Oe(e,Ce)}toObjectArray(){let e=this.liveEnglishAliases();return this._rows.map(n=>{let r={};this._cols.forEach((i,s)=>{r[i.name]=n[s],this.emitLegacyAggAliases&&i.hostName&&i.hostName!==i.name&&!Object.prototype.hasOwnProperty.call(r,i.hostName)&&(r[i.hostName]=n[s])});for(let[i,s]of e)Object.prototype.hasOwnProperty.call(r,s.alias)||(r[s.alias]=n[i]);return r})}async getCSVAsync(e){let n=[],r=e?25:1e7,i=e?4e3:1e7,s=new Map;for(let l of this._rows){let u={};for(let c=0;c<this._cols.length;c++){let d=this._cols[c],f=l[c];if(this.STR(f)!=""){if(e&&d.dataType=="String")if(s.has(f))f=s.get(f);else{let m=this.obfuscateString(f);s.set(f,m),f=m}else if(d.dataType=="DateTime"&&!d.dateWithTime){let m=f instanceof Date?f:typeof f=="string"?ce(f)??new Date(f):new Date(f);f=(this.wholeDayIso(m)??m.toISOString().slice(0,10))+"T00:00:00.000Z"}i-=this.STR(f).length}else f=null;u[c]=f,--i}if(n.push(u),--r,r<=0||i<=0)break}return await tt.unparse(n,{header:!1})}getCSVHeaderLine(){let e=this.liveEnglishAliases();return tt.unparse([this._cols.map((n,r)=>{if(this.emitLegacyAggAliases&&n.hostName)return this.STR(n.hostName);let i=e.get(r);return this.STR(i&&i.headerName?i.alias:n.name)})])}setHostQueryNames(e){this._hostQueryNames=(e??[]).map(n=>n==null?null:this.STR(n)),this._englishAliases=new Map}aliasesForCode(e){let n=fe(e,this._cols)?this.legacyAliases():[];for(let r of this.englishAliasesFor(e).values())n.push({name:r.name,alias:r.alias,reason:"english-implicit-agg"});return n}armAliasesForCode(e){return this.emitLegacyAggAliases=fe(e,this._cols),this._englishAliases=this.englishAliasesFor(e),this.getArmedAliases()}getArmedAliases(){let e=this.emitLegacyAggAliases?this.legacyAliases():[];for(let n of this.liveEnglishAliases().values())e.push({name:n.name,alias:n.alias,reason:"english-implicit-agg"});return e}legacyAliases(){let e=[];for(let n of this._cols)n&&n.hostName&&n.hostName!==n.name&&e.push({name:this.STR(n.name),alias:this.STR(n.hostName),reason:"doubled-agg-prefix"});return e}englishAliasesFor(e){let n=new Map;if(!e||this._hostQueryNames.length===0||!this._cols||this._cols.length===0)return n;let r=String(e),i=new Set;for(let o of this._cols)o&&(i.add(this.STR(o.name)),o.hostName&&i.add(this.STR(o.hostName)));let s=new Map;for(let o=0;o<this._cols.length;o++){if(!this._cols[o])continue;let l=ze(this._hostQueryNames[o]).filter(u=>!i.has(u)&&ee(r,u));l.length===1&&s.set(l[0],[...s.get(l[0])??[],o])}for(let[o,l]of s){if(l.length!==1)continue;let u=this.STR(this._cols[l[0]].name);n.set(l[0],{name:u,alias:o,headerName:!ee(r,u)})}return n}liveEnglishAliases(){let e=new Map;for(let[n,r]of this._englishAliases){let i=this._cols?this._cols[n]:null;i&&this.STR(i.name)===r.name&&e.set(n,r)}return e}addRow(e,n){if(this.dedupRows){let r="";for(let s of e)r+=this.STR(s)+"~";let i=Ae(r);if(this._rowHashes.has(i))return!1;this._rowHashes.add(i)}return this._rows.push(Rn(e)),this._origIndices.push(n??-1),!0}getOriginalRowIndex(e){return e<0||e>=this._origIndices.length?-1:this._origIndices[e]}reset(){this._cols=[],this._rows=[],this._origIndices=[],this._rowHashes=new Set,this._leafCardinality=null,this._hostQueryNames=[],this._englishAliases=new Map}setColumns(e){if(this._cols=e,!e||e.length===0)return;let n=new Set(e.map(r=>this.STR(r?.name)));for(let r of e){if(!r)continue;let i=this.STR(r.name),s=We(i);!s||s===i||n.has(s)||(n.delete(i),n.add(s),r.hostName=i,r.name=s)}}};export{we as a,ut as b,ae as c,En as d,pt as e,ht as f,bt as g,yt as h,Ge as i,Mt as j,We as k,fe as l,ze as m,Ue as n,Nt as o,Ke as p,Ye as q,Dn as r,On as s,Pn as t,ee as u,Dt as v,Fn as w,Ot as x,Pt as y,ge as z,je as A,Zt as B,jt as C,Qt as D,nn as E,Je as F,et as G,rt as H,st as I,Cn as J,Mn as K,xn as L,nt as M,Rn as N,it as O};
|