react-semaphor 0.1.469 → 0.1.471
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/README.md +10 -0
- package/dist/analytics-protocol/index.cjs +1 -1
- package/dist/analytics-protocol/index.js +107 -106
- package/dist/brand-studio/index.cjs +1 -1
- package/dist/brand-studio/index.js +4 -4
- package/dist/briefings/index.cjs +1 -1
- package/dist/briefings/index.js +4 -4
- package/dist/chunks/{analyze-result-contract-kaCNxjA7.js → analyze-result-contract-B3agc2XU.js} +1 -1
- package/dist/chunks/{analyze-result-contract-CMwVg9w2.cjs → analyze-result-contract-OgPk-zGu.cjs} +1 -1
- package/dist/chunks/{common-types-tRK8fhXV.cjs → common-types-C1IM7gao.cjs} +1 -1
- package/dist/chunks/{common-types-BgI-ymBp.js → common-types-g_1fKJLK.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-kKSBCRLE.js → dashboard-briefing-launcher-C2-b7rZU.js} +10 -10
- package/dist/chunks/dashboard-briefing-launcher-ChHmLu0F.cjs +26 -0
- package/dist/chunks/{dashboard-controls-DP2rftVR.js → dashboard-controls-Db7VOHdj.js} +9 -9
- package/dist/chunks/{dashboard-controls-Z8ow3GV6.cjs → dashboard-controls-kw4QQDSz.cjs} +1 -1
- package/dist/chunks/dashboard-filter-value-compatibility-Dmh-NaPK.cjs +1 -0
- package/dist/chunks/dashboard-filter-value-compatibility-ilbH2A31.js +836 -0
- package/dist/chunks/{dashboard-input-contract-12mPNhCF.cjs → dashboard-input-contract-JFJZgenC.cjs} +1 -1
- package/dist/chunks/{dashboard-input-contract-Ciboc347.js → dashboard-input-contract-Vr_3ApfF.js} +1 -1
- package/dist/chunks/{dashboard-json-CPq7IMvR.cjs → dashboard-json-Cu37kF4Q.cjs} +1 -1
- package/dist/chunks/{dashboard-json-3qT123Xa.js → dashboard-json-Dp-38lll.js} +7 -7
- package/dist/chunks/{edit-dashboard-visual-7eUCTZnx.cjs → edit-dashboard-visual-Cbtpwhlp.cjs} +33 -33
- package/dist/chunks/{edit-dashboard-visual-Clz6LQOX.js → edit-dashboard-visual-CffII05Z.js} +3611 -3713
- package/dist/chunks/{editor-action-buttons-WJFWflfs.cjs → editor-action-buttons-DcTGZa2C.cjs} +1 -1
- package/dist/chunks/{editor-action-buttons-CFbMRQSE.js → editor-action-buttons-DqwDHxFv.js} +6 -6
- package/dist/chunks/{index-CQN-X1jN.cjs → index-B4VxBoJg.cjs} +1 -1
- package/dist/chunks/{index-8Cm77joZ.js → index-CUf0lwSP.js} +24824 -24881
- package/dist/chunks/{index-DKaQRhKm.cjs → index-DUYREWSl.cjs} +227 -227
- package/dist/chunks/{index-DO4BESNy.js → index-oVXvCLH-.js} +9 -9
- package/dist/chunks/{matrix-result-contract-ClC6Pd_g.js → matrix-result-contract-DoU9diAh.js} +3 -3
- package/dist/chunks/{matrix-result-contract-DF-qt0jx.cjs → matrix-result-contract-SrzyG_KQ.cjs} +1 -1
- package/dist/chunks/{pivot-header-presentation-OpY8xzdT.js → pivot-header-presentation-7XrwJYDm.js} +102 -95
- package/dist/chunks/pivot-header-presentation-Cr6pU5JL.cjs +4 -0
- package/dist/chunks/{pivot-result-identity-CCMpd8ZA.js → pivot-result-identity-5v4hRVbc.js} +1 -1
- package/dist/chunks/{pivot-result-identity-gsOwOjHi.cjs → pivot-result-identity-DRUlTWUq.cjs} +1 -1
- package/dist/chunks/{pivot-result-lifecycle-CEfU43GZ.cjs → pivot-result-lifecycle-DJgO2P0H.cjs} +1 -1
- package/dist/chunks/{pivot-result-lifecycle-B38AZx4a.js → pivot-result-lifecycle-O_roVguV.js} +7 -7
- package/dist/chunks/{raw-temporal-contract-r_EMdR85.js → raw-temporal-contract-BEMf3avg.js} +1 -1
- package/dist/chunks/{raw-temporal-contract-UdblxoVB.cjs → raw-temporal-contract-D8YuxTAg.cjs} +1 -1
- package/dist/chunks/{report-preferences-dialog-C5UOCTwt.cjs → report-preferences-dialog-BEe2cTT-.cjs} +1 -1
- package/dist/chunks/{report-preferences-dialog-D-NDYRrk.js → report-preferences-dialog-C_FTOmOg.js} +6 -6
- package/dist/chunks/{report-runtime-context-CcXUjpb-.js → report-runtime-context-DnNbpkGo.js} +1 -1
- package/dist/chunks/{report-runtime-context-CLtzrZdC.cjs → report-runtime-context-RFiWq4wK.cjs} +1 -1
- package/dist/chunks/{saved-temporal-bucket-format-hylaofsQ.js → saved-temporal-bucket-format-CygnBDO2.js} +24 -24
- package/dist/chunks/{saved-temporal-bucket-format-Ca4hUfTo.cjs → saved-temporal-bucket-format-DNMtD77o.cjs} +1 -1
- package/dist/chunks/{switch-DyE2_OmQ.cjs → switch-CQN9Hzho.cjs} +19 -19
- package/dist/chunks/{switch-BagpmPNw.js → switch-n2yUNY8i.js} +177 -164
- package/dist/chunks/{temporal-bucket-BDRcWdVv.cjs → temporal-bucket-9Wz9Ds6H.cjs} +1 -1
- package/dist/chunks/{temporal-bucket-Cc9fmx8s.js → temporal-bucket-CUKJktCl.js} +1 -1
- package/dist/chunks/{temporal-bucket-authoring-DjPFtRSF.js → temporal-bucket-authoring-CZoJV2L6.js} +3 -3
- package/dist/chunks/{temporal-bucket-authoring-C6sZAVqS.cjs → temporal-bucket-authoring-DSpzgXHc.cjs} +1 -1
- package/dist/chunks/{temporal-bucket-contract-vrOkax-r.cjs → temporal-bucket-contract-BD862TAa.cjs} +1 -1
- package/dist/chunks/{temporal-bucket-contract-DT4kU0VY.js → temporal-bucket-contract-Cno9TlYr.js} +1 -1
- package/dist/chunks/{token-types-DALtlgbG.cjs → token-types-CoHsSJ4E.cjs} +1 -1
- package/dist/chunks/{token-types-Z889rD6g.js → token-types-W3EHNW-D.js} +1 -1
- package/dist/chunks/{update-policy-Cyufdviq.cjs → update-policy-BGNXFgBU.cjs} +1 -1
- package/dist/chunks/{update-policy-Bu5Tw43R.js → update-policy-kRNJwwUV.js} +1 -1
- package/dist/chunks/{validators-DhTaCK1O.js → validators-B5t1s8oh.js} +274 -266
- package/dist/chunks/validators-DcshgK7w.cjs +1 -0
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.cjs +1 -1
- package/dist/dashboard-authoring/index.js +4 -4
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +2 -2
- package/dist/data-app-codegen/index.cjs +1 -1
- package/dist/data-app-codegen/index.js +2 -2
- package/dist/data-app-codegen-node/index.cjs +1 -1
- package/dist/data-app-codegen-node/index.js +3 -3
- package/dist/data-app-sdk/index.cjs +1 -1
- package/dist/data-app-sdk/index.js +3 -3
- package/dist/data-app-sdk-adapters/index.cjs +1 -1
- package/dist/data-app-sdk-adapters/index.js +2 -2
- package/dist/data-app-sdk-validation/index.cjs +1 -1
- package/dist/data-app-sdk-validation/index.js +3 -3
- package/dist/format-utils/index.cjs +3 -3
- package/dist/format-utils/index.js +72 -69
- package/dist/index.cjs +1 -1
- package/dist/index.js +14 -14
- package/dist/report-runtime-context/index.cjs +1 -1
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +3 -3
- package/dist/types/analytics-protocol.d.ts +13 -0
- package/dist/types/format-utils.d.ts +9 -0
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.js +4 -4
- package/package.json +1 -1
- package/dist/chunks/dashboard-briefing-launcher-BqxcYhO2.cjs +0 -26
- package/dist/chunks/dashboard-filter-value-compatibility-Ce7jUVh-.js +0 -692
- package/dist/chunks/dashboard-filter-value-compatibility-iCPBcrRS.cjs +0 -1
- package/dist/chunks/pivot-header-presentation-DyV0iOZ_.cjs +0 -4
- package/dist/chunks/validators-DO-YuzgO.cjs +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
var Je = Object.defineProperty;
|
|
2
2
|
var Qe = (e, r, t) => r in e ? Je(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
|
|
3
3
|
var _ = (e, r, t) => Qe(e, typeof r != "symbol" ? r + "" : r, t);
|
|
4
|
-
import { F as Xe, D as et, q as tt, E as rt, A as J, u as q, o as nt, M as ot, w as at, R as it, i as Ce, b as ct, m as lt, P as U } from "./pivot-result-lifecycle-
|
|
4
|
+
import { F as Xe, D as et, q as tt, E as rt, A as J, u as q, o as nt, M as ot, w as at, R as it, i as Ce, b as ct, m as lt, P as U } from "./pivot-result-lifecycle-O_roVguV.js";
|
|
5
5
|
import { DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as de } from "../value-format-preferences/index.js";
|
|
6
|
-
import { E as Te, l as dt, q as ae } from "./validators-
|
|
7
|
-
import "./analyze-result-contract-
|
|
8
|
-
import { h as $e, r as ke, a as Ee, v as st, i as mt } from "./saved-temporal-bucket-format-
|
|
9
|
-
import { r as z, b as ut, d as ft, P as pt } from "./pivot-result-identity-
|
|
10
|
-
import { v as yt, a as ht } from "./temporal-bucket-contract-
|
|
11
|
-
import { h as gt, T as vt, k as xe, i as bt } from "./temporal-bucket-
|
|
12
|
-
import { r as Se, s as It, i as wt } from "./temporal-bucket-authoring-
|
|
13
|
-
import { v as _e } from "./raw-temporal-contract-
|
|
6
|
+
import { E as Te, l as dt, q as ae } from "./validators-B5t1s8oh.js";
|
|
7
|
+
import "./analyze-result-contract-B3agc2XU.js";
|
|
8
|
+
import { h as $e, r as ke, a as Ee, v as st, i as mt } from "./saved-temporal-bucket-format-CygnBDO2.js";
|
|
9
|
+
import { r as z, b as ut, d as ft, P as pt } from "./pivot-result-identity-5v4hRVbc.js";
|
|
10
|
+
import { v as yt, a as ht } from "./temporal-bucket-contract-Cno9TlYr.js";
|
|
11
|
+
import { h as gt, T as vt, k as xe, i as bt } from "./temporal-bucket-CUKJktCl.js";
|
|
12
|
+
import { r as Se, s as It, i as wt } from "./temporal-bucket-authoring-CZoJV2L6.js";
|
|
13
|
+
import { v as _e } from "./raw-temporal-contract-BEMf3avg.js";
|
|
14
14
|
import { r as Ct, a as Tt, b as $t } from "./canonical-result-keys-CEQefvdO.js";
|
|
15
15
|
const kt = `import pandas as pd
|
|
16
16
|
df = pd.DataFrame(data) # 'data' contains the query result
|
package/dist/chunks/{matrix-result-contract-ClC6Pd_g.js → matrix-result-contract-DoU9diAh.js}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var P = Object.defineProperty;
|
|
2
2
|
var R = (e, t, a) => t in e ? P(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
|
|
3
3
|
var g = (e, t, a) => R(e, typeof t != "symbol" ? t + "" : t, a);
|
|
4
|
-
import { p as j } from "./temporal-bucket-
|
|
5
|
-
import { a6 as K } from "./validators-
|
|
6
|
-
import { v as O } from "./temporal-bucket-contract-
|
|
4
|
+
import { p as j } from "./temporal-bucket-CUKJktCl.js";
|
|
5
|
+
import { a6 as K } from "./validators-B5t1s8oh.js";
|
|
6
|
+
import { v as O } from "./temporal-bucket-contract-Cno9TlYr.js";
|
|
7
7
|
function w(e) {
|
|
8
8
|
const t = E(e);
|
|
9
9
|
return t.length > 0 ? t.join(".") : void 0;
|
package/dist/chunks/{matrix-result-contract-DF-qt0jx.cjs → matrix-result-contract-SrzyG_KQ.cjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var R=Object.defineProperty;var j=(e,t,a)=>t in e?R(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;var $=(e,t,a)=>j(e,typeof t!="symbol"?t+"":t,a);const E=require("./temporal-bucket-BDRcWdVv.cjs"),K=require("./validators-DO-YuzgO.cjs"),O=require("./temporal-bucket-contract-vrOkax-r.cjs");function b(e){const t=G(e);return t.length>0?t.join("."):void 0}function S(e){const t=b(e.qualifiedName),a=(t==null?void 0:t.split("."))||[];if(a.length===0)return{};const r={};let s=a.length-1;for(let i=e.capabilities.prefixLevels.length-1;i>=0&&s>=0;i-=1,s-=1)V(r,e.capabilities.prefixLevels[i],a[s]);return r}function g(e){return!e.left.tableName||!e.right.tableName?!1:e.capabilities.prefixLevels.every(t=>{const a=p(e.left,t),r=p(e.right,t);return!a||!r||a===r})}function A(e){return e.capabilities.prefixLevels.every(t=>{const a=p(e.requested,t);return a?p(e.allowed,t)===a:!0})}function w(e,t={}){const a=N(e),r={connectionId:t.connectionId,connectionType:e,path:["database","schema","table"],labels:{database:"Database",schema:"Schema",table:"Table"},prefixLevels:["database","schema","table"],dialect:"postgres",supportsFilterClause:!0};return a.includes("postgres")?{...r,prefixLevels:["schema","table"],dialect:"postgres"}:a.includes("mysql")?{...r,prefixLevels:["database","table"],dialect:"mysql",supportsFilterClause:!1}:a.includes("mssql")||a.includes("sqlserver")?{...r,dialect:"mssql",supportsFilterClause:!1}:a.includes("redshift")?{...r,prefixLevels:["schema","table"],dialect:"redshift"}:a.includes("snowflake")?{...r,dialect:"snowflake"}:a.includes("clickhouse")?{connectionId:t.connectionId,connectionType:e,path:["database","table"],labels:{database:"Database",table:"Table"},prefixLevels:["database","table"],dialect:"clickhouse",supportsFilterClause:!1}:a==="s3"||a==="api"?{connectionId:t.connectionId,connectionType:e,path:["table"],labels:{table:a==="api"?"API Table":"File Table"},prefixLevels:["table"],dialect:"duckdb",supportsFilterClause:!0}:a==="googlesheets"||a==="fileupload"?{connectionId:t.connectionId,connectionType:e,path:["table"],labels:{table:"Table"},prefixLevels:["table"],dialect:"postgres",supportsFilterClause:!0}:a==="s3tables"?{...r,labels:{database:"Database",schema:"Namespace",table:"Table"},dialect:"duckdb"}:a==="bigquery"?{...r,labels:{database:"Project",schema:"Dataset",table:"Table"},prefixLevels:["schema","table"],dialect:"bigquery",supportsFilterClause:!1}:r}function Q(e){const t=N(e);switch(t){case"mysql":case"bigquery":case"redshift":case"snowflake":case"clickhouse":case"duckdb":case"sqlite":return t;case"mssql":case"sqlserver":return"mssql";case"postgres":case"postgresql":return"postgres";default:return"unknown"}}function F(e){return e.capabilities.prefixLevels.every(t=>!!p(e.source,t))}function z(e){const t=e.quoteIdentifier??D;return e.capabilities.prefixLevels.map(a=>p(e.source,a)).filter(a=>!!a).map(a=>t(a,e.capabilities.dialect)).join(".")}function p(e,t){return t==="database"?e.databaseName:t==="schema"?e.schemaName:e.tableName}function V(e,t,a){t==="database"?e.databaseName=a:t==="schema"?e.schemaName=a:e.tableName=a}function G(e){const t=e==null?void 0:e.trim();if(!t)return[];const a=t.split(".").map(r=>{const s=r.trim();return s.length>=2&&s.startsWith('"')&&s.endsWith('"')?s.slice(1,-1):s});return a.some(r=>!r)?[]:a}function D(e,t){return t==="mysql"||t==="bigquery"||t==="clickhouse"||t==="duckdb"?`\`${e.replace(/`/g,"``")}\``:t==="mssql"?`[${e.replace(/]/g,"]]")}]`:`"${e.replace(/"/g,'""')}"`}function N(e){if(typeof e!="string")return"";const t=[];for(const a of e.trim().toLowerCase())J(a)&&t.push(a);return t.join("")}function J(e){const t=e.charCodeAt(0);return t>=48&&t<=57||t>=97&&t<=122}function m(e){return typeof e=="string"&&e.trim()?e.trim():void 0}function v(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function H(e){const t=v(e);return!t||!m(t.name)||t.type==="model"?!1:t.type==="dataset"?t.datasetType==="physical":!0}function x(e){const t=v(e);if(!t)return{};const a=m(t.table)||m(t.name);return{...m(t.database)?{databaseName:m(t.database)}:{},...m(t.schema)?{schemaName:m(t.schema)}:{},...a?{tableName:a}:{}}}function W(e){const t=e.entities.filter(H),a=U(e),r=X({entities:t,connectionType:e.connectionType});if(!r)return{kind:"incompatible_capabilities"};const s=Y({hints:e.qualifiedHints||[],coordinateHint:e.coordinateHint,capabilities:r});if(s.kind!=="valid")return{kind:s.kind};const i=s.coordinates,n=i?t.filter(c=>g({left:x(c),right:i,capabilities:r})):t;if(i&&n.length===0)return{kind:"not_found",basis:"qualified",coordinates:i};if(i&&n.length===1){const c=n[0];return{kind:"resolved",basis:"qualified",entity:c,coordinates:re(x(c),i)}}const l=P([...e.bareHints||[],...s.bareHints,i==null?void 0:i.tableName]);if(l.size>0){const c=n.filter(u=>{const h=ae(u);return Array.from(l).some(d=>h.has(d))});if(c.length===1){const u=c[0];return{kind:"resolved",basis:"bare",entity:u,coordinates:x(u)}}return c.length>1?{kind:"ambiguous",basis:"bare"}:{kind:"not_found",basis:"bare"}}if(i)return{kind:"ambiguous",basis:"qualified"};if(a)return{kind:"not_found",basis:a};if(t.length===1){const c=t[0];return{kind:"resolved",basis:"unqualified",entity:c,coordinates:x(c)}}return{kind:"unqualified"}}function U(e){const t=(e.qualifiedHints||[]).map(m).filter(r=>!!r);return Object.values(e.coordinateHint||{}).some(r=>!!m(r))||t.some(r=>r.includes("."))?"qualified":[...t,...e.bareHints||[]].some(r=>!!m(r))?"bare":void 0}function X(e){var r;const t=m(e.connectionType);if(t)return w(t);const a=e.entities.flatMap(s=>{var l;const i=m((l=v(s))==null?void 0:l.connectionType);if(!i)return[];const n=w(i);return[{capabilities:n,signature:`${n.dialect}:${n.prefixLevels.join(".")}`}]});if(!(new Set(a.map(s=>s.signature)).size>1))return((r=a[0])==null?void 0:r.capabilities)||w(void 0)}function Y(e){const t=[],a=[];for(const u of e.hints){const h=m(u);if(!h)continue;if(!h.includes(".")){a.push(h);continue}const d=b(h);if(!d)return{kind:"malformed"};t.push(d)}const r=Z(e.coordinateHint);if(r.kind==="malformed")return r;const s=Array.from(new Set(t)).map(u=>S({qualifiedName:u,capabilities:e.capabilities}));if(!te(s,e.capabilities))return{kind:"conflicting"};const i=[...new Set(t)].sort((u,h)=>h.split(".").length-u.split(".").length)[0],n=i?S({qualifiedName:i,capabilities:e.capabilities}):void 0,l=ee(r.coordinates,e.capabilities),c=!!(l.tableName&&(l.databaseName||l.schemaName));return n&&c&&!g({left:n,right:l,capabilities:e.capabilities})?{kind:"conflicting"}:{kind:"valid",coordinates:n?c?{...n,...l}:n:c?l:void 0,bareHints:[...a,...!c&&l.tableName?[l.tableName]:[]]}}function Z(e){const t={};for(const[a,r]of Object.entries(e||{})){const s=m(r);if(!s)continue;const i=b(s);if(!i)return{kind:"malformed"};t[a]=i}return{kind:"valid",coordinates:t}}function ee(e,t){return{...t.prefixLevels.includes("database")&&e.databaseName?{databaseName:e.databaseName}:{},...t.prefixLevels.includes("schema")&&e.schemaName?{schemaName:e.schemaName}:{},...e.tableName?{tableName:e.tableName}:{}}}function te(e,t){return e.every((a,r)=>e.slice(r+1).every(s=>g({left:a,right:s,capabilities:t})))}function P(e){return new Set(e.map(m).map(b).filter(t=>!!t))}function ae(e){const t=v(e);return t?P([m(t.name),m(t.table),m(t.id)]):new Set}function re(e,t){return{...t,...e}}class M extends Error{constructor(a){super(a.message);$(this,"code");$(this,"path");this.name="MatrixResultContractError",this.code=a.code,this.path=a.path}}function ie(e){var c,u,h;const t=de(e);if(t!==2)throw new M({code:"unsupported_matrix_result_version",message:`Canonical Matrix results require schemaVersion 2; received ${String(t)}.`,path:"schemaVersion"});const a=K.semaphorMatrixResultSchema.safeParse(e);if(!a.success){const d=a.error.issues[0];throw o((d==null?void 0:d.message)||"Canonical Matrix result has an invalid shape.",d==null?void 0:d.path.join("."))}const r=a.data,s={row:C(r.axes.rows.levels,"axes.rows.levels"),column:C(r.axes.columns.levels,"axes.columns.levels")};ce(r),B(r,"row"),B(r,"column");const i=new Set([...r.axes.rows.nodeIds,...r.axes.columns.nodeIds]),n=new Set;for(const[d,f]of Object.entries(r.nodesById)){if(f.id!==d)throw o("Matrix node directory key must equal node.id.",`nodesById.${d}.id`);if(!i.has(d))throw o("Matrix node directory cannot contain nodes omitted from both axes.",`nodesById.${d}`);se(f,s[f.axis],`nodesById.${d}`);const y=JSON.stringify([f.axis,f.path,f.isSubtotal===!0,f.isGrandTotal===!0]);if(n.has(y))throw o("Matrix nodes must have unique canonical path and total-role identity.",`nodesById.${d}`);n.add(y),le(r,f,`nodesById.${d}`)}const l=new Set;for(const[d,f]of r.cells.entries()){if(!((c=r.nodesById[f.rowId])!=null&&c.axis)||((u=r.nodesById[f.rowId])==null?void 0:u.axis)!=="row")throw o("Matrix cell rowId must reference a row node.",`cells.${d}.rowId`);if(f.columnId&&((h=r.nodesById[f.columnId])==null?void 0:h.axis)!=="column")throw o("Matrix cell columnId must reference a column node.",`cells.${d}.columnId`);if(!r.measuresById[f.measureId])throw o("Matrix cell measureId must reference a measure.",`cells.${d}.measureId`);const y=ne(r.nodesById[f.rowId],f.columnId?r.nodesById[f.columnId]:void 0);if(f.role!==y)throw o("Matrix cell role must match its referenced row and column total roles.",`cells.${d}.role`);const q=JSON.stringify([f.rowId,f.columnId??null,f.measureId]);if(l.has(q))throw o("Matrix result cannot contain duplicate physical cell addresses.",`cells.${d}`);l.add(q)}return oe(r,s),r}function C(e,t){var r;const a=new Map;for(const[s,i]of e.entries()){const n=`${t}.${s}`;if(a.has(i.instanceId))throw o("Matrix axis level ids must be unique.",`${n}.instanceId`);a.set(i.instanceId,i);const l=i.field.role==="date"||i.field.dataType==="date"||i.field.dataType==="datetime",c=i.field.dataType==="string"||i.field.dataType==="number"||i.field.dataType==="boolean";if(l&&!i.grain)throw o("Temporal Matrix axis level is missing its explicit grain.",`${n}.grain`);if(c&&i.grain)throw o("Non-temporal Matrix axis level cannot carry a grain.",`${n}.grain`);if(i.grain){if(!i.temporalBucket)throw o("Temporal Matrix axis level is missing governed bucket metadata.",`${n}.temporalBucket`);const u=O.validateTemporalBucketMetadata(i.temporalBucket);if(!u.ok||((r=u.value)==null?void 0:r.granularity)!==i.grain)throw o("Matrix axis grain and temporal metadata must agree.",`${n}.temporalBucket`)}else if(i.temporalBucket)throw o("Non-temporal Matrix axis levels cannot carry temporal bucket metadata.",n)}return a}function B(e,t){var s;const a=t==="row"?e.axes.rows:e.axes.columns,r=new Set;for(const[i,n]of a.nodeIds.entries()){if(r.has(n))throw o("Matrix axis node ids must be unique.",`axes.${t==="row"?"rows":"columns"}.nodeIds.${i}`);if(r.add(n),((s=e.nodesById[n])==null?void 0:s.axis)!==t)throw o("Matrix axis node id references the wrong axis.",`axes.${t==="row"?"rows":"columns"}.nodeIds.${i}`)}}function se(e,t,a){if(e.isGrandTotal){if(e.isSubtotal)throw o("Matrix nodes cannot be both subtotal and grand total.",a);if(e.path.length!==0)throw o("Matrix grand-total nodes must have an empty member path.",`${a}.path`);return}if(!e.path.length||e.level!==e.path.length-1)throw o("Ordinary and subtotal Matrix nodes require a level-aligned non-empty path.",a);const r=[...t.values()];if(e.path.length>r.length)throw o("Matrix node path exceeds its authored axis depth.",`${a}.path`);if(e.isSubtotal&&e.path.length>=r.length)throw o("Matrix subtotal nodes must identify a proper authored-axis prefix.",`${a}.path`);e.path.forEach((l,c)=>{const u=r[c];if(l.instanceId==="__matrix_remaining__"&&l.fieldKey==="__matrix_remaining__"&&l.value==="__matrix_remaining__"){if(c!==e.path.length-1)throw o("Matrix remaining-member identity must be the terminal path segment.",`${a}.path.${c}`);if(typeof l.label!="string")throw o("Matrix remaining-member paths require their explicit display label.",`${a}.path.${c}.label`);return}if(!u||l.instanceId!==u.instanceId||l.fieldKey!==u.fieldKey)throw o("Matrix member path must follow authored axis order and identity.",`${a}.path.${c}`);L(l,u,`${a}.path.${c}`)});const s=e.path[e.path.length-1],i=s.instanceId==="__matrix_remaining__"&&s.fieldKey==="__matrix_remaining__"&&s.value==="__matrix_remaining__";if(!k(e.value,s.value))throw o("Matrix node value must equal its final canonical path member.",`${a}.value`);const n=r[e.path.length-1];if(n!=null&&n.temporalBucket&&!e.isSubtotal&&!i&&e.label!==void 0)throw o("Temporal Matrix nodes cannot transport display labels.",`${a}.label`);if((!(n!=null&&n.temporalBucket)||i)&&typeof e.label!="string")throw o("Non-temporal Matrix nodes require a display label.",`${a}.label`)}function ne(e,t){return e.isGrandTotal&&(t!=null&&t.isGrandTotal)?"matrixGrandTotal":e.isGrandTotal?"rowGrandTotal":t!=null&&t.isGrandTotal?"columnGrandTotal":e.isSubtotal&&(t!=null&&t.isSubtotal)?"subtotalIntersection":e.isSubtotal?"rowSubtotal":t!=null&&t.isSubtotal?"columnSubtotal":"value"}function L(e,t,a){if(t.temporalBucket){if(e.label!==void 0)throw o("Temporal Matrix path members cannot transport display labels.",`${a}.label`);if(e.value!==null&&typeof e.value!="string")throw o("Temporal Matrix member values must be canonical strings or null.",`${a}.value`);const r=E.parseTemporalBucketValue(e.value,t.temporalBucket);if(!r.ok)throw o(r.error.message,`${a}.value`)}else if(typeof e.label!="string")throw o("Non-temporal Matrix path members require a display label.",`${a}.label`)}function oe(e,t){const a=[...t.row.values()];if(e.layout.rowHeaderLevels.length!==a.length)throw o("Matrix row-header layout must describe every row-axis level exactly once.","layout.rowHeaderLevels");e.layout.rowHeaderLevels.forEach((s,i)=>{var n;if(s.fieldInstanceId!==((n=a[i])==null?void 0:n.instanceId))throw o("Matrix row-header layout must follow authored row-axis order.",`layout.rowHeaderLevels.${i}.fieldInstanceId`)});for(const[s,i]of e.layout.columnHeaderRows.entries())for(const[n,l]of i.cells.entries()){if(_(l.columnPath,t.column,`layout.columnHeaderRows.${s}.cells.${n}.columnPath`),l.measureInstanceId&&!e.measuresById[l.measureInstanceId])throw o("Matrix header measureInstanceId must reference a measure.",`layout.columnHeaderRows.${s}.cells.${n}.measureInstanceId`);if(l.role==="columnHeader"&&l.label!==void 0)throw o("Matrix member headers cannot transport composed display labels.",`layout.columnHeaderRows.${s}.cells.${n}.label`)}const r=new Set;for(const[s,i]of e.layout.columns.entries()){if(r.has(i.id))throw o("Matrix layout column ids must be unique.",`layout.columns.${s}.id`);if(r.add(i.id),_(i.columnPath,t.column,`layout.columns.${s}.columnPath`),i.role==="value"&&i.columnPath.length>0&&i.label!==void 0)throw o("Matrix value columns with member paths cannot transport composed display labels.",`layout.columns.${s}.label`);if(!e.measuresById[i.measureInstanceId])throw o("Matrix layout column measureInstanceId must reference a measure.",`layout.columns.${s}.measureInstanceId`);if(i.columnNodeId){const n=e.nodesById[i.columnNodeId];if((n==null?void 0:n.axis)!=="column"||!k(n.path,i.columnPath))throw o("Matrix layout column must match its referenced column node path.",`layout.columns.${s}.columnNodeId`)}else if(t.column.size>0)throw o("Matrix columns with an authored column axis require a columnNodeId.",`layout.columns.${s}.columnNodeId`)}}function _(e,t,a){const r=[...t.values()];if(e.length>r.length)throw o("Matrix layout path exceeds its authored axis depth.",a);e.forEach((s,i)=>{const n=r[i];if(!n||s.instanceId!==n.instanceId||s.fieldKey!==n.fieldKey)throw o("Matrix layout path must follow authored axis order and identity.",`${a}.${i}`);L(s,n,`${a}.${i}`)})}function le(e,t,a){if(!t.parentId)return;const r=e.nodesById[t.parentId];if(!r)throw o("Matrix parentId must reference an existing node.",`${a}.parentId`);if(r.axis!==t.axis||r.path.length!==t.path.length-1||!k(r.path,t.path.slice(0,-1)))throw o("Matrix parentId must reference the immediate same-axis path prefix.",`${a}.parentId`)}function ce(e){for(const[t,a]of[["rows",e.axes.rows],["columns",e.axes.columns]]){const r=t==="rows"?"row":"column";a.levels.forEach((s,i)=>{const n=e.fieldsById[s.instanceId];if(!n||n.instanceId!==s.instanceId||n.fieldKey!==s.fieldKey||n.role!==r||!T(n.field,s.field))throw o("Matrix axis level must have one matching role-scoped field descriptor.",`axes.${t}.levels.${i}`)})}for(const[t,a]of Object.entries(e.measuresById)){if(a.instanceId!==t)throw o("Matrix measure directory key must equal measure.instanceId.",`measuresById.${t}.instanceId`);const r=e.fieldsById[t];if(!r||r.instanceId!==t||r.fieldKey!==a.fieldKey||r.role!=="measure"||!T(r.field,a.field))throw o("Matrix measure must have one matching field descriptor.",`measuresById.${t}`)}}function de(e){return e&&typeof e=="object"?e.schemaVersion:void 0}function k(e,t){return JSON.stringify(e)===JSON.stringify(t)}function T(e,t){return I(e)===I(t)}function I(e){if(Array.isArray(e))return`[${e.map(I).join(",")}]`;if(e&&typeof e=="object"){const t=e;return`{${Object.keys(t).filter(a=>t[a]!==void 0).sort().map(a=>`${JSON.stringify(a)}:${I(t[a])}`).join(",")}}`}return e===void 0?"undefined":JSON.stringify(e)}function o(e,t){return new M({code:"invalid_matrix_result_contract",message:e,path:t})}exports.MatrixResultContractError=M;exports.buildSemaphorQualifiedSourcePath=z;exports.canonicalizeSemaphorQualifiedSourcePath=b;exports.getSemaphorConnectionCapabilities=w;exports.isSemaphorPhysicalSourceEntity=H;exports.normalizeSemaphorDialect=Q;exports.parseCanonicalMatrixResult=ie;exports.parseSemaphorQualifiedSourcePath=S;exports.resolveSemaphorPhysicalSourceEntity=W;exports.semaphorPhysicalSourceCoordinatesAreCompatible=g;exports.semaphorPhysicalSourceCoordinatesCover=A;exports.semaphorSourceHasRequiredCoordinates=F;
|
|
1
|
+
"use strict";var R=Object.defineProperty;var j=(e,t,a)=>t in e?R(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;var $=(e,t,a)=>j(e,typeof t!="symbol"?t+"":t,a);const E=require("./temporal-bucket-9Wz9Ds6H.cjs"),K=require("./validators-DcshgK7w.cjs"),O=require("./temporal-bucket-contract-BD862TAa.cjs");function b(e){const t=G(e);return t.length>0?t.join("."):void 0}function S(e){const t=b(e.qualifiedName),a=(t==null?void 0:t.split("."))||[];if(a.length===0)return{};const r={};let s=a.length-1;for(let i=e.capabilities.prefixLevels.length-1;i>=0&&s>=0;i-=1,s-=1)V(r,e.capabilities.prefixLevels[i],a[s]);return r}function g(e){return!e.left.tableName||!e.right.tableName?!1:e.capabilities.prefixLevels.every(t=>{const a=p(e.left,t),r=p(e.right,t);return!a||!r||a===r})}function A(e){return e.capabilities.prefixLevels.every(t=>{const a=p(e.requested,t);return a?p(e.allowed,t)===a:!0})}function w(e,t={}){const a=N(e),r={connectionId:t.connectionId,connectionType:e,path:["database","schema","table"],labels:{database:"Database",schema:"Schema",table:"Table"},prefixLevels:["database","schema","table"],dialect:"postgres",supportsFilterClause:!0};return a.includes("postgres")?{...r,prefixLevels:["schema","table"],dialect:"postgres"}:a.includes("mysql")?{...r,prefixLevels:["database","table"],dialect:"mysql",supportsFilterClause:!1}:a.includes("mssql")||a.includes("sqlserver")?{...r,dialect:"mssql",supportsFilterClause:!1}:a.includes("redshift")?{...r,prefixLevels:["schema","table"],dialect:"redshift"}:a.includes("snowflake")?{...r,dialect:"snowflake"}:a.includes("clickhouse")?{connectionId:t.connectionId,connectionType:e,path:["database","table"],labels:{database:"Database",table:"Table"},prefixLevels:["database","table"],dialect:"clickhouse",supportsFilterClause:!1}:a==="s3"||a==="api"?{connectionId:t.connectionId,connectionType:e,path:["table"],labels:{table:a==="api"?"API Table":"File Table"},prefixLevels:["table"],dialect:"duckdb",supportsFilterClause:!0}:a==="googlesheets"||a==="fileupload"?{connectionId:t.connectionId,connectionType:e,path:["table"],labels:{table:"Table"},prefixLevels:["table"],dialect:"postgres",supportsFilterClause:!0}:a==="s3tables"?{...r,labels:{database:"Database",schema:"Namespace",table:"Table"},dialect:"duckdb"}:a==="bigquery"?{...r,labels:{database:"Project",schema:"Dataset",table:"Table"},prefixLevels:["schema","table"],dialect:"bigquery",supportsFilterClause:!1}:r}function Q(e){const t=N(e);switch(t){case"mysql":case"bigquery":case"redshift":case"snowflake":case"clickhouse":case"duckdb":case"sqlite":return t;case"mssql":case"sqlserver":return"mssql";case"postgres":case"postgresql":return"postgres";default:return"unknown"}}function F(e){return e.capabilities.prefixLevels.every(t=>!!p(e.source,t))}function z(e){const t=e.quoteIdentifier??D;return e.capabilities.prefixLevels.map(a=>p(e.source,a)).filter(a=>!!a).map(a=>t(a,e.capabilities.dialect)).join(".")}function p(e,t){return t==="database"?e.databaseName:t==="schema"?e.schemaName:e.tableName}function V(e,t,a){t==="database"?e.databaseName=a:t==="schema"?e.schemaName=a:e.tableName=a}function G(e){const t=e==null?void 0:e.trim();if(!t)return[];const a=t.split(".").map(r=>{const s=r.trim();return s.length>=2&&s.startsWith('"')&&s.endsWith('"')?s.slice(1,-1):s});return a.some(r=>!r)?[]:a}function D(e,t){return t==="mysql"||t==="bigquery"||t==="clickhouse"||t==="duckdb"?`\`${e.replace(/`/g,"``")}\``:t==="mssql"?`[${e.replace(/]/g,"]]")}]`:`"${e.replace(/"/g,'""')}"`}function N(e){if(typeof e!="string")return"";const t=[];for(const a of e.trim().toLowerCase())J(a)&&t.push(a);return t.join("")}function J(e){const t=e.charCodeAt(0);return t>=48&&t<=57||t>=97&&t<=122}function m(e){return typeof e=="string"&&e.trim()?e.trim():void 0}function v(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function H(e){const t=v(e);return!t||!m(t.name)||t.type==="model"?!1:t.type==="dataset"?t.datasetType==="physical":!0}function x(e){const t=v(e);if(!t)return{};const a=m(t.table)||m(t.name);return{...m(t.database)?{databaseName:m(t.database)}:{},...m(t.schema)?{schemaName:m(t.schema)}:{},...a?{tableName:a}:{}}}function W(e){const t=e.entities.filter(H),a=U(e),r=X({entities:t,connectionType:e.connectionType});if(!r)return{kind:"incompatible_capabilities"};const s=Y({hints:e.qualifiedHints||[],coordinateHint:e.coordinateHint,capabilities:r});if(s.kind!=="valid")return{kind:s.kind};const i=s.coordinates,n=i?t.filter(c=>g({left:x(c),right:i,capabilities:r})):t;if(i&&n.length===0)return{kind:"not_found",basis:"qualified",coordinates:i};if(i&&n.length===1){const c=n[0];return{kind:"resolved",basis:"qualified",entity:c,coordinates:re(x(c),i)}}const l=P([...e.bareHints||[],...s.bareHints,i==null?void 0:i.tableName]);if(l.size>0){const c=n.filter(u=>{const h=ae(u);return Array.from(l).some(d=>h.has(d))});if(c.length===1){const u=c[0];return{kind:"resolved",basis:"bare",entity:u,coordinates:x(u)}}return c.length>1?{kind:"ambiguous",basis:"bare"}:{kind:"not_found",basis:"bare"}}if(i)return{kind:"ambiguous",basis:"qualified"};if(a)return{kind:"not_found",basis:a};if(t.length===1){const c=t[0];return{kind:"resolved",basis:"unqualified",entity:c,coordinates:x(c)}}return{kind:"unqualified"}}function U(e){const t=(e.qualifiedHints||[]).map(m).filter(r=>!!r);return Object.values(e.coordinateHint||{}).some(r=>!!m(r))||t.some(r=>r.includes("."))?"qualified":[...t,...e.bareHints||[]].some(r=>!!m(r))?"bare":void 0}function X(e){var r;const t=m(e.connectionType);if(t)return w(t);const a=e.entities.flatMap(s=>{var l;const i=m((l=v(s))==null?void 0:l.connectionType);if(!i)return[];const n=w(i);return[{capabilities:n,signature:`${n.dialect}:${n.prefixLevels.join(".")}`}]});if(!(new Set(a.map(s=>s.signature)).size>1))return((r=a[0])==null?void 0:r.capabilities)||w(void 0)}function Y(e){const t=[],a=[];for(const u of e.hints){const h=m(u);if(!h)continue;if(!h.includes(".")){a.push(h);continue}const d=b(h);if(!d)return{kind:"malformed"};t.push(d)}const r=Z(e.coordinateHint);if(r.kind==="malformed")return r;const s=Array.from(new Set(t)).map(u=>S({qualifiedName:u,capabilities:e.capabilities}));if(!te(s,e.capabilities))return{kind:"conflicting"};const i=[...new Set(t)].sort((u,h)=>h.split(".").length-u.split(".").length)[0],n=i?S({qualifiedName:i,capabilities:e.capabilities}):void 0,l=ee(r.coordinates,e.capabilities),c=!!(l.tableName&&(l.databaseName||l.schemaName));return n&&c&&!g({left:n,right:l,capabilities:e.capabilities})?{kind:"conflicting"}:{kind:"valid",coordinates:n?c?{...n,...l}:n:c?l:void 0,bareHints:[...a,...!c&&l.tableName?[l.tableName]:[]]}}function Z(e){const t={};for(const[a,r]of Object.entries(e||{})){const s=m(r);if(!s)continue;const i=b(s);if(!i)return{kind:"malformed"};t[a]=i}return{kind:"valid",coordinates:t}}function ee(e,t){return{...t.prefixLevels.includes("database")&&e.databaseName?{databaseName:e.databaseName}:{},...t.prefixLevels.includes("schema")&&e.schemaName?{schemaName:e.schemaName}:{},...e.tableName?{tableName:e.tableName}:{}}}function te(e,t){return e.every((a,r)=>e.slice(r+1).every(s=>g({left:a,right:s,capabilities:t})))}function P(e){return new Set(e.map(m).map(b).filter(t=>!!t))}function ae(e){const t=v(e);return t?P([m(t.name),m(t.table),m(t.id)]):new Set}function re(e,t){return{...t,...e}}class M extends Error{constructor(a){super(a.message);$(this,"code");$(this,"path");this.name="MatrixResultContractError",this.code=a.code,this.path=a.path}}function ie(e){var c,u,h;const t=de(e);if(t!==2)throw new M({code:"unsupported_matrix_result_version",message:`Canonical Matrix results require schemaVersion 2; received ${String(t)}.`,path:"schemaVersion"});const a=K.semaphorMatrixResultSchema.safeParse(e);if(!a.success){const d=a.error.issues[0];throw o((d==null?void 0:d.message)||"Canonical Matrix result has an invalid shape.",d==null?void 0:d.path.join("."))}const r=a.data,s={row:C(r.axes.rows.levels,"axes.rows.levels"),column:C(r.axes.columns.levels,"axes.columns.levels")};ce(r),B(r,"row"),B(r,"column");const i=new Set([...r.axes.rows.nodeIds,...r.axes.columns.nodeIds]),n=new Set;for(const[d,f]of Object.entries(r.nodesById)){if(f.id!==d)throw o("Matrix node directory key must equal node.id.",`nodesById.${d}.id`);if(!i.has(d))throw o("Matrix node directory cannot contain nodes omitted from both axes.",`nodesById.${d}`);se(f,s[f.axis],`nodesById.${d}`);const y=JSON.stringify([f.axis,f.path,f.isSubtotal===!0,f.isGrandTotal===!0]);if(n.has(y))throw o("Matrix nodes must have unique canonical path and total-role identity.",`nodesById.${d}`);n.add(y),le(r,f,`nodesById.${d}`)}const l=new Set;for(const[d,f]of r.cells.entries()){if(!((c=r.nodesById[f.rowId])!=null&&c.axis)||((u=r.nodesById[f.rowId])==null?void 0:u.axis)!=="row")throw o("Matrix cell rowId must reference a row node.",`cells.${d}.rowId`);if(f.columnId&&((h=r.nodesById[f.columnId])==null?void 0:h.axis)!=="column")throw o("Matrix cell columnId must reference a column node.",`cells.${d}.columnId`);if(!r.measuresById[f.measureId])throw o("Matrix cell measureId must reference a measure.",`cells.${d}.measureId`);const y=ne(r.nodesById[f.rowId],f.columnId?r.nodesById[f.columnId]:void 0);if(f.role!==y)throw o("Matrix cell role must match its referenced row and column total roles.",`cells.${d}.role`);const q=JSON.stringify([f.rowId,f.columnId??null,f.measureId]);if(l.has(q))throw o("Matrix result cannot contain duplicate physical cell addresses.",`cells.${d}`);l.add(q)}return oe(r,s),r}function C(e,t){var r;const a=new Map;for(const[s,i]of e.entries()){const n=`${t}.${s}`;if(a.has(i.instanceId))throw o("Matrix axis level ids must be unique.",`${n}.instanceId`);a.set(i.instanceId,i);const l=i.field.role==="date"||i.field.dataType==="date"||i.field.dataType==="datetime",c=i.field.dataType==="string"||i.field.dataType==="number"||i.field.dataType==="boolean";if(l&&!i.grain)throw o("Temporal Matrix axis level is missing its explicit grain.",`${n}.grain`);if(c&&i.grain)throw o("Non-temporal Matrix axis level cannot carry a grain.",`${n}.grain`);if(i.grain){if(!i.temporalBucket)throw o("Temporal Matrix axis level is missing governed bucket metadata.",`${n}.temporalBucket`);const u=O.validateTemporalBucketMetadata(i.temporalBucket);if(!u.ok||((r=u.value)==null?void 0:r.granularity)!==i.grain)throw o("Matrix axis grain and temporal metadata must agree.",`${n}.temporalBucket`)}else if(i.temporalBucket)throw o("Non-temporal Matrix axis levels cannot carry temporal bucket metadata.",n)}return a}function B(e,t){var s;const a=t==="row"?e.axes.rows:e.axes.columns,r=new Set;for(const[i,n]of a.nodeIds.entries()){if(r.has(n))throw o("Matrix axis node ids must be unique.",`axes.${t==="row"?"rows":"columns"}.nodeIds.${i}`);if(r.add(n),((s=e.nodesById[n])==null?void 0:s.axis)!==t)throw o("Matrix axis node id references the wrong axis.",`axes.${t==="row"?"rows":"columns"}.nodeIds.${i}`)}}function se(e,t,a){if(e.isGrandTotal){if(e.isSubtotal)throw o("Matrix nodes cannot be both subtotal and grand total.",a);if(e.path.length!==0)throw o("Matrix grand-total nodes must have an empty member path.",`${a}.path`);return}if(!e.path.length||e.level!==e.path.length-1)throw o("Ordinary and subtotal Matrix nodes require a level-aligned non-empty path.",a);const r=[...t.values()];if(e.path.length>r.length)throw o("Matrix node path exceeds its authored axis depth.",`${a}.path`);if(e.isSubtotal&&e.path.length>=r.length)throw o("Matrix subtotal nodes must identify a proper authored-axis prefix.",`${a}.path`);e.path.forEach((l,c)=>{const u=r[c];if(l.instanceId==="__matrix_remaining__"&&l.fieldKey==="__matrix_remaining__"&&l.value==="__matrix_remaining__"){if(c!==e.path.length-1)throw o("Matrix remaining-member identity must be the terminal path segment.",`${a}.path.${c}`);if(typeof l.label!="string")throw o("Matrix remaining-member paths require their explicit display label.",`${a}.path.${c}.label`);return}if(!u||l.instanceId!==u.instanceId||l.fieldKey!==u.fieldKey)throw o("Matrix member path must follow authored axis order and identity.",`${a}.path.${c}`);L(l,u,`${a}.path.${c}`)});const s=e.path[e.path.length-1],i=s.instanceId==="__matrix_remaining__"&&s.fieldKey==="__matrix_remaining__"&&s.value==="__matrix_remaining__";if(!k(e.value,s.value))throw o("Matrix node value must equal its final canonical path member.",`${a}.value`);const n=r[e.path.length-1];if(n!=null&&n.temporalBucket&&!e.isSubtotal&&!i&&e.label!==void 0)throw o("Temporal Matrix nodes cannot transport display labels.",`${a}.label`);if((!(n!=null&&n.temporalBucket)||i)&&typeof e.label!="string")throw o("Non-temporal Matrix nodes require a display label.",`${a}.label`)}function ne(e,t){return e.isGrandTotal&&(t!=null&&t.isGrandTotal)?"matrixGrandTotal":e.isGrandTotal?"rowGrandTotal":t!=null&&t.isGrandTotal?"columnGrandTotal":e.isSubtotal&&(t!=null&&t.isSubtotal)?"subtotalIntersection":e.isSubtotal?"rowSubtotal":t!=null&&t.isSubtotal?"columnSubtotal":"value"}function L(e,t,a){if(t.temporalBucket){if(e.label!==void 0)throw o("Temporal Matrix path members cannot transport display labels.",`${a}.label`);if(e.value!==null&&typeof e.value!="string")throw o("Temporal Matrix member values must be canonical strings or null.",`${a}.value`);const r=E.parseTemporalBucketValue(e.value,t.temporalBucket);if(!r.ok)throw o(r.error.message,`${a}.value`)}else if(typeof e.label!="string")throw o("Non-temporal Matrix path members require a display label.",`${a}.label`)}function oe(e,t){const a=[...t.row.values()];if(e.layout.rowHeaderLevels.length!==a.length)throw o("Matrix row-header layout must describe every row-axis level exactly once.","layout.rowHeaderLevels");e.layout.rowHeaderLevels.forEach((s,i)=>{var n;if(s.fieldInstanceId!==((n=a[i])==null?void 0:n.instanceId))throw o("Matrix row-header layout must follow authored row-axis order.",`layout.rowHeaderLevels.${i}.fieldInstanceId`)});for(const[s,i]of e.layout.columnHeaderRows.entries())for(const[n,l]of i.cells.entries()){if(_(l.columnPath,t.column,`layout.columnHeaderRows.${s}.cells.${n}.columnPath`),l.measureInstanceId&&!e.measuresById[l.measureInstanceId])throw o("Matrix header measureInstanceId must reference a measure.",`layout.columnHeaderRows.${s}.cells.${n}.measureInstanceId`);if(l.role==="columnHeader"&&l.label!==void 0)throw o("Matrix member headers cannot transport composed display labels.",`layout.columnHeaderRows.${s}.cells.${n}.label`)}const r=new Set;for(const[s,i]of e.layout.columns.entries()){if(r.has(i.id))throw o("Matrix layout column ids must be unique.",`layout.columns.${s}.id`);if(r.add(i.id),_(i.columnPath,t.column,`layout.columns.${s}.columnPath`),i.role==="value"&&i.columnPath.length>0&&i.label!==void 0)throw o("Matrix value columns with member paths cannot transport composed display labels.",`layout.columns.${s}.label`);if(!e.measuresById[i.measureInstanceId])throw o("Matrix layout column measureInstanceId must reference a measure.",`layout.columns.${s}.measureInstanceId`);if(i.columnNodeId){const n=e.nodesById[i.columnNodeId];if((n==null?void 0:n.axis)!=="column"||!k(n.path,i.columnPath))throw o("Matrix layout column must match its referenced column node path.",`layout.columns.${s}.columnNodeId`)}else if(t.column.size>0)throw o("Matrix columns with an authored column axis require a columnNodeId.",`layout.columns.${s}.columnNodeId`)}}function _(e,t,a){const r=[...t.values()];if(e.length>r.length)throw o("Matrix layout path exceeds its authored axis depth.",a);e.forEach((s,i)=>{const n=r[i];if(!n||s.instanceId!==n.instanceId||s.fieldKey!==n.fieldKey)throw o("Matrix layout path must follow authored axis order and identity.",`${a}.${i}`);L(s,n,`${a}.${i}`)})}function le(e,t,a){if(!t.parentId)return;const r=e.nodesById[t.parentId];if(!r)throw o("Matrix parentId must reference an existing node.",`${a}.parentId`);if(r.axis!==t.axis||r.path.length!==t.path.length-1||!k(r.path,t.path.slice(0,-1)))throw o("Matrix parentId must reference the immediate same-axis path prefix.",`${a}.parentId`)}function ce(e){for(const[t,a]of[["rows",e.axes.rows],["columns",e.axes.columns]]){const r=t==="rows"?"row":"column";a.levels.forEach((s,i)=>{const n=e.fieldsById[s.instanceId];if(!n||n.instanceId!==s.instanceId||n.fieldKey!==s.fieldKey||n.role!==r||!T(n.field,s.field))throw o("Matrix axis level must have one matching role-scoped field descriptor.",`axes.${t}.levels.${i}`)})}for(const[t,a]of Object.entries(e.measuresById)){if(a.instanceId!==t)throw o("Matrix measure directory key must equal measure.instanceId.",`measuresById.${t}.instanceId`);const r=e.fieldsById[t];if(!r||r.instanceId!==t||r.fieldKey!==a.fieldKey||r.role!=="measure"||!T(r.field,a.field))throw o("Matrix measure must have one matching field descriptor.",`measuresById.${t}`)}}function de(e){return e&&typeof e=="object"?e.schemaVersion:void 0}function k(e,t){return JSON.stringify(e)===JSON.stringify(t)}function T(e,t){return I(e)===I(t)}function I(e){if(Array.isArray(e))return`[${e.map(I).join(",")}]`;if(e&&typeof e=="object"){const t=e;return`{${Object.keys(t).filter(a=>t[a]!==void 0).sort().map(a=>`${JSON.stringify(a)}:${I(t[a])}`).join(",")}}`}return e===void 0?"undefined":JSON.stringify(e)}function o(e,t){return new M({code:"invalid_matrix_result_contract",message:e,path:t})}exports.MatrixResultContractError=M;exports.buildSemaphorQualifiedSourcePath=z;exports.canonicalizeSemaphorQualifiedSourcePath=b;exports.getSemaphorConnectionCapabilities=w;exports.isSemaphorPhysicalSourceEntity=H;exports.normalizeSemaphorDialect=Q;exports.parseCanonicalMatrixResult=ie;exports.parseSemaphorQualifiedSourcePath=S;exports.resolveSemaphorPhysicalSourceEntity=W;exports.semaphorPhysicalSourceCoordinatesAreCompatible=g;exports.semaphorPhysicalSourceCoordinatesCover=A;exports.semaphorSourceHasRequiredCoordinates=F;
|
package/dist/chunks/{pivot-header-presentation-OpY8xzdT.js → pivot-header-presentation-7XrwJYDm.js}
RENAMED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var A = (e, t, n) =>
|
|
4
|
-
import { t as f, c as
|
|
5
|
-
import { b as y } from "./pivot-result-lifecycle-
|
|
6
|
-
import { f as
|
|
7
|
-
import { h as
|
|
1
|
+
var F = Object.defineProperty;
|
|
2
|
+
var R = (e, t, n) => t in e ? F(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var A = (e, t, n) => R(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { t as f, c as U, g as O, e as P, a as T, m as S, b as M, i as Z, f as k, d as X } from "./format-types-CFHQoIuk.js";
|
|
5
|
+
import { b as y } from "./pivot-result-lifecycle-O_roVguV.js";
|
|
6
|
+
import { f as B } from "./index-CACdoqu3.js";
|
|
7
|
+
import { h as j } from "./temporal-bucket-CUKJktCl.js";
|
|
8
8
|
function b(e, t) {
|
|
9
9
|
const n = f(e), o = f(t), r = n.getTime() - o.getTime();
|
|
10
10
|
return r < 0 ? -1 : r > 0 ? 1 : r;
|
|
11
11
|
}
|
|
12
12
|
function G(e) {
|
|
13
|
-
return
|
|
13
|
+
return U(e, Date.now());
|
|
14
14
|
}
|
|
15
15
|
function H(e, t) {
|
|
16
16
|
const n = f(e), o = f(t), r = n.getFullYear() - o.getFullYear(), s = n.getMonth() - o.getMonth();
|
|
@@ -56,16 +56,16 @@ function z(e, t, n) {
|
|
|
56
56
|
return Y(n == null ? void 0 : n.roundingMethod)(o);
|
|
57
57
|
}
|
|
58
58
|
function ee(e, t, n) {
|
|
59
|
-
const o =
|
|
59
|
+
const o = O(), r = (n == null ? void 0 : n.locale) ?? o.locale ?? P, s = 2520, i = b(e, t);
|
|
60
60
|
if (isNaN(i))
|
|
61
61
|
throw new RangeError("Invalid time value");
|
|
62
62
|
const a = Object.assign({}, n, {
|
|
63
63
|
addSuffix: n == null ? void 0 : n.addSuffix,
|
|
64
64
|
comparison: i
|
|
65
65
|
});
|
|
66
|
-
let
|
|
67
|
-
i > 0 ? (
|
|
68
|
-
const d = z(
|
|
66
|
+
let c, l;
|
|
67
|
+
i > 0 ? (c = f(t), l = f(e)) : (c = f(e), l = f(t));
|
|
68
|
+
const d = z(l, c), m = (T(l) - T(c)) / 1e3, u = Math.round((d - m) / 60);
|
|
69
69
|
let h;
|
|
70
70
|
if (u < 2)
|
|
71
71
|
return n != null && n.includeSeconds ? d < 5 ? r.formatDistance("lessThanXSeconds", 5, a) : d < 10 ? r.formatDistance("lessThanXSeconds", 10, a) : d < 20 ? r.formatDistance("lessThanXSeconds", 20, a) : d < 40 ? r.formatDistance("halfAMinute", 0, a) : d < 60 ? r.formatDistance("lessThanXMinutes", 1, a) : r.formatDistance("xMinutes", 1, a) : u === 0 ? r.formatDistance("lessThanXMinutes", 1, a) : r.formatDistance("xMinutes", u, a);
|
|
@@ -85,7 +85,7 @@ function ee(e, t, n) {
|
|
|
85
85
|
} else if (u < M * 2)
|
|
86
86
|
return h = Math.round(u / M), r.formatDistance("aboutXMonths", h, a);
|
|
87
87
|
}
|
|
88
|
-
if (h = Q(
|
|
88
|
+
if (h = Q(l, c), h < 12) {
|
|
89
89
|
const g = Math.round(u / M);
|
|
90
90
|
return r.formatDistance("xMonths", g, a);
|
|
91
91
|
} else {
|
|
@@ -96,13 +96,13 @@ function ee(e, t, n) {
|
|
|
96
96
|
function te(e, t) {
|
|
97
97
|
return ee(e, G(e), t);
|
|
98
98
|
}
|
|
99
|
-
const
|
|
99
|
+
const N = [
|
|
100
100
|
"day",
|
|
101
101
|
"hour",
|
|
102
102
|
"minute",
|
|
103
103
|
"second",
|
|
104
104
|
"millisecond"
|
|
105
|
-
],
|
|
105
|
+
], p = {
|
|
106
106
|
day: 864e5,
|
|
107
107
|
hour: 36e5,
|
|
108
108
|
minute: 6e4,
|
|
@@ -124,32 +124,32 @@ const V = [
|
|
|
124
124
|
function oe(e) {
|
|
125
125
|
return e === "day" || e === "hour" || e === "minute" || e === "second" || e === "millisecond";
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function V(e, t) {
|
|
128
128
|
return oe(e) ? e : t;
|
|
129
129
|
}
|
|
130
|
-
function
|
|
131
|
-
return
|
|
130
|
+
function _(e, t) {
|
|
131
|
+
return N.indexOf(V(e, t));
|
|
132
132
|
}
|
|
133
133
|
function se(e, t) {
|
|
134
|
-
const n =
|
|
135
|
-
return
|
|
134
|
+
const n = _(e, "day"), o = _(t, "second"), r = Math.min(n, o), s = Math.max(n, o);
|
|
135
|
+
return N.slice(r, s + 1);
|
|
136
136
|
}
|
|
137
137
|
function ae(e, t) {
|
|
138
|
-
return e *
|
|
138
|
+
return e * p[V(t, "second")];
|
|
139
139
|
}
|
|
140
140
|
function ie(e, t) {
|
|
141
|
-
const n = se(t.largestUnit, t.smallestUnit), o = n[n.length - 1], r =
|
|
141
|
+
const n = se(t.largestUnit, t.smallestUnit), o = n[n.length - 1], r = p[o];
|
|
142
142
|
let s = Math.round(e / r) * r;
|
|
143
143
|
return n.map((i) => {
|
|
144
|
-
const a =
|
|
145
|
-
return s -=
|
|
144
|
+
const a = p[i], c = Math.floor(s / a);
|
|
145
|
+
return s -= c * a, { unit: i, value: c };
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function ce(e, t) {
|
|
149
149
|
const n = e.filter((s) => s.value !== 0), o = n.length > 0 ? n : [e[e.length - 1]], r = typeof t == "number" && Number.isFinite(t) ? Math.max(1, Math.trunc(t)) : o.length;
|
|
150
150
|
return o.slice(0, r).map((s) => `${s.value}${ne[s.unit]}`).join(" ");
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function le(e, t) {
|
|
153
153
|
const n = e.filter((s) => s.value !== 0), o = n.length > 0 ? n : [e[e.length - 1]], r = typeof t == "number" && Number.isFinite(t) ? Math.max(1, Math.trunc(t)) : o.length;
|
|
154
154
|
return o.slice(0, r).map((s) => {
|
|
155
155
|
const [i, a] = re[s.unit];
|
|
@@ -158,11 +158,11 @@ function ce(e, t) {
|
|
|
158
158
|
}
|
|
159
159
|
function ue(e) {
|
|
160
160
|
const t = e.some(
|
|
161
|
-
(
|
|
162
|
-
), n = e.some((
|
|
161
|
+
(c) => c.unit === "day" && c.value !== 0
|
|
162
|
+
), n = e.some((c) => c.unit === "millisecond"), o = e.findIndex((c) => c.value !== 0), r = Math.max(0, e.length - 2), s = t ? 0 : o === -1 ? r : Math.min(o, r), i = o === -1 ? e.slice(r) : e.slice(s);
|
|
163
163
|
if (i.length === 0)
|
|
164
164
|
return "0";
|
|
165
|
-
const a = i.map((
|
|
165
|
+
const a = i.map((c, l) => c.unit === "millisecond" ? String(c.value).padStart(3, "0") : l === 0 ? String(c.value) : String(c.value).padStart(2, "0")).join(":");
|
|
166
166
|
return n ? a.replace(/:(\d{3})$/, ".$1") : a;
|
|
167
167
|
}
|
|
168
168
|
function fe(e, t, n) {
|
|
@@ -175,8 +175,8 @@ function me(e, t = {}) {
|
|
|
175
175
|
const n = typeof e == "number" ? e : typeof e == "string" && e.trim() ? Number(e) : NaN;
|
|
176
176
|
if (!Number.isFinite(n))
|
|
177
177
|
return "";
|
|
178
|
-
const o = t.inputUnit || "second", r = t.outputStyle === "digital" || t.outputStyle === "long" ? t.outputStyle : "compact", s = n < 0, i = Math.abs(ae(n, o)), a = ie(i, t),
|
|
179
|
-
return fe(
|
|
178
|
+
const o = t.inputUnit || "second", r = t.outputStyle === "digital" || t.outputStyle === "long" ? t.outputStyle : "compact", s = n < 0, i = Math.abs(ae(n, o)), a = ie(i, t), c = r === "digital" ? ue(a) : r === "long" ? le(a, t.maxUnits) : ce(a, t.maxUnits);
|
|
179
|
+
return fe(c, s, t);
|
|
180
180
|
}
|
|
181
181
|
function de(e, t, n) {
|
|
182
182
|
const o = {
|
|
@@ -191,7 +191,7 @@ function de(e, t, n) {
|
|
|
191
191
|
negativeStyle: o.type === "currency" ? o.negativeStyle : "minus"
|
|
192
192
|
})}${s ?? ""}`;
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function L(e, t, n) {
|
|
195
195
|
return e === null ? { value: e, text: null } : !t || !Z(t) && t.type !== "duration" ? {
|
|
196
196
|
value: e,
|
|
197
197
|
text: y(e, { type: "number", locale: n })
|
|
@@ -236,21 +236,21 @@ function I(e, t) {
|
|
|
236
236
|
throw new RangeError("Comparison precision must be an integer from 0 to 6.");
|
|
237
237
|
return e;
|
|
238
238
|
}
|
|
239
|
-
function
|
|
239
|
+
function ve(e, t) {
|
|
240
240
|
const n = {
|
|
241
241
|
mode: t.displayMode,
|
|
242
|
-
current:
|
|
242
|
+
current: L(
|
|
243
243
|
e.currentValue,
|
|
244
244
|
t.metricFormat,
|
|
245
245
|
t.locale
|
|
246
246
|
),
|
|
247
|
-
comparison:
|
|
247
|
+
comparison: L(
|
|
248
248
|
e.comparisonValue,
|
|
249
249
|
t.metricFormat,
|
|
250
250
|
t.locale
|
|
251
251
|
)
|
|
252
252
|
};
|
|
253
|
-
return (t.displayMode === "difference" || t.displayMode === "both") && (n.difference =
|
|
253
|
+
return (t.displayMode === "difference" || t.displayMode === "both") && (n.difference = L(
|
|
254
254
|
e.delta,
|
|
255
255
|
t.metricFormat,
|
|
256
256
|
t.locale
|
|
@@ -266,10 +266,10 @@ function Ne(e, t) {
|
|
|
266
266
|
"ratio"
|
|
267
267
|
)), n;
|
|
268
268
|
}
|
|
269
|
-
function
|
|
269
|
+
function Ie(e, t) {
|
|
270
270
|
return e && e !== "auto" ? e : t;
|
|
271
271
|
}
|
|
272
|
-
function
|
|
272
|
+
function Ne(e, t = /* @__PURE__ */ new Date()) {
|
|
273
273
|
try {
|
|
274
274
|
const n = {
|
|
275
275
|
timeZone: e,
|
|
@@ -305,9 +305,9 @@ function C(e, t = "auto") {
|
|
|
305
305
|
return new Date(s);
|
|
306
306
|
}
|
|
307
307
|
return new Date(e);
|
|
308
|
-
} else return t === "UTC" ? n ? new Date(e) : o ? new Date(e) : /* @__PURE__ */ new Date(e + "Z") : n || o || r ? new Date(e) :
|
|
308
|
+
} else return t === "UTC" ? n ? new Date(e) : o ? new Date(e) : /* @__PURE__ */ new Date(e + "Z") : n || o || r ? new Date(e) : B(e, t);
|
|
309
309
|
}
|
|
310
|
-
const ge = "MM/dd/yyyy",
|
|
310
|
+
const ge = "MM/dd/yyyy", Ce = (e, t, n, o = "auto") => {
|
|
311
311
|
if (!e)
|
|
312
312
|
return "";
|
|
313
313
|
try {
|
|
@@ -315,11 +315,11 @@ const ge = "MM/dd/yyyy", $e = (e, t, n, o = "auto") => {
|
|
|
315
315
|
if (isNaN(r.getTime()))
|
|
316
316
|
return e;
|
|
317
317
|
const i = (t && t.trim() ? t : ge).replace(/LLLL/g, "MMMM").replace(/LLL/g, "MMM");
|
|
318
|
-
return n && n !== "auto" ? k(r, n, i) :
|
|
318
|
+
return n && n !== "auto" ? k(r, n, i) : X(r, i);
|
|
319
319
|
} catch (r) {
|
|
320
320
|
return console.error("Date formatting error:", r), e;
|
|
321
321
|
}
|
|
322
|
-
},
|
|
322
|
+
}, $e = (e, t = "auto") => {
|
|
323
323
|
if (!e)
|
|
324
324
|
return "";
|
|
325
325
|
try {
|
|
@@ -344,7 +344,7 @@ function Me(e, t = {}) {
|
|
|
344
344
|
` } = t;
|
|
345
345
|
return e.map((r) => ye(r, n)).join(o);
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function Ee(e, t = {}) {
|
|
348
348
|
if (e.length === 0)
|
|
349
349
|
return "";
|
|
350
350
|
const {
|
|
@@ -355,33 +355,37 @@ function _e(e, t = {}) {
|
|
|
355
355
|
columns: s
|
|
356
356
|
} = t, i = s || Object.keys(e[0]), a = [];
|
|
357
357
|
r && a.push(i);
|
|
358
|
-
for (const
|
|
359
|
-
const
|
|
360
|
-
const m =
|
|
358
|
+
for (const c of e) {
|
|
359
|
+
const l = i.map((d) => {
|
|
360
|
+
const m = c[d];
|
|
361
361
|
return m == null ? "" : String(m);
|
|
362
362
|
});
|
|
363
|
-
a.push(
|
|
363
|
+
a.push(l);
|
|
364
364
|
}
|
|
365
365
|
return Me(a, { delimiter: n, lineEnding: o });
|
|
366
366
|
}
|
|
367
|
-
const be =
|
|
367
|
+
const be = 1e4, Fe = 1e6;
|
|
368
|
+
function Re(e) {
|
|
369
|
+
return e > be;
|
|
370
|
+
}
|
|
371
|
+
const De = "__TOTAL__";
|
|
368
372
|
function D(e) {
|
|
369
373
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
370
374
|
}
|
|
371
375
|
function x(e) {
|
|
372
|
-
return e ===
|
|
376
|
+
return e === De;
|
|
373
377
|
}
|
|
374
|
-
function
|
|
378
|
+
function Ue(e) {
|
|
375
379
|
const t = /* @__PURE__ */ new Map(), n = (e.groupByColumns ?? []).map((r, s) => {
|
|
376
|
-
var
|
|
380
|
+
var l, d, m;
|
|
377
381
|
if (!D(r))
|
|
378
382
|
throw new Error(`Aggregate groupByColumns[${s}] is invalid`);
|
|
379
|
-
const i = typeof r.id == "string" && r.id.length > 0 ? r.id : void 0, a = i ? (m = (d = (
|
|
380
|
-
if (!
|
|
383
|
+
const i = typeof r.id == "string" && r.id.length > 0 ? r.id : void 0, a = i ? (m = (d = (l = e.columnKeyMap) == null ? void 0 : l.byRole) == null ? void 0 : d.groupby) == null ? void 0 : m[i] : void 0, c = (a == null ? void 0 : a.outputKey) || (a == null ? void 0 : a.rawKey) || (typeof r.alias == "string" && r.alias.length > 0 ? r.alias : typeof r.name == "string" && r.name.length > 0 ? r.name : void 0);
|
|
384
|
+
if (!c)
|
|
381
385
|
throw new Error(`Aggregate groupByColumns[${s}] has no output key`);
|
|
382
|
-
return [i, r.alias, r.name,
|
|
383
|
-
typeof u == "string" && u.length > 0 && t.set(u,
|
|
384
|
-
}),
|
|
386
|
+
return [i, r.alias, r.name, c].forEach((u) => {
|
|
387
|
+
typeof u == "string" && u.length > 0 && t.set(u, c);
|
|
388
|
+
}), c;
|
|
385
389
|
}), o = (e.rowAggregates ?? []).flatMap((r) => !D(r) || typeof r.function != "string" || typeof r.groupLevel != "string" ? [] : [
|
|
386
390
|
{
|
|
387
391
|
function: r.function,
|
|
@@ -391,13 +395,13 @@ function Fe(e) {
|
|
|
391
395
|
]);
|
|
392
396
|
return { groupColumnKeys: n, rowAggregates: o };
|
|
393
397
|
}
|
|
394
|
-
function
|
|
398
|
+
function $(e) {
|
|
395
399
|
return e === "SUM" ? "Total" : e.charAt(0).toUpperCase() + e.slice(1).toLowerCase();
|
|
396
400
|
}
|
|
397
|
-
function
|
|
401
|
+
function we(e) {
|
|
398
402
|
var n;
|
|
399
403
|
if (e.customLabel) return e.customLabel;
|
|
400
|
-
const t =
|
|
404
|
+
const t = $(e.aggregateFunction);
|
|
401
405
|
if (e.levelValue !== void 0 && !x(e.levelValue)) {
|
|
402
406
|
if (e.levelValue === null) {
|
|
403
407
|
const r = (n = e.formatValue) == null ? void 0 : n.call(e, null);
|
|
@@ -408,10 +412,10 @@ function De(e) {
|
|
|
408
412
|
}
|
|
409
413
|
return `Subtotal ${t}`;
|
|
410
414
|
}
|
|
411
|
-
function
|
|
412
|
-
return t || `Grand ${
|
|
415
|
+
function Le(e, t) {
|
|
416
|
+
return t || `Grand ${$(e)}`;
|
|
413
417
|
}
|
|
414
|
-
function
|
|
418
|
+
function E(e) {
|
|
415
419
|
var o, r;
|
|
416
420
|
const t = e.context.groupColumnKeys, n = typeof e.row.aggregate == "string" ? e.row.aggregate : "SUM";
|
|
417
421
|
if (e.row.isGrandTotal === !0) {
|
|
@@ -422,7 +426,7 @@ function F(e) {
|
|
|
422
426
|
kind: "grand-total",
|
|
423
427
|
cells: t.map((i, a) => ({
|
|
424
428
|
columnKey: i,
|
|
425
|
-
text: a === 0 ?
|
|
429
|
+
text: a === 0 ? Le(n, s) : "",
|
|
426
430
|
placement: a === 0 ? "label" : "empty",
|
|
427
431
|
colSpan: a === 0 ? t.length : 1
|
|
428
432
|
}))
|
|
@@ -436,35 +440,35 @@ function F(e) {
|
|
|
436
440
|
throw new Error(
|
|
437
441
|
`Aggregate subtotal level "${e.row.subtotalLevel}" has no group column`
|
|
438
442
|
);
|
|
439
|
-
const i = D(e.row.subtotalContext) ? e.row.subtotalContext : void 0, a = D(i == null ? void 0 : i.groupByValues) ? i.groupByValues : {},
|
|
440
|
-
(
|
|
443
|
+
const i = D(e.row.subtotalContext) ? e.row.subtotalContext : void 0, a = D(i == null ? void 0 : i.groupByValues) ? i.groupByValues : {}, c = (r = e.context.rowAggregates.find(
|
|
444
|
+
(l) => l.groupLevel === e.row.subtotalLevel && l.function === n
|
|
441
445
|
)) == null ? void 0 : r.label;
|
|
442
446
|
return {
|
|
443
447
|
kind: "subtotal",
|
|
444
|
-
cells: t.map((
|
|
448
|
+
cells: t.map((l, d) => {
|
|
445
449
|
if (d > s)
|
|
446
450
|
return {
|
|
447
|
-
columnKey:
|
|
451
|
+
columnKey: l,
|
|
448
452
|
text: "",
|
|
449
453
|
placement: "empty",
|
|
450
454
|
colSpan: 1
|
|
451
455
|
};
|
|
452
456
|
if (d < s) {
|
|
453
|
-
const m = e.row[
|
|
457
|
+
const m = e.row[l];
|
|
454
458
|
return {
|
|
455
|
-
columnKey:
|
|
456
|
-
text: m === void 0 || x(m) ? "" : e.formatValue(m,
|
|
459
|
+
columnKey: l,
|
|
460
|
+
text: m === void 0 || x(m) ? "" : e.formatValue(m, l),
|
|
457
461
|
placement: "value",
|
|
458
462
|
colSpan: 1
|
|
459
463
|
};
|
|
460
464
|
}
|
|
461
465
|
return {
|
|
462
|
-
columnKey:
|
|
463
|
-
text:
|
|
466
|
+
columnKey: l,
|
|
467
|
+
text: we({
|
|
464
468
|
aggregateFunction: n,
|
|
465
|
-
customLabel:
|
|
466
|
-
levelValue: a[
|
|
467
|
-
formatValue: (m) => e.formatLabelValue ? e.formatLabelValue(m,
|
|
469
|
+
customLabel: c,
|
|
470
|
+
levelValue: a[l],
|
|
471
|
+
formatValue: (m) => e.formatLabelValue ? e.formatLabelValue(m, l) : String(e.formatValue(m, l) ?? "")
|
|
468
472
|
}),
|
|
469
473
|
placement: "label",
|
|
470
474
|
colSpan: t.length - s
|
|
@@ -485,16 +489,16 @@ function F(e) {
|
|
|
485
489
|
})
|
|
486
490
|
};
|
|
487
491
|
}
|
|
488
|
-
function
|
|
489
|
-
const t =
|
|
492
|
+
function Oe(e) {
|
|
493
|
+
const t = E(e).cells.find(
|
|
490
494
|
(n) => n.columnKey === e.columnKey
|
|
491
495
|
);
|
|
492
496
|
if (!t)
|
|
493
497
|
throw new Error(`Aggregate group column "${e.columnKey}" is unknown`);
|
|
494
498
|
return t.text;
|
|
495
499
|
}
|
|
496
|
-
function
|
|
497
|
-
return
|
|
500
|
+
function Pe(e) {
|
|
501
|
+
return E(e).cells.map((t) => t.text);
|
|
498
502
|
}
|
|
499
503
|
class pe extends Error {
|
|
500
504
|
constructor(n, o) {
|
|
@@ -503,7 +507,7 @@ class pe extends Error {
|
|
|
503
507
|
this.code = n, this.name = "PivotHeaderPresentationError";
|
|
504
508
|
}
|
|
505
509
|
}
|
|
506
|
-
function
|
|
510
|
+
function Ze(e) {
|
|
507
511
|
var r;
|
|
508
512
|
const t = e.mode ?? "formatted", n = e.members.map((s) => {
|
|
509
513
|
var a;
|
|
@@ -515,7 +519,7 @@ function Pe(e) {
|
|
|
515
519
|
"missing_resolved_temporal_format",
|
|
516
520
|
`Missing resolved temporal presentation for pivot field "${s.fieldId}"`
|
|
517
521
|
);
|
|
518
|
-
return
|
|
522
|
+
return j({
|
|
519
523
|
value: s.value,
|
|
520
524
|
metadata: s.temporalBucket,
|
|
521
525
|
format: i
|
|
@@ -531,27 +535,30 @@ function Pe(e) {
|
|
|
531
535
|
};
|
|
532
536
|
}
|
|
533
537
|
export {
|
|
534
|
-
|
|
538
|
+
De as A,
|
|
539
|
+
be as D,
|
|
540
|
+
Fe as F,
|
|
535
541
|
pe as P,
|
|
536
|
-
|
|
542
|
+
Ce as a,
|
|
537
543
|
ye as b,
|
|
538
544
|
me as c,
|
|
539
|
-
|
|
545
|
+
ve as d,
|
|
540
546
|
he as e,
|
|
541
|
-
|
|
542
|
-
|
|
547
|
+
$e as f,
|
|
548
|
+
Ne as g,
|
|
543
549
|
Ve as h,
|
|
544
550
|
Me as i,
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
551
|
+
Re as j,
|
|
552
|
+
x as k,
|
|
553
|
+
Ue as l,
|
|
548
554
|
we as m,
|
|
549
|
-
|
|
550
|
-
|
|
555
|
+
Le as n,
|
|
556
|
+
Ee as o,
|
|
551
557
|
C as p,
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
558
|
+
E as q,
|
|
559
|
+
Ie as r,
|
|
560
|
+
Oe as s,
|
|
555
561
|
Pe as t,
|
|
556
|
-
|
|
562
|
+
Ze as u,
|
|
563
|
+
te as v
|
|
557
564
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";var Z=Object.defineProperty;var G=(e,t,n)=>t in e?Z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var x=(e,t,n)=>G(e,typeof t!="symbol"?t+"":t,n);const l=require("./format-types-PSZZ7hG8.cjs"),M=require("./pivot-result-lifecycle-DJgO2P0H.cjs"),B=require("./index-F25jnH0p.cjs"),j=require("./temporal-bucket-9Wz9Ds6H.cjs");function y(e,t){const n=l.toDate(e),o=l.toDate(t),r=n.getTime()-o.getTime();return r<0?-1:r>0?1:r}function H(e){return l.constructFrom(e,Date.now())}function Y(e,t){const n=l.toDate(e),o=l.toDate(t),r=n.getFullYear()-o.getFullYear(),a=n.getMonth()-o.getMonth();return r*12+a}function W(e){return t=>{const o=(e?Math[e]:Math.trunc)(t);return o===0?0:o}}function q(e,t){return+l.toDate(e)-+l.toDate(t)}function K(e){const t=l.toDate(e);return t.setHours(23,59,59,999),t}function J(e){const t=l.toDate(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function Q(e){const t=l.toDate(e);return+K(t)==+J(t)}function z(e,t){const n=l.toDate(e),o=l.toDate(t),r=y(n,o),a=Math.abs(Y(n,o));let i;if(a<1)i=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-r*a);let s=y(n,o)===-r;Q(l.toDate(e))&&a===1&&y(e,o)===1&&(s=!1),i=r*(a-Number(s))}return i===0?0:i}function ee(e,t,n){const o=q(e,t)/1e3;return W(n==null?void 0:n.roundingMethod)(o)}function te(e,t,n){const o=l.getDefaultOptions(),r=(n==null?void 0:n.locale)??o.locale??l.enUS,a=2520,i=y(e,t);if(isNaN(i))throw new RangeError("Invalid time value");const s=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:i});let c,u;i>0?(c=l.toDate(t),u=l.toDate(e)):(c=l.toDate(e),u=l.toDate(t));const g=ee(u,c),m=(l.getTimezoneOffsetInMilliseconds(u)-l.getTimezoneOffsetInMilliseconds(c))/1e3,f=Math.round((g-m)/60);let h;if(f<2)return n!=null&&n.includeSeconds?g<5?r.formatDistance("lessThanXSeconds",5,s):g<10?r.formatDistance("lessThanXSeconds",10,s):g<20?r.formatDistance("lessThanXSeconds",20,s):g<40?r.formatDistance("halfAMinute",0,s):g<60?r.formatDistance("lessThanXMinutes",1,s):r.formatDistance("xMinutes",1,s):f===0?r.formatDistance("lessThanXMinutes",1,s):r.formatDistance("xMinutes",f,s);if(f<45)return r.formatDistance("xMinutes",f,s);if(f<90)return r.formatDistance("aboutXHours",1,s);if(f<l.minutesInDay){const d=Math.round(f/60);return r.formatDistance("aboutXHours",d,s)}else{if(f<a)return r.formatDistance("xDays",1,s);if(f<l.minutesInMonth){const d=Math.round(f/l.minutesInDay);return r.formatDistance("xDays",d,s)}else if(f<l.minutesInMonth*2)return h=Math.round(f/l.minutesInMonth),r.formatDistance("aboutXMonths",h,s)}if(h=z(u,c),h<12){const d=Math.round(f/l.minutesInMonth);return r.formatDistance("xMonths",d,s)}else{const d=h%12,T=Math.trunc(h/12);return d<3?r.formatDistance("aboutXYears",T,s):d<9?r.formatDistance("overXYears",T,s):r.formatDistance("almostXYears",T+1,s)}}function v(e,t){return te(e,H(e),t)}const E=["day","hour","minute","second","millisecond"],L={day:864e5,hour:36e5,minute:6e4,second:1e3,millisecond:1},ne={day:"d",hour:"hr",minute:"min",second:"s",millisecond:"ms"},re={day:["day","days"],hour:["hour","hours"],minute:["minute","minutes"],second:["second","seconds"],millisecond:["millisecond","milliseconds"]};function oe(e){return e==="day"||e==="hour"||e==="minute"||e==="second"||e==="millisecond"}function R(e,t){return oe(e)?e:t}function S(e,t){return E.indexOf(R(e,t))}function ae(e,t){const n=S(e,"day"),o=S(t,"second"),r=Math.min(n,o),a=Math.max(n,o);return E.slice(r,a+1)}function se(e,t){return e*L[R(t,"second")]}function ie(e,t){const n=ae(t.largestUnit,t.smallestUnit),o=n[n.length-1],r=L[o];let a=Math.round(e/r)*r;return n.map(i=>{const s=L[i],c=Math.floor(a/s);return a-=c*s,{unit:i,value:c}})}function ce(e,t){const n=e.filter(a=>a.value!==0),o=n.length>0?n:[e[e.length-1]],r=typeof t=="number"&&Number.isFinite(t)?Math.max(1,Math.trunc(t)):o.length;return o.slice(0,r).map(a=>`${a.value}${ne[a.unit]}`).join(" ")}function le(e,t){const n=e.filter(a=>a.value!==0),o=n.length>0?n:[e[e.length-1]],r=typeof t=="number"&&Number.isFinite(t)?Math.max(1,Math.trunc(t)):o.length;return o.slice(0,r).map(a=>{const[i,s]=re[a.unit];return`${a.value} ${a.value===1?i:s}`}).join(" ")}function ue(e){const t=e.some(c=>c.unit==="day"&&c.value!==0),n=e.some(c=>c.unit==="millisecond"),o=e.findIndex(c=>c.value!==0),r=Math.max(0,e.length-2),a=t?0:o===-1?r:Math.min(o,r),i=o===-1?e.slice(r):e.slice(a);if(i.length===0)return"0";const s=i.map((c,u)=>c.unit==="millisecond"?String(c.value).padStart(3,"0"):u===0?String(c.value):String(c.value).padStart(2,"0")).join(":");return n?s.replace(/:(\d{3})$/,".$1"):s}function fe(e,t,n){const o=`${n.prefix||""}${e}${n.suffix||""}`;return t?n.negativeInParentheses?`(${o})`:`-${o}`:o}function V(e,t={}){if(e==null)return"";const n=typeof e=="number"?e:typeof e=="string"&&e.trim()?Number(e):NaN;if(!Number.isFinite(n))return"";const o=t.inputUnit||"second",r=t.outputStyle==="digital"||t.outputStyle==="long"?t.outputStyle:"compact",a=n<0,i=Math.abs(se(n,o)),s=ie(i,t),c=r==="digital"?ue(s):r==="long"?le(s,t.maxUnits):ce(s,t.maxUnits);return fe(c,a,t)}function me(e,t,n){const o={...t,locale:t.locale??n};if(o.type==="number")return M.formatNumericCanonical(e,o);const{prefix:r,suffix:a,...i}=o;return`${r??""}${M.formatNumericCanonical(e,{...i,negativeStyle:o.type==="currency"?o.negativeStyle:"minus"})}${a??""}`}function w(e,t,n){return e===null?{value:e,text:null}:!t||!l.isNumericCanonicalFormat(t)&&t.type!=="duration"?{value:e,text:M.formatNumericCanonical(e,{type:"number",locale:n})}:t.type==="duration"?{value:e,text:V(e,{inputUnit:t.inputUnit,outputStyle:t.outputStyle,largestUnit:t.largestUnit,smallestUnit:t.smallestUnit,maxUnits:t.maxUnits,prefix:t.prefix,suffix:t.suffix,negativeInParentheses:t.negativeStyle==="parentheses"})}:{value:e,text:me(e,t,n)}}function C(e,t,n,o){return e===null?{value:e,text:null}:o==="percent"?{value:e,text:M.formatNumericCanonical(e,{type:"percent",locale:n,minimumFractionDigits:t,maximumFractionDigits:t,percentValueMode:"fraction"})}:{value:e,text:M.formatNumericCanonical(e,{type:"number",locale:n,minimumFractionDigits:t,maximumFractionDigits:t,suffix:"×"})}}function _(e,t){if(e===void 0)return t;if(!Number.isInteger(e)||e<0||e>6)throw new RangeError("Comparison precision must be an integer from 0 to 6.");return e}function ge(e,t){const n={mode:t.displayMode,current:w(e.currentValue,t.metricFormat,t.locale),comparison:w(e.comparisonValue,t.metricFormat,t.locale)};return(t.displayMode==="difference"||t.displayMode==="both")&&(n.difference=w(e.delta,t.metricFormat,t.locale)),(t.displayMode==="percent_change"||t.displayMode==="both")&&(n.percentChange=C(e.percentChange,_(t.precision,1),t.locale,"percent")),t.displayMode==="ratio"&&(n.ratio=C(e.ratio,_(t.precision,2),t.locale,"ratio")),n}function de(e,t){return e&&e!=="auto"?e:t}function he(e,t=new Date){try{const n={timeZone:e,timeZoneName:"short"},r=new Intl.DateTimeFormat("en-US",n).formatToParts(t).find(a=>a.type==="timeZoneName");return(r==null?void 0:r.value)||e}catch{return e}}function Me(e){try{const t={timeZone:e,timeZoneName:"long"},o=new Intl.DateTimeFormat("en-US",t).formatToParts(new Date).find(r=>r.type==="timeZoneName");return(o==null?void 0:o.value)||e}catch{return e}}function p(e,t="auto"){if(!e)return new Date(NaN);const n=e.endsWith("Z"),o=/[+-]\d{2}:?\d{2}$/.test(e),r=/\([A-Z]{3,4}\)$/.test(e);if(t==="auto")return n||o||r?new Date(e):new Date(e+"Z");if(t==="local"){if(n||o){const a=e.replace(/Z$/,"").replace(/[+-]\d{2}:?\d{2}$/,"");return new Date(a)}return new Date(e)}else return t==="UTC"?n?new Date(e):o?new Date(e):new Date(e+"Z"):n||o||r?new Date(e):B.fromZonedTime(e,t)}const ye="MM/dd/yyyy",De=(e,t,n,o="auto")=>{if(!e)return"";try{const r=p(e,o);if(isNaN(r.getTime()))return e;const i=(t&&t.trim()?t:ye).replace(/LLLL/g,"MMMM").replace(/LLL/g,"MMM");return n&&n!=="auto"?l.formatInTimeZone(r,n,i):l.format(r,i)}catch(r){return console.error("Date formatting error:",r),e}},be=(e,t="auto")=>{if(!e)return"";try{const n=p(e,t);return isNaN(n.getTime())?e:v(n,{addSuffix:!0})}catch(n){return console.error("Relative time formatting error:",n),e}};function I(e,t=","){if(e==null)return"";const n=String(e);return n.includes(t)||n.includes('"')||n.includes(`
|
|
2
|
+
`)||n.includes("\r")?`"${n.replace(/"/g,'""')}"`:n}function N(e,t=","){return e.map(n=>I(n,t)).join(t)}function O(e,t={}){const{delimiter:n=",",lineEnding:o=`
|
|
3
|
+
`}=t;return e.map(r=>N(r,n)).join(o)}function Te(e,t={}){if(e.length===0)return"";const{delimiter:n=",",lineEnding:o=`
|
|
4
|
+
`,includeHeaders:r=!0,columns:a}=t,i=a||Object.keys(e[0]),s=[];r&&s.push(i);for(const c of e){const u=i.map(g=>{const m=c[g];return m==null?"":String(m)});s.push(u)}return O(s,{delimiter:n,lineEnding:o})}const $=1e4,we=1e6;function Le(e){return e>$}const P="__TOTAL__";function D(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function b(e){return e===P}function pe(e){const t=new Map,n=(e.groupByColumns??[]).map((r,a)=>{var u,g,m;if(!D(r))throw new Error(`Aggregate groupByColumns[${a}] is invalid`);const i=typeof r.id=="string"&&r.id.length>0?r.id:void 0,s=i?(m=(g=(u=e.columnKeyMap)==null?void 0:u.byRole)==null?void 0:g.groupby)==null?void 0:m[i]:void 0,c=(s==null?void 0:s.outputKey)||(s==null?void 0:s.rawKey)||(typeof r.alias=="string"&&r.alias.length>0?r.alias:typeof r.name=="string"&&r.name.length>0?r.name:void 0);if(!c)throw new Error(`Aggregate groupByColumns[${a}] has no output key`);return[i,r.alias,r.name,c].forEach(f=>{typeof f=="string"&&f.length>0&&t.set(f,c)}),c}),o=(e.rowAggregates??[]).flatMap(r=>!D(r)||typeof r.function!="string"||typeof r.groupLevel!="string"?[]:[{function:r.function,groupLevel:r.groupLevel==="ALL"?"ALL":t.get(r.groupLevel)||r.groupLevel,...typeof r.label=="string"?{label:r.label}:{}}]);return{groupColumnKeys:n,rowAggregates:o}}function F(e){return e==="SUM"?"Total":e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function U(e){var n;if(e.customLabel)return e.customLabel;const t=F(e.aggregateFunction);if(e.levelValue!==void 0&&!b(e.levelValue)){if(e.levelValue===null){const r=(n=e.formatValue)==null?void 0:n.call(e,null);return r?`Subtotal ${r}`:`Subtotal ${t}`}const o=e.formatValue?e.formatValue(e.levelValue):String(e.levelValue);if(o)return`Subtotal (${o})`}return`Subtotal ${t}`}function k(e,t){return t||`Grand ${F(e)}`}function A(e){var o,r;const t=e.context.groupColumnKeys,n=typeof e.row.aggregate=="string"?e.row.aggregate:"SUM";if(e.row.isGrandTotal===!0){const a=(o=e.context.rowAggregates.find(i=>i.groupLevel==="ALL"))==null?void 0:o.label;return{kind:"grand-total",cells:t.map((i,s)=>({columnKey:i,text:s===0?k(n,a):"",placement:s===0?"label":"empty",colSpan:s===0?t.length:1}))}}if(e.row.isSubtotal===!0){if(typeof e.row.subtotalLevel!="string")throw new Error("Aggregate subtotal row is missing subtotalLevel");const a=t.indexOf(e.row.subtotalLevel);if(a<0)throw new Error(`Aggregate subtotal level "${e.row.subtotalLevel}" has no group column`);const i=D(e.row.subtotalContext)?e.row.subtotalContext:void 0,s=D(i==null?void 0:i.groupByValues)?i.groupByValues:{},c=(r=e.context.rowAggregates.find(u=>u.groupLevel===e.row.subtotalLevel&&u.function===n))==null?void 0:r.label;return{kind:"subtotal",cells:t.map((u,g)=>{if(g>a)return{columnKey:u,text:"",placement:"empty",colSpan:1};if(g<a){const m=e.row[u];return{columnKey:u,text:m===void 0||b(m)?"":e.formatValue(m,u),placement:"value",colSpan:1}}return{columnKey:u,text:U({aggregateFunction:n,customLabel:c,levelValue:s[u],formatValue:m=>e.formatLabelValue?e.formatLabelValue(m,u):String(e.formatValue(m,u)??"")}),placement:"label",colSpan:t.length-a}})}}return{kind:"data",cells:t.map(a=>{const i=e.row[a];return{columnKey:a,text:i===void 0||b(i)?"":e.formatValue(i,a),placement:"value",colSpan:1}})}}function Ae(e){const t=A(e).cells.find(n=>n.columnKey===e.columnKey);if(!t)throw new Error(`Aggregate group column "${e.columnKey}" is unknown`);return t.text}function xe(e){return A(e).cells.map(t=>t.text)}class X extends Error{constructor(n,o){super(`${n}: ${o}`);x(this,"deliveryBlocking",!0);this.code=n,this.name="PivotHeaderPresentationError"}}function Se(e){var r;const t=e.mode??"formatted",n=e.members.map(a=>{var s;if(t==="canonical"||!a.temporalBucket)return a.value===null?"":String(a.value);const i=(s=e.resolveTemporalFormat)==null?void 0:s.call(e,a.fieldId);if(!i)throw new X("missing_resolved_temporal_format",`Missing resolved temporal presentation for pivot field "${a.fieldId}"`);return j.formatTemporalBucket({value:a.value,metadata:a.temporalBucket,format:i})}),o=((r=e.metricLabel)==null?void 0:r.trim())||void 0;return{memberLabels:n,...o?{metricLabel:o}:{},flattenedLabel:[...n,...o?[o]:[]].join(" / ")}}exports.AGGREGATE_TOTAL_MEMBER_MARKER=P;exports.DIRECT_CSV_EXPORT_MAX_ROWS=$;exports.FULL_DATASET_CSV_EXPORT_MAX_ROWS=we;exports.PivotHeaderPresentationError=X;exports.arrayToCSV=O;exports.arrayToCSVRow=N;exports.escapeCSVValue=I;exports.formatAggregateGrandTotalLabel=k;exports.formatAggregateGroupCell=Ae;exports.formatAggregateGroupRow=xe;exports.formatAggregateSubtotalLabel=U;exports.formatDate=De;exports.formatDistanceToNow=v;exports.formatDuration=V;exports.formatMetricComparison=ge;exports.formatRelativeTime=be;exports.getTimezoneAbbreviation=he;exports.getTimezoneName=Me;exports.isAggregateTotalMemberMarker=b;exports.objectsToCSV=Te;exports.parseWithSourceTimezone=p;exports.presentAggregateGroupRow=A;exports.presentPivotHeader=Se;exports.requiresChunkedCsvExport=Le;exports.resolveAggregateTablePresentationContext=pe;exports.resolveTimezone=de;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var y = Object.defineProperty;
|
|
2
2
|
var c = (t, e, r) => e in t ? y(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
3
|
var u = (t, e, r) => c(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
-
import { v as d } from "./temporal-bucket-contract-
|
|
4
|
+
import { v as d } from "./temporal-bucket-contract-Cno9TlYr.js";
|
|
5
5
|
function f(t) {
|
|
6
6
|
return !!(t != null && t.isSubtotal && t.subtotalScope === "pivot-value");
|
|
7
7
|
}
|