@bicharts/shape-core 0.6.44 → 0.6.45

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/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 An,b as Nn}from"./chunk-UQU75XXR.mjs";import{a as Fn,b as I,c as kn,d as k,e as h,f as Gn,g as Y,h as Q}from"./chunk-HMLAY26J.mjs";import{a as Ln,b as Mn,c as _n,d as On,e as In}from"./chunk-JNKMTRKG.mjs";import{A as cn,B as dn,C as mn,D as fn,E as pn,F as yn,G as gn,H as hn,I as Cn,J as bn,K as Tn,L as En,M as Sn,N as Rn,O as xn,P as wn,Q as Pn,S as vn,a as Nt,b as Ft,c as kt,d as Gt,e as Wt,f as qt,g as zt,h as $t,i as Kt,j as Bt,k as Ht,l as jt,m as Yt,n as Qt,o as Xt,p as Jt,q as Zt,r as en,s as tn,t as nn,u as rn,v as on,w as sn,x as an,y as ln,z as un}from"./chunk-FUHYYIXD.mjs";import{a as Dt}from"./chunk-U3H6UBOO.mjs";import{a as Vt,b as Ut}from"./chunk-2LR73DNS.mjs";import{a as ae,b as le,c as _t,d as Ot,e as It,f as At}from"./chunk-VIWJJUDA.mjs";import{a as V,f as U,g as O,h as W,i as H,j as Tt,k as Et,l as se,m as L,n as St,o as Rt,p as xt,q,r as wt,s as Pt,t as vt,u as Lt,v as j,w as Mt}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,j as pt,k as yt,l as gt,m as ht,n as Ct,o as bt}from"./chunk-GXQQHMEY.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 Me,b as _e,c as Oe,d as Ie,e as Ae,f as K,g as Ne,h as Fe,i as ke,j as Ge,k as De,l as Ve,m as Ue,n as We,o as qe,p as ze,q as $e,r as Ke,s as Be,t as He,u as je,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=V(String(n));if(!W(o)&&!e.has(o)&&(e.add(o),e.size>=de))break}return Array.from(e)}function N(t){let e=F(t);if(e.length===0||ee(t)<95)return!1;let n=e.filter(u=>Z(u)&&!L(u)).length,o=e.filter(u=>!Z(u)&&!!L(u)).length;return n>=1&&n>=o}function ue(t,e){if(!L(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)L(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(V(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 Dn(t,e){let n=F(t);if(n.length===0)return 0;let o=0;for(let u of n)j(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 Vn(t,e){let n=0;for(let o of ne(t))e(o)&&n++;return n}function Un(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)`):N(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(N(S))continue;let v=z(S);if(v<95)continue;let $=J(S,D=>!!L(D)),Le=J(S,D=>!!L(D)&&!ue(D,o));$<X&&Le<1||(!i||v>i.pct)&&(i={name:c,pct:v})}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)&&!(Vn(c,v=>q(v).length>0)<X)){s.zip=i,p.add(i),l.push(`zip=${i} (${S}% ZIP codes)`);break}}let E=s.country;if(!E||!N(C(E))){let i=null;for(let c of g){if(p.has(c)||!N(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),v=Dn(S,o);v<H||J(S,$=>j($,o))<X||(!i||v>i.pct)&&(i={name:c,pct:v})}i&&(s.city=i.name,l.push(`city=${i.name} (${i.pct}% known cities)`))}let M=s.country?C(s.country):[],R=!!s.country&&N(M),_=R?new Set(M.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")}),Wn=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 qn(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 zn(t,e){let n=String(t??"").trim().normalize("NFC");if(!n)return null;for(let o of qn(n,e)){let u=re[o];if(u&&u.langs.includes(e))return u.part}return null}function $n(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 Kn(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),A=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},Bn=[["city","CityColumn"],["state","StateColumn"],["zip","ZipColumn"],["lat","LatColumn"],["lon","LonColumn"],["country","CountryColumn"]];function Ce(t,e){let n={};for(let[o,u]of Bn){let l=m(h(t,e+u));l&&(n[o]=l)}return n}function Hn(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 jn(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:Hn(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:A(e("isServiceError")),isRateLimited:A(e("isRateLimited")),isRefusal:A(e("isRefusal")),isVersionNotFound:A(e("isVersionNotFound")),isGenerationCancelled:A(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 Yn(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:A(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:A(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 Qn(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 Xn(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 Jn="FREEMIUM_ATTEMPT_SPENT",Zn="CLIENT_SECRET_MISMATCH",er="FREEMIUM_COLUMN_CAP";function tr(t){let e=t?.retryable;return typeof e=="boolean"?e:null}function nr(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 rr(t){let{width:e,height:n}=t.measure();return{request:{height:n,width:e},hints:{viewportWidth:e,viewportHeight:n}}}function or(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 ir(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 sr(t){let e=n=>t.renderers.has(n);return{supportsD3:e("D3"),supportsPlotly:e("PLOTLY"),supportsVega:e("VEGA")}}function ar(t){let e=t.cap!=null&&t.budget>t.cap?t.cap:t.budget;return{triesLeft:t.triesLeft??e,maxTries:e}}function lr(t){return t&&t>0?{leafCardinality:Math.round(t)}:{}}function Se(t,e){return t!=null&&e!=null&&t!==e}function ur(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 cr=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 cr[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 dr(t){return B(xe(t))}var mr=2,fr=3,pr=4,yr=64,gr=8e3,hr=6e4,Cr=Object.freeze({RENDER_START:"render-start",RENDER_OK:"render-ok",RENDER_ERROR:"render-error",VIEW:"view",VIEW_VERDICT:"view-verdict"});function br(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 Tr(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=I(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 Pe(t){return Object.assign(new Error(`The request did not finish within ${t} ms.`),{name:"TimeoutError"})}function Er(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 Sr(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=Er(b);if(T)throw T;let C=new AbortController,y=!1,f=setTimeout(()=>{y=!0,C.abort(Pe(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=P=>y?Pe(b):P,M;try{M=await n(u,{method:"POST",body:l,headers:a,credentials:o,signal:C.signal})}catch(P){throw g(),E(P)}let R=Y(M),_=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(P){throw E(P)}finally{g()}}};let x=R.body.getReader(),w=new ReadableStream({async pull(P){try{let i=await x.read();if(i.done){g(),P.close();return}P.enqueue(i.value)}catch(i){g(),P.error(E(i))}},cancel(P){return g(),x.cancel(P)}});return{status:R.status,..._,contentType:R.contentType,body:w,text:()=>new Response(w).text()}}}}var ve=300,Rr="/LLMChart/",xr="/LLMChart/qualify",wr="/VisionReview/",Pr="/LLMChart/sample",vr=t=>!!t&&typeof t=="object"&&t.name==="TimeoutError",ie=async t=>JSON.parse(await t.text());function Lr(t){try{t.body?t.body.cancel().catch(()=>{}):t.text().catch(()=>{})}catch{}}function Mr(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)}`,M={"Content-Type":"text/plain","X-Signature":k(d,o)},R=p.signal??void 0,_=(w,P)=>{let i=!!R?.aborted;return{kind:"transport",headersReceived:w,timedOut:!i&&vr(P),cancelled:i,error:P}},x;try{x=await u.post(E,d,M,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)Lr(x);else try{w=(await x.text()).slice(0,ve)}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",Rr,I(y),d,g=>Q(g,p))},async qualify(y,f){let d=C("qualify",f),p=d.route??xr;if(typeof p!="string"||!p.startsWith("/"))throw new TypeError("The qualify route must start with '/'");return T("qualify",p,I(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",wr,p,d,ie)},async sample(y,f){let d=C("sample",f);return T("sample",Pr,I(y),d,ie)}}}export{H as CITY_ROLE_MATCH_PCT,Cr 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,Wn as DATE_LEVEL_LANGUAGES,re as DATE_LEVEL_NAMES,me as DATE_LEVEL_NON_GREGORIAN_LANGUAGES,dn as DEFAULT_GAP_FACTOR,Je as DEFAULT_TEMPERATURE,Jn as FREEMIUM_ATTEMPT_SPENT,er as FREEMIUM_COLUMN_CAP,Qe as GET_RANDOM,ze as GLUED_STEM_MIN,Ke as HANGUL_MIN_STEM,ve as HTTP_BODY_START_CHARS,on as IDENTIFIER_HEAD_INITIAL,sn as IDENTIFIER_UNFOLDED,rn as IDENTIFIER_WORDS,qt as INTENSIVE_SUFFIX_TOKENS,Wt as INTENSIVE_WORD_TOKENS,vn as IndexedText,mn as MAX_RUN_BOUNDS,mt as PERIOD_CODE_FORMS,dt as PERIOD_CODE_MEMBERS,ft as PERIOD_ORDINALS,pt as PERIOD_UNFOLDED,$t as POSITIONAL_SUFFIX_TOKENS,zt as POSITIONAL_WORD_TOKENS,An as PREVIEW_OMITTED_FIELDS,Te as PROGRESS_STAGE_IDS,O as ROLE_MATCH_PCT,yn as SERIES_COMPLETENESS_MAX_LISTED,gn as SERIES_COMPLETENESS_MIN_FILL,hn as SERIES_KEY_MAX_DISTINCT,pr as SEV_ERROR,mr as SEV_INFO,yr as SEV_USER_PRESENTED,fr as SEV_WARNING,B as SIMPLE_STRING_HASH,Ye as STR,He as SUBSTRING_MIN,Me as SUPPORTED_LANGUAGES,_e as SUPPORTED_LANGUAGE_CODES,hr as TELEMETRY_TIMEOUT_DEV_MS,gr as TELEMETRY_TIMEOUT_MS,Ae as VOCABULARY_LANGUAGE_CODES,Ie as VOCABULARY_ONLY_LANGUAGES,st as YEAR_WORDS,z as admin1MatchPct,Zt as allowedAggregations,tr as answerIsRetryable,At as buildGeoIsoColumn,vt as buildGeoPointColumns,lt as calendarWordIn,sr as capabilityFields,Mt as cityMatchPct,Lt as cityTagsFor,wn as classifyAdditivity,Jt as classifyForAggregation,Pn as classifyNumericValueNature,Rn as classifyTemporal,jt as codeNeedsLegacyAggNames,ln as codeReadsColumn,un as codeReadsColumnsByRoleOrPosition,Ht as collapseRepeatedAggPrefix,cn as columnsTheCodeReads,kt as countryRegion,Mr as createGenerateClient,Tr as createTelemetryClient,nr as credentialFields,zn as dateLevelPart,$n as dateLevelYearAdmits,Ln as decimalSeparatorOf,en as defaultAggregation,Mn as detectDecimalSeparator,Dt as detectFormatSignature,_t as detectGeo,bt as detectOrdinalDomain,Sn as detectTextDatePattern,I as encodePayload,On as engineTypeForSqlType,Yt as englishImplicitAggNames,oe as eventLogLine,ir as fetchFields,Sr as fetchTransport,Fe as foldName,Kn as freemiumColumnCapRefusal,ye as freemiumColumnsOverCap,ge as freemiumDateHierarchyClauses,$e as gluedPrefixStems,Fn as gzipWireText,Be as hangulWordEndsWith,Bt as hasDefaultAggPrefix,Ve as hasUnsegmentedScript,xn as hostAggHint,In as ingest,tn as isAggregationAllowed,W as isBlankLike,Et as isCityTableLoaded,Xe as isDeterministicRefusal,br as isEventLogCode,wt as isGeoPointAmbiguity,En as isIdentifierName,It as isJoinGeoKind,Gn as isNdjsonContentType,ht as isOrdinalFriendlyName,kn as keyedSigner,lr as leafCardinalityField,rt as localMidnightDateColumns,nt as localMidnightToUtcDay,ct as localizedCycleIn,an as localizedIdentifierWordIn,ut as localizedYearWordIn,N as looksLikeCountryColumn,je as matchNameToken,or as maxNonMeasureCardinality,pn as measureCadence,Tn as measureSeriesCompleteness,k as messageSignature,Ut as monthLookupFor,Ge as nameLetterRuns,Xt as nameLooksIntensiveRate,Qt as nameLooksPositional,ke as nameWords,St as normalizeCountry,ot as normalizeLocalMidnightDates,Vt as normalizeMonthKey,V as normalizePlaceName,xt as normalizeZip5,ur as offeredShortlistFor,Ze as parseDateStable,jn as parseGenerateResponse,_n as parseNumberText,Yn as parseQualifyResponse,Qn as parseReviewVerdict,fn as parseTemporalPoint,Nn as payloadPreview,gt as periodCodeSeries,bn as pickSeriesColumn,Xn as progressStageOf,Q as readGenerateStream,De as readName,yt as readPeriodCode,h as readWireField,Tt as registerCityTable,Ft as registerIso3Regions,L as resolveAdmin1,Ee as resolveFetchVersion,Pt as resolveGeoPoint,Ne as resolveLanguage,Un as resolvePointRoles,ar as retryFields,Ct as safeDistinctValuesToShip,xe as schemaIdentity,dr as schemaIdentityKey,Re as schemaTypeFamily,Cn as seriesKeyVerdict,nn as shareOfTotalIsHonest,Se as shortlistIsStale,Kt as stripHostAggPrefix,Gt as summarizeCountryRegions,Nt as summarizeGeoExtent,Oe as supportedLanguage,Ot as toGeoIso,Ue as unsegmentedRuns,rr as viewportFields,K as vocabularyLanguage,et as wholeDayFrame,tt as wholeDayIso,Y as wireResponseFromFetch,qe as wordEndsWith,te as zipMatchPct,q as zipPrefixCandidates,Rt as zipToPrefix3};
2
+ import{a as Gn,b as Dn}from"./chunk-UQU75XXR.mjs";import{a as Vn,b as I,c as Un,d as k,e as h,f as Wn,g as Q,h as X}from"./chunk-HMLAY26J.mjs";import{a as In,b as Nn,c as An,d as Fn,e as kn}from"./chunk-JNKMTRKG.mjs";import{A as pn,B as gn,C as yn,D as hn,E as Cn,F as bn,G as En,H as Tn,I as Sn,J as Rn,K as xn,L as wn,M as _n,N as Pn,O as vn,P as Ln,Q as Mn,S as On,a as Dt,b as Vt,c as Ut,d as Wt,e as Ht,f as Kt,g as Bt,h as jt,i as Yt,j as Qt,k as Xt,l as Zt,m as Jt,n as en,o as tn,p as nn,q as rn,r as on,s as sn,t as an,u as ln,v as un,w as cn,x as dn,y as mn,z as fn}from"./chunk-FUHYYIXD.mjs";import{a as qt}from"./chunk-U3H6UBOO.mjs";import{a as zt,b as $t}from"./chunk-2LR73DNS.mjs";import{a as le,b as ue,c as At,d as Ft,e as kt,f as Gt}from"./chunk-VIWJJUDA.mjs";import{a as V,f as U,g as O,h as W,i as j,j as xt,k as wt,l as ae,m as v,n as _t,o as Pt,p as vt,q,r as Lt,s as Mt,t as Ot,u as It,v as Y,w as Nt}from"./chunk-TPVDJHU6.mjs";import"./chunk-5MRZID36.mjs";import{a as ut,b as ct,c as dt,d as mt,e as ft,f as pt,g as gt,h as yt,i as ht,j as Ct,k as bt,l as Et,m as Tt,n as St,o as Rt}from"./chunk-GXQQHMEY.mjs";import{A as nt,B as rt,C as ot,D as it,E as st,F as at,G as lt,a as Ne,b as Ae,c as Fe,d as ke,e as Ge,f as K,g as De,h as Ve,i as Ue,j as We,k as qe,l as ze,m as $e,n as He,o as Ke,p as Be,q as je,r as Ye,s as Qe,t as Xe,u as Ze,v as Je,x as B,y as et,z as tt}from"./chunk-4VN252CK.mjs";var Z=2,me=400;function ee(t){return!!U(t)}function F(t){let e=new Set;for(let n of t){if(n==null)continue;let o=V(String(n));if(!W(o)&&!e.has(o)&&(e.add(o),e.size>=me))break}return Array.from(e)}function A(t){let e=F(t);if(e.length===0||te(t)<95)return!1;let n=e.filter(u=>ee(u)&&!v(u)).length,o=e.filter(u=>!ee(u)&&!!v(u)).length;return n>=1&&n>=o}function ce(t,e){if(!v(t))return!1;let n=U(t);return n?e==="world"?!0:ae.has(n):!1}function te(t){let e=F(t);if(e.length===0)return 0;let n=0;for(let o of e)ee(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)v(o)&&n++;return Math.round(n/e.length*1e3)/10}function re(t){let e=new Set;for(let n of t){if(n==null)continue;let o=String(n).trim();if(!W(V(o))&&!e.has(o)&&(e.add(o),e.size>=me))break}return Array.from(e)}function ne(t){let e=re(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 de(t,e){return ue(e,le)?!0:re(t).some(n=>/^\d{5}(-\d{4})?$/.test(n.replace(/\.0+$/,"")))}function qn(t,e){let n=F(t);if(n.length===0)return 0;let o=0;for(let u of n)Y(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 zn(t,e){let n=0;for(let o of re(t))e(o)&&n++;return n}function $n(t,e,n,o,u){let l=[],a=[],i={},b={},E=new Set(t),C=s=>e.map(c=>c[s]);for(let s of["city","country"]){let c=n?.[s];c&&E.has(c)&&(i[s]=c)}let g=new Set(u??t);for(let s of["lat","lon"]){let c=n?.[s];c&&g.has(c)&&(i[s]=c)}let f=n?.zip;if(f&&E.has(f)){let s=C(f),c=ne(s);c<95?a.push(`zip=${f} (only ${c}% of values read as ZIPs)`):de(s,f)?i.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&&E.has(d)){let s=C(d),c=F(s);c.length>0&&c.every(S=>ce(S,o))?a.push(`state=${d} (every value is "CA", which is both Canada and California)`):A(s)?(a.push(`state=${d} (every value is a country, not a state)`),i.country||(i.country=d)):z(s)<95?a.push(`state=${d} (only ${z(s)}% of values are states/provinces)`):i.state=d}let p=new Set(Object.values(i).filter(Boolean)),y=t.filter(s=>!p.has(s)&&!s.startsWith("__"));if(!i.state){let s=null;for(let c of y){let S=C(c);if(A(S))continue;let P=z(S);if(P<95)continue;let H=J(S,D=>!!v(D)),Ie=J(S,D=>!!v(D)&&!ce(D,o));H<Z&&Ie<1||(!s||P>s.pct)&&(s={name:c,pct:P})}s&&(i.state=s.name,p.add(s.name),l.push(`state=${s.name} (${s.pct}% states/provinces)`))}if(!i.zip)for(let s of y){if(p.has(s))continue;let c=C(s),S=ne(c);if(!(S<95)&&de(c,s)&&!(zn(c,P=>q(P).length>0)<Z)){i.zip=s,p.add(s),l.push(`zip=${s} (${S}% ZIP codes)`);break}}let T=i.country;if(!T||!A(C(T))){let s=null;for(let c of y){if(p.has(c)||!A(C(c)))continue;let S=te(C(c));(!s||S>s.pct)&&(s={name:c,pct:S})}s&&(T&&(a.push(`country=${T} (only ${te(C(T))}% of values are country identifiers; using ${s.name} instead)`),b.country=T),i.country=s.name,p.add(s.name),l.push(`country=${s.name}`))}if(!i.city){let s=null;for(let c of y){if(p.has(c))continue;let S=C(c),P=qn(S,o);P<j||J(S,H=>Y(H,o))<Z||(!s||P>s.pct)&&(s={name:c,pct:P})}s&&(i.city=s.name,l.push(`city=${s.name} (${s.pct}% known cities)`))}let L=i.country?C(i.country):[],R=!!i.country&&A(L),M=R?new Set(L.map(s=>U(s==null?null:String(s))).filter(Boolean)).size:0,x=R&&M>=2,w=!!(i.lat&&i.lon)&&e.some(s=>{let c=+String(s[i.lat]??"").trim(),S=+String(s[i.lon]??"").trim();return isFinite(c)&&isFinite(S)&&c>=-90&&c<=90&&S>=-180&&S<=180&&String(s[i.lat]??"").trim()!==""&&String(s[i.lon]??"").trim()!==""});return i.lat&&i.lon&&!w&&a.push(`lat/lon=${i.lat}/${i.lon} (no row holds a usable coordinate pair)`),i.country&&!x&&!(i.city||i.state||i.zip||w)&&a.push(R?`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||w)?i:null,backfilled:l,refused:a,...Object.keys(b).length?{labelFallback:b}:{}}}var r=(t,...e)=>({part:t,langs:Object.freeze(e)}),oe=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")}),Hn=Object.freeze(Array.from(new Set(Object.values(oe).flatMap(t=>t.langs)))),fe=Object.freeze(["fa","ar","he","th"]),pe=1900,ge=2100;function Kn(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 Bn(t,e){let n=String(t??"").trim().normalize("NFC");if(!n)return null;for(let o of Kn(n,e)){let u=oe[o];if(u&&u.langs.includes(e))return u.part}return null}function jn(t,e){return fe.includes(t)?typeof e=="number"&&Number.isFinite(e)&&e>=pe&&e<=ge:!0}function ye(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Yn=/\b(?:columns|cols|column)\b/i;function $(t,e){let n=Math.max(0,e-240),o=t.slice(n,e),u=o.lastIndexOf(";");return u>=0&&(o=o.slice(u+1)),Yn.test(o)}function he(t,e){let n=ye(e),o=new RegExp(String.raw`(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=[^;]*?\.name\s*===?\s*(['"])${n}\2`,"g"),u=new RegExp(String.raw`\.name\s*===?\s*(['"])${n}\1`,"g"),l=0,a;for(;(a=u.exec(t))!==null;)$(t,a.index)&&l++;let i=0;for(;(a=o.exec(t))!==null;){let b=a.index+a[0].lastIndexOf(".name");if(!$(t,b))continue;i++;let E=ye(a[1]);if(!new RegExp(String.raw`\b${E}\s*(?:>=\s*0|>\s*-1|[!=]==?\s*-1)`).test(t))return!1}return i>0&&i===l}var Ce=["__rowIdx__","__geoIso__","__geoLat__","__geoLon__","__geoPrecision__"];function Qn(t,e){if(!t)return[];let n=new Set(e);for(let i of Ce)n.add(i);let o=new Set,u=/\.name\s*===?\s*(['"])([^'"]+)\1/g,l;for(;(l=u.exec(t))!==null;)$(t,l.index)&&o.add(l[2]);if(o.size===0)return[];let a=[];return o.forEach(i=>{n.has(i)||he(t,i)||a.push(i)}),a}function Xn(t,e){if(!t)return[];let n=(t.getColumns()||[]).map(o=>o.name);if(!e||typeof t.aliasesForCode!="function")return n;for(let o of t.aliasesForCode(e))n.push(o.alias);return n}function be(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 Zn(t,e,n){let o=be(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=Ee(n);return i.length===0?a:a+" "+i.join(" ")}function Ee(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():"",b=typeof l.name=="string"?l.name.trim():"",E=i!==""?i:b;E!==""&&o.set(a,E)}}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 m=t=>t==null?"":String(t),N=t=>t===!0,Te=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},Jn=[["city","CityColumn"],["state","StateColumn"],["zip","ZipColumn"],["lat","LatColumn"],["lon","LonColumn"],["country","CountryColumn"]];function Se(t,e){let n={};for(let[o,u]of Jn){let l=m(h(t,e+u));l&&(n[o]=l)}return n}function er(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 tr(t){let e=b=>h(t,b),n=e("retryAfterSeconds"),o=e("overrideThumbnailUpload"),u=e("forceThumbnailUpload"),l=Se(t,"point"),a=Se(t,"destPoint");Object.keys(a).length&&(l.dest=a);let i=e("retryable");return{errorMessage:m(e("errorMessage")),errorCode:m(e("errorCode")),refusalCode:m(e("refusalCode")),retryable:typeof i=="boolean"?i:null,notices:er(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:Te(e("creditBalanceBefore")),creditCost:Te(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 Re=t=>t==null?void 0:Number(t),G=t=>m(t)||void 0;function nr(t){let e=h(t,"charts"),n=h(t,"refused"),o=Array.isArray(e)?e.map(l=>{let a=b=>h(l,b),i=a("recommended");return{name:m(a("chartTypeName")??a("name")),description:m(a("description")??a("chartDesc")),rank:Re(a("rank")),score:Re(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: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 rr(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 xe=["working","analyze","generate","refine","review"];function or(t,e){let n=String(t??"").trim().toLowerCase();if(xe.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 ir="FREEMIUM_ATTEMPT_SPENT",sr="CLIENT_SECRET_MISMATCH",ar="FREEMIUM_COLUMN_CAP";function lr(t){let e=t?.retryable;return typeof e=="boolean"?e:null}function ur(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 cr(t){let{width:e,height:n}=t.measure();return{request:{height:n,width:e},hints:{viewportWidth:e,viewportHeight:n}}}function dr(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 we(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 mr(t){let e=t.fetchCorrelationId!=null,o=e||t.recoveryFetchVersion!=null?!1:t.genNew,u=we({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 fr(t){let e=n=>t.renderers.has(n);return{supportsD3:e("D3"),supportsPlotly:e("PLOTLY"),supportsVega:e("VEGA")}}function pr(t){let e=t.cap!=null&&t.budget>t.cap?t.cap:t.budget;return{triesLeft:t.triesLeft??e,maxTries:e}}function gr(t){return t&&t>0?{leafCardinality:Math.round(t)}:{}}function _e(t,e){return t!=null&&e!=null&&t!==e}function yr(t,e){return t?_e(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 hr=Object.freeze({integer:"number",decimal:"number",double:"number",datetime:"date",date:"date",boolean:"boolean",string:"text"});function Pe(t){let e=String(t??"").trim().toLowerCase();return hr[e]??e}function ve(t){let e="";for(let n of t)e+=JSON.stringify([String(n.name??""),n.isMeasure?"M":"D",Pe(n.dataType)]);return e}function Cr(t){return B(ve(t))}var br=2,Er=3,Tr=4,Sr=64,Rr=8e3,xr=6e4,wr=Object.freeze({RENDER_START:"render-start",RENDER_OK:"render-ok",RENDER_ERROR:"render-error",VIEW:"view",VIEW_VERDICT:"view-verdict"});function _r(t){return!!t&&!t.includes("|")&&!t.includes(",")}function ie(t,e,n,o){let u=`${t},${e}|${n}`;return o?`${u}|${Math.max(0,Math.round(o.count))}|${o.nonce}`:u}function Pr(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,b=()=>typeof e.baseUrl=="function"?e.baseUrl():e.baseUrl,E=g=>{try{e.onFailure?.(g)}catch{}},C=async(g,f,d,p)=>{let y;try{let T=await u.post(f,d,p,{timeoutMs:i});y=T.status;try{T.body?.cancel().catch(()=>{})}catch{}}catch(T){E({channel:g,stage:"post",status:null,error:T});return}(y<200||y>299)&&E({channel:g,stage:"status",status:y,error:null})};return{async sendClientMessage(g){let f,d,p;try{f=`${b()}${a}/LogClientMsg/?nocache=${l.now()}`,d=I(g),p=k(d,o)}catch(y){E({channel:"client-message",stage:"build",status:null,error:y});return}await C("client-message",f,d,{"Content-Type":"text/plain","X-Signature":p})},async countEvent(g,f,d){let p,y;try{p=`${b()}${a}/eventlog`,y=ie(g,e.clientVersion,f,d)}catch(T){E({channel:"event-count",stage:"build",status:null,error:T});return}await C("event-count",p,y,{"Content-Type":"text/plain"})}}}var Le=2**31-1;function Me(t){return Object.assign(new Error(`The request did not finish within ${t} ms.`),{name:"TimeoutError"})}function vr(t){return typeof t=="number"&&t>0&&t<=Le?null:new RangeError(`fetchTransport cannot keep a deadline of ${String(t)} ms: it must be a number of milliseconds above 0 and at most ${Le} (about 24.8 days), the longest a timer can wait. Nothing was sent.`)}function Lr(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 b=i.timeoutMs,E=vr(b);if(E)throw E;let C=new AbortController,g=!1,f=setTimeout(()=>{g=!0,C.abort(Me(b))},b),d=()=>C.abort(i.signal?.reason);i.signal&&(i.signal.aborted?d():i.signal.addEventListener("abort",d,{once:!0}));let p=!1,y=()=>{p||(p=!0,clearTimeout(f),i.signal?.removeEventListener("abort",d))},T=_=>g?Me(b):_,L;try{L=await n(u,{method:"POST",body:l,headers:a,credentials:o,signal:C.signal})}catch(_){throw y(),T(_)}let R=Q(L),M=R.statusText!==void 0?{statusText:R.statusText}:{};if(!R.body)return{status:R.status,...M,contentType:R.contentType,body:null,text:async()=>{try{return await R.text()}catch(_){throw T(_)}finally{y()}}};let x=R.body.getReader(),w=new ReadableStream({async pull(_){try{let s=await x.read();if(s.done){y(),_.close();return}_.enqueue(s.value)}catch(s){y(),_.error(T(s))}},cancel(_){return y(),x.cancel(_)}});return{status:R.status,...M,contentType:R.contentType,body:w,text:()=>new Response(w).text()}}}}var Oe=300,Mr="/LLMChart/",Or="/LLMChart/qualify",Ir="/VisionReview/",Nr="/LLMChart/sample",Ar=t=>!!t&&typeof t=="object"&&t.name==="TimeoutError",se=async t=>JSON.parse(await t.text());function Fr(t){try{t.body?t.body.cancel().catch(()=>{}):t.text().catch(()=>{})}catch{}}function kr(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,b=g=>e.nocache?e.nocache(g):String(l.now());async function E(g,f,d,p,y){let T=`${i()}${a}${f}?nocache=${b(g)}`,L={"Content-Type":"text/plain","X-Signature":k(d,o)},R=p.signal??void 0,M=(w,_)=>{let s=!!R?.aborted;return{kind:"transport",headersReceived:w,timedOut:!s&&Ar(_),cancelled:s,error:_}},x;try{x=await u.post(T,d,L,R?{timeoutMs:p.timeoutMs,signal:R}:{timeoutMs:p.timeoutMs})}catch(w){return M(!1,w)}if(x.status<200||x.status>299){let w="";if(p.readErrorBody===!1)Fr(x);else try{w=(await x.text()).slice(0,Oe)}catch{}return{kind:"http",status:x.status,statusText:x.statusText??"",bodyStart:w}}try{return{kind:"answer",status:x.status,value:await y(x)}}catch(w){return M(!0,w)}}function C(g,f){if(!f||typeof f.timeoutMs!="number"||!Number.isFinite(f.timeoutMs)||f.timeoutMs<=0)throw new TypeError(`The ${g} call needs a positive deadline in milliseconds`);return f}return{async generate(g,f){let d=C("generate",f),p=d.onStage??void 0;return E("generate",Mr,I(g),d,y=>X(y,p))},async qualify(g,f){let d=C("qualify",f),p=d.route??Or;if(typeof p!="string"||!p.startsWith("/"))throw new TypeError("The qualify route must start with '/'");return E("qualify",p,I(g),d,se)},async review(g,f){let d=C("review",f),p=JSON.stringify(g);if(typeof p!="string")throw new TypeError("The review wire did not serialize to JSON");return E("review",Ir,p,d,se)},async sample(g,f){let d=C("sample",f);return E("sample",Nr,I(g),d,se)}}}export{j as CITY_ROLE_MATCH_PCT,wr as CLIENT_EVENT_KINDS,sr as CLIENT_SECRET_MISMATCH,He as COMPOUND_MIN_STEM,ut as CYCLE_MEMBERS,dt as CYCLE_WORDS,ge as DATE_LEVEL_GREGORIAN_YEAR_MAX,pe as DATE_LEVEL_GREGORIAN_YEAR_MIN,Hn as DATE_LEVEL_LANGUAGES,oe as DATE_LEVEL_NAMES,fe as DATE_LEVEL_NON_GREGORIAN_LANGUAGES,gn as DEFAULT_GAP_FACTOR,nt as DEFAULT_TEMPERATURE,ir as FREEMIUM_ATTEMPT_SPENT,ar as FREEMIUM_COLUMN_CAP,et as GET_RANDOM,Be as GLUED_STEM_MIN,Ye as HANGUL_MIN_STEM,Ce as HOST_SYNTHETIC_COLUMNS,Oe as HTTP_BODY_START_CHARS,un as IDENTIFIER_HEAD_INITIAL,cn as IDENTIFIER_UNFOLDED,ln as IDENTIFIER_WORDS,Kt as INTENSIVE_SUFFIX_TOKENS,Ht as INTENSIVE_WORD_TOKENS,On as IndexedText,yn as MAX_RUN_BOUNDS,yt as PERIOD_CODE_FORMS,gt as PERIOD_CODE_MEMBERS,ht as PERIOD_ORDINALS,Ct as PERIOD_UNFOLDED,jt as POSITIONAL_SUFFIX_TOKENS,Bt as POSITIONAL_WORD_TOKENS,Gn as PREVIEW_OMITTED_FIELDS,xe as PROGRESS_STAGE_IDS,O as ROLE_MATCH_PCT,bn as SERIES_COMPLETENESS_MAX_LISTED,En as SERIES_COMPLETENESS_MIN_FILL,Tn as SERIES_KEY_MAX_DISTINCT,Tr as SEV_ERROR,br as SEV_INFO,Sr as SEV_USER_PRESENTED,Er as SEV_WARNING,B as SIMPLE_STRING_HASH,Je as STR,Xe as SUBSTRING_MIN,Ne as SUPPORTED_LANGUAGES,Ae as SUPPORTED_LANGUAGE_CODES,xr as TELEMETRY_TIMEOUT_DEV_MS,Rr as TELEMETRY_TIMEOUT_MS,Ge as VOCABULARY_LANGUAGE_CODES,ke as VOCABULARY_ONLY_LANGUAGES,ct as YEAR_WORDS,z as admin1MatchPct,rn as allowedAggregations,lr as answerIsRetryable,Gt as buildGeoIsoColumn,Ot as buildGeoPointColumns,mt as calendarWordIn,fr as capabilityFields,Nt as cityMatchPct,It as cityTagsFor,Ln as classifyAdditivity,nn as classifyForAggregation,Mn as classifyNumericValueNature,Pn as classifyTemporal,Zt as codeNeedsLegacyAggNames,mn as codeReadsColumn,fn as codeReadsColumnsByRoleOrPosition,Xt as collapseRepeatedAggPrefix,pn as columnsTheCodeReads,Ut as countryRegion,kr as createGenerateClient,Pr as createTelemetryClient,ur as credentialFields,Bn as dateLevelPart,jn as dateLevelYearAdmits,In as decimalSeparatorOf,on as defaultAggregation,Nn as detectDecimalSeparator,qt as detectFormatSignature,At as detectGeo,Rt as detectOrdinalDomain,_n as detectTextDatePattern,I as encodePayload,Fn as engineTypeForSqlType,Jt as englishImplicitAggNames,ie as eventLogLine,mr as fetchFields,Lr as fetchTransport,Ve as foldName,Zn as freemiumColumnCapRefusal,be as freemiumColumnsOverCap,Ee as freemiumDateHierarchyClauses,je as gluedPrefixStems,Xn as guardColumnNames,Vn as gzipWireText,Qe as hangulWordEndsWith,Qt as hasDefaultAggPrefix,ze as hasUnsegmentedScript,vn as hostAggHint,kn as ingest,sn as isAggregationAllowed,W as isBlankLike,wt as isCityTableLoaded,$ as isColumnContextRef,tt as isDeterministicRefusal,_r as isEventLogCode,Lt as isGeoPointAmbiguity,wn as isIdentifierName,kt as isJoinGeoKind,Wn as isNdjsonContentType,Tt as isOrdinalFriendlyName,Un as keyedSigner,gr as leafCardinalityField,at as localMidnightDateColumns,st as localMidnightToUtcDay,pt as localizedCycleIn,dn as localizedIdentifierWordIn,ft as localizedYearWordIn,A as looksLikeCountryColumn,Ze as matchNameToken,dr as maxNonMeasureCardinality,Cn as measureCadence,xn as measureSeriesCompleteness,k as messageSignature,Qn as missingHardColumnRefs,$t as monthLookupFor,We as nameLetterRuns,tn as nameLooksIntensiveRate,en as nameLooksPositional,he as nameProbeIsGuarded,Ue as nameWords,_t as normalizeCountry,lt as normalizeLocalMidnightDates,zt as normalizeMonthKey,V as normalizePlaceName,vt as normalizeZip5,yr as offeredShortlistFor,rt as parseDateStable,tr as parseGenerateResponse,An as parseNumberText,nr as parseQualifyResponse,rr as parseReviewVerdict,hn as parseTemporalPoint,Dn as payloadPreview,Et as periodCodeSeries,Rn as pickSeriesColumn,or as progressStageOf,X as readGenerateStream,qe as readName,bt as readPeriodCode,h as readWireField,xt as registerCityTable,Vt as registerIso3Regions,v as resolveAdmin1,we as resolveFetchVersion,Mt as resolveGeoPoint,De as resolveLanguage,$n as resolvePointRoles,pr as retryFields,St as safeDistinctValuesToShip,ve as schemaIdentity,Cr as schemaIdentityKey,Pe as schemaTypeFamily,Sn as seriesKeyVerdict,an as shareOfTotalIsHonest,_e as shortlistIsStale,Yt as stripHostAggPrefix,Wt as summarizeCountryRegions,Dt as summarizeGeoExtent,Fe as supportedLanguage,Ft as toGeoIso,$e as unsegmentedRuns,cr as viewportFields,K as vocabularyLanguage,ot as wholeDayFrame,it as wholeDayIso,Q as wireResponseFromFetch,Ke as wordEndsWith,ne as zipMatchPct,q as zipPrefixCandidates,Pt as zipToPrefix3};
@@ -0,0 +1,12 @@
1
+ export declare function isColumnContextRef(code: string, nameIdx: number): boolean;
2
+ export declare function nameProbeIsGuarded(code: string, name: string): boolean;
3
+ export declare const HOST_SYNTHETIC_COLUMNS: readonly string[];
4
+ export declare function missingHardColumnRefs(code: string, presentNames: Iterable<string>): string[];
5
+ export declare function guardColumnNames(index: {
6
+ getColumns(): Array<{
7
+ name: string;
8
+ }>;
9
+ aliasesForCode?(code: string): Array<{
10
+ alias: string;
11
+ }>;
12
+ } | null | undefined, code: string): string[];
@@ -44,6 +44,7 @@ export type { DataSource, IngestOptions, IngestResult, ColumnDescriptor, SqlColu
44
44
  export { payloadPreview, PREVIEW_OMITTED_FIELDS } from "./payloadPreview";
45
45
  export type { PayloadPreviewOptions } from "./payloadPreview";
46
46
  export { codeReadsColumn, codeReadsColumnsByRoleOrPosition, columnsTheCodeReads } from "./codeColumnReads";
47
+ export { isColumnContextRef, nameProbeIsGuarded, missingHardColumnRefs, HOST_SYNTHETIC_COLUMNS, guardColumnNames, } from "./columnRefScan";
47
48
  export { freemiumColumnsOverCap, freemiumColumnCapRefusal, freemiumDateHierarchyClauses } from "./freemiumCaps";
48
49
  export type { FreemiumColumnCapStatus, FreemiumDateGroupColumn } from "./freemiumCaps";
49
50
  export type { WireSigner, WireTransport, WireResponse, CredentialTriple, CredentialSource, ViewportSource, Clock, DiagnosticEntry, DiagnosticsSink, RendererId, WireServices, } from "./host/services";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bicharts/shape-core",
3
- "version": "0.6.44",
3
+ "version": "0.6.45",
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",