react-semaphor 0.1.459 → 0.1.461

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -1
  2. package/dist/analytics-protocol/index.js +32 -32
  3. package/dist/brand-studio/index.cjs +1 -1
  4. package/dist/brand-studio/index.js +4 -4
  5. package/dist/briefings/index.cjs +1 -1
  6. package/dist/briefings/index.js +4 -4
  7. package/dist/chunks/{analyze-result-contract-BbRJ-C06.js → analyze-result-contract-DROq4vgY.js} +1 -1
  8. package/dist/chunks/{analyze-result-contract-LPDNldic.cjs → analyze-result-contract-DSGoFuXQ.cjs} +1 -1
  9. package/dist/chunks/canonical-result-keys-CEQefvdO.js +33 -0
  10. package/dist/chunks/canonical-result-keys-Cb96edol.cjs +1 -0
  11. package/dist/chunks/{common-types-H51FLKB7.js → common-types-BHVKgxRR.js} +1 -1
  12. package/dist/chunks/{common-types-C57kJ59w.cjs → common-types-BcV9PD9D.cjs} +1 -1
  13. package/dist/chunks/{dashboard-briefing-launcher-ClCj98sq.js → dashboard-briefing-launcher-3owMxX5K.js} +60 -61
  14. package/dist/chunks/{dashboard-briefing-launcher-DHtEouuH.cjs → dashboard-briefing-launcher-xuGrw8H3.cjs} +2 -2
  15. package/dist/chunks/{dashboard-controls-B8gsKlxc.js → dashboard-controls-B4GvjGr1.js} +44 -45
  16. package/dist/chunks/{dashboard-controls-VRShl9J0.cjs → dashboard-controls-Bpm_xOXQ.cjs} +1 -1
  17. package/dist/chunks/dashboard-filter-value-compatibility-KXIyvbhc.js +677 -0
  18. package/dist/chunks/dashboard-filter-value-compatibility-UapptYnn.cjs +1 -0
  19. package/dist/chunks/dashboard-input-contract-BkRFQ7Tq.cjs +1 -0
  20. package/dist/chunks/{dashboard-date-comparison-definition-DC3ekV2S.js → dashboard-input-contract-D5dxTWJ5.js} +41 -25
  21. package/dist/chunks/{dashboard-json-i_Auue_K.js → dashboard-json-DzyxoBp-.js} +13 -14
  22. package/dist/chunks/dashboard-json-yLM01xK4.cjs +1 -0
  23. package/dist/chunks/{edit-dashboard-visual-DWWyT55u.cjs → edit-dashboard-visual-1T278Nr_.cjs} +28 -28
  24. package/dist/chunks/{edit-dashboard-visual-B3JF0fe4.js → edit-dashboard-visual-nwSasO_j.js} +880 -894
  25. package/dist/chunks/{editor-action-buttons-BTlCsP63.cjs → editor-action-buttons-CX1Pken3.cjs} +2 -2
  26. package/dist/chunks/{editor-action-buttons-C9x3nGnb.js → editor-action-buttons-Dqw0asfA.js} +28 -28
  27. package/dist/chunks/index-B1qplNxl.cjs +1392 -0
  28. package/dist/chunks/{index-BS2-ZZGf.js → index-DazD5k0F.js} +45362 -42931
  29. package/dist/chunks/{index-BIFLI8ul.js → index-De_7nrwb.js} +10 -10
  30. package/dist/chunks/index-DjjKJPDy.cjs +4 -0
  31. package/dist/chunks/{matrix-result-contract-CofATICL.js → matrix-result-contract-BTpPuHOc.js} +88 -104
  32. package/dist/chunks/matrix-result-contract-ZRNfeIbI.cjs +1 -0
  33. package/dist/chunks/{pivot-header-presentation-B9nXXKlW.cjs → pivot-header-presentation-BijPbP33.cjs} +1 -1
  34. package/dist/chunks/{pivot-header-presentation-D-0jvUwn.js → pivot-header-presentation-DW0gKG8g.js} +2 -2
  35. package/dist/chunks/{pivot-result-identity-Bb4EixVN.cjs → pivot-result-identity-DxHtiKVj.cjs} +1 -1
  36. package/dist/chunks/{pivot-result-identity-DU1v-5Xk.js → pivot-result-identity-Z9tN2tEV.js} +1 -1
  37. package/dist/chunks/{pivot-result-lifecycle-DTLRuDEW.cjs → pivot-result-lifecycle-BXzIlQVu.cjs} +1 -1
  38. package/dist/chunks/{pivot-result-lifecycle-CHWEGU2o.js → pivot-result-lifecycle-g2U-vzQb.js} +7 -7
  39. package/dist/chunks/{raw-temporal-contract-BtjH_G-d.cjs → raw-temporal-contract-DfAvqNMo.cjs} +1 -1
  40. package/dist/chunks/{raw-temporal-contract-CxncLze5.js → raw-temporal-contract-UtAqoOZO.js} +1 -1
  41. package/dist/chunks/{report-preferences-dialog-BK0yAJnQ.cjs → report-preferences-dialog-DKPyjiCt.cjs} +1 -1
  42. package/dist/chunks/{report-preferences-dialog-BDpkcUtz.js → report-preferences-dialog-Dv3vCCFt.js} +6 -6
  43. package/dist/chunks/{report-runtime-context-DqxS4wbi.cjs → report-runtime-context-C0NfLPfc.cjs} +1 -1
  44. package/dist/chunks/{report-runtime-context-SM6YO61_.js → report-runtime-context-CNncA3VD.js} +11 -11
  45. package/dist/chunks/{saved-temporal-bucket-format-CFfWXRl9.cjs → saved-temporal-bucket-format-3QKveR3v.cjs} +1 -1
  46. package/dist/chunks/{saved-temporal-bucket-format-SGAV0ivR.js → saved-temporal-bucket-format-Dd2eixTH.js} +11 -11
  47. package/dist/chunks/switch-DBZsEV0U.cjs +138 -0
  48. package/dist/chunks/{switch-DQR-Va05.js → switch-kPUJEC1A.js} +6615 -5219
  49. package/dist/chunks/{temporal-bucket-5UYEotyQ.js → temporal-bucket-C85rmFmC.js} +4 -4
  50. package/dist/chunks/temporal-bucket-authoring-1fZuPAVb.js +653 -0
  51. package/dist/chunks/temporal-bucket-authoring-BK1UhYpD.cjs +1 -0
  52. package/dist/chunks/{temporal-bucket-contract-D5d-xEl3.js → temporal-bucket-contract-DXXNZssK.js} +1 -1
  53. package/dist/chunks/{temporal-bucket-contract-D2-93DGr.cjs → temporal-bucket-contract-xFkvboaw.cjs} +1 -1
  54. package/dist/chunks/{temporal-bucket-DHY1y9lq.cjs → temporal-bucket-pMfghsLX.cjs} +1 -1
  55. package/dist/chunks/{token-types-GbxRUozo.js → token-types-BLxc7UwR.js} +1 -1
  56. package/dist/chunks/{token-types-D7CaaI80.cjs → token-types-BYYO109W.cjs} +1 -1
  57. package/dist/chunks/{update-policy-hednMF-0.js → update-policy-CB8XJIoY.js} +1 -1
  58. package/dist/chunks/{update-policy-BmiOd0PB.cjs → update-policy-DMjjGjQY.cjs} +1 -1
  59. package/dist/chunks/{validators-DEmd8Sin.js → validators-DVd8s3qY.js} +416 -350
  60. package/dist/chunks/validators-dJlwubP4.cjs +1 -0
  61. package/dist/dashboard/index.cjs +1 -1
  62. package/dist/dashboard/index.js +2 -2
  63. package/dist/dashboard-authoring/index.cjs +3 -3
  64. package/dist/dashboard-authoring/index.js +328 -311
  65. package/dist/data-app-builder/index.cjs +1 -1
  66. package/dist/data-app-builder/index.js +2 -2
  67. package/dist/data-app-codegen/index.cjs +1 -1
  68. package/dist/data-app-codegen/index.js +2 -2
  69. package/dist/data-app-codegen-node/index.cjs +1 -1
  70. package/dist/data-app-codegen-node/index.js +3 -3
  71. package/dist/data-app-sdk/index.cjs +1 -1
  72. package/dist/data-app-sdk/index.js +55 -55
  73. package/dist/data-app-sdk-adapters/index.cjs +1 -1
  74. package/dist/data-app-sdk-adapters/index.js +61 -56
  75. package/dist/data-app-sdk-validation/index.cjs +1 -1
  76. package/dist/data-app-sdk-validation/index.js +9 -9
  77. package/dist/format-utils/index.cjs +1 -1
  78. package/dist/format-utils/index.js +15 -15
  79. package/dist/index.cjs +1 -1
  80. package/dist/index.js +154 -155
  81. package/dist/report-runtime-context/index.cjs +1 -1
  82. package/dist/report-runtime-context/index.js +2 -2
  83. package/dist/style.css +1 -1
  84. package/dist/surfboard/index.cjs +1 -1
  85. package/dist/surfboard/index.js +3 -3
  86. package/dist/types/analytics-protocol.d.ts +16 -8
  87. package/dist/types/briefings.d.ts +95 -13
  88. package/dist/types/dashboard-assistant.d.ts +11 -6
  89. package/dist/types/dashboard-authoring.d.ts +257 -19
  90. package/dist/types/dashboard.d.ts +109 -14
  91. package/dist/types/data-app-builder.d.ts +11 -6
  92. package/dist/types/data-app-codegen-node.d.ts +16 -8
  93. package/dist/types/data-app-codegen.d.ts +16 -8
  94. package/dist/types/data-app-sdk-adapters.d.ts +17 -11
  95. package/dist/types/data-app-sdk-validation.d.ts +17 -11
  96. package/dist/types/data-app-sdk.d.ts +17 -11
  97. package/dist/types/index.cjs +1 -1
  98. package/dist/types/index.js +4 -4
  99. package/dist/types/main.d.ts +225 -20
  100. package/dist/types/shared.d.ts +95 -13
  101. package/dist/types/surfboard.d.ts +109 -14
  102. package/dist/types/types.d.ts +109 -14
  103. package/package.json +1 -1
  104. package/dist/chunks/canonical-result-keys-BA0HCP4e.cjs +0 -1
  105. package/dist/chunks/canonical-result-keys-D6avdjpA.js +0 -467
  106. package/dist/chunks/dashboard-date-comparison-definition-Ces4alFm.cjs +0 -1
  107. package/dist/chunks/dashboard-json-BhvPMpZA.cjs +0 -1
  108. package/dist/chunks/index-DHF-2AqS.cjs +0 -1392
  109. package/dist/chunks/index-k8tEp0ys.cjs +0 -4
  110. package/dist/chunks/matrix-result-contract-zamd9euI.cjs +0 -1
  111. package/dist/chunks/switch-f3TuZNLr.cjs +0 -138
  112. package/dist/chunks/temporal-bucket-authoring-K1kE6R_z.js +0 -222
  113. package/dist/chunks/temporal-bucket-authoring-o3Emn05L.cjs +0 -1
  114. package/dist/chunks/validators-BDYprKI9.cjs +0 -1
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),p=require("react"),An=require("react-dom/client"),k=require("../chunks/index-DHF-2AqS.cjs"),w=require("../chunks/switch-f3TuZNLr.cjs"),Ze=require("../data-app-builder-browser-runtime/index.cjs"),te=require("../chunks/x-B6ghREd2.cjs"),Cn=require("../chunks/save-3dYRmehL.cjs"),Rn=require("../chunks/mouse-pointer-2-DX4A_XZw.cjs"),tt=require("../chunks/search-BqqhaMx9.cjs");function Tr(t){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const d=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(s,a,d.get?d:{enumerable:!0,get:()=>t[a]})}}return s.default=t,Object.freeze(s)}const Bn=Tr(p),Dn=Tr(An);/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),p=require("react"),An=require("react-dom/client"),k=require("../chunks/index-B1qplNxl.cjs"),w=require("../chunks/switch-DBZsEV0U.cjs"),Ze=require("../data-app-builder-browser-runtime/index.cjs"),te=require("../chunks/x-B6ghREd2.cjs"),Cn=require("../chunks/save-3dYRmehL.cjs"),Rn=require("../chunks/mouse-pointer-2-DX4A_XZw.cjs"),tt=require("../chunks/search-BqqhaMx9.cjs");function Tr(t){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const d=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(s,a,d.get?d:{enumerable:!0,get:()=>t[a]})}}return s.default=t,Object.freeze(s)}const Bn=Tr(p),Dn=Tr(An);/**
2
2
  * @license lucide-react v0.453.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -2,8 +2,8 @@ import { jsx as r, jsxs as c, Fragment as re } from "react/jsx-runtime";
2
2
  import * as Zn from "react";
3
3
  import { useContext as qn, useState as x, useRef as oe, useMemo as je, useEffect as W, useCallback as Ot } from "react";
4
4
  import * as Xn from "react-dom/client";
5
- import { aM as ea, aN as ta, aO as Ir, aP as jr, aQ as zr, aR as ra, aS as Wr, aT as Hr, aU as Jr, aV as Vr, aW as _r, aX as Ur, aY as Gr, aZ as na, a_ as aa, a$ as oa, b0 as Ht, b1 as on, R as Kr, b2 as sa, b3 as Vt, b4 as sn, b5 as ia, b6 as la } from "../chunks/index-BS2-ZZGf.js";
6
- import { B as H, P as it, a as lt, b as dt, _ as da, $ as ca, a0 as ua, a1 as pa, a2 as ha, L as me, R as ma, d as _t } from "../chunks/switch-DQR-Va05.js";
5
+ import { aM as ea, aN as ta, aO as Ir, aP as jr, aQ as zr, aR as ra, aS as Wr, aT as Hr, aU as Jr, aV as Vr, aW as _r, aX as Ur, aY as Gr, aZ as na, a_ as aa, a$ as oa, b0 as Ht, b1 as on, R as Kr, b2 as sa, b3 as Vt, b4 as sn, b5 as ia, b6 as la } from "../chunks/index-DazD5k0F.js";
6
+ import { B as H, P as it, a as lt, b as dt, _ as da, $ as ca, a0 as ua, a1 as pa, a2 as ha, L as me, R as ma, d as _t } from "../chunks/switch-kPUJEC1A.js";
7
7
  import { loadSemaphorBrowserRuntime as ot } from "../data-app-builder-browser-runtime/index.js";
8
8
  import { c as Ve, X as He } from "../chunks/x-CXDkqdur.js";
9
9
  import { S as fa } from "../chunks/save-DgMfP0j8.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../chunks/validators-BDYprKI9.cjs"),e=require("../chunks/update-policy-BmiOd0PB.cjs");exports.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_SCHEMA_VERSION=a.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_SCHEMA_VERSION;exports.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_VALIDATOR_VERSION=a.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_VALIDATOR_VERSION;exports.isSemaphorDataAppCodegenSummary=a.isSemaphorDataAppCodegenSummary;exports.validateSemaphorDataAppCodegenSummary=a.validateSemaphorDataAppCodegenSummary;exports.CODEGEN_SUMMARY_SCHEMA_VERSION=e.CODEGEN_SUMMARY_SCHEMA_VERSION;exports.CODEGEN_SUMMARY_VALIDATOR_VERSION=e.CODEGEN_SUMMARY_VALIDATOR_VERSION;exports.CONTRACT_MANIFEST_SCHEMA_VERSION=e.CONTRACT_MANIFEST_SCHEMA_VERSION;exports.GENERATED_CONTRACT_SCHEMA_VERSION=e.GENERATED_CONTRACT_SCHEMA_VERSION;exports.GENERATED_CONTRACT_TYPESCRIPT_FILES=e.GENERATED_CONTRACT_TYPESCRIPT_FILES;exports.REQUIRED_GENERATED_CONTRACT_FILES=e.REQUIRED_GENERATED_CONTRACT_FILES;exports.assertValidCodegenSummary=e.assertValidCodegenSummary;exports.buildSemaphorGeneratedActiveInput=e.buildSemaphorGeneratedActiveInput;exports.buildSemaphorGeneratedInputOptionIntent=e.buildSemaphorGeneratedInputOptionIntent;exports.buildSemaphorGeneratedViewExecutionRequest=e.buildSemaphorGeneratedViewExecutionRequest;exports.buildSemaphorGeneratedViewExecutionRequests=e.buildSemaphorGeneratedViewExecutionRequests;exports.evaluateSemaphorDataAppContractUpdatePolicy=e.evaluateSemaphorDataAppContractUpdatePolicy;exports.validateCodegenSummary=e.validateCodegenSummary;exports.validateSemaphorGeneratedContract=e.validateSemaphorGeneratedContract;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../chunks/validators-dJlwubP4.cjs"),e=require("../chunks/update-policy-DMjjGjQY.cjs");exports.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_SCHEMA_VERSION=a.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_SCHEMA_VERSION;exports.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_VALIDATOR_VERSION=a.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_VALIDATOR_VERSION;exports.isSemaphorDataAppCodegenSummary=a.isSemaphorDataAppCodegenSummary;exports.validateSemaphorDataAppCodegenSummary=a.validateSemaphorDataAppCodegenSummary;exports.CODEGEN_SUMMARY_SCHEMA_VERSION=e.CODEGEN_SUMMARY_SCHEMA_VERSION;exports.CODEGEN_SUMMARY_VALIDATOR_VERSION=e.CODEGEN_SUMMARY_VALIDATOR_VERSION;exports.CONTRACT_MANIFEST_SCHEMA_VERSION=e.CONTRACT_MANIFEST_SCHEMA_VERSION;exports.GENERATED_CONTRACT_SCHEMA_VERSION=e.GENERATED_CONTRACT_SCHEMA_VERSION;exports.GENERATED_CONTRACT_TYPESCRIPT_FILES=e.GENERATED_CONTRACT_TYPESCRIPT_FILES;exports.REQUIRED_GENERATED_CONTRACT_FILES=e.REQUIRED_GENERATED_CONTRACT_FILES;exports.assertValidCodegenSummary=e.assertValidCodegenSummary;exports.buildSemaphorGeneratedActiveInput=e.buildSemaphorGeneratedActiveInput;exports.buildSemaphorGeneratedInputOptionIntent=e.buildSemaphorGeneratedInputOptionIntent;exports.buildSemaphorGeneratedViewExecutionRequest=e.buildSemaphorGeneratedViewExecutionRequest;exports.buildSemaphorGeneratedViewExecutionRequests=e.buildSemaphorGeneratedViewExecutionRequests;exports.evaluateSemaphorDataAppContractUpdatePolicy=e.evaluateSemaphorDataAppContractUpdatePolicy;exports.validateCodegenSummary=e.validateCodegenSummary;exports.validateSemaphorGeneratedContract=e.validateSemaphorGeneratedContract;
@@ -1,5 +1,5 @@
1
- import { S as E, a as S, i as A, v as t } from "../chunks/validators-DEmd8Sin.js";
2
- import { C as R, a as r, b as s, G as C, e as o, R as p, c as d, f as O, g as i, h as m, i as n, j as N, v as T, d as I } from "../chunks/update-policy-hednMF-0.js";
1
+ import { S as E, a as S, i as A, v as t } from "../chunks/validators-DVd8s3qY.js";
2
+ import { C as R, a as r, b as s, G as C, e as o, R as p, c as d, f as O, g as i, h as m, i as n, j as N, v as T, d as I } from "../chunks/update-policy-CB8XJIoY.js";
3
3
  export {
4
4
  R as CODEGEN_SUMMARY_SCHEMA_VERSION,
5
5
  r as CODEGEN_SUMMARY_VALIDATOR_VERSION,
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("../chunks/validators-BDYprKI9.cjs"),R=require("../chunks/update-policy-BmiOd0PB.cjs"),he=require("node:crypto"),Ce="src/semaphor/generated",H=`// Generated by Semaphor Agent Plugin. Do not hand-edit analytics wiring here.
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("../chunks/validators-dJlwubP4.cjs"),R=require("../chunks/update-policy-DMjjGjQY.cjs"),he=require("node:crypto"),Ce="src/semaphor/generated",H=`// Generated by Semaphor Agent Plugin. Do not hand-edit analytics wiring here.
2
2
  // Regenerate from the accepted semaphor_plan_data_app codegenSummary when the plan changes.
3
3
  `;function Oe(e,n={}){R.assertValidCodegenSummary(e);const r=Me(e);if(r.views.length===0&&!n.allowEmpty)throw new Error("Contract generation produced zero executable views. Stop and ask for a different domain/goal or semantic model improvement; pass --allow-empty only for an explicit model-gap report.");const t=ke(r),o=Ne({contract:r,files:t,generatorName:n.generatorName||"react-semaphor/data-app-codegen/node",generatorVersion:n.generatorVersion||"unknown"}),a={...t,"contract.manifest.json":`${JSON.stringify(o,null,2)}
4
4
  `};return{schemaVersion:R.GENERATED_CONTRACT_SCHEMA_VERSION,files:a,manifest:o,contentHash:String(o.generatedContentHash||""),usageExample:Te(r),warnings:r.warnings,stats:{inputCount:r.inputs.length,executableViewCount:r.views.length,presentationViewCount:r.presentationViews.length,queryCount:r.views.length,optionQueryCount:r.optionQueries.length}}}function Me(e){var d,p,m,i,l,g,h,I,$,M,b,E;const n=[],r=[];for(const s of e.inputs){S(r,s.fieldRef);for(const V of s.bindings||[])S(r,V.fieldRef);S(r,(d=s.optionQuery)==null?void 0:d.valueFieldRef),S(r,(p=s.optionQuery)==null?void 0:p.labelFieldRef),S(r,(m=s.optionQuery)==null?void 0:m.filterFieldRef),D(r,(i=s.optionQuery)==null?void 0:i.spec)}for(const s of e.filterContracts){S(r,s.fieldRef),S(r,(l=s.optionQuery)==null?void 0:l.valueFieldRef),S(r,(g=s.optionQuery)==null?void 0:g.labelFieldRef),S(r,(h=s.optionQuery)==null?void 0:h.filterFieldRef),D(r,(I=s.optionQuery)==null?void 0:I.spec);for(const V of s.bindings||[])S(r,V.fieldRef)}for(const s of e.views){for(const V of s.fields||[])S(r,V);D(r,($=s.sdkSpec)==null?void 0:$.spec),D(r,s.visualSpec)}const t=e.implementationChecklist||{};for(const s of Object.values(t.bindingsByView||{}))for(const V of Array.isArray(s)?s:[])S(r,V.fieldRef),S(r,V.optionValueField),S(r,V.optionLabelField);for(const s of t.requiredInputOptions||[])S(r,s.visibleLabelField),S(r,s.optionValueField),S(r,s.runtimeFilterField);const o=pn([...e.sources.map(s=>({raw:s,key:Ie(s),aliases:Ve(s),name:""})),...r.map(s=>an(s)).filter(x)]);P(o,s=>{const V=F(s.raw);return j(s.raw.label||(V==null?void 0:V.datasetName)||(V==null?void 0:V.datasetId)||(V==null?void 0:V.name)||s.raw.kind||"source")});const a=ln(o),u=ne(r.filter(s=>s.name).map(s=>({raw:s,key:X(s),name:""})),s=>s.key);P(u,s=>j([s.raw.sourceKey?yn(s.raw.sourceKey):"",s.raw.aggregate?s.raw.aggregate.toLowerCase():"",s.raw.name].filter(Boolean).join("_")));const c=new Map(u.map(s=>[s.key,s.name])),w=e.inputs.map(s=>({raw:s,name:j(s.id||s.label||"input")}));P(w,s=>s.name);const f=w.filter(s=>!!s.raw.optionQuery).map(s=>({input:s,name:`${s.name}Options`,raw:s.raw.optionQuery}));P(f,s=>s.name);for(const s of f)un(s.raw.labelFieldRef,s.raw.valueFieldRef)&&dn(s.raw.valueFieldRef)&&n.push(`Input option query ${((M=s.raw.spec)==null?void 0:M.inputId)||s.input.raw.id||s.name} uses identifier field ${s.raw.valueFieldRef.name} as both label and value. It can execute, but the UI will show key values unless the semantic model exposes a human-readable label through a modeled relationship.`);const y=e.views.filter(s=>{var V,K;return!!((V=s.sdkSpec)!=null&&V.builder&&((K=s.sdkSpec)!=null&&K.spec))}).map(s=>({raw:s,name:j(s.id||s.title||"query")}));P(y,s=>s.name);const k=e.views.filter(s=>fe(s)&&!("sdkSpec"in s)).map(s=>sn(s));for(const s of e.views)(!("sdkSpec"in s)||!((b=s.sdkSpec)!=null&&b.builder)||!((E=s.sdkSpec)!=null&&E.spec))&&!fe(s)&&n.push(`Skipped view ${s.id||s.title||"unknown"} because it has no sdkSpec.`);return Ee({inputs:w,views:y,filterContracts:e.filterContracts}),{summary:e,title:e.title||"Semaphor Data App",sources:o,fields:u,inputs:w,optionQueries:f,views:y,presentationViews:k,filterContracts:e.filterContracts,checklist:t,sourceNameByKey:a,fieldNameByKey:c,warnings:n}}function Ee({inputs:e,views:n,filterContracts:r}){const t=new Set(e.map(a=>a.raw.id).filter(Boolean)),o=new Set(n.map(a=>a.raw.id).filter(Boolean));for(const[a,u]of r.entries()){if(!t.has(u.inputId))throw new Error(`filterContracts.${a}.inputId must reference a generated input.`);const c=new Set(u.appliesToViewIds||[]),w=new Set(u.notAppliedToViewIds||[]);for(const[f,y]of(u.appliesToViewIds||[]).entries())if(!o.has(y))throw new Error(`filterContracts.${a}.appliesToViewIds.${f} must reference an executable generated view.`);for(const[f,y]of(u.notAppliedToViewIds||[]).entries())if(!o.has(y))throw new Error(`filterContracts.${a}.notAppliedToViewIds.${f} must reference an executable generated view.`);for(const[f,y]of(u.bindings||[]).entries()){if(!o.has(y.viewId))throw new Error(`filterContracts.${a}.bindings.${f}.viewId must reference an executable generated view.`);if(!c.has(y.viewId))throw new Error(`filterContracts.${a}.bindings.${f}.viewId must be included in appliesToViewIds.`);if(w.has(y.viewId))throw new Error(`filterContracts.${a}.bindings.${f}.viewId must not be listed in notAppliedToViewIds.`)}}}function ke(e){return{"sources.ts":ve(e),"fields.ts":qe(e),"inputs.ts":De(e),"queries.ts":Pe(e),"bindings.ts":Le(e),"accessors.ts":Ye(e),"metadata.ts":We(e),"index.ts":Xe(),"USAGE.md":Ae(e)}}function Ne({contract:e,files:n,generatorName:r,generatorVersion:t}){return{schemaVersion:R.CONTRACT_MANIFEST_SCHEMA_VERSION,generatedContractSchemaVersion:R.GENERATED_CONTRACT_SCHEMA_VERSION,generator:{name:r,version:t},generatedContentHash:Ge(n),codegenSummaryValidatorVersion:R.CODEGEN_SUMMARY_VALIDATOR_VERSION,codegenSummaryHash:xe(e.summary),codegenSummary:e.summary}}function Ge(e){const n=he.createHash("sha256");for(const r of Object.keys(e).filter(t=>t.endsWith(".ts")).sort())n.update(r),n.update("\0"),n.update(e[r]),n.update("\0");return`sha256:${n.digest("hex")}`}function Ae(e){const n=["# Semaphor Generated Data App Contract","","Generated files in this directory are governed Semaphor analytics wiring. Do not hand-edit them.","","Use the app-facing exports from `index.ts`:","","- `queries`: generated governed query factories.","- `queryOptionsForView`: active-input wiring for each generated view.","- `rowsForView`: table/records row readers.","- `rowValuesForView`: friendly row object readers for chart/table views.","- `metricValuesForView`: friendly metric-value readers.","- `kpiPropsForView`: KPI component props derived from runtime metric results.","- `roleValuesForView`: canonical dimension/measure/date/id role readers.","- `appInputSpecs`: generated input/filter specs.","- `inputOptionQueries`: option-list query factories for generated inputs.","- `semaphorGeneratedContractMetadata`: generated view/input metadata and presentation-only views.","","Start with these exports before opening large generated internals such as `metadata.ts`.",""];return e.views.length>0&&(n.push("Generated executable views:"),e.views.forEach(r=>{n.push(`- \`${r.raw.id}\`: ${r.raw.title||r.name}`)}),n.push("")),e.inputs.length>0&&(n.push("Generated inputs:"),e.inputs.forEach(r=>{n.push(`- \`${r.raw.id}\`: ${r.raw.label||r.name}`)}),n.push("")),`${n.join(`
@@ -1,6 +1,6 @@
1
- import { S as Vn, a as Fn, i as bn, v as kn } from "../chunks/validators-DEmd8Sin.js";
2
- import { c as ke, G as fe, a as Re, b as Me } from "../chunks/update-policy-hednMF-0.js";
3
- import { C as Mn, e as Cn, R as On, f as xn, g as Gn, h as Nn, i as En, j as An, v as jn, d as vn } from "../chunks/update-policy-hednMF-0.js";
1
+ import { S as Vn, a as Fn, i as bn, v as kn } from "../chunks/validators-DVd8s3qY.js";
2
+ import { c as ke, G as fe, a as Re, b as Me } from "../chunks/update-policy-CB8XJIoY.js";
3
+ import { C as Mn, e as Cn, R as On, f as xn, g as Gn, h as Nn, i as En, j as An, v as jn, d as vn } from "../chunks/update-policy-CB8XJIoY.js";
4
4
  import { createHash as ye } from "node:crypto";
5
5
  const wn = "src/semaphor/generated", v = `// Generated by Semaphor Agent Plugin. Do not hand-edit analytics wiring here.
6
6
  // Regenerate from the accepted semaphor_plan_data_app codegenSummary when the plan changes.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("../data-app-sdk-adapters/index.cjs"),i=require("react/jsx-runtime"),c=require("react"),ae=require("../chunks/validators-BDYprKI9.cjs");require("../chunks/analyze-result-contract-LPDNldic.cjs");require("../value-format-preferences/index.cjs");const se=require("../chunks/search-BqqhaMx9.cjs"),Ke=require("../chunks/x-B6ghREd2.cjs");function ue(e,r,t={}){return{...t,name:e,role:r}}function Mr(e){return e}function Kr(e){return e}const Wr={source:{semantic(e){return{...e,kind:"semantic"}},sql(e){return{...e,kind:"sql"}}},field:{measure(e,r){return ue(e,"measure",r)},dimension(e,r){return ue(e,"dimension",r)},date(e,r){return ue(e,"date",r)},id(e,r){return ue(e,"id",r)}},filter(e){return{...e,kind:"filter"}},bindInput(e,r){return{toAnalyticsInput(){const[t]=w.toSemaphorInputSnapshots([e]),n=w.toSemaphorInputBinding({...r,inputId:r.inputId||t.inputId});return{...t,inputId:n.inputId,...n.kind?{kind:n.kind}:{},...n.controlRole?{controlRole:n.controlRole}:{},...n.operator?{operator:n.operator}:{},...n.field?{field:n.field}:{},...n.relationshipHint?{relationshipHint:n.relationshipHint}:{}}}}},control(e){return{...e,kind:"control"}},sqlParam(e){return{...e,kind:"control",role:"sqlParam"}},derivedField(e){return{...e,kind:"derived_field",expressionLanguage:e.expressionLanguage||"semaphor_sql_template"}},metric(e){return{...e,queryKind:"metric"}},analysis(e){return{...e,queryKind:"analysis"}},records(e){return{...e,queryKind:"records"}},inputOptions(e){return{...e,queryKind:"inputOptions"}},sql(e){return{...e,queryKind:"sql"}},matrix(e){return{...e,queryKind:"matrix"}}},ie=10,Le=8;function We(e,r){const t=e==null?void 0:e.result;if(t)switch(t.kind){case"records":return te({title:"Records",rowNoun:"rows",records:t.records,columns:t.columns,rowCount:t.rowCount});case"sql":return te({title:"SQL Rows",rowNoun:"rows",records:t.records,columns:t.columns,rowCount:t.rowCount});case"inputOptions":return te({title:"Options",rowNoun:"options",records:t.options.slice(0,ie).map(n=>{var s;return{label:n.label,value:n.value,count:n.count,disambiguation:(s=n.disambiguation)==null?void 0:s.join(" / ")}}),columns:[{key:"label",label:"Label"},{key:"value",label:"Value"},{key:"count",label:"Count"},{key:"disambiguation",label:"Disambiguation"}],rowCount:t.rowCount??t.options.length});case"metric":return _r(t,r);case"matrix":return te({title:"Matrix Cells",rowNoun:"cells",records:t.cells.slice(0,ie).map(n=>{const s=t.nodesById[n.rowId],o=n.columnId?t.nodesById[n.columnId]:void 0,u=t.measuresById[n.measureId];return{row:(s==null?void 0:s.label)||n.rowId,column:(o==null?void 0:o.label)||n.columnId||"Total",measure:(u==null?void 0:u.label)||n.measureId,value:n.value,role:n.role}}),columns:[{key:"row",label:"Row"},{key:"column",label:"Column"},{key:"measure",label:"Measure"},{key:"value",label:"Value"},{key:"role",label:"Role"}],rowCount:t.rowCount??t.cells.length});default:return Fr(t)}}function _r(e,r){var o,u,p,d,f;const t=[{metric:"primaryValue",value:(r==null?void 0:r.primaryValue)??e.primaryValue}],n=(r==null?void 0:r.comparisonKind)??((o=e.comparison)==null?void 0:o.kind);return n&&t.push({metric:`${n} value`,value:(r==null?void 0:r.comparisonValue)??((u=e.comparison)==null?void 0:u.value)},{metric:"delta",value:(r==null?void 0:r.delta)??((p=e.comparison)==null?void 0:p.delta)},{metric:"deltaPercent",value:(r==null?void 0:r.deltaPercent)??((d=e.comparison)==null?void 0:d.deltaPercent)}),(((f=r==null?void 0:r.missingMeasures)==null?void 0:f.filter(Boolean))??[]).forEach(g=>{t.push({metric:`missing:${g}`,value:"missing"})}),Object.entries((r==null?void 0:r.measures)??{}).sort(([g],[m])=>g.localeCompare(m)).forEach(([g,m])=>{t.push({metric:`measure:${g}`,value:m})}),Object.entries((r==null?void 0:r.measureBindings)??{}).sort(([g],[m])=>g.localeCompare(m)).forEach(([g,m])=>{t.push({metric:`binding:${g}`,value:m})}),te({title:"Metric",rowNoun:"values",records:t,columns:[{key:"metric",label:"Metric"},{key:"value",label:"Value"}],rowCount:t.length})}function te({title:e,rowNoun:r,records:t,columns:n,rowCount:s}){const o=Nr(n,t);if(!o.length)return;const u=s??t.length,p=t.slice(0,ie);return{title:e,summary:`${Pr(u)} ${r}`,columns:o.slice(0,Le),rows:p,truncatedRows:u>p.length,truncatedColumns:o.length>Le}}function Nr(e,r){if(e!=null&&e.length)return e.filter(n=>n.key).map(n=>({key:n.key,label:n.label||n.key}));const t=new Set;return r.slice(0,ie).forEach(n=>{Object.keys(n).forEach(s=>t.add(s))}),[...t].map(n=>({key:n,label:n}))}function Fr(e){throw new Error(`Unhandled Semaphor result kind: ${pr(e)}`)}function zr(e){return e===null?"null":e===void 0?"":typeof e=="string"?rr(e):typeof e=="number"||typeof e=="boolean"?String(e):rr(pr(e))}function Pr(e){return typeof e=="number"?e.toLocaleString():"-"}function pr(e){return JSON.stringify(e,null,2)??"undefined"}function rr(e){return e.length>80?`${e.slice(0,77)}...`:e}function he(e){return e.viewTitle||e.queryLabel||e.viewId||e.queryId}function Hr(e){if(e.label)return e.label;if(e.queryKind!=="inputOptions")return;const t=e.labelField.label||e.valueField.label||e.labelField.name||e.valueField.name||e.inputId;return`${Vr(t)} Options`}function Vr(e){return(e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\bfilter\b/gi," ").replace(/\boptions?\b/gi," ").replace(/\bid\b/gi," ").replace(/\s+/g," ").trim()||e).split(" ").filter(Boolean).map(n=>n===n.toUpperCase()&&n.length>1?n:`${n.slice(0,1).toUpperCase()}${n.slice(1)}`).join(" ")}function _e(e){return e.flatMap(r=>{var g,m,v,y;const t=r.latestAttempt,n=t==null?void 0:t.executionResult,s=Se((g=n==null?void 0:n.validation)==null?void 0:g.warnings),o=Se((m=n==null?void 0:n.validation)==null?void 0:m.errors),u=Jr((v=n==null?void 0:n.coverage)==null?void 0:v.missingObligations),p=Se((y=n==null?void 0:n.coverage)==null?void 0:y.warnings),d=[],f=he(r);(t==null?void 0:t.status)==="error"&&d.push({trace:r,tone:"error",title:f,message:t.errorMessage||"Query attempt failed."});for(const h of r.clientWarnings)d.push({trace:r,tone:"warning",title:f,message:h});for(const h of s)d.push({trace:r,tone:"warning",title:f,...h});for(const h of o)d.push({trace:r,tone:"error",title:f,...h});for(const h of u)d.push({trace:r,tone:"warning",title:f,message:h});for(const h of p)d.push({trace:r,tone:"warning",title:f,...h});return d})}function Qr(e){return{traceId:e.trace.traceId,queryId:e.trace.queryId,viewId:e.trace.viewId,viewTitle:e.trace.viewTitle,queryLabel:e.trace.queryLabel,severity:e.tone,title:e.title,message:e.message,code:e.code,path:e.path}}function Ur(e,r){return e.filter(t=>t.trace.traceId===r.traceId).length}function Gr(e){const r=_e(e),t=e.filter(u=>{var p;return((p=u.latestAttempt)==null?void 0:p.status)==="error"}).length,n=e.filter(u=>{var p;return((p=u.latestAttempt)==null?void 0:p.status)==="loading"}).length,s=r.filter(u=>u.tone==="error").length,o=r.filter(u=>u.tone==="warning").length;return{total:e.length,failed:t,loading:n,errorCount:s,warningCount:o,issueCount:r.length,severity:t||s?"error":o?"warning":n?"loading":"ok"}}function Jr(e){return Array.isArray(e)?e.filter(r=>typeof r=="string"):[]}function Se(e){return Array.isArray(e)?e.map(Yr).filter(r=>!!r):[]}function Yr(e){if(typeof e=="string")return{message:e};if(!e||typeof e!="object"||Array.isArray(e))return;const r=e,t=typeof r.message=="string"?r.message:"",n=typeof r.code=="string"?r.code:"",s=typeof r.path=="string"?r.path:"";return t&&n?{message:s?`${t} (${n}, ${s})`:`${t} (${n})`,code:n,...s?{path:s}:{}}:t?{message:t,...s?{path:s}:{}}:n?{message:n,code:n}:void 0}function Xr(e){if(!e.enabled)return e;const r=e.queries.map(gr);return{enabled:e.enabled,queries:r,issues:e.issues,getQuery:t=>r.find(n=>n.queryId===t),getQueries:t=>r.filter(n=>n.queryId===t)}}function tr(e){return e?gr(e):void 0}function gr(e){var r;return(r=e==null?void 0:e.latestAttempt)!=null&&r.executionResult?{...e,latestAttempt:{...e.latestAttempt,resultPreview:e.latestAttempt.resultPreview||We(e.latestAttempt.executionResult),executionResult:Zr(e.latestAttempt.executionResult)}}:e}function Zr(e){const{compiledQuery:r,intent:t,result:n,...s}=e,o=et(s.metadata);return{...s,...o?{metadata:o}:{}}}function et(e){if(!e||typeof e!="object"||Array.isArray(e))return e;const r=e.dataAppDebug;if(!r||typeof r!="object"||Array.isArray(r))return e;const{compiledSql:t,...n}=r;return{...e,dataAppDebug:n}}function rt(e){return e==="relative"?{position:"relative",top:"auto",right:"auto",bottom:"auto",left:"auto"}:{top:e.startsWith("top")?20:"auto",right:e.endsWith("right")?20:"auto",bottom:e.startsWith("bottom")?20:"auto",left:e.endsWith("left")?20:"auto"}}function tt(e){return e==="error"?{borderColor:"var(--sd-error-border)",background:"var(--sd-error-bg)",color:"var(--sd-error-fg)"}:e==="warning"?{borderColor:"var(--sd-warning-border)",background:"var(--sd-warning-bg)",color:"var(--sd-warning-fg)"}:e==="loading"?{borderColor:"var(--sd-loading-border)",background:"var(--sd-loading-bg)",color:"var(--sd-loading-fg)"}:{borderColor:"var(--sd-success-border)",background:"var(--sd-success-bg)",color:"var(--sd-success-fg)"}}function nt(e){return e==="right"?{top:16,right:16,bottom:16,left:"auto",width:"min(720px, calc(100vw - 32px))",height:"auto",borderRadius:6}:{top:"auto",right:16,bottom:16,left:16,width:"auto",height:"min(420px, 45vh)",borderRadius:6}}function st(e){return e==="right"?{gridTemplateColumns:"minmax(210px, 280px) minmax(0, 1fr)"}:{gridTemplateColumns:"minmax(260px, 340px) minmax(0, 1fr)"}}function it(e){return{borderRight:"1px solid var(--sd-border)",borderBottom:0}}function mr(e){return e==="error"?{background:"var(--sd-error-dot)"}:e==="success"?{background:"var(--sd-success-dot)"}:e==="loading"?{background:"var(--sd-loading-dot)"}:{background:"var(--sd-idle-dot)"}}function ot(e){return e==="error"?{borderColor:"var(--sd-error-border)",color:"var(--sd-error-fg)"}:e==="success"?{borderColor:"var(--sd-success-border)",color:"var(--sd-success-fg)"}:e==="loading"?{borderColor:"var(--sd-loading-border)",color:"var(--sd-loading-fg)"}:{borderColor:"var(--sd-border)",color:"var(--sd-fg-muted)"}}const nr="semaphor-devtools-stylesheet",T="semaphor-devtools",at=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("../data-app-sdk-adapters/index.cjs"),i=require("react/jsx-runtime"),c=require("react"),ae=require("../chunks/validators-dJlwubP4.cjs");require("../chunks/analyze-result-contract-DSGoFuXQ.cjs");require("../value-format-preferences/index.cjs");const se=require("../chunks/search-BqqhaMx9.cjs"),Ke=require("../chunks/x-B6ghREd2.cjs");function ue(e,r,t={}){return{...t,name:e,role:r}}function Mr(e){return e}function Kr(e){return e}const Wr={source:{semantic(e){return{...e,kind:"semantic"}},sql(e){return{...e,kind:"sql"}}},field:{measure(e,r){return ue(e,"measure",r)},dimension(e,r){return ue(e,"dimension",r)},date(e,r){return ue(e,"date",r)},id(e,r){return ue(e,"id",r)}},filter(e){return{...e,kind:"filter"}},bindInput(e,r){return{toAnalyticsInput(){const[t]=w.toSemaphorInputSnapshots([e]),n=w.toSemaphorInputBinding({...r,inputId:r.inputId||t.inputId});return{...t,inputId:n.inputId,...n.kind?{kind:n.kind}:{},...n.controlRole?{controlRole:n.controlRole}:{},...n.operator?{operator:n.operator}:{},...n.field?{field:n.field}:{},...n.relationshipHint?{relationshipHint:n.relationshipHint}:{}}}}},control(e){return{...e,kind:"control"}},sqlParam(e){return{...e,kind:"control",role:"sqlParam"}},derivedField(e){return{...e,kind:"derived_field",expressionLanguage:e.expressionLanguage||"semaphor_sql_template"}},metric(e){return{...e,queryKind:"metric"}},analysis(e){return{...e,queryKind:"analysis"}},records(e){return{...e,queryKind:"records"}},inputOptions(e){return{...e,queryKind:"inputOptions"}},sql(e){return{...e,queryKind:"sql"}},matrix(e){return{...e,queryKind:"matrix"}}},ie=10,Le=8;function We(e,r){const t=e==null?void 0:e.result;if(t)switch(t.kind){case"records":return te({title:"Records",rowNoun:"rows",records:t.records,columns:t.columns,rowCount:t.rowCount});case"sql":return te({title:"SQL Rows",rowNoun:"rows",records:t.records,columns:t.columns,rowCount:t.rowCount});case"inputOptions":return te({title:"Options",rowNoun:"options",records:t.options.slice(0,ie).map(n=>{var s;return{label:n.label,value:n.value,count:n.count,disambiguation:(s=n.disambiguation)==null?void 0:s.join(" / ")}}),columns:[{key:"label",label:"Label"},{key:"value",label:"Value"},{key:"count",label:"Count"},{key:"disambiguation",label:"Disambiguation"}],rowCount:t.rowCount??t.options.length});case"metric":return _r(t,r);case"matrix":return te({title:"Matrix Cells",rowNoun:"cells",records:t.cells.slice(0,ie).map(n=>{const s=t.nodesById[n.rowId],o=n.columnId?t.nodesById[n.columnId]:void 0,u=t.measuresById[n.measureId];return{row:(s==null?void 0:s.label)||n.rowId,column:(o==null?void 0:o.label)||n.columnId||"Total",measure:(u==null?void 0:u.label)||n.measureId,value:n.value,role:n.role}}),columns:[{key:"row",label:"Row"},{key:"column",label:"Column"},{key:"measure",label:"Measure"},{key:"value",label:"Value"},{key:"role",label:"Role"}],rowCount:t.rowCount??t.cells.length});default:return Fr(t)}}function _r(e,r){var o,u,p,d,f;const t=[{metric:"primaryValue",value:(r==null?void 0:r.primaryValue)??e.primaryValue}],n=(r==null?void 0:r.comparisonKind)??((o=e.comparison)==null?void 0:o.kind);return n&&t.push({metric:`${n} value`,value:(r==null?void 0:r.comparisonValue)??((u=e.comparison)==null?void 0:u.value)},{metric:"delta",value:(r==null?void 0:r.delta)??((p=e.comparison)==null?void 0:p.delta)},{metric:"deltaPercent",value:(r==null?void 0:r.deltaPercent)??((d=e.comparison)==null?void 0:d.deltaPercent)}),(((f=r==null?void 0:r.missingMeasures)==null?void 0:f.filter(Boolean))??[]).forEach(g=>{t.push({metric:`missing:${g}`,value:"missing"})}),Object.entries((r==null?void 0:r.measures)??{}).sort(([g],[m])=>g.localeCompare(m)).forEach(([g,m])=>{t.push({metric:`measure:${g}`,value:m})}),Object.entries((r==null?void 0:r.measureBindings)??{}).sort(([g],[m])=>g.localeCompare(m)).forEach(([g,m])=>{t.push({metric:`binding:${g}`,value:m})}),te({title:"Metric",rowNoun:"values",records:t,columns:[{key:"metric",label:"Metric"},{key:"value",label:"Value"}],rowCount:t.length})}function te({title:e,rowNoun:r,records:t,columns:n,rowCount:s}){const o=Nr(n,t);if(!o.length)return;const u=s??t.length,p=t.slice(0,ie);return{title:e,summary:`${Pr(u)} ${r}`,columns:o.slice(0,Le),rows:p,truncatedRows:u>p.length,truncatedColumns:o.length>Le}}function Nr(e,r){if(e!=null&&e.length)return e.filter(n=>n.key).map(n=>({key:n.key,label:n.label||n.key}));const t=new Set;return r.slice(0,ie).forEach(n=>{Object.keys(n).forEach(s=>t.add(s))}),[...t].map(n=>({key:n,label:n}))}function Fr(e){throw new Error(`Unhandled Semaphor result kind: ${pr(e)}`)}function zr(e){return e===null?"null":e===void 0?"":typeof e=="string"?rr(e):typeof e=="number"||typeof e=="boolean"?String(e):rr(pr(e))}function Pr(e){return typeof e=="number"?e.toLocaleString():"-"}function pr(e){return JSON.stringify(e,null,2)??"undefined"}function rr(e){return e.length>80?`${e.slice(0,77)}...`:e}function he(e){return e.viewTitle||e.queryLabel||e.viewId||e.queryId}function Hr(e){if(e.label)return e.label;if(e.queryKind!=="inputOptions")return;const t=e.labelField.label||e.valueField.label||e.labelField.name||e.valueField.name||e.inputId;return`${Vr(t)} Options`}function Vr(e){return(e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\bfilter\b/gi," ").replace(/\boptions?\b/gi," ").replace(/\bid\b/gi," ").replace(/\s+/g," ").trim()||e).split(" ").filter(Boolean).map(n=>n===n.toUpperCase()&&n.length>1?n:`${n.slice(0,1).toUpperCase()}${n.slice(1)}`).join(" ")}function _e(e){return e.flatMap(r=>{var g,m,v,y;const t=r.latestAttempt,n=t==null?void 0:t.executionResult,s=Se((g=n==null?void 0:n.validation)==null?void 0:g.warnings),o=Se((m=n==null?void 0:n.validation)==null?void 0:m.errors),u=Jr((v=n==null?void 0:n.coverage)==null?void 0:v.missingObligations),p=Se((y=n==null?void 0:n.coverage)==null?void 0:y.warnings),d=[],f=he(r);(t==null?void 0:t.status)==="error"&&d.push({trace:r,tone:"error",title:f,message:t.errorMessage||"Query attempt failed."});for(const h of r.clientWarnings)d.push({trace:r,tone:"warning",title:f,message:h});for(const h of s)d.push({trace:r,tone:"warning",title:f,...h});for(const h of o)d.push({trace:r,tone:"error",title:f,...h});for(const h of u)d.push({trace:r,tone:"warning",title:f,message:h});for(const h of p)d.push({trace:r,tone:"warning",title:f,...h});return d})}function Qr(e){return{traceId:e.trace.traceId,queryId:e.trace.queryId,viewId:e.trace.viewId,viewTitle:e.trace.viewTitle,queryLabel:e.trace.queryLabel,severity:e.tone,title:e.title,message:e.message,code:e.code,path:e.path}}function Ur(e,r){return e.filter(t=>t.trace.traceId===r.traceId).length}function Gr(e){const r=_e(e),t=e.filter(u=>{var p;return((p=u.latestAttempt)==null?void 0:p.status)==="error"}).length,n=e.filter(u=>{var p;return((p=u.latestAttempt)==null?void 0:p.status)==="loading"}).length,s=r.filter(u=>u.tone==="error").length,o=r.filter(u=>u.tone==="warning").length;return{total:e.length,failed:t,loading:n,errorCount:s,warningCount:o,issueCount:r.length,severity:t||s?"error":o?"warning":n?"loading":"ok"}}function Jr(e){return Array.isArray(e)?e.filter(r=>typeof r=="string"):[]}function Se(e){return Array.isArray(e)?e.map(Yr).filter(r=>!!r):[]}function Yr(e){if(typeof e=="string")return{message:e};if(!e||typeof e!="object"||Array.isArray(e))return;const r=e,t=typeof r.message=="string"?r.message:"",n=typeof r.code=="string"?r.code:"",s=typeof r.path=="string"?r.path:"";return t&&n?{message:s?`${t} (${n}, ${s})`:`${t} (${n})`,code:n,...s?{path:s}:{}}:t?{message:t,...s?{path:s}:{}}:n?{message:n,code:n}:void 0}function Xr(e){if(!e.enabled)return e;const r=e.queries.map(gr);return{enabled:e.enabled,queries:r,issues:e.issues,getQuery:t=>r.find(n=>n.queryId===t),getQueries:t=>r.filter(n=>n.queryId===t)}}function tr(e){return e?gr(e):void 0}function gr(e){var r;return(r=e==null?void 0:e.latestAttempt)!=null&&r.executionResult?{...e,latestAttempt:{...e.latestAttempt,resultPreview:e.latestAttempt.resultPreview||We(e.latestAttempt.executionResult),executionResult:Zr(e.latestAttempt.executionResult)}}:e}function Zr(e){const{compiledQuery:r,intent:t,result:n,...s}=e,o=et(s.metadata);return{...s,...o?{metadata:o}:{}}}function et(e){if(!e||typeof e!="object"||Array.isArray(e))return e;const r=e.dataAppDebug;if(!r||typeof r!="object"||Array.isArray(r))return e;const{compiledSql:t,...n}=r;return{...e,dataAppDebug:n}}function rt(e){return e==="relative"?{position:"relative",top:"auto",right:"auto",bottom:"auto",left:"auto"}:{top:e.startsWith("top")?20:"auto",right:e.endsWith("right")?20:"auto",bottom:e.startsWith("bottom")?20:"auto",left:e.endsWith("left")?20:"auto"}}function tt(e){return e==="error"?{borderColor:"var(--sd-error-border)",background:"var(--sd-error-bg)",color:"var(--sd-error-fg)"}:e==="warning"?{borderColor:"var(--sd-warning-border)",background:"var(--sd-warning-bg)",color:"var(--sd-warning-fg)"}:e==="loading"?{borderColor:"var(--sd-loading-border)",background:"var(--sd-loading-bg)",color:"var(--sd-loading-fg)"}:{borderColor:"var(--sd-success-border)",background:"var(--sd-success-bg)",color:"var(--sd-success-fg)"}}function nt(e){return e==="right"?{top:16,right:16,bottom:16,left:"auto",width:"min(720px, calc(100vw - 32px))",height:"auto",borderRadius:6}:{top:"auto",right:16,bottom:16,left:16,width:"auto",height:"min(420px, 45vh)",borderRadius:6}}function st(e){return e==="right"?{gridTemplateColumns:"minmax(210px, 280px) minmax(0, 1fr)"}:{gridTemplateColumns:"minmax(260px, 340px) minmax(0, 1fr)"}}function it(e){return{borderRight:"1px solid var(--sd-border)",borderBottom:0}}function mr(e){return e==="error"?{background:"var(--sd-error-dot)"}:e==="success"?{background:"var(--sd-success-dot)"}:e==="loading"?{background:"var(--sd-loading-dot)"}:{background:"var(--sd-idle-dot)"}}function ot(e){return e==="error"?{borderColor:"var(--sd-error-border)",color:"var(--sd-error-fg)"}:e==="success"?{borderColor:"var(--sd-success-border)",color:"var(--sd-success-fg)"}:e==="loading"?{borderColor:"var(--sd-loading-border)",color:"var(--sd-loading-fg)"}:{borderColor:"var(--sd-border)",color:"var(--sd-fg-muted)"}}const nr="semaphor-devtools-stylesheet",T="semaphor-devtools",at=`
2
2
  .${T} {
3
3
  --sd-bg: #ffffff;
4
4
  --sd-bg-muted: #fafafa;
@@ -1,9 +1,9 @@
1
1
  import { toSemaphorInputSnapshots as jr, toSemaphorInputBinding as Hr, toSemaphorActiveInputSnapshots as X, toSemaphorMatrixIntent as Pr, toSemaphorSqlIntent as Vr, toSemaphorInputOptionsIntent as Qr, toSemaphorRecordsIntent as Ur, toSemaphorAnalysisQueryOptions as Gr, toSemaphorAnalysisIntent as Jr, toSemaphorMetricIntent as Yr, hasSemaphorInputValue as ue, normalizeSemaphorInputOptions as hr, toSemaphorInputSpec as br } from "../data-app-sdk-adapters/index.js";
2
2
  import { jsxs as p, Fragment as vr, jsx as a } from "react/jsx-runtime";
3
- import { createContext as Ie, useContext as Q, useState as z, useRef as E, useEffect as D, useMemo as I, Fragment as Xr, useId as Sr, useCallback as B, useReducer as Zr } from "react";
4
- import { m as et, aj as rt, B as tt } from "../chunks/validators-DEmd8Sin.js";
5
- import { c as lo, ak as uo } from "../chunks/validators-DEmd8Sin.js";
6
- import "../chunks/analyze-result-contract-BbRJ-C06.js";
3
+ import { createContext as Ie, useContext as Q, useState as z, useRef as E, useEffect as B, useMemo as I, Fragment as Xr, useId as Sr, useCallback as D, useReducer as Zr } from "react";
4
+ import { k as et, ah as rt, y as tt } from "../chunks/validators-DVd8s3qY.js";
5
+ import { c as lo, ai as uo } from "../chunks/validators-DVd8s3qY.js";
6
+ import "../chunks/analyze-result-contract-DROq4vgY.js";
7
7
  import "../value-format-preferences/index.js";
8
8
  import { M as nt, a as it, S as ot, E as st, C as at } from "../chunks/search-BHsQIWBV.js";
9
9
  import { X as lt, C as dt, j as ut } from "../chunks/x-CXDkqdur.js";
@@ -1560,7 +1560,7 @@ const ye = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
1560
1560
  textOverflow: "ellipsis",
1561
1561
  whiteSpace: "nowrap"
1562
1562
  }
1563
- }, Ee = 10, Re = 100, Ot = 25, Bt = 500, Ar = {
1563
+ }, Ee = 10, Re = 100, Ot = 25, Dt = 500, Ar = {
1564
1564
  enabled: !1,
1565
1565
  queries: [],
1566
1566
  issues: [],
@@ -1570,7 +1570,7 @@ const ye = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
1570
1570
  }, Ve = Ie(null), Qe = Ie(null), Ue = Ie(
1571
1571
  void 0
1572
1572
  ), V = [];
1573
- function Dt({
1573
+ function Bt({
1574
1574
  debug: e,
1575
1575
  children: r
1576
1576
  }) {
@@ -1579,9 +1579,9 @@ function Dt({
1579
1579
  t,
1580
1580
  Or
1581
1581
  ), o = E(n), u = Sr(), [f, d] = z({ open: !1 });
1582
- o.current = n, D(() => {
1582
+ o.current = n, B(() => {
1583
1583
  i({ type: "config", config: t });
1584
- }, [t]), D(() => {
1584
+ }, [t]), B(() => {
1585
1585
  if (!n.enabled || !n.exposeWindowBridge || typeof window > "u")
1586
1586
  return;
1587
1587
  const h = Kn(() => o.current);
@@ -1592,11 +1592,11 @@ function Dt({
1592
1592
  Wt(u);
1593
1593
  };
1594
1594
  }, [u, n.enabled, n.exposeWindowBridge]);
1595
- const c = I(() => ({ state: n, dispatch: i }), [n]), g = B((h) => {
1595
+ const c = I(() => ({ state: n, dispatch: i }), [n]), g = D((h) => {
1596
1596
  d({ open: !0, focus: h });
1597
- }, []), m = B(() => {
1597
+ }, []), m = D(() => {
1598
1598
  d((h) => ({ ...h, open: !1 }));
1599
- }, []), v = B((h) => {
1599
+ }, []), v = D((h) => {
1600
1600
  d({ open: !0, focus: h });
1601
1601
  }, []), y = I(
1602
1602
  () => ({
@@ -1650,11 +1650,11 @@ function _t({
1650
1650
  style: i
1651
1651
  } = {}) {
1652
1652
  const o = Tr(), u = Q(Qe), [f, d] = z(""), [c, g] = z(!1), m = E(null), v = E(null), y = u == null ? void 0 : u.openDevtools, h = u == null ? void 0 : u.closeDevtools, C = (u == null ? void 0 : u.open) === !0;
1653
- D(() => {
1653
+ B(() => {
1654
1654
  qr();
1655
- }, []), D(() => {
1655
+ }, []), B(() => {
1656
1656
  r && o.enabled && (y == null || y());
1657
- }, [r, o.enabled, y]), D(() => {
1657
+ }, [r, o.enabled, y]), B(() => {
1658
1658
  if (!C || !h)
1659
1659
  return;
1660
1660
  const S = (w) => {
@@ -1891,7 +1891,7 @@ function eo({
1891
1891
  } = {}) {
1892
1892
  var m, v;
1893
1893
  const o = Tr(), u = Q(Qe), f = Q(Ue);
1894
- D(() => {
1894
+ B(() => {
1895
1895
  qr();
1896
1896
  }, []);
1897
1897
  const d = r || (f == null ? void 0 : f.id), c = I(
@@ -1998,18 +1998,18 @@ function Nt({
1998
1998
  ie
1999
1999
  ]
2000
2000
  );
2001
- D(() => {
2001
+ B(() => {
2002
2002
  if (!(!d || !c))
2003
2003
  return c({ type: "register", descriptor: Ze }), () => {
2004
2004
  c({ type: "unregister", traceKey: H });
2005
2005
  };
2006
2006
  }, [Ze, c, d, H]);
2007
- const M = B(
2007
+ const M = D(
2008
2008
  (q, U) => {
2009
2009
  !d || !c || c({ type: "event", traceKey: H, event: q, latestAttempt: U });
2010
2010
  },
2011
2011
  [c, d, H]
2012
- ), er = B(() => {
2012
+ ), er = D(() => {
2013
2013
  M(
2014
2014
  {
2015
2015
  type: "query_started",
@@ -2018,7 +2018,7 @@ function Nt({
2018
2018
  },
2019
2019
  { status: "loading" }
2020
2020
  );
2021
- }, [M, k]), rr = B(
2021
+ }, [M, k]), rr = D(
2022
2022
  (q, U) => {
2023
2023
  const se = gr(q), ae = Un(q), zr = Gn(q), ir = pr(q);
2024
2024
  M(
@@ -2046,7 +2046,7 @@ function Nt({
2046
2046
  );
2047
2047
  },
2048
2048
  [M, k]
2049
- ), ge = B(
2049
+ ), ge = D(
2050
2050
  (q, U) => {
2051
2051
  const se = gr(q), ae = q instanceof Error ? q.message : String(q);
2052
2052
  M(
@@ -2067,7 +2067,7 @@ function Nt({
2067
2067
  );
2068
2068
  },
2069
2069
  [M, k]
2070
- ), tr = B(
2070
+ ), tr = D(
2071
2071
  (q) => {
2072
2072
  M(
2073
2073
  {
@@ -2079,7 +2079,7 @@ function Nt({
2079
2079
  );
2080
2080
  },
2081
2081
  [M, k]
2082
- ), nr = B(
2082
+ ), nr = D(
2083
2083
  (q) => {
2084
2084
  ge(q, 0);
2085
2085
  },
@@ -2244,7 +2244,7 @@ function zt({
2244
2244
  render: () => /* @__PURE__ */ a("pre", { style: s.codeBlock, children: In(e) })
