@bicharts/shape-core 0.6.70 → 0.6.75
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 qn,b as zn}from"./chunk-HIVICMC5.mjs";import{a as $n,b as I,c as Kn,d as k,e as E,f as Hn,g as X,h as J}from"./chunk-HMLAY26J.mjs";import{a as Gn,b as Dn,c as Vn,d as Un,e as Wn}from"./chunk-N52JPYZI.mjs";import{A as bn,B as En,C as Tn,D as Sn,E as Rn,F as xn,G as wn,H as _n,I as Pn,J as On,K as vn,L as Ln,M as Mn,N as In,O as Nn,P as An,Q as Fn,S as kn,a as zt,b as $t,c as Kt,d as Ht,e as Qt,f as Xt,g as Jt,h as Zt,i as en,j as tn,k as nn,l as rn,m as on,n as sn,o as an,p as ln,q as un,r as cn,s as dn,t as mn,u as fn,v as pn,w as gn,x as yn,y as hn,z as Cn}from"./chunk-OPDY2YEA.mjs";import{a as Bt}from"./chunk-U3H6UBOO.mjs";import{a as jt,b as Yt}from"./chunk-555PKUBU.mjs";import{a as le,b as ue,c as Vt,d as Ut,e as Wt,f as qt}from"./chunk-KQOVPOVU.mjs";import{a as M,b as V,c as Y,d as U,k as W,l as vt,m as Lt,n as ae,o as O,p as Mt,q as It,r as Nt,s as q,t as At,u as Ft,v as kt,w as Gt,x as Q,y as Dt}from"./chunk-INMDBTAR.mjs";import"./chunk-5MRZID36.mjs";import{a as ct,b as dt,c as mt,d as ft,e as pt,f as gt,g as yt,h as ht,i as Ct,j as bt,k as Et,l as Tt,m as _t,n as Pt,o as Ot}from"./chunk-GKXYRUK5.mjs";import{A as rt,B as ot,C as it,D as st,E as at,F as lt,G as ut,a as Ae,b as Fe,c as ke,d as Ge,e as De,f as B,g as Ve,h as Ue,i as We,j as qe,k as ze,l as $e,m as Ke,n as He,o as Be,p as je,q as Ye,r as Qe,s as Xe,t as Je,u as Ze,v as et,x as j,y as tt,z as nt}from"./chunk-4VN252CK.mjs";import{b as St,c as Rt,d as xt,e as wt}from"./chunk-5HI6TVMM.mjs";var Z=2,me=400;function te(t){return!!W(t)}function F(t){let e=new Set;for(let n of t){if(n==null)continue;let o=U(String(n));if(!V(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||ne(t)<95)return!1;let n=e.filter(u=>te(u)&&!O(u)).length,o=e.filter(u=>!te(u)&&!!O(u)).length;return n>=1&&n>=o}function ce(t,e){if(!O(t))return!1;let n=W(t);return n?e==="world"?!0:ae.has(n):!1}function ne(t){let e=F(t);if(e.length===0)return 0;let n=0;for(let o of e)te(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)O(o)&&n++;return Math.round(n/e.length*1e3)/10}function oe(t){let e=new Set;for(let n of t){if(n==null)continue;let o=String(n).trim();if(!V(U(o))&&!e.has(o)&&(e.add(o),e.size>=me))break}return Array.from(e)}function re(t){let e=oe(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:oe(t).some(n=>/^\d{5}(-\d{4})?$/.test(n.replace(/\.0+$/,"")))}function Bn(t,e){let n=F(t);if(n.length===0)return 0;let o=0;for(let u of n)Q(u,e)&&o++;return Math.round(o/n.length*1e3)/10}function ee(t,e){let n=0;for(let o of F(t))e(o)&&n++;return n}function jn(t,e){let n=0;for(let o of oe(t))e(o)&&n++;return n}function Yn(t,e,n,o,u){let l=[],a=[],i={},h={},C=new Set(t),y=s=>e.map(d=>d[s]);for(let s of["city","country"]){let d=n?.[s];d&&C.has(d)&&(i[s]=d)}let g=new Set(u??t);for(let s of["lat","lon"]){let d=n?.[s];d&&g.has(d)&&(i[s]=d)}let f=n?.zip;if(f&&C.has(f)){let s=y(f),d=re(s);d<95?a.push(`zip=${f} (only ${d}% 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 c=n?.state;if(c&&C.has(c)){let s=y(c),d=F(s);d.length>0&&d.every(S=>ce(S,o))?a.push(`state=${c} (every value is "CA", which is both Canada and California)`):A(s)?(a.push(`state=${c} (every value is a country, not a state)`),i.country||(i.country=c)):z(s)<95?a.push(`state=${c} (only ${z(s)}% of values are states/provinces)`):i.state=c}let p=new Set(Object.values(i).filter(Boolean)),b=t.filter(s=>!p.has(s)&&!s.startsWith("__"));if(!i.state){let s=null;for(let d of b){let S=y(d);if(A(S))continue;let P=z(S);if(P<95)continue;let H=ee(S,D=>!!O(D)),Ne=ee(S,D=>!!O(D)&&!ce(D,o));H<Z&&Ne<1||(!s||P>s.pct)&&(s={name:d,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 b){if(p.has(s))continue;let d=y(s),S=re(d);if(!(S<95)&&de(d,s)&&!(jn(d,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(y(T))){let s=null;for(let d of b){if(p.has(d)||!A(y(d)))continue;let S=ne(y(d));(!s||S>s.pct)&&(s={name:d,pct:S})}s&&(T&&(a.push(`country=${T} (only ${ne(y(T))}% of values are country identifiers; using ${s.name} instead)`),h.country=T),i.country=s.name,p.add(s.name),l.push(`country=${s.name}`))}if(!i.city){let s=null;for(let d of b){if(p.has(d))continue;let S=y(d),P=Bn(S,o);P<Y||ee(S,H=>Q(H,o))<Z||(!s||P>s.pct)&&(s={name:d,pct:P})}s&&(i.city=s.name,l.push(`city=${s.name} (${s.pct}% known cities)`))}let v=i.country?y(i.country):[],R=!!i.country&&A(v),L=R?new Set(v.map(s=>W(s==null?null:String(s))).filter(Boolean)).size:0,x=R&&L>=2,w=!!(i.lat&&i.lon)&&e.some(s=>{let d=+String(s[i.lat]??"").trim(),S=+String(s[i.lon]??"").trim();return isFinite(d)&&isFinite(S)&&d>=-90&&d<=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(h).length?{labelFallback:h}:{}}}var r=(t,...e)=>({part:t,langs:Object.freeze(e)}),ie=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")}),Qn=Object.freeze(Array.from(new Set(Object.values(ie).flatMap(t=>t.langs)))),fe=Object.freeze(["fa","ar","he","th"]),pe=1900,ge=2100;function Xn(t,e){let n=[],o=B(e);try{o&&n.push(t.toLocaleLowerCase(o.intl))}catch{}let u=t.toLowerCase();return n.includes(u)||n.push(u),n}function Jn(t,e){let n=String(t??"").trim().normalize("NFC");if(!n)return null;for(let o of Xn(n,e)){let u=ie[o];if(u&&u.langs.includes(e))return u.part}return null}function Zn(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 er=/\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)),er.test(o)}function he(t,e){return Ce(t,e,n=>new RegExp(String.raw`\b${n}\s*(?:>=\s*0|>\s*-1|[!=]==?\s*-1)`).test(t))}function Ce(t,e,n){let o=ye(e),u=new RegExp(String.raw`(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=[^;]*?\.name\s*===?\s*(['"])${o}\2`,"g"),l=new RegExp(String.raw`\.name\s*===?\s*(['"])${o}\1`,"g"),a=0,i;for(;(i=l.exec(t))!==null;)$(t,i.index)&&a++;let h=0;for(;(i=u.exec(t))!==null;){let C=i.index+i[0].lastIndexOf(".name");if(!$(t,C))continue;h++;let y=ye(i[1]);if(!n(y))return!1}return h>0&&h===a}function tr(t,e){return Ce(t,e,n=>new RegExp(String.raw`\b${n}\s*(?:>=\s*0|>\s*-1|!==?\s*-1)`).test(t)&&!new RegExp(String.raw`\b${n}\s*===?\s*-1`).test(t))}var be=["__rowIdx__","__geoIso__","__geoLat__","__geoLon__","__geoPrecision__"];function nr(t,e){if(!t)return[];let n=new Set(e);for(let i of be)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 rr(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 Ee(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 or(t,e,n){let o=Ee(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=Te(n);return i.length===0?a:a+" "+i.join(" ")}function Te(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():"",h=typeof l.name=="string"?l.name.trim():"",C=i!==""?i:h;C!==""&&o.set(a,C)}}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,Se=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},ir=[["city","CityColumn"],["state","StateColumn"],["zip","ZipColumn"],["lat","LatColumn"],["lon","LonColumn"],["country","CountryColumn"]];function Re(t,e){let n={};for(let[o,u]of ir){let l=m(E(t,e+u));l&&(n[o]=l)}return n}function sr(t){return Array.isArray(t)?t.map(e=>({code:m(E(e,"code")),severity:m(E(e,"severity")),text:m(E(e,"text"))})).filter(e=>e.text!==""):[]}function ar(t){let e=C=>E(t,C),n=e("retryAfterSeconds"),o=e("overrideThumbnailUpload"),u=e("forceThumbnailUpload"),l=Re(t,"point"),a=Re(t,"destPoint");Object.keys(a).length&&(l.dest=a);let i=e("retryable"),h=e("isPollFinal");return{errorMessage:m(e("errorMessage")),errorCode:m(e("errorCode")),refusalCode:m(e("refusalCode")),retryable:typeof i=="boolean"?i:null,notices:sr(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:Se(e("creditBalanceBefore")),creditCost:Se(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 h=="boolean"?{isPollFinal:h}:{},...m(e("pollOutcome"))!==""?{pollOutcome:m(e("pollOutcome"))}:{},...typeof o=="boolean"?{overrideThumbnailUpload:o}:{},...typeof u=="boolean"?{forceThumbnailUpload:u}:{}}}var xe=t=>t==null?void 0:Number(t),G=t=>m(t)||void 0;function lr(t){let e=E(t,"charts"),n=E(t,"refused"),o=Array.isArray(e)?e.map(l=>{let a=h=>E(l,h),i=a("recommended");return{name:m(a("chartTypeName")??a("name")),description:m(a("description")??a("chartDesc")),rank:xe(a("rank")),score:xe(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(E(l,"chartTypeName")??E(l,"name")),reason:m(E(l,"reason")),reasonCode:m(E(l,"reasonCode")),isVeto:N(E(l,"isVeto"))})).filter(l=>l.name):[];return{errorMessage:m(E(t,"errorMessage")),errorCode:m(E(t,"errorCode")),charts:o,refused:u,noFitSummary:m(E(t,"noFitSummary"))}}function ur(t){return!t||typeof t!="object"?null:{status:String(E(t,"status")??""),verdictReason:E(t,"verdictReason")??null,instruction:E(t,"instruction")??null,fix:E(t,"fix")??null,errorMessage:E(t,"errorMessage")??null,errorCode:E(t,"errorCode")??null}}var we=["working","analyze","generate","refine","review"];function cr(t,e){let n=String(t??"").trim().toLowerCase();if(we.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 dr="FREEMIUM_ATTEMPT_SPENT",mr="CLIENT_SECRET_MISMATCH",fr="FREEMIUM_COLUMN_CAP",pr="OAUTH_TOKEN_EXPIRED",gr="OAUTH_SIGNED_OUT";function yr(t){let e=t?.retryable;return typeof e=="boolean"?e:null}function hr(t){let e=t.linkNonce?(t.linkNonce()??"").trim():null,n=e?null:t.accessToken?(t.accessToken()??"").trim():null,o=e||n?{licensee:"",licenseKey:"",secretKey:""}:t.triple();return{request:{licenseKey:o.licenseKey,licensee:o.licensee,secretKey:o.secretKey,freemiumKey:t.freemiumKey?.()??""},linkNonce:e,accessToken:n}}function Cr(t){let{width:e,height:n}=t.measure();return{request:{height:n,width:e},hints:{viewportWidth:e,viewportHeight:n}}}function br(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 _e(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 Er(t){let e=t.fetchCorrelationId!=null,o=e||t.recoveryFetchVersion!=null?!1:t.genNew,u=_e({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 Tr(t){let e=n=>t.renderers.has(n);return{supportsD3:e("D3"),supportsPlotly:e("PLOTLY"),supportsVega:e("VEGA")}}function Sr(t){let e=t.cap!=null&&t.budget>t.cap?t.cap:t.budget;return{triesLeft:t.triesLeft??e,maxTries:e}}function Rr(t){return t&&t>0?{leafCardinality:Math.round(t)}:{}}function Pe(t,e){return t!=null&&e!=null&&t!==e}function xr(t,e){return t?Pe(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 wr=Object.freeze({integer:"number",decimal:"number",double:"number",datetime:"date",date:"date",boolean:"boolean",string:"text"});function Oe(t){let e=String(t??"").trim().toLowerCase();return wr[e]??e}function ve(t){let e="";for(let n of t)e+=JSON.stringify([String(n.name??""),n.isMeasure?"M":"D",Oe(n.dataType)]);return e}function _r(t){return j(ve(t))}var Pr=2,Or=3,vr=4,Lr=64,Mr=8e3,Ir=6e4,Nr=Object.freeze({RENDER_START:"render-start",RENDER_OK:"render-ok",RENDER_ERROR:"render-error",VIEW:"view",VIEW_VERDICT:"view-verdict"});function Ar(t){return!!t&&!t.includes("|")&&!t.includes(",")}function se(t,e,n,o){let u=`${t},${e}|${n}`;return o?`${u}|${Math.max(0,Math.round(o.count))}|${o.nonce}`:u}function Fr(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,h=()=>typeof e.baseUrl=="function"?e.baseUrl():e.baseUrl,C=g=>{try{e.onFailure?.(g)}catch{}},y=async(g,f,c,p)=>{let b;try{let T=await u.post(f,c,p,{timeoutMs:i});b=T.status;try{T.body?.cancel().catch(()=>{})}catch{}}catch(T){C({channel:g,stage:"post",status:null,error:T});return}(b<200||b>299)&&C({channel:g,stage:"status",status:b,error:null})};return{async sendClientMessage(g){let f,c,p;try{f=`${h()}${a}/LogClientMsg/?nocache=${l.now()}`,c=I(g),p=k(c,o)}catch(b){C({channel:"client-message",stage:"build",status:null,error:b});return}await y("client-message",f,c,{"Content-Type":"text/plain","X-Signature":p})},async countEvent(g,f,c){let p,b;try{p=`${h()}${a}/eventlog`,b=se(g,e.clientVersion,f,c)}catch(T){C({channel:"event-count",stage:"build",status:null,error:T});return}await y("event-count",p,b,{"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 kr(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 Gr(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 h=i.timeoutMs,C=kr(h);if(C)throw C;let y=new AbortController,g=!1,f=setTimeout(()=>{g=!0,y.abort(Me(h))},h),c=()=>y.abort(i.signal?.reason);i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c,{once:!0}));let p=!1,b=()=>{p||(p=!0,clearTimeout(f),i.signal?.removeEventListener("abort",c))},T=_=>g?Me(h):_,v;try{v=await n(u,{method:"POST",body:l,headers:a,credentials:o,signal:y.signal})}catch(_){throw b(),T(_)}let R=X(v),L=R.statusText!==void 0?{statusText:R.statusText}:{};if(!R.body)return{status:R.status,...L,contentType:R.contentType,body:null,text:async()=>{try{return await R.text()}catch(_){throw T(_)}finally{b()}}};let x=R.body.getReader(),w=new ReadableStream({async pull(_){try{let s=await x.read();if(s.done){b(),_.close();return}_.enqueue(s.value)}catch(s){b(),_.error(T(s))}},cancel(_){return b(),x.cancel(_)}});return{status:R.status,...L,contentType:R.contentType,body:w,text:()=>new Response(w).text()}}}}var Ie=300,Dr="/LLMChart/",Vr="/LLMChart/qualify",Ur="/VisionReview/",Wr="/LLMChart/sample",qr="/RefundGenerate/",zr=t=>!!t&&typeof t=="object"&&t.name==="TimeoutError",K=async t=>JSON.parse(await t.text());function $r(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,h=g=>e.nocache?e.nocache(g):String(l.now());async function C(g,f,c,p,b){let T=`${i()}${a}${f}?nocache=${h(g)}`,v={"Content-Type":"text/plain","X-Signature":k(c,o)},R=p.signal??void 0,L=(w,_)=>{let s=!!R?.aborted;return{kind:"transport",headersReceived:w,timedOut:!s&&zr(_),cancelled:s,error:_}},x;try{x=await u.post(T,c,v,R?{timeoutMs:p.timeoutMs,signal:R}:{timeoutMs:p.timeoutMs})}catch(w){return L(!1,w)}if(x.status<200||x.status>299){let w="";if(p.readErrorBody===!1)$r(x);else try{w=(await x.text()).slice(0,Ie)}catch{}return{kind:"http",status:x.status,statusText:x.statusText??"",bodyStart:w}}try{return{kind:"answer",status:x.status,value:await b(x)}}catch(w){return L(!0,w)}}function y(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 c=y("generate",f),p=c.onStage??void 0;return C("generate",Dr,I(g),c,b=>J(b,p))},async qualify(g,f){let c=y("qualify",f),p=c.route??Vr;if(typeof p!="string"||!p.startsWith("/"))throw new TypeError("The qualify route must start with '/'");return C("qualify",p,I(g),c,K)},async review(g,f){let c=y("review",f),p=JSON.stringify(g);if(typeof p!="string")throw new TypeError("The review wire did not serialize to JSON");return C("review",Ur,p,c,K)},async sample(g,f){let c=y("sample",f);return C("sample",Wr,I(g),c,K)},async refund(g,f){let c=y("refund",f);if(typeof g!="string"||g.trim()==="")throw new TypeError("A refund needs the generation's correlation id");return C("refund",qr,JSON.stringify({CorrelationID:g.trim()}),c,K)}}}export{Y as CITY_ROLE_MATCH_PCT,Nr as CLIENT_EVENT_KINDS,mr as CLIENT_SECRET_MISMATCH,He as COMPOUND_MIN_STEM,ct as CYCLE_MEMBERS,mt as CYCLE_WORDS,ge as DATE_LEVEL_GREGORIAN_YEAR_MAX,pe as DATE_LEVEL_GREGORIAN_YEAR_MIN,Qn as DATE_LEVEL_LANGUAGES,ie as DATE_LEVEL_NAMES,fe as DATE_LEVEL_NON_GREGORIAN_LANGUAGES,En as DEFAULT_GAP_FACTOR,rt as DEFAULT_TEMPERATURE,dr as FREEMIUM_ATTEMPT_SPENT,fr as FREEMIUM_COLUMN_CAP,tt as GET_RANDOM,je as GLUED_STEM_MIN,Qe as HANGUL_MIN_STEM,be as HOST_SYNTHETIC_COLUMNS,Ie as HTTP_BODY_START_CHARS,pn as IDENTIFIER_HEAD_INITIAL,gn as IDENTIFIER_UNFOLDED,fn as IDENTIFIER_WORDS,Xt as INTENSIVE_SUFFIX_TOKENS,Qt as INTENSIVE_WORD_TOKENS,kn as IndexedText,Rt as LOOSE_KEY_MIN_LENGTH,wt as LooseIndex,Tn as MAX_RUN_BOUNDS,gr as OAUTH_SIGNED_OUT,pr as OAUTH_TOKEN_EXPIRED,ht as PERIOD_CODE_FORMS,yt as PERIOD_CODE_MEMBERS,Ct as PERIOD_ORDINALS,bt as PERIOD_UNFOLDED,Zt as POSITIONAL_SUFFIX_TOKENS,Jt as POSITIONAL_WORD_TOKENS,qn as PREVIEW_OMITTED_FIELDS,we as PROGRESS_STAGE_IDS,M as ROLE_MATCH_PCT,xn as SERIES_COMPLETENESS_MAX_LISTED,wn as SERIES_COMPLETENESS_MIN_FILL,_n as SERIES_KEY_MAX_DISTINCT,vr as SEV_ERROR,Pr as SEV_INFO,Lr as SEV_USER_PRESENTED,Or as SEV_WARNING,j as SIMPLE_STRING_HASH,et as STR,Je as SUBSTRING_MIN,Ae as SUPPORTED_LANGUAGES,Fe as SUPPORTED_LANGUAGE_CODES,Ir as TELEMETRY_TIMEOUT_DEV_MS,Mr as TELEMETRY_TIMEOUT_MS,De as VOCABULARY_LANGUAGE_CODES,Ge as VOCABULARY_ONLY_LANGUAGES,dt as YEAR_WORDS,z as admin1MatchPct,un as allowedAggregations,yr as answerIsRetryable,qt as buildGeoIsoColumn,kt as buildGeoPointColumns,ft as calendarWordIn,Tr as capabilityFields,Dt as cityMatchPct,Gt as cityTagsFor,An as classifyAdditivity,ln as classifyForAggregation,Fn as classifyNumericValueNature,In as classifyTemporal,rn as codeNeedsLegacyAggNames,hn as codeReadsColumn,Cn as codeReadsColumnsByRoleOrPosition,nn as collapseRepeatedAggPrefix,bn as columnsTheCodeReads,Kt as countryRegion,Kr as createGenerateClient,Fr as createTelemetryClient,hr as credentialFields,Jn as dateLevelPart,Zn as dateLevelYearAdmits,Gn as decimalSeparatorOf,cn as defaultAggregation,Dn as detectDecimalSeparator,Bt as detectFormatSignature,Vt as detectGeo,Ot as detectOrdinalDomain,Mn as detectTextDatePattern,I as encodePayload,Un as engineTypeForSqlType,on as englishImplicitAggNames,se as eventLogLine,Er as fetchFields,Gr as fetchTransport,Ue as foldName,or as freemiumColumnCapRefusal,Ee as freemiumColumnsOverCap,Te as freemiumDateHierarchyClauses,Ye as gluedPrefixStems,rr as guardColumnNames,$n as gzipWireText,Xe as hangulWordEndsWith,tn as hasDefaultAggPrefix,$e as hasUnsegmentedScript,Nn as hostAggHint,Wn as ingest,dn as isAggregationAllowed,V as isBlankLike,Lt as isCityTableLoaded,$ as isColumnContextRef,nt as isDeterministicRefusal,Ar as isEventLogCode,At as isGeoPointAmbiguity,Ln as isIdentifierName,Wt as isJoinGeoKind,Hn as isNdjsonContentType,_t as isOrdinalFriendlyName,xt as isUsableLooseKey,Kn as keyedSigner,Rr as leafCardinalityField,lt as localMidnightDateColumns,at as localMidnightToUtcDay,gt as localizedCycleIn,yn as localizedIdentifierWordIn,pt as localizedYearWordIn,A as looksLikeCountryColumn,St as looseNameKey,Ze as matchNameToken,br as maxNonMeasureCardinality,Rn as measureCadence,vn as measureSeriesCompleteness,k as messageSignature,nr as missingHardColumnRefs,Yt as monthLookupFor,qe as nameLetterRuns,an as nameLooksIntensiveRate,sn as nameLooksPositional,he as nameProbeIsGuarded,tr as nameProbeKeepsDrawing,We as nameWords,Mt as normalizeCountry,ut as normalizeLocalMidnightDates,jt as normalizeMonthKey,U as normalizePlaceName,Nt as normalizeZip5,xr as offeredShortlistFor,ot as parseDateStable,ar as parseGenerateResponse,Vn as parseNumberText,lr as parseQualifyResponse,ur as parseReviewVerdict,Sn as parseTemporalPoint,zn as payloadPreview,Tt as periodCodeSeries,On as pickSeriesColumn,cr as progressStageOf,J as readGenerateStream,ze as readName,Et as readPeriodCode,E as readWireField,vt as registerCityTable,$t as registerIso3Regions,O as resolveAdmin1,_e as resolveFetchVersion,Ft as resolveGeoPoint,Ve as resolveLanguage,Yn as resolvePointRoles,Sr as retryFields,Pt as safeDistinctValuesToShip,ve as schemaIdentity,_r as schemaIdentityKey,Oe as schemaTypeFamily,Pn as seriesKeyVerdict,mn as shareOfTotalIsHonest,Pe as shortlistIsStale,en as stripHostAggPrefix,Ht as summarizeCountryRegions,zt as summarizeGeoExtent,ke as supportedLanguage,Ut as toGeoIso,Ke as unsegmentedRuns,Cr as viewportFields,B as vocabularyLanguage,it as wholeDayFrame,st as wholeDayIso,X as wireResponseFromFetch,Be as wordEndsWith,re as zipMatchPct,q as zipPrefixCandidates,It as zipToPrefix3};
|
|
2
|
+
import{a as $n,b as zn}from"./chunk-HIVICMC5.mjs";import{a as Hn,b as I,c as Kn,d as D,e as E,f as Bn,g as X,h as J}from"./chunk-HMLAY26J.mjs";import{a as Gn,b as Vn,c as Un,d as Wn,e as qn}from"./chunk-N52JPYZI.mjs";import{A as En,B as Tn,C as Sn,D as Rn,E as xn,F as wn,G as _n,H as On,I as vn,J as Pn,K as Ln,L as An,M as Mn,N as In,O as Nn,P as Fn,Q as Dn,S as kn,a as zt,b as Ht,c as Kt,d as Bt,e as Xt,f as Jt,g as Zt,h as en,i as tn,j as nn,k as rn,l as on,m as sn,n as an,o as ln,p as un,q as cn,r as dn,s as mn,t as fn,u as pn,v as gn,w as yn,x as hn,y as Cn,z as bn}from"./chunk-OPDY2YEA.mjs";import{a as jt}from"./chunk-U3H6UBOO.mjs";import{a as Yt,b as Qt}from"./chunk-555PKUBU.mjs";import{a as le,b as ue,c as Ut,d as Wt,e as qt,f as $t}from"./chunk-KQOVPOVU.mjs";import{a as M,b as V,c as Y,d as U,k as W,l as Lt,m as At,n as ae,o as v,p as Mt,q as It,r as Nt,s as q,t as Ft,u as Dt,v as kt,w as Gt,x as Q,y as Vt}from"./chunk-INMDBTAR.mjs";import"./chunk-5MRZID36.mjs";import{a as dt,b as mt,c as ft,d as pt,e as gt,f as yt,g as ht,h as Ct,i as bt,j as Et,k as Tt,l as St,m as Ot,n as vt,o as Pt}from"./chunk-GKXYRUK5.mjs";import{A as ot,B as it,C as st,D as at,E as lt,F as ut,G as ct,a as Fe,b as De,c as ke,d as Ge,e as Ve,f as B,g as Ue,h as We,i as qe,j as $e,k as ze,l as He,m as Ke,n as Be,o as je,p as Ye,q as Qe,r as Xe,s as Je,t as Ze,u as et,v as tt,x as j,y as nt,z as rt}from"./chunk-4VN252CK.mjs";import{b as Rt,c as xt,d as wt,e as _t}from"./chunk-5HI6TVMM.mjs";var Z=2,me=400;function te(e){return!!W(e)}function F(e){let t=new Set;for(let n of e){if(n==null)continue;let o=U(String(n));if(!V(o)&&!t.has(o)&&(t.add(o),t.size>=me))break}return Array.from(t)}function N(e){let t=F(e);if(t.length===0||ne(e)<95)return!1;let n=t.filter(l=>te(l)&&!v(l)).length,o=t.filter(l=>!te(l)&&!!v(l)).length;return n>=1&&n>=o}function ce(e,t){if(!v(e))return!1;let n=W(e);return n?t==="world"?!0:ae.has(n):!1}function ne(e){let t=F(e);if(t.length===0)return 0;let n=0;for(let o of t)te(o)&&n++;return Math.round(n/t.length*1e3)/10}function $(e){let t=F(e);if(t.length===0)return 0;let n=0;for(let o of t)v(o)&&n++;return Math.round(n/t.length*1e3)/10}function oe(e){let t=new Set;for(let n of e){if(n==null)continue;let o=String(n).trim();if(!V(U(o))&&!t.has(o)&&(t.add(o),t.size>=me))break}return Array.from(t)}function re(e){let t=oe(e);if(t.length===0)return 0;let n=0;for(let o of t)q(o).length>0&&n++;return Math.round(n/t.length*1e3)/10}function de(e,t){return ue(t,le)?!0:oe(e).some(n=>/^\d{5}(-\d{4})?$/.test(n.replace(/\.0+$/,"")))}function jn(e,t){let n=F(e);if(n.length===0)return 0;let o=0;for(let l of n)Q(l,t)&&o++;return Math.round(o/n.length*1e3)/10}function ee(e,t){let n=0;for(let o of F(e))t(o)&&n++;return n}function Yn(e,t){let n=0;for(let o of oe(e))t(o)&&n++;return n}function Qn(e,t,n,o,l){let u=[],a=[],i={},h={},C=new Set(e),y=s=>t.map(d=>d[s]);for(let s of["city","country"]){let d=n?.[s];d&&C.has(d)&&(i[s]=d)}let g=new Set(l??e);for(let s of["lat","lon"]){let d=n?.[s];d&&g.has(d)&&(i[s]=d)}let f=n?.zip;if(f&&C.has(f)){let s=y(f),d=re(s);d<95?a.push(`zip=${f} (only ${d}% 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 c=n?.state;if(c&&C.has(c)){let s=y(c),d=F(s);d.length>0&&d.every(S=>ce(S,o))?a.push(`state=${c} (every value is "CA", which is both Canada and California)`):N(s)?(a.push(`state=${c} (every value is a country, not a state)`),i.country||(i.country=c)):$(s)<95?a.push(`state=${c} (only ${$(s)}% of values are states/provinces)`):i.state=c}let p=new Set(Object.values(i).filter(Boolean)),b=e.filter(s=>!p.has(s)&&!s.startsWith("__"));if(!i.state){let s=null;for(let d of b){let S=y(d);if(N(S))continue;let O=$(S);if(O<95)continue;let K=ee(S,G=>!!v(G)),Ne=ee(S,G=>!!v(G)&&!ce(G,o));K<Z&&Ne<1||(!s||O>s.pct)&&(s={name:d,pct:O})}s&&(i.state=s.name,p.add(s.name),u.push(`state=${s.name} (${s.pct}% states/provinces)`))}if(!i.zip)for(let s of b){if(p.has(s))continue;let d=y(s),S=re(d);if(!(S<95)&&de(d,s)&&!(Yn(d,O=>q(O).length>0)<Z)){i.zip=s,p.add(s),u.push(`zip=${s} (${S}% ZIP codes)`);break}}let T=i.country;if(!T||!N(y(T))){let s=null;for(let d of b){if(p.has(d)||!N(y(d)))continue;let S=ne(y(d));(!s||S>s.pct)&&(s={name:d,pct:S})}s&&(T&&(a.push(`country=${T} (only ${ne(y(T))}% of values are country identifiers; using ${s.name} instead)`),h.country=T),i.country=s.name,p.add(s.name),u.push(`country=${s.name}`))}if(!i.city){let s=null;for(let d of b){if(p.has(d))continue;let S=y(d),O=jn(S,o);O<Y||ee(S,K=>Q(K,o))<Z||(!s||O>s.pct)&&(s={name:d,pct:O})}s&&(i.city=s.name,u.push(`city=${s.name} (${s.pct}% known cities)`))}let L=i.country?y(i.country):[],R=!!i.country&&N(L),A=R?new Set(L.map(s=>W(s==null?null:String(s))).filter(Boolean)).size:0,x=R&&A>=2,w=!!(i.lat&&i.lon)&&t.some(s=>{let d=+String(s[i.lat]??"").trim(),S=+String(s[i.lon]??"").trim();return isFinite(d)&&isFinite(S)&&d>=-90&&d<=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:u,refused:a,...Object.keys(h).length?{labelFallback:h}:{}}}var r=(e,...t)=>({part:e,langs:Object.freeze(t)}),ie=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(ie).flatMap(e=>e.langs)))),fe=Object.freeze(["fa","ar","he","th"]),pe=1900,ge=2100;function Jn(e,t){let n=[],o=B(t);try{o&&n.push(e.toLocaleLowerCase(o.intl))}catch{}let l=e.toLowerCase();return n.includes(l)||n.push(l),n}function Zn(e,t){let n=String(e??"").trim().normalize("NFC");if(!n)return null;for(let o of Jn(n,t)){let l=ie[o];if(l&&l.langs.includes(t))return l.part}return null}function er(e,t){return fe.includes(e)?typeof t=="number"&&Number.isFinite(t)&&t>=pe&&t<=ge:!0}function ye(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var tr=/\b(?:columns|cols|column)\b/i;function z(e,t){let n=Math.max(0,t-240),o=e.slice(n,t),l=o.lastIndexOf(";");return l>=0&&(o=o.slice(l+1)),tr.test(o)}function he(e,t){return Ce(e,t,n=>new RegExp(String.raw`\b${n}\s*(?:>=\s*0|>\s*-1|[!=]==?\s*-1)`).test(e))}function Ce(e,t,n){let o=ye(t),l=new RegExp(String.raw`(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=[^;]*?\.name\s*===?\s*(['"])${o}\2`,"g"),u=new RegExp(String.raw`\.name\s*===?\s*(['"])${o}\1`,"g"),a=0,i;for(;(i=u.exec(e))!==null;)z(e,i.index)&&a++;let h=0;for(;(i=l.exec(e))!==null;){let C=i.index+i[0].lastIndexOf(".name");if(!z(e,C))continue;h++;let y=ye(i[1]);if(!n(y))return!1}return h>0&&h===a}function nr(e,t){return Ce(e,t,n=>new RegExp(String.raw`\b${n}\s*(?:>=\s*0|>\s*-1|!==?\s*-1)`).test(e)&&!new RegExp(String.raw`\b${n}\s*===?\s*-1`).test(e))}var be=["__rowIdx__","__geoIso__","__geoLat__","__geoLon__","__geoPrecision__"];function rr(e,t){if(!e)return[];let n=new Set(t);for(let i of be)n.add(i);let o=new Set,l=/\.name\s*===?\s*(['"])([^'"]+)\1/g,u;for(;(u=l.exec(e))!==null;)z(e,u.index)&&o.add(u[2]);if(o.size===0)return[];let a=[];return o.forEach(i=>{n.has(i)||he(e,i)||a.push(i)}),a}function or(e,t){if(!e)return[];let n=(e.getColumns()||[]).map(o=>o.name);if(!t||typeof e.aliasesForCode!="function")return n;for(let o of e.aliasesForCode(t))n.push(o.alias);return n}function Ee(e,t){let n=t?.freemiumMaxShapeColumns;return typeof n!="number"||!isFinite(n)||n<1?null:!isFinite(e)||e<=n?0:Math.round(e-n)}function ir(e,t,n){let o=Ee(e,t);if(o===null||o<=0)return null;let l=typeof t?.freemiumColumnCapPivot=="number"?t.freemiumColumnCapPivot:4,u=o>l?t?.freemiumColumnCapMessageMany:t?.freemiumColumnCapMessageFew;if(typeof u!="string"||u.trim().length===0)return null;let a=u.split("{n}").join(String(o)).split("{fields}").join(o===1?"field":"fields"),i=Te(n);return i.length===0?a:a+" "+i.join(" ")}function Te(e){if(!e||e.length===0)return[];let t=[],n=new Map,o=new Map;for(let u of e){let a=typeof u?.dateGroupId=="string"?u.dateGroupId.trim():"";if(a!==""&&(n.has(a)||(t.push(a),n.set(a,0)),u.isDatePart===!0&&n.set(a,n.get(a)+1),u.isReassembledDate===!0&&!o.has(a))){let i=typeof u.sourceField=="string"?u.sourceField.trim():"",h=typeof u.name=="string"?u.name.trim():"",C=i!==""?i:h;C!==""&&o.set(a,C)}}let l=[];for(let u of t){let a=o.get(u),i=n.get(u)??0;!a||i===0||l.push(`'${a}' is a date hierarchy and counts as ${i+1} fields - bind the date itself instead of its hierarchy.`)}return l}var m=e=>e==null?"":String(e),P=e=>e===!0,Se=e=>{if(typeof e=="number")return Number.isFinite(e)?e:null;if(typeof e=="string"&&e.trim()!==""){let t=Number(e);return Number.isFinite(t)?t:null}return null},sr=[["city","CityColumn"],["state","StateColumn"],["zip","ZipColumn"],["lat","LatColumn"],["lon","LonColumn"],["country","CountryColumn"]];function Re(e,t){let n={};for(let[o,l]of sr){let u=m(E(e,t+l));u&&(n[o]=u)}return n}function ar(e){return Array.isArray(e)?e.map(t=>({code:m(E(t,"code")),severity:m(E(t,"severity")),text:m(E(t,"text"))})).filter(t=>t.text!==""):[]}function lr(e){let t=C=>E(e,C),n=t("retryAfterSeconds"),o=t("overrideThumbnailUpload"),l=t("forceThumbnailUpload"),u=Re(e,"point"),a=Re(e,"destPoint");Object.keys(a).length&&(u.dest=a);let i=t("retryable"),h=t("isPollFinal");return{errorMessage:m(t("errorMessage")),errorCode:m(t("errorCode")),refusalCode:m(t("refusalCode")),retryable:typeof i=="boolean"?i:null,notices:ar(t("notices")),freemiumStatusCode:m(t("freemiumStatusCode")),code:m(t("code")),language:m(t("language")),version:Number(t("version")??0),codeSummary:m(t("codeSummary")),chartName:m(t("chartName")??t("chartType")),finalChartName:m(t("finalChartName")),warningMessage:m(t("warningMessage")),outputHash:m(t("outputHash")),validatorToken:m(t("validatorToken")),editCodeKey:m(t("editCodeKey")),signedLLMRequestID:m(t("signedLLMRequestID")),userReply:m(t("userReply")),userReplyOutcome:m(t("userReplyOutcome")),improvementSuggestion:m(t("improvementSuggestion")),geoColumn:m(t("geoColumn")),geoKind:m(t("geoKind")),geoPointCols:Object.keys(u).length?u:null,creditBalanceBefore:Se(t("creditBalanceBefore")),creditCost:Se(t("creditCost")),isServiceError:P(t("isServiceError")),isRateLimited:P(t("isRateLimited")),isRefusal:P(t("isRefusal")),isVersionNotFound:P(t("isVersionNotFound")),isGenerationCancelled:P(t("isGenerationCancelled")),retryAfterSeconds:typeof n=="number"&&Number.isFinite(n)?n:null,servedCorrelationId:m(t("servedCorrelationId")),...typeof h=="boolean"?{isPollFinal:h}:{},...m(t("pollOutcome"))!==""?{pollOutcome:m(t("pollOutcome"))}:{},...typeof o=="boolean"?{overrideThumbnailUpload:o}:{},...typeof l=="boolean"?{forceThumbnailUpload:l}:{}}}var xe=e=>e==null?void 0:Number(e),k=e=>m(e)||void 0;function ur(e){let t=E(e,"charts"),n=E(e,"refused"),o=Array.isArray(t)?t.map(u=>{let a=h=>E(u,h),i=a("recommended");return{name:m(a("chartTypeName")??a("name")),description:m(a("description")??a("chartDesc")),rank:xe(a("rank")),score:xe(a("score")),renderer:k(a("renderer")),language:k(a("language")),isPreview:P(a("isPreview")),alsoWorthALook:P(a("alsoWorthALook")),recommended:typeof i=="boolean"?i:void 0,viaProjection:k(a("viaProjection")),viaProjectionKey:k(a("viaProjectionKey")),detailNote:k(a("detailNote"))}}).filter(u=>u.name):null,l=Array.isArray(n)?n.map(u=>({name:m(E(u,"chartTypeName")??E(u,"name")),reason:m(E(u,"reason")),reasonCode:m(E(u,"reasonCode")),isVeto:P(E(u,"isVeto"))})).filter(u=>u.name):[];return{errorMessage:m(E(e,"errorMessage")),errorCode:m(E(e,"errorCode")),charts:o,refused:l,noFitSummary:m(E(e,"noFitSummary"))}}function cr(e){return!e||typeof e!="object"?null:{status:String(E(e,"status")??""),verdictReason:E(e,"verdictReason")??null,instruction:E(e,"instruction")??null,fix:E(e,"fix")??null,errorMessage:E(e,"errorMessage")??null,errorCode:E(e,"errorCode")??null}}var we=["working","analyze","generate","refine","review"];function dr(e,t){let n=String(e??"").trim().toLowerCase();if(we.includes(n))return n;let o=String(t??"").toLowerCase();return o.includes("analyz")?"analyze":o.includes("generat")?"generate":o.includes("refin")?"refine":o.includes("review")?"review":null}var mr="FREEMIUM_ATTEMPT_SPENT",fr="CLIENT_SECRET_MISMATCH",pr="FREEMIUM_COLUMN_CAP",gr="OAUTH_TOKEN_EXPIRED",yr="OAUTH_SIGNED_OUT";function hr(e){let t=e?.retryable;return typeof t=="boolean"?t:null}function Cr(e){let t=e.linkNonce?(e.linkNonce()??"").trim():null,n=t?null:e.accessToken?(e.accessToken()??"").trim():null,o=t||n?{licensee:"",licenseKey:"",secretKey:""}:e.triple();return{request:{licenseKey:o.licenseKey,licensee:o.licensee,secretKey:o.secretKey,freemiumKey:e.freemiumKey?.()??""},linkNonce:t,accessToken:n}}function br(e){let{width:t,height:n}=e.measure();return{request:{height:n,width:t},hints:{viewportWidth:t,viewportHeight:n}}}function Er(e){let t=0;for(let n of e){if(n.isMeasure)continue;let o=n.distinctCount;typeof o=="number"&&o>t&&(t=o)}return t}function _e(e){if(e.recoveryFetchByCorrelation)return{version:null,fetchOnly:!0};if(e.recoveryFetchVersion!=null)return{version:e.recoveryFetchVersion,fetchOnly:!0};let t=e.settingVersion??null;if(e.genNew)return{version:t,fetchOnly:void 0};let n=(t??0)>0?t:null,o=(e.codeVersion??0)>0?e.codeVersion:null,l=n??o??t;return{version:l,fetchOnly:l!=null&&l>0?!0:void 0}}function Tr(e){let t=e.fetchCorrelationId!=null,o=t||e.recoveryFetchVersion!=null?!1:e.genNew,l=_e({genNew:o,recoveryFetchVersion:e.recoveryFetchVersion,recoveryFetchByCorrelation:t,settingVersion:e.settingVersion,codeVersion:e.codeVersion});return{genNew:o,version:l.version,fetchOnly:l.fetchOnly,fetchCorrelationId:e.fetchCorrelationId??void 0}}function Sr(e){let t=n=>e.renderers.has(n);return{supportsD3:t("D3"),supportsPlotly:t("PLOTLY"),supportsVega:t("VEGA")}}function Rr(e){let t=e.cap!=null&&e.budget>e.cap?e.cap:e.budget;return{triesLeft:e.triesLeft??t,maxTries:t}}function xr(e){return e&&e>0?{leafCardinality:Math.round(e)}:{}}var wr={fit:"Best fit",variety:"Something different"};function Oe(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return t==="fit"||t==="variety"?t:null}function _r(e){let t=Oe(e);return t?{qualifyOrder:t}:{}}function ve(e,t){return e!=null&&t!=null&&e!==t}function Or(e,t){return e?ve(t.capturedFor,t.now)?{shortlist:void 0,stale:!0}:{shortlist:{...e,ageMs:t.atMs>0?Math.max(0,Math.round(t.nowMs-t.atMs)):void 0},stale:!1}:{shortlist:void 0,stale:!1}}var vr=Object.freeze({integer:"number",decimal:"number",double:"number",datetime:"date",date:"date",boolean:"boolean",string:"text"});function Pe(e){let t=String(e??"").trim().toLowerCase();return vr[t]??t}function Le(e){let t="";for(let n of e)t+=JSON.stringify([String(n.name??""),n.isMeasure?"M":"D",Pe(n.dataType)]);return t}function Pr(e){return j(Le(e))}var Lr=2,Ar=3,Mr=4,Ir=64,Nr=8e3,Fr=6e4,Dr=Object.freeze({RENDER_START:"render-start",RENDER_OK:"render-ok",RENDER_ERROR:"render-error",VIEW:"view",VIEW_VERDICT:"view-verdict",REDRAW:"redraw",INTERACT:"interact"}),kr=Object.freeze(["open","generate","version","rebind","data","sample","fix","resize","other"]);function Gr(e,t){return t?`${t};draw:${e}`:`draw:${e}`}function Vr(e){return e.hint?e.hint:e.generated?"generate":e.previous?e.outputHash!==e.previous.outputHash?"version":e.dataSignature!==e.previous.dataSignature?"data":e.viewport!==e.previous.viewport?"resize":"other":"open"}function Ur(){let e=new Set,t=new Set;return{firstDraw(n,o){if(!n)return!1;let l=`${n}|${o}`;return e.has(l)?!1:(e.add(l),!0)},firstInteract(n){return!n||t.has(n)?!1:(t.add(n),!0)}}}function Wr(e){return!!e&&!e.includes("|")&&!e.includes(",")}function se(e,t,n,o){let l=`${e},${t}|${n}`;return o?`${l}|${Math.max(0,Math.round(o.count))}|${o.nonce}`:l}function qr(e,t){let n=e;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(!t||typeof t.baseUrl!="string"&&typeof t.baseUrl!="function")throw new TypeError("createTelemetryClient needs the service's base URL");if(typeof t.baseUrl=="string"&&t.baseUrl==="")throw new TypeError("createTelemetryClient needs the service's base URL");if(typeof t.clientVersion!="string"||t.clientVersion==="")throw new TypeError("createTelemetryClient needs the client version");if(typeof t.timeoutMs!="number"||!Number.isFinite(t.timeoutMs)||t.timeoutMs<=0)throw new TypeError("createTelemetryClient needs a positive deadline in milliseconds");let{signer:o,transport:l,clock:u}=n,a=t.apiPath??"/api",i=t.timeoutMs,h=()=>typeof t.baseUrl=="function"?t.baseUrl():t.baseUrl,C=g=>{try{t.onFailure?.(g)}catch{}},y=async(g,f,c,p)=>{let b;try{let T=await l.post(f,c,p,{timeoutMs:i});b=T.status;try{T.body?.cancel().catch(()=>{})}catch{}}catch(T){C({channel:g,stage:"post",status:null,error:T});return}(b<200||b>299)&&C({channel:g,stage:"status",status:b,error:null})};return{async sendClientMessage(g){let f,c,p;try{f=`${h()}${a}/LogClientMsg/?nocache=${u.now()}`,c=I(g),p=D(c,o)}catch(b){C({channel:"client-message",stage:"build",status:null,error:b});return}await y("client-message",f,c,{"Content-Type":"text/plain","X-Signature":p})},async countEvent(g,f,c){let p,b;try{p=`${h()}${a}/eventlog`,b=se(g,t.clientVersion,f,c)}catch(T){C({channel:"event-count",stage:"build",status:null,error:T});return}await y("event-count",p,b,{"Content-Type":"text/plain"})}}}var Ae=2**31-1;function Me(e){return Object.assign(new Error(`The request did not finish within ${e} ms.`),{name:"TimeoutError"})}function $r(e){return typeof e=="number"&&e>0&&e<=Ae?null:new RangeError(`fetchTransport cannot keep a deadline of ${String(e)} ms: it must be a number of milliseconds above 0 and at most ${Ae} (about 24.8 days), the longest a timer can wait. Nothing was sent.`)}function zr(e,t={}){if(typeof e!="function")throw new TypeError("fetchTransport needs the host's fetch");let n=e,o=t.credentials??"omit";return{async post(l,u,a,i){let h=i.timeoutMs,C=$r(h);if(C)throw C;let y=new AbortController,g=!1,f=setTimeout(()=>{g=!0,y.abort(Me(h))},h),c=()=>y.abort(i.signal?.reason);i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c,{once:!0}));let p=!1,b=()=>{p||(p=!0,clearTimeout(f),i.signal?.removeEventListener("abort",c))},T=_=>g?Me(h):_,L;try{L=await n(l,{method:"POST",body:u,headers:a,credentials:o,signal:y.signal})}catch(_){throw b(),T(_)}let R=X(L),A=R.statusText!==void 0?{statusText:R.statusText}:{};if(!R.body)return{status:R.status,...A,contentType:R.contentType,body:null,text:async()=>{try{return await R.text()}catch(_){throw T(_)}finally{b()}}};let x=R.body.getReader(),w=new ReadableStream({async pull(_){try{let s=await x.read();if(s.done){b(),_.close();return}_.enqueue(s.value)}catch(s){b(),_.error(T(s))}},cancel(_){return b(),x.cancel(_)}});return{status:R.status,...A,contentType:R.contentType,body:w,text:()=>new Response(w).text()}}}}var Ie=300,Hr="/LLMChart/",Kr="/LLMChart/qualify",Br="/VisionReview/",jr="/LLMChart/sample",Yr="/RefundGenerate/",Qr=e=>!!e&&typeof e=="object"&&e.name==="TimeoutError",H=async e=>JSON.parse(await e.text());function Xr(e){try{e.body?e.body.cancel().catch(()=>{}):e.text().catch(()=>{})}catch{}}function Jr(e,t){let n=e;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(!t||typeof t.baseUrl!="string"&&typeof t.baseUrl!="function")throw new TypeError("createGenerateClient needs the service's base URL");if(typeof t.baseUrl=="string"&&t.baseUrl==="")throw new TypeError("createGenerateClient needs the service's base URL");if(t.apiPath!==void 0&&typeof t.apiPath!="string")throw new TypeError("createGenerateClient's apiPath must be a string");if(t.nocache!==void 0&&t.nocache!==null&&typeof t.nocache!="function")throw new TypeError("createGenerateClient's nocache must be a function");let{signer:o,transport:l,clock:u}=n,a=t.apiPath??"/api",i=()=>typeof t.baseUrl=="function"?t.baseUrl():t.baseUrl,h=g=>t.nocache?t.nocache(g):String(u.now());async function C(g,f,c,p,b){let T=`${i()}${a}${f}?nocache=${h(g)}`,L={"Content-Type":"text/plain","X-Signature":D(c,o)},R=p.signal??void 0,A=(w,_)=>{let s=!!R?.aborted;return{kind:"transport",headersReceived:w,timedOut:!s&&Qr(_),cancelled:s,error:_}},x;try{x=await l.post(T,c,L,R?{timeoutMs:p.timeoutMs,signal:R}:{timeoutMs:p.timeoutMs})}catch(w){return A(!1,w)}if(x.status<200||x.status>299){let w="";if(p.readErrorBody===!1)Xr(x);else try{w=(await x.text()).slice(0,Ie)}catch{}return{kind:"http",status:x.status,statusText:x.statusText??"",bodyStart:w}}try{return{kind:"answer",status:x.status,value:await b(x)}}catch(w){return A(!0,w)}}function y(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 c=y("generate",f),p=c.onStage??void 0;return C("generate",Hr,I(g),c,b=>J(b,p))},async qualify(g,f){let c=y("qualify",f),p=c.route??Kr;if(typeof p!="string"||!p.startsWith("/"))throw new TypeError("The qualify route must start with '/'");return C("qualify",p,I(g),c,H)},async review(g,f){let c=y("review",f),p=JSON.stringify(g);if(typeof p!="string")throw new TypeError("The review wire did not serialize to JSON");return C("review",Br,p,c,H)},async sample(g,f){let c=y("sample",f);return C("sample",jr,I(g),c,H)},async refund(g,f){let c=y("refund",f);if(typeof g!="string"||g.trim()==="")throw new TypeError("A refund needs the generation's correlation id");return C("refund",Yr,JSON.stringify({CorrelationID:g.trim()}),c,H)}}}export{Y as CITY_ROLE_MATCH_PCT,Dr as CLIENT_EVENT_KINDS,fr as CLIENT_SECRET_MISMATCH,Be as COMPOUND_MIN_STEM,dt as CYCLE_MEMBERS,ft as CYCLE_WORDS,ge as DATE_LEVEL_GREGORIAN_YEAR_MAX,pe as DATE_LEVEL_GREGORIAN_YEAR_MIN,Xn as DATE_LEVEL_LANGUAGES,ie as DATE_LEVEL_NAMES,fe as DATE_LEVEL_NON_GREGORIAN_LANGUAGES,Tn as DEFAULT_GAP_FACTOR,ot as DEFAULT_TEMPERATURE,kr as DRAW_REASONS,mr as FREEMIUM_ATTEMPT_SPENT,pr as FREEMIUM_COLUMN_CAP,nt as GET_RANDOM,Ye as GLUED_STEM_MIN,Xe as HANGUL_MIN_STEM,be as HOST_SYNTHETIC_COLUMNS,Ie as HTTP_BODY_START_CHARS,gn as IDENTIFIER_HEAD_INITIAL,yn as IDENTIFIER_UNFOLDED,pn as IDENTIFIER_WORDS,Jt as INTENSIVE_SUFFIX_TOKENS,Xt as INTENSIVE_WORD_TOKENS,kn as IndexedText,xt as LOOSE_KEY_MIN_LENGTH,_t as LooseIndex,Sn as MAX_RUN_BOUNDS,yr as OAUTH_SIGNED_OUT,gr as OAUTH_TOKEN_EXPIRED,Ct as PERIOD_CODE_FORMS,ht as PERIOD_CODE_MEMBERS,bt as PERIOD_ORDINALS,Et as PERIOD_UNFOLDED,en as POSITIONAL_SUFFIX_TOKENS,Zt as POSITIONAL_WORD_TOKENS,$n as PREVIEW_OMITTED_FIELDS,we as PROGRESS_STAGE_IDS,wr as QUALIFY_ORDER_LABELS,M as ROLE_MATCH_PCT,wn as SERIES_COMPLETENESS_MAX_LISTED,_n as SERIES_COMPLETENESS_MIN_FILL,On as SERIES_KEY_MAX_DISTINCT,Mr as SEV_ERROR,Lr as SEV_INFO,Ir as SEV_USER_PRESENTED,Ar as SEV_WARNING,j as SIMPLE_STRING_HASH,tt as STR,Ze as SUBSTRING_MIN,Fe as SUPPORTED_LANGUAGES,De as SUPPORTED_LANGUAGE_CODES,Fr as TELEMETRY_TIMEOUT_DEV_MS,Nr as TELEMETRY_TIMEOUT_MS,Ve as VOCABULARY_LANGUAGE_CODES,Ge as VOCABULARY_ONLY_LANGUAGES,mt as YEAR_WORDS,$ as admin1MatchPct,cn as allowedAggregations,hr as answerIsRetryable,$t as buildGeoIsoColumn,kt as buildGeoPointColumns,pt as calendarWordIn,Sr as capabilityFields,Vt as cityMatchPct,Gt as cityTagsFor,Fn as classifyAdditivity,Vr as classifyDraw,un as classifyForAggregation,Dn as classifyNumericValueNature,In as classifyTemporal,on as codeNeedsLegacyAggNames,Cn as codeReadsColumn,bn as codeReadsColumnsByRoleOrPosition,rn as collapseRepeatedAggPrefix,En as columnsTheCodeReads,Kt as countryRegion,Ur as createDrawLedger,Jr as createGenerateClient,qr as createTelemetryClient,Cr as credentialFields,Zn as dateLevelPart,er as dateLevelYearAdmits,Gn as decimalSeparatorOf,dn as defaultAggregation,Vn as detectDecimalSeparator,jt as detectFormatSignature,Ut as detectGeo,Pt as detectOrdinalDomain,Mn as detectTextDatePattern,Gr as drawLocation,I as encodePayload,Wn as engineTypeForSqlType,sn as englishImplicitAggNames,se as eventLogLine,Tr as fetchFields,zr as fetchTransport,We as foldName,ir as freemiumColumnCapRefusal,Ee as freemiumColumnsOverCap,Te as freemiumDateHierarchyClauses,Qe as gluedPrefixStems,or as guardColumnNames,Hn as gzipWireText,Je as hangulWordEndsWith,nn as hasDefaultAggPrefix,He as hasUnsegmentedScript,Nn as hostAggHint,qn as ingest,mn as isAggregationAllowed,V as isBlankLike,At as isCityTableLoaded,z as isColumnContextRef,rt as isDeterministicRefusal,Wr as isEventLogCode,Ft as isGeoPointAmbiguity,An as isIdentifierName,qt as isJoinGeoKind,Bn as isNdjsonContentType,Ot as isOrdinalFriendlyName,wt as isUsableLooseKey,Kn as keyedSigner,xr as leafCardinalityField,ut as localMidnightDateColumns,lt as localMidnightToUtcDay,yt as localizedCycleIn,hn as localizedIdentifierWordIn,gt as localizedYearWordIn,N as looksLikeCountryColumn,Rt as looseNameKey,et as matchNameToken,Er as maxNonMeasureCardinality,xn as measureCadence,Ln as measureSeriesCompleteness,D as messageSignature,rr as missingHardColumnRefs,Qt as monthLookupFor,$e as nameLetterRuns,ln as nameLooksIntensiveRate,an as nameLooksPositional,he as nameProbeIsGuarded,nr as nameProbeKeepsDrawing,qe as nameWords,Mt as normalizeCountry,ct as normalizeLocalMidnightDates,Yt as normalizeMonthKey,U as normalizePlaceName,Nt as normalizeZip5,Or as offeredShortlistFor,it as parseDateStable,lr as parseGenerateResponse,Un as parseNumberText,ur as parseQualifyResponse,cr as parseReviewVerdict,Rn as parseTemporalPoint,zn as payloadPreview,St as periodCodeSeries,Pn as pickSeriesColumn,dr as progressStageOf,_r as qualifyOrderField,Oe as qualifyOrderOf,J as readGenerateStream,ze as readName,Tt as readPeriodCode,E as readWireField,Lt as registerCityTable,Ht as registerIso3Regions,v as resolveAdmin1,_e as resolveFetchVersion,Dt as resolveGeoPoint,Ue as resolveLanguage,Qn as resolvePointRoles,Rr as retryFields,vt as safeDistinctValuesToShip,Le as schemaIdentity,Pr as schemaIdentityKey,Pe as schemaTypeFamily,vn as seriesKeyVerdict,fn as shareOfTotalIsHonest,ve as shortlistIsStale,tn as stripHostAggPrefix,Bt as summarizeCountryRegions,zt as summarizeGeoExtent,ke as supportedLanguage,Wt as toGeoIso,Ke as unsegmentedRuns,br as viewportFields,B as vocabularyLanguage,st as wholeDayFrame,at as wholeDayIso,X as wireResponseFromFetch,je as wordEndsWith,re as zipMatchPct,q as zipPrefixCandidates,It as zipToPrefix3};
|
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Freemium entitlement walls a host can ANTICIPATE, in the server's own words.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* twelve. The server did everything right: it refused at the routing boundary in 31 ms, charged
|
|
8
|
-
* nothing, handed the rate-limit slot back, and composed a sentence naming exactly how many fields
|
|
9
|
-
* to drop. The response never came back through the proxy, so what the reader actually read was
|
|
10
|
-
* "We couldn't reach the charting service - it may be offline, or blocked on this network", and
|
|
11
|
-
* they left inside a second.
|
|
12
|
-
*
|
|
13
|
-
* The question never needed the wire. The bound column count and the freemium state are both in
|
|
14
|
-
* the host's hand before the request is built.
|
|
4
|
+
* The question never needs the wire: the bound column count and the freemium state are both in
|
|
5
|
+
* the host's hand before the request is built, so a host can say so before a refusal has to
|
|
6
|
+
* travel back through a network that may swallow it.
|
|
15
7
|
*
|
|
16
8
|
* TWO RULES THIS MODULE EXISTS TO KEEP:
|
|
17
9
|
*
|
package/dist/types/index.d.ts
CHANGED
|
@@ -57,12 +57,12 @@ export { parseGenerateResponse, parseQualifyResponse, parseReviewVerdict } from
|
|
|
57
57
|
export type { ParsedGenerateResponse, ParsedQualifyResponse, ParsedQualifyChart, ParsedQualifyRefusal, ParsedReviewVerdict, ParsedNotice, WirePointBinding, WirePointColumns, } from "./wireParse";
|
|
58
58
|
export { PROGRESS_STAGE_IDS, progressStageOf, FREEMIUM_ATTEMPT_SPENT, CLIENT_SECRET_MISMATCH, FREEMIUM_COLUMN_CAP, OAUTH_TOKEN_EXPIRED, OAUTH_SIGNED_OUT, answerIsRetryable, } from "./messageCodes";
|
|
59
59
|
export type { ProgressStageId } from "./messageCodes";
|
|
60
|
-
export { viewportFields, maxNonMeasureCardinality, credentialFields, resolveFetchVersion, fetchFields, capabilityFields, retryFields, leafCardinalityField, shortlistIsStale, offeredShortlistFor, } from "./wireBuild";
|
|
61
|
-
export type { ViewportFields, CredentialFields, FetchRequest, FetchFields, CapabilityFields, RetryFields, } from "./wireBuild";
|
|
60
|
+
export { viewportFields, maxNonMeasureCardinality, credentialFields, resolveFetchVersion, fetchFields, capabilityFields, retryFields, leafCardinalityField, qualifyOrderOf, qualifyOrderField, QUALIFY_ORDER_LABELS, shortlistIsStale, offeredShortlistFor, } from "./wireBuild";
|
|
61
|
+
export type { ViewportFields, CredentialFields, FetchRequest, FetchFields, CapabilityFields, RetryFields, QualifyOrder, } from "./wireBuild";
|
|
62
62
|
export { schemaIdentity, schemaIdentityKey, schemaTypeFamily } from "./schemaIdentity";
|
|
63
63
|
export type { SchemaIdentityColumn } from "./schemaIdentity";
|
|
64
|
-
export { SEV_INFO, SEV_WARNING, SEV_ERROR, SEV_USER_PRESENTED, CLIENT_EVENT_KINDS, isEventLogCode, eventLogLine, TELEMETRY_TIMEOUT_MS, TELEMETRY_TIMEOUT_DEV_MS, } from "./telemetry";
|
|
65
|
-
export type { ClientMessage } from "./telemetry";
|
|
64
|
+
export { SEV_INFO, SEV_WARNING, SEV_ERROR, SEV_USER_PRESENTED, CLIENT_EVENT_KINDS, isEventLogCode, eventLogLine, TELEMETRY_TIMEOUT_MS, TELEMETRY_TIMEOUT_DEV_MS, DRAW_REASONS, drawLocation, classifyDraw, createDrawLedger, } from "./telemetry";
|
|
65
|
+
export type { ClientMessage, DrawReason, DrawFacts, DrawLedger } from "./telemetry";
|
|
66
66
|
export { createTelemetryClient } from "./telemetryClient";
|
|
67
67
|
export type { TelemetryClient, TelemetryServices, TelemetryEnv, TelemetryFailure, TelemetryChannel } from "./telemetryClient";
|
|
68
68
|
export { fetchTransport } from "./fetchTransport";
|
package/dist/types/models.d.ts
CHANGED
|
@@ -137,6 +137,13 @@ export type LLMClientHints = {
|
|
|
137
137
|
* that admits the type.
|
|
138
138
|
*/
|
|
139
139
|
favorProjection?: string;
|
|
140
|
+
/**
|
|
141
|
+
* The order the "What fits?" list comes back in (older servers ignore it and use their default): "fit" ranks by how
|
|
142
|
+
* well each type suits the data, "variety" by the picker's selection order, which favors newer
|
|
143
|
+
* and less-common types. Read on qualify only. Absent means the server's own default, and a
|
|
144
|
+
* server that predates the field ignores it. Build it with `qualifyOrderField`.
|
|
145
|
+
*/
|
|
146
|
+
qualifyOrder?: "fit" | "variety";
|
|
140
147
|
/**
|
|
141
148
|
* Does this host let the reader CHOOSE a grain, and send it back as `favorProjection`?
|
|
142
149
|
*
|
|
@@ -293,6 +300,7 @@ export type LLMQualifyResult = {
|
|
|
293
300
|
*/
|
|
294
301
|
viaProjectionKey?: string;
|
|
295
302
|
isPreview?: boolean;
|
|
303
|
+
alsoWorthALook?: boolean;
|
|
296
304
|
detailNote?: string;
|
|
297
305
|
}[];
|
|
298
306
|
refused?: {
|
|
@@ -48,7 +48,69 @@ export declare const CLIENT_EVENT_KINDS: Readonly<{
|
|
|
48
48
|
readonly RENDER_ERROR: "render-error";
|
|
49
49
|
readonly VIEW: "view";
|
|
50
50
|
readonly VIEW_VERDICT: "view-verdict";
|
|
51
|
+
/** A later draw of a chart version this session already reported, for a reason not yet said. */
|
|
52
|
+
readonly REDRAW: "redraw";
|
|
53
|
+
/** The reader selected something in a chart version, said once per version per session. */
|
|
54
|
+
readonly INTERACT: "interact";
|
|
51
55
|
}>;
|
|
56
|
+
/**
|
|
57
|
+
* WHY A CHART WAS DRAWN. Each value names the event that caused the draw:
|
|
58
|
+
* - `open`: a saved chart drawn when the document or report opened.
|
|
59
|
+
* - `generate`: a new version arriving.
|
|
60
|
+
* - `version`: a switch to another saved version.
|
|
61
|
+
* - `rebind`: the chart pointed at other data.
|
|
62
|
+
* - `data`: the data under it changed (an edit, a refresh, a filter from elsewhere).
|
|
63
|
+
* - `sample`: an example chart shown.
|
|
64
|
+
* - `fix`: a review's correction redrawn.
|
|
65
|
+
* - `resize`: the frame changed size.
|
|
66
|
+
* - `other`: a redraw with none of those causes.
|
|
67
|
+
* A draw-row only says a chart drew. The reason says whether a reader came back, the data moved, or
|
|
68
|
+
* the frame changed size, and a view count that cannot tell those apart overcounts.
|
|
69
|
+
*/
|
|
70
|
+
export declare const DRAW_REASONS: readonly ["open", "generate", "version", "rebind", "data", "sample", "fix", "resize", "other"];
|
|
71
|
+
export type DrawReason = (typeof DRAW_REASONS)[number];
|
|
72
|
+
/**
|
|
73
|
+
* The render row's Location for a draw: `draw:<reason>`, after the host's own Location when it has one
|
|
74
|
+
* (`excel-view;draw:open`). The reason rides Location because that field is kept per render row; the
|
|
75
|
+
* behaviour flags are kept once per chart version, so a reason sent there after the first draw is lost.
|
|
76
|
+
*/
|
|
77
|
+
export declare function drawLocation(reason: DrawReason, base?: string | null): string;
|
|
78
|
+
/** What a host knows about one draw, and about the draw before it in this session (null on the first). */
|
|
79
|
+
export interface DrawFacts {
|
|
80
|
+
/** The reason when the caller knows it (a review fix, an example); it wins over everything below. */
|
|
81
|
+
hint?: DrawReason | null;
|
|
82
|
+
/** The draw shows a version that was generated just now. */
|
|
83
|
+
generated: boolean;
|
|
84
|
+
outputHash: string;
|
|
85
|
+
/** Changes whenever new data arrives under the chart; equal across draws of the same data. */
|
|
86
|
+
dataSignature: string;
|
|
87
|
+
/** The frame's size, as any string that changes when the size does. */
|
|
88
|
+
viewport: string;
|
|
89
|
+
previous: {
|
|
90
|
+
outputHash: string;
|
|
91
|
+
dataSignature: string;
|
|
92
|
+
viewport: string;
|
|
93
|
+
} | null;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* The reason for a draw a host has to infer. Checked in order: the caller's hint; a new version;
|
|
97
|
+
* the session's first draw; another version than the last draw; new data; a new frame size. Anything
|
|
98
|
+
* else is `other`. A host whose every draw call knows its reason passes that reason and never calls this.
|
|
99
|
+
*/
|
|
100
|
+
export declare function classifyDraw(f: DrawFacts): DrawReason;
|
|
101
|
+
/**
|
|
102
|
+
* The once-per-session gates for the two signals. A chart version's reason is said once (a slicer
|
|
103
|
+
* dragged across fifty values is one `data`, not fifty rows), and its first selection is said once:
|
|
104
|
+
* the question is whether a chart was clicked at all, never how often, and a count of gestures is a
|
|
105
|
+
* trace of one reader. Nothing about what was selected is ever sent.
|
|
106
|
+
*/
|
|
107
|
+
export interface DrawLedger {
|
|
108
|
+
/** True the first time this (version, reason) is seen this session. */
|
|
109
|
+
firstDraw(outputHash: string, reason: DrawReason): boolean;
|
|
110
|
+
/** True the first time this version is selected in this session. */
|
|
111
|
+
firstInteract(outputHash: string): boolean;
|
|
112
|
+
}
|
|
113
|
+
export declare function createDrawLedger(): DrawLedger;
|
|
52
114
|
/**
|
|
53
115
|
* Can this code name an event counter? The service splits the line on "|" and keys the counter on
|
|
54
116
|
* everything before it, with "," separating code from version - so a code carrying either delimiter
|
|
@@ -193,6 +193,20 @@ export declare function retryFields(p: {
|
|
|
193
193
|
export declare function leafCardinalityField(count: number | null | undefined): {
|
|
194
194
|
leafCardinality?: number;
|
|
195
195
|
};
|
|
196
|
+
/** The order of the "what fits" list: by how well each type suits the data, or by the picker's selection order. */
|
|
197
|
+
export type QualifyOrder = "fit" | "variety";
|
|
198
|
+
/** The two orders' reader-facing names, for any host's control. */
|
|
199
|
+
export declare const QUALIFY_ORDER_LABELS: Readonly<Record<QualifyOrder, string>>;
|
|
200
|
+
/** A stored or typed order read back: one of the two the server knows (case and padding ignored), else null. */
|
|
201
|
+
export declare function qualifyOrderOf(raw: unknown): QualifyOrder | null;
|
|
202
|
+
/**
|
|
203
|
+
* THE ORDER A "WHAT FITS" REQUEST ASKS FOR - the client hints' `qualifyOrder`. Sent only when the reader
|
|
204
|
+
* has chosen one: an unmade choice sends no field, so the server's own default applies, and a server
|
|
205
|
+
* that predates the field ignores it. Spread where the host builds its hints.
|
|
206
|
+
*/
|
|
207
|
+
export declare function qualifyOrderField(raw: unknown): {
|
|
208
|
+
qualifyOrder?: QualifyOrder;
|
|
209
|
+
};
|
|
196
210
|
/**
|
|
197
211
|
* IS A CAPTURED "WHAT FITS" LIST STALE? True when the list was captured for one schema and the
|
|
198
212
|
* request now describes another - the reader changed the fields since they looked, so the list is not
|
|
@@ -111,6 +111,8 @@ export interface ParsedQualifyChart {
|
|
|
111
111
|
language: string | undefined;
|
|
112
112
|
/** True only when the server said so: a newer, less proven type. */
|
|
113
113
|
isPreview: boolean;
|
|
114
|
+
/** True only when the server said so: one of the "also worth a look" picks below the top fits, drawn for variety. A hint, never a gate. */
|
|
115
|
+
alsoWorthALook: boolean;
|
|
114
116
|
/** False = a required channel is poorly served; undefined = unassessed, never a demotion. */
|
|
115
117
|
recommended: boolean | undefined;
|
|
116
118
|
/** Non-empty when the type qualifies only against an aggregated projection. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bicharts/shape-core",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.75",
|
|
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",
|