2245
2245
  });
2246
2246
  const u = (C = o[0]) == null ? void 0 : C.id, f = e.traceId || `${e.viewId ?? ""}:${e.queryId}`, [d, c] = z(u), g = E(f), m = E(!1), v = o.map((l) => l.id).join("|");
2247
- D(() => {
2247
+ B(() => {
2248
2248
  if (g.current !== f) {
2249
2249
  g.current = f, m.current = !1, c(u);
2250
2250
  return;
@@ -2982,7 +2982,7 @@ function Rn(e, r) {
2982
2982
  return e;
2983
2983
  switch (r.type) {
2984
2984
  case "register":
2985
- return Bn(Ln(e, r.descriptor));
2985
+ return Dn(Ln(e, r.descriptor));
2986
2986
  case "unregister":
2987
2987
  return $n(e, r.traceKey);
2988
2988
  case "event":
@@ -2993,8 +2993,8 @@ function Rn(e, r) {
2993
2993
  }
2994
2994
  function Ln(e, r) {
2995
2995
  const t = e.entries[r.traceKey], n = t ? e.sequence : e.sequence + 1, i = Je(), o = {
2996
- ...t || Dn(r),
2997
- ...Br(r),
2996
+ ...t || Bn(r),
2997
+ ...Dr(r),
2998
2998
  traceKey: r.traceKey,
2999
2999
  latestAttempt: (t == null ? void 0 : t.latestAttempt) || { status: "idle" },
3000
3000
  recentEvents: (t == null ? void 0 : t.recentEvents) || [],
@@ -3049,7 +3049,7 @@ function On(e, r) {
3049
3049
  }
3050
3050
  };
3051
3051
  }
3052
- function Bn(e) {
3052
+ function Dn(e) {
3053
3053
  if (e.order.length <= e.maxQueries)
3054
3054
  return e;
3055
3055
  const r = e.order.map((i) => e.entries[i]).filter((i) => !!i).sort((i, o) => i.mounted !== o.mounted ? i.mounted ? 1 : -1 : i.lastEventAt - o.lastEventAt), t = e.order.length - e.maxQueries, n = new Set(
@@ -3063,10 +3063,10 @@ function Bn(e) {
3063
3063
  )
3064
3064
  } : e;
3065
3065
  }
3066
- function Dn(e) {
3066
+ function Bn(e) {
3067
3067
  const r = Je();
3068
3068
  return {
3069
- ...Br(e),
3069
+ ...Dr(e),
3070
3070
  traceKey: e.traceKey,
3071
3071
  latestAttempt: { status: "idle" },
3072
3072
  recentEvents: [],
@@ -3075,7 +3075,7 @@ function Dn(e) {
3075
3075
  lastEventAt: r
3076
3076
  };
3077
3077
  }
3078
- function Br(e) {
3078
+ function Dr(e) {
3079
3079
  var n;
3080
3080
  const r = Hn(e.spec), t = Pn(
3081
3081
  e.spec,
@@ -3164,7 +3164,7 @@ function Wn(e) {
3164
3164
  maxQueries: cr(
3165
3165
  e.maxQueries,
3166
3166
  Re,
3167
- Bt
3167
+ Dt
3168
3168
  )
3169
3169
  };
3170
3170
  }
@@ -3291,7 +3291,7 @@ function Hn(e) {
3291
3291
  }
3292
3292
  function Pn(e, r) {
3293
3293
  const t = [
3294
- ...(e.inputs || []).map(Dr),
3294
+ ...(e.inputs || []).map(Br),
3295
3295
  ...(r || []).map((n) => n.field)
3296
3296
  ];
3297
3297
  return Y(t);
@@ -3302,13 +3302,13 @@ function Y(e) {
3302
3302
  t && fe(t) && r.set(Ge(t), t);
3303
3303
  }), [...r.values()];
3304
3304
  }
3305
- function Dr(e) {
3305
+ function Br(e) {
3306
3306
  if (!e || typeof e != "object")
3307
3307
  return;
3308
3308
  const r = e.toAnalyticsInput;
3309
3309
  if (typeof r == "function") {
3310
3310
  const n = r.call(e);
3311
- return Dr(n);
3311
+ return Br(n);
3312
3312
  }
3313
3313
  const t = e.field;
3314
3314
  return fe(t) ? t : void 0;
@@ -3622,9 +3622,9 @@ function ze(e) {
3622
3622
  const r = e;
3623
3623
  return `{${Object.keys(r).sort().map((t) => `${JSON.stringify(t)}:${ze(r[t])}`).join(",")}}`;
3624
3624
  }
3625
- const Be = {
3625
+ const De = {
3626
3626
  primaryValue: null
3627
- }, De = {}, pi = { records: [] }, Ke = { options: [] }, gi = { records: [] }, We = {};
3627
+ }, Be = {}, pi = { records: [] }, Ke = { options: [] }, gi = { records: [] }, We = {};
3628
3628
  function mi(e) {
3629
3629
  const r = X(e.inputs), t = Gr(e);
3630
3630
  try {
@@ -3639,14 +3639,14 @@ function mi(e) {
3639
3639
  i,
3640
3640
  t
3641
3641
  ),
3642
- idleData: De
3642
+ idleData: Be
3643
3643
  } : {
3644
3644
  intent: n,
3645
3645
  error: null,
3646
3646
  activeInputs: r,
3647
3647
  analysisOptions: t,
3648
3648
  queryKey: A(n, r, void 0, t),
3649
- idleData: De
3649
+ idleData: Be
3650
3650
  };
3651
3651
  } catch (n) {
3652
3652
  const i = Z(n, "analysis");
@@ -3660,7 +3660,7 @@ function mi(e) {
3660
3660
  i,
3661
3661
  t
3662
3662
  ),
3663
- idleData: De
3663
+ idleData: Be
3664
3664
  };
3665
3665
  }
3666
3666
  }
@@ -3672,13 +3672,13 @@ function yi(e) {
3672
3672
  error: n,
3673
3673
  activeInputs: r,
3674
3674
  queryKey: A(void 0, r, n),
3675
- idleData: Be
3675
+ idleData: De
3676
3676
  } : {
3677
3677
  intent: t,
3678
3678
  error: null,
3679
3679
  activeInputs: r,
3680
3680
  queryKey: A(t, r),
3681
- idleData: Be
3681
+ idleData: De
3682
3682
  };
3683
3683
  } catch (t) {
3684
3684
  const n = Z(t, "metric");
@@ -3686,7 +3686,7 @@ function yi(e) {
3686
3686
  error: n,
3687
3687
  activeInputs: r,
3688
3688
  queryKey: A(void 0, r, n),
3689
- idleData: Be
3689
+ idleData: De
3690
3690
  };
3691
3691
  }
3692
3692
  }
@@ -4067,14 +4067,14 @@ function ro(e) {
4067
4067
  const [r, t] = z(e.defaultValue), n = Object.prototype.hasOwnProperty.call(e, "value"), i = n ? e.value : r, o = I(
4068
4068
  () => hr(e.options),
4069
4069
  [e.options]
4070
- ), u = B(
4070
+ ), u = D(
4071
4071
  (d) => {
4072
4072
  var g;
4073
4073
  const c = d;
4074
4074
  (g = e.onValueChange) == null || g.call(e, c), n || t(c);
4075
4075
  },
4076
4076
  [n, e]
4077
- ), f = B(() => u(void 0), [u]);
4077
+ ), f = D(() => u(void 0), [u]);
4078
4078
  return I(() => {
4079
4079
  const d = br(e);
4080
4080
  return {
@@ -4106,7 +4106,7 @@ function ro(e) {
4106
4106
  }
4107
4107
  function to(e) {
4108
4108
  const [r, t] = z(() => Mi(e));
4109
- return D(() => {
4109
+ return B(() => {
4110
4110
  t((n) => {
4111
4111
  let i = n;
4112
4112
  for (const o of e)
@@ -4155,12 +4155,12 @@ function to(e) {
4155
4155
  );
4156
4156
  }
4157
4157
  function no(e, r) {
4158
- const t = (r == null ? void 0 : r.status) === "success" ? r.options : void 0, n = I(() => Di(t), [t]);
4159
- D(() => {
4160
- Bi(e.value, t) || e.clear();
4158
+ const t = (r == null ? void 0 : r.status) === "success" ? r.options : void 0, n = I(() => Bi(t), [t]);
4159
+ B(() => {
4160
+ Di(e.value, t) || e.clear();
4161
4161
  }, [e, n, r == null ? void 0 : r.status, t]);
4162
4162
  }
4163
- function Bi(e, r) {
4163
+ function Di(e, r) {
4164
4164
  if (!ue(e) || r === void 0)
4165
4165
  return !0;
4166
4166
  const t = new Set(
@@ -4170,7 +4170,7 @@ function Bi(e, r) {
4170
4170
  (i) => t.has(mr(i))
4171
4171
  );
4172
4172
  }
4173
- function Di(e) {
4173
+ function Bi(e) {
4174
4174
  return JSON.stringify((e || []).map((r) => r.value));
4175
4175
  }
4176
4176
  function mr(e) {
@@ -4238,7 +4238,7 @@ function io(e, r = {}) {
4238
4238
  i.start,
4239
4239
  i.success
4240
4240
  ]
4241
- ), f = B(
4241
+ ), f = D(
4242
4242
  (l) => {
4243
4243
  var K, T, N, $, S, w, L, x, O;
4244
4244
  const b = n.request;
@@ -4290,7 +4290,7 @@ function io(e, r = {}) {
4290
4290
  n.request.activeInputs,
4291
4291
  u
4292
4292
  ), c = i.queryId, g = i.validationFailure;
4293
- D(() => {
4293
+ B(() => {
4294
4294
  const l = n.request.error;
4295
4295
  if (!l) {
4296
4296
  o.current = null;
@@ -4513,7 +4513,7 @@ function Ni(e, r, t, n, i) {
4513
4513
  error: null,
4514
4514
  isStale: !1
4515
4515
  });
4516
- return u.current = r, f.current = n, D(() => {
4516
+ return u.current = r, f.current = n, B(() => {
4517
4517
  let g;
4518
4518
  try {
4519
4519
  g = u.current({
@@ -4588,7 +4588,7 @@ function oo({
4588
4588
  }),
4589
4589
  [f, d, m, u]
4590
4590
  );
4591
- return /* @__PURE__ */ a(Dt, { debug: d, children: /* @__PURE__ */ p(Mr.Provider, { value: v, children: [
4591
+ return /* @__PURE__ */ a(Bt, { debug: d, children: /* @__PURE__ */ p(Mr.Provider, { value: v, children: [
4592
4592
  i,
4593
4593
  c ? /* @__PURE__ */ a(_t, { ...c }) : null
4594
4594
  ] }) });
@@ -4601,7 +4601,7 @@ export {
4601
4601
  Ii as createSemaphorQueryExecutor,
4602
4602
  Ji as defineSemaphorDataApp,
4603
4603
  Yi as defineSemaphorInput,
4604
- Bi as isSemaphorInputValueValidForOptions,
4604
+ Di as isSemaphorInputValueValidForOptions,
4605
4605
  Xi as semaphor,
4606
4606
  lo as semaphorMetricAggregate,
4607
4607
  uo as semaphorMetricMeasureBindingKey,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../chunks/validators-BDYprKI9.cjs"),v=require("../chunks/operators-DrTQsJXv.cjs");require("../chunks/analyze-result-contract-LPDNldic.cjs");require("../value-format-preferences/index.cjs");function p(i){var n,e,a;const t=b(i);return{version:1,kind:"metric",id:i.id,label:i.label,source:s(i),measures:t,primaryMeasure:M(i,t),dateField:i.dateField?o(i.dateField,"date"):void 0,timeGrain:i.timeGrain,dimensions:(n=i.dimensions)==null?void 0:n.map(r=>o(r,"dimension")),comparison:G(i.comparison),orderBy:i.orderBy?{field:o(i.orderBy.field),direction:i.orderBy.direction}:void 0,inputs:l(i.inputs),...(e=i.filters)!=null&&e.length?{filters:i.filters}:{},...i.relationshipHint?{relationshipHint:i.relationshipHint}:{},limit:i.limit,...(a=i.derivedFields)!=null&&a.length?{derivedFields:i.derivedFields}:{}}}function c(i){return{...p(i),...i.timeWindow?{timeWindow:i.timeWindow}:{},...i.analysis?{analysis:i.analysis}:{}}}function F(i){return{...i.chartTitle?{chartTitle:i.chartTitle}:{},...i.chartType?{chartType:i.chartType}:{},...i.driverMode?{driverMode:i.driverMode}:{},...i.includePopulation!==void 0?{includePopulation:i.includePopulation}:{},...i.calendarContext?{calendarContext:i.calendarContext}:{}}}function M(i,t){if(!i.primaryMeasure)return t[0]||{name:"",role:"measure"};const n=o(i.primaryMeasure,"measure"),e=A(n,t),a=e.length===1?e[0]:void 0;return a?I(n,a):n}function b(i){const t=[];for(const n of i.measures.map(e=>o(e,"measure"))){if(!n.name)continue;const e=t.findIndex(a=>R(a,n));if(e===-1){t.push(n);continue}t[e]=I(t[e],n)}return t}function R(i,t){return u.semaphorFieldRefsMatch(i,t)&&d(i)===d(t)}function H(i,t){return d(t)===d(i)}function w(i,t){return t.name!==i.name||i.source&&!u.semaphorFieldRefsMatch(t,i)?!1:H(i,t)}function A(i,t){const n=t.filter(e=>w(i,e));return i.aggregate!==void 0,n}function d(i){return u.semaphorMetricAggregate(i)}function I(i,t){if(i.aggregate&&t.aggregate&&i.aggregate!==t.aggregate)throw new Error(`Measure "${i.name}" was requested with conflicting aggregate semantics: ${i.aggregate} and ${t.aggregate}.`);return{...u.preferSemaphorFieldRefMetadata(i,t),aggregate:i.aggregate||t.aggregate}}function k(i){var n,e;if("sort"in i)throw new Error("semaphor.records supports orderBy for a single deterministic sort. Multiple sort clauses are not supported by the analytics protocol yet.");if(!V(i))throw new Error("semaphor.records needs at least one field.");const t=B(i.fields);return{version:1,kind:"records",id:i.id,label:i.label,source:s(i),fields:t,dateField:i.dateField?o(i.dateField,"date"):void 0,timeGrain:i.timeGrain,...i.timeWindow?{timeWindow:i.timeWindow}:{},...(n=i.filters)!=null&&n.length?{filters:i.filters}:{},orderBy:i.orderBy?{field:o(i.orderBy.field),direction:i.orderBy.direction}:void 0,inputs:l(i.inputs),...i.relationshipHint?{relationshipHint:i.relationshipHint}:{},limit:i.limit,...i.pagination?{pagination:i.pagination}:{},...i.totals?{totals:{mode:"server",measures:i.totals.measures.map(a=>o(a,"measure"))}}:{},...(e=i.derivedFields)!=null&&e.length?{derivedFields:i.derivedFields}:{}}}function B(i){return i.map(t=>{const n=o(t);if(!n.role)throw new Error(`semaphor.records field "${n.name}" needs an explicit role.`);return n})}function x(i){var t,n,e;return{version:1,kind:"inputOptions",id:i.id,label:i.label,inputId:i.inputId,source:s(i),labelField:o(i.labelField,"dimension"),valueField:o(i.valueField,"dimension"),...i.searchField?{searchField:o(i.searchField,"dimension")}:{},...(t=i.disambiguationFields)!=null&&t.length?{disambiguationFields:i.disambiguationFields.map(a=>o(a,"dimension"))}:{},...i.population?{population:i.population}:{},...i.dependencies?{dependencies:i.dependencies}:{},search:i.search,limit:i.limit,...(n=i.inputs)!=null&&n.length?{inputs:i.inputs.map(a=>f(a))}:{},...(e=i.derivedFields)!=null&&e.length?{derivedFields:i.derivedFields}:{}}}function O(i){var t;return{version:1,kind:"sql",id:i.id,label:i.label,source:i.source,sql:i.sql,...i.defaultParameters?{defaultParameters:i.defaultParameters}:{},...i.pythonCode?{pythonCode:i.pythonCode}:{},...(t=i.fields)!=null&&t.length?{fields:i.fields.map(n=>o(n))}:{},inputs:l(i.inputs),limit:i.limit,...i.pagination?{pagination:i.pagination}:{},rationale:i.rationale}}function P(i){var t,n;return{version:1,kind:"matrix",id:i.id,label:i.label,source:s(i),rows:i.rows.map(e=>g(e,"dimension")),columns:(i.columns??[]).map(e=>g(e,"dimension")),values:i.values.map(z),...(t=i.filters)!=null&&t.length?{filters:i.filters}:{},inputs:l(i.inputs),...i.relationshipHint?{relationshipHint:i.relationshipHint}:{},...i.totals?{totals:i.totals}:{},...(n=i.sort)!=null&&n.length?{sort:i.sort}:{},...i.expansion?{expansion:i.expansion}:{},...i.layout?{layout:i.layout}:{},...i.displayLimits?{displayLimits:i.displayLimits}:{}}}function g(i,t){return C(i)?{...i,field:o(i.field,t)}:{field:o(i,t)}}function z(i){return T(i)?{...i,field:o(i.field,"measure")}:{field:o(i,"measure"),aggregate:i.aggregate}}function C(i){return"field"in i}function T(i){return"field"in i}function f(i){if("toAnalyticsInput"in i){const r=i.toAnalyticsInput();return{inputId:r.inputId,kind:r.kind,...r.controlRole?{controlRole:r.controlRole}:{},...r.operator?{operator:r.operator}:{},...r.field?{field:r.field}:{},...r.relationshipHint?{relationshipHint:r.relationshipHint}:{}}}if("id"in i){const r=h(i);return{inputId:r.inputId,kind:r.kind,...r.controlRole?{controlRole:r.controlRole}:{},...r.operator?{operator:r.operator}:{},...r.field?{field:r.field}:{},...r.relationshipHint?{relationshipHint:r.relationshipHint}:{}}}const t="kind"in i?i.kind:void 0,n="operator"in i?S(i.operator,i.inputId):void 0,e="controlRole"in i?i.controlRole:"role"in i?i.role:void 0,a=q(e)?e:void 0;return{inputId:i.inputId,...t?{kind:t}:{},...a?{controlRole:a}:{},...n?{operator:n}:{},...i.field?{field:i.field}:{},...i.relationshipHint?{relationshipHint:i.relationshipHint}:{}}}function q(i){return i==="grain"||i==="measure"||i==="dimension"||i==="aggregation"||i==="sqlParam"}function W(i){const t=l(i);return t.length>0?t:void 0}function y(i){return(i||[]).map(L)}function $(i){return y(i).filter(t=>t.isActive)}function h(i){if(i.kind==="filter"){const t=S(i.operator,i.id);return{inputId:i.id,kind:i.kind,label:i.label,field:o(i.field,"dimension"),operator:t||"in",...i.relationshipHint?{relationshipHint:i.relationshipHint}:{}}}return{inputId:i.id,kind:i.kind,label:i.label,controlRole:i.role}}function E(i=[]){return i.map(t=>typeof t=="object"?t:{label:String(t),value:t})}function m(i){return i==null?!1:Array.isArray(i)?i.length>0:typeof i=="string"?i.trim().length>0:!0}function L(i){if("toAnalyticsInput"in i)return i.toAnalyticsInput();if("kind"in i&&"isActive"in i)return i;if("id"in i){const t=h(i),n=Object.prototype.hasOwnProperty.call(i,"value")?i.value:i.defaultValue;return{inputId:t.inputId,kind:t.kind,label:t.label,...t.field?{field:t.field}:{},...t.operator?{operator:t.operator}:{},...t.controlRole?{controlRole:t.controlRole}:{},...t.relationshipHint?{relationshipHint:t.relationshipHint}:{},value:n,isActive:m(n)}}return{...i,kind:"filter",isActive:m(i.value),value:i.value}}function s(i){return i.source}function V(i){var t;return!!((t=i.fields)!=null&&t.length)}function o(i,t){return{...i,role:i.role||t}}function l(i){return(i||[]).map(f)}function G(i){if(i)return i}function S(i,t){if(i===void 0)return;const n=v.normalizeSemaphorInputOperator(i);if(!n)throw new Error(`useSemaphorInput "${t}" uses unsupported filter operator "${i}".`);return n}exports.hasSemaphorInputValue=m;exports.normalizeSemaphorInputOptions=E;exports.toSemaphorActiveInputSnapshots=$;exports.toSemaphorAnalysisIntent=c;exports.toSemaphorAnalysisQueryOptions=F;exports.toSemaphorInputBinding=f;exports.toSemaphorInputBindings=W;exports.toSemaphorInputOptionsIntent=x;exports.toSemaphorInputSnapshots=y;exports.toSemaphorInputSpec=h;exports.toSemaphorMatrixIntent=P;exports.toSemaphorMetricIntent=p;exports.toSemaphorRecordsIntent=k;exports.toSemaphorSqlIntent=O;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../chunks/validators-dJlwubP4.cjs"),c=require("../chunks/operators-DrTQsJXv.cjs");require("../chunks/analyze-result-contract-DSGoFuXQ.cjs");require("../value-format-preferences/index.cjs");function p(i){var n,r,a;const t=b(i);return{version:1,kind:"metric",id:i.id,label:i.label,source:s(i),measures:t,primaryMeasure:M(i,t),dateField:i.dateField?o(i.dateField,"date"):void 0,timeGrain:i.timeGrain,dimensions:(n=i.dimensions)==null?void 0:n.map(e=>o(e,"dimension")),comparison:G(i.comparison),orderBy:i.orderBy?{field:o(i.orderBy.field),direction:i.orderBy.direction}:void 0,inputs:l(i.inputs),...(r=i.filters)!=null&&r.length?{filters:i.filters}:{},...i.relationshipHint?{relationshipHint:i.relationshipHint}:{},limit:i.limit,...(a=i.derivedFields)!=null&&a.length?{derivedFields:i.derivedFields}:{}}}function v(i){return{...p(i),...i.timeWindow?{timeWindow:i.timeWindow}:{},...i.analysis?{analysis:i.analysis}:{}}}function F(i){return{...i.chartTitle?{chartTitle:i.chartTitle}:{},...i.chartType?{chartType:i.chartType}:{},...i.driverMode?{driverMode:i.driverMode}:{},...i.includePopulation!==void 0?{includePopulation:i.includePopulation}:{},...i.calendarContext?{calendarContext:i.calendarContext}:{}}}function M(i,t){if(!i.primaryMeasure)return t[0]||{name:"",role:"measure"};const n=o(i.primaryMeasure,"measure"),r=k(n,t),a=r.length===1?r[0]:void 0;return a?I(n,a):n}function b(i){const t=[];for(const n of i.measures.map(r=>o(r,"measure"))){if(!n.name)continue;const r=t.findIndex(a=>R(a,n));if(r===-1){t.push(n);continue}t[r]=I(t[r],n)}return t}function R(i,t){return u.semaphorFieldRefsMatch(i,t)&&d(i)===d(t)}function w(i,t){return d(t)===d(i)}function H(i,t){return t.name!==i.name||i.source&&!u.semaphorFieldRefsMatch(t,i)?!1:w(i,t)}function k(i,t){const n=t.filter(r=>H(i,r));return i.aggregate!==void 0,n}function d(i){return u.semaphorMetricAggregate(i)}function I(i,t){if(i.aggregate&&t.aggregate&&i.aggregate!==t.aggregate)throw new Error(`Measure "${i.name}" was requested with conflicting aggregate semantics: ${i.aggregate} and ${t.aggregate}.`);return{...u.preferSemaphorFieldRefMetadata(i,t),aggregate:i.aggregate||t.aggregate}}function A(i){var n,r;if("sort"in i)throw new Error("semaphor.records supports orderBy for a single deterministic sort. Multiple sort clauses are not supported by the analytics protocol yet.");if(!V(i))throw new Error("semaphor.records needs at least one field.");const t=B(i.fields);return{version:1,kind:"records",id:i.id,label:i.label,source:s(i),fields:t,dateField:i.dateField?o(i.dateField,"date"):void 0,timeGrain:i.timeGrain,...i.timeWindow?{timeWindow:i.timeWindow}:{},...(n=i.filters)!=null&&n.length?{filters:i.filters}:{},orderBy:i.orderBy?{field:o(i.orderBy.field),direction:i.orderBy.direction}:void 0,inputs:l(i.inputs),...i.relationshipHint?{relationshipHint:i.relationshipHint}:{},limit:i.limit,...i.pagination?{pagination:i.pagination}:{},...i.totals?{totals:{mode:"server",measures:i.totals.measures.map(a=>o(a,"measure"))}}:{},...(r=i.derivedFields)!=null&&r.length?{derivedFields:i.derivedFields}:{}}}function B(i){return i.map(t=>{const n=o(t);if(!n.role)throw new Error(`semaphor.records field "${n.name}" needs an explicit role.`);return n})}function x(i){var n,r,a;const t=s(i);if(t.kind==="sql")throw new Error("semaphor.inputOptions requires a semantic or physical option source.");return{version:1,kind:"inputOptions",id:i.id,label:i.label,inputId:i.inputId,source:t,labelField:o(i.labelField,"dimension"),valueField:o(i.valueField,"dimension"),...i.searchField?{searchField:o(i.searchField,"dimension")}:{},...(n=i.disambiguationFields)!=null&&n.length?{disambiguationFields:i.disambiguationFields.map(e=>o(e,"dimension"))}:{},...i.population?{population:i.population}:{},...i.dependencies?{dependencies:i.dependencies}:{},search:i.search,limit:i.limit,...(r=i.inputs)!=null&&r.length?{inputs:i.inputs.map(e=>f(e))}:{},...(a=i.derivedFields)!=null&&a.length?{derivedFields:i.derivedFields}:{}}}function O(i){var t;return{version:1,kind:"sql",id:i.id,label:i.label,source:i.source,sql:i.sql,...i.defaultParameters?{defaultParameters:i.defaultParameters}:{},...i.pythonCode?{pythonCode:i.pythonCode}:{},...(t=i.fields)!=null&&t.length?{fields:i.fields.map(n=>o(n))}:{},inputs:l(i.inputs),limit:i.limit,...i.pagination?{pagination:i.pagination}:{},rationale:i.rationale}}function P(i){var t,n;return{version:1,kind:"matrix",id:i.id,label:i.label,source:s(i),rows:i.rows.map(r=>g(r,"dimension")),columns:(i.columns??[]).map(r=>g(r,"dimension")),values:i.values.map(q),...(t=i.filters)!=null&&t.length?{filters:i.filters}:{},inputs:l(i.inputs),...i.relationshipHint?{relationshipHint:i.relationshipHint}:{},...i.totals?{totals:i.totals}:{},...(n=i.sort)!=null&&n.length?{sort:i.sort}:{},...i.expansion?{expansion:i.expansion}:{},...i.layout?{layout:i.layout}:{},...i.displayLimits?{displayLimits:i.displayLimits}:{}}}function g(i,t){return z(i)?{...i,field:o(i.field,t)}:{field:o(i,t)}}function q(i){return C(i)?{...i,field:o(i.field,"measure")}:{field:o(i,"measure"),aggregate:i.aggregate}}function z(i){return"field"in i}function C(i){return"field"in i}function f(i){if("toAnalyticsInput"in i){const e=i.toAnalyticsInput();return{inputId:e.inputId,kind:e.kind,...e.controlRole?{controlRole:e.controlRole}:{},...e.operator?{operator:e.operator}:{},...e.field?{field:e.field}:{},...e.relationshipHint?{relationshipHint:e.relationshipHint}:{}}}if("id"in i){const e=h(i);return{inputId:e.inputId,kind:e.kind,...e.controlRole?{controlRole:e.controlRole}:{},...e.operator?{operator:e.operator}:{},...e.field?{field:e.field}:{},...e.relationshipHint?{relationshipHint:e.relationshipHint}:{}}}const t="kind"in i?i.kind:void 0,n="operator"in i?S(i.operator,i.inputId):void 0,r="controlRole"in i?i.controlRole:"role"in i?i.role:void 0,a=T(r)?r:void 0;return{inputId:i.inputId,...t?{kind:t}:{},...a?{controlRole:a}:{},...n?{operator:n}:{},...i.field?{field:i.field}:{},...i.relationshipHint?{relationshipHint:i.relationshipHint}:{}}}function T(i){return i==="grain"||i==="measure"||i==="dimension"||i==="aggregation"||i==="sqlParam"}function E(i){const t=l(i);return t.length>0?t:void 0}function y(i){return(i||[]).map(L)}function W(i){return y(i).filter(t=>t.isActive)}function h(i){if(i.kind==="filter"){const t=S(i.operator,i.id);return{inputId:i.id,kind:i.kind,label:i.label,field:o(i.field,"dimension"),operator:t||"in",...i.relationshipHint?{relationshipHint:i.relationshipHint}:{}}}return{inputId:i.id,kind:i.kind,label:i.label,controlRole:i.role}}function $(i=[]){return i.map(t=>typeof t=="object"?t:{label:String(t),value:t})}function m(i){return i==null?!1:Array.isArray(i)?i.length>0:typeof i=="string"?i.trim().length>0:!0}function L(i){if("toAnalyticsInput"in i)return i.toAnalyticsInput();if("kind"in i&&"isActive"in i)return i;if("id"in i){const t=h(i),n=Object.prototype.hasOwnProperty.call(i,"value")?i.value:i.defaultValue;return{inputId:t.inputId,kind:t.kind,label:t.label,...t.field?{field:t.field}:{},...t.operator?{operator:t.operator}:{},...t.controlRole?{controlRole:t.controlRole}:{},...t.relationshipHint?{relationshipHint:t.relationshipHint}:{},value:n,isActive:m(n)}}return{...i,kind:"filter",isActive:m(i.value),value:i.value}}function s(i){return i.source}function V(i){var t;return!!((t=i.fields)!=null&&t.length)}function o(i,t){return{...i,role:i.role||t}}function l(i){return(i||[]).map(f)}function G(i){if(i)return i}function S(i,t){if(i===void 0)return;const n=c.normalizeSemaphorInputOperator(i);if(!n)throw new Error(`useSemaphorInput "${t}" uses unsupported filter operator "${i}".`);return n}exports.hasSemaphorInputValue=m;exports.normalizeSemaphorInputOptions=$;exports.toSemaphorActiveInputSnapshots=W;exports.toSemaphorAnalysisIntent=v;exports.toSemaphorAnalysisQueryOptions=F;exports.toSemaphorInputBinding=f;exports.toSemaphorInputBindings=E;exports.toSemaphorInputOptionsIntent=x;exports.toSemaphorInputSnapshots=y;exports.toSemaphorInputSpec=h;exports.toSemaphorMatrixIntent=P;exports.toSemaphorMetricIntent=p;exports.toSemaphorRecordsIntent=A;exports.toSemaphorSqlIntent=O;