react-semaphor 0.1.421 → 0.1.423

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 (67) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -1
  2. package/dist/analytics-protocol/index.js +2 -2
  3. package/dist/brand-studio/index.cjs +1 -1
  4. package/dist/brand-studio/index.js +2 -2
  5. package/dist/briefings/index.cjs +1 -1
  6. package/dist/briefings/index.js +913 -712
  7. package/dist/chunks/{analyze-result-contract-sWcmvBOA.js → analyze-result-contract-D7pjjYPy.js} +45 -46
  8. package/dist/chunks/{analyze-result-contract-B5Eeu7vD.js → analyze-result-contract-DpDcImgk.js} +1 -1
  9. package/dist/chunks/{calendar-preferences-dialog-CscmhyuZ.js → calendar-preferences-dialog-CTmeASaM.js} +1 -1
  10. package/dist/chunks/{calendar-preferences-dialog-cN3_2C-u.js → calendar-preferences-dialog-t5ET6MON.js} +3 -3
  11. package/dist/chunks/card-config-utils-15sRtebL.js +1 -0
  12. package/dist/chunks/card-config-utils-BYZ5MJOh.js +16 -0
  13. package/dist/chunks/dashboard-briefing-launcher-Cavd0QJb.js +3401 -0
  14. package/dist/chunks/dashboard-briefing-launcher-S2akO-ub.js +26 -0
  15. package/dist/chunks/dashboard-controls-BJLrErjW.js +2322 -0
  16. package/dist/chunks/dashboard-controls-DzbP8AXA.js +52 -0
  17. package/dist/chunks/dashboard-json-5tWb5KD6.js +1 -0
  18. package/dist/chunks/{dashboard-json-Cxhw2TZc.js → dashboard-json-Do2-pdPZ.js} +12 -11
  19. package/dist/chunks/{edit-dashboard-visual-BigSJ3-x.js → edit-dashboard-visual-Cw6bq4_w.js} +7058 -6989
  20. package/dist/chunks/edit-dashboard-visual-Yh5YFgMF.js +178 -0
  21. package/dist/chunks/index-BPM3gDRw.js +1406 -0
  22. package/dist/chunks/{index-CH2ZzQo4.js → index-yHe0SeLO.js} +81534 -75430
  23. package/dist/chunks/{switch-TbCsyhv9.js → switch-2bh3Hka1.js} +620 -633
  24. package/dist/chunks/{switch-CiOjVyVI.js → switch-DMT7qf_R.js} +24 -24
  25. package/dist/chunks/{update-policy-2MZ-Vf7v.js → update-policy-BCJc0oI5.js} +1 -1
  26. package/dist/chunks/{update-policy-qpyAkOyO.js → update-policy-C1pmhLz9.js} +1 -1
  27. package/dist/chunks/{use-create-flow-overlay-state-BzcJWNzh.js → use-create-flow-overlay-state-5MDbZcs1.js} +515 -544
  28. package/dist/chunks/use-create-flow-overlay-state-BNczg9Gj.js +11 -0
  29. package/dist/chunks/{validators-Dj1Y-46V.js → validators-DMlVbd1p.js} +1 -1
  30. package/dist/chunks/{validators-D0pfj3jJ.js → validators-PXkij33j.js} +1 -1
  31. package/dist/dashboard/index.cjs +1 -1
  32. package/dist/dashboard/index.js +1 -1
  33. package/dist/dashboard-authoring/index.cjs +1 -1
  34. package/dist/dashboard-authoring/index.js +2 -2
  35. package/dist/data-app-builder/index.cjs +1 -1
  36. package/dist/data-app-builder/index.js +108 -108
  37. package/dist/data-app-codegen/index.cjs +1 -1
  38. package/dist/data-app-codegen/index.js +2 -2
  39. package/dist/data-app-codegen-node/index.cjs +165 -340
  40. package/dist/data-app-codegen-node/index.js +761 -952
  41. package/dist/data-app-sdk/index.cjs +2 -2
  42. package/dist/data-app-sdk/index.js +91 -95
  43. package/dist/data-app-sdk-adapters/index.cjs +1 -1
  44. package/dist/data-app-sdk-adapters/index.js +1 -1
  45. package/dist/data-app-sdk-validation/index.cjs +1 -1
  46. package/dist/data-app-sdk-validation/index.js +2 -2
  47. package/dist/index.cjs +1 -1
  48. package/dist/index.js +168 -164
  49. package/dist/style.css +1 -1
  50. package/dist/surfboard/index.cjs +1 -1
  51. package/dist/surfboard/index.js +2 -2
  52. package/dist/types/analytics-protocol.d.ts +0 -4
  53. package/dist/types/briefings.d.ts +2388 -7
  54. package/dist/types/dashboard-assistant.d.ts +0 -1
  55. package/dist/types/data-app-sdk-validation.d.ts +0 -1
  56. package/dist/types/data-app-sdk.d.ts +0 -2
  57. package/dist/types/main.d.ts +70 -10
  58. package/dist/types/types.d.ts +4 -8
  59. package/package.json +1 -1
  60. package/dist/chunks/dashboard-briefing-launcher-BYTBNetR.js +0 -9077
  61. package/dist/chunks/dashboard-briefing-launcher-DmZkzIC3.js +0 -80
  62. package/dist/chunks/dashboard-controls-9DFeKIP4.js +0 -52
  63. package/dist/chunks/dashboard-controls-PhzuaTBj.js +0 -2280
  64. package/dist/chunks/dashboard-json-DyRHI3mL.js +0 -1
  65. package/dist/chunks/edit-dashboard-visual-3_jiBXsu.js +0 -178
  66. package/dist/chunks/index-BKDQw0aK.js +0 -1346
  67. package/dist/chunks/use-create-flow-overlay-state-DUQmgb9H.js +0 -21
@@ -1,5 +1,5 @@
1
1
  import { n as I } from "../chunks/operators-C8TxpM4C.js";
2
- import { s as m, p as F, b as c } from "../chunks/analyze-result-contract-sWcmvBOA.js";
2
+ import { s as m, p as F, b as c } from "../chunks/analyze-result-contract-D7pjjYPy.js";
3
3
  function S(i) {
4
4
  var n, r, a;
5
5
  const t = M(i);
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../chunks/validators-Dj1Y-46V.js"),v=require("../chunks/analyze-result-contract-B5Eeu7vD.js"),y=require("../data-app-sdk-adapters/index.cjs"),R=require("../chunks/catalog-field-grounding-Bnx-3tE0.js");function W({intent:e,field:r,catalogField:o,relativePath:t}){const i=U({intent:e,field:r,relativePath:t});if(!i||i.allowedRelatedRoles.length===0)return!1;const a=f(r,i.selectedField),s=w(o),n=p(a);return M(s,i.allowedRelatedRoles)?n===s:!1}function J(e){return e.kind==="records"?X(e):e.kind==="metric"?Y(e):Z(e)}function w(e){const r=R.normalizeAnalyticsCatalogName(e.role);if(r==="measure")return"measure";if(r==="id")return"id";const o=R.normalizeAnalyticsCatalogDataType(e.dataType);if(r==="date"||o==="date"||o==="datetime")return"date";if(r==="dimension")return"dimension"}function M(e,r){return!!(e&&r.includes(e))}function f(e,r){const o=p(e);if(o)return e.role===o?e:{...e,role:o};const t=r?p(r):void 0;return t?{...e,role:t}:e}function u(e,r){return e.find(o=>D(o,r))}function S(e){return[...e.rows.map(r=>r.field),...(e.columns||[]).map(r=>r.field)]}function U({intent:e,field:r,relativePath:o}){if(e.kind==="records")return L(e,r,o);if(e.kind==="metric")return V(e,r,o);if(e.kind==="matrix")return G(e,r,o)}function L(e,r,o){if(o.startsWith("spec.fields."))return{allowedRelatedRoles:["dimension","date","id"]};if(o==="spec.dateField"&&!e.timeWindow)return{allowedRelatedRoles:["date"]};if(o==="spec.orderBy.field"){const t=u(B(e),r);return{selectedField:t,allowedRelatedRoles:t?x(t):[]}}}function V(e,r,o){if(o.startsWith("spec.dimensions."))return{allowedRelatedRoles:["dimension"]};if(o==="spec.orderBy.field"){const t=u(e.dimensions||[],r);return{selectedField:t,allowedRelatedRoles:t?["dimension"]:[]}}}function G(e,r,o){if(oe(o))return{allowedRelatedRoles:["dimension","date"]};if(te(o)){const t=u(S(e),r);return{selectedField:t,allowedRelatedRoles:q(t)}}}function X(e){var t,i;const r=B(e),o=(t=e.orderBy)!=null&&t.field?u(r,e.orderBy.field):void 0;return _([...r.map(a=>l(a,x(a))),...(i=e.orderBy)!=null&&i.field?[l(f(e.orderBy.field,o),o?x(o):[],{unsupportedRelatedRoleMessage:"Joined records projections support related sort fields only when the same related field is included in spec.fields.",recommendedNextStep:"Add the related sort field to spec.fields, or keep orderBy fields on the base source."})]:[]])}function Y(e){var o,t;const r=(o=e.orderBy)!=null&&o.field?u(e.dimensions||[],e.orderBy.field):void 0;return _([...e.measures.map(i=>l(i,[])),...e.primaryMeasure?[l(e.primaryMeasure,[])]:[],...(e.dimensions||[]).map(i=>l(i,["dimension"])),...e.dateField?[l({...e.dateField,role:"date"},[])]:[],...(t=e.orderBy)!=null&&t.field?[l(f(e.orderBy.field,r),r?["dimension"]:[],{unsupportedRelatedRoleMessage:"Joined metric projections support related orderBy fields only when the same related field is declared in spec.dimensions.",recommendedNextStep:"Add the related field as a metric dimension when it should participate in the grouped result, or keep orderBy fields on the base source."})]:[]])}function Z(e){const r=[...e.rows,...e.columns||[]];return _([...r.map(o=>l(o.field,q(o.field))),...r.flatMap(o=>{var a;if(((a=o.sortBy)==null?void 0:a.by.kind)!=="field")return[];const t=o.sortBy.by.field,i=u(S(e),t);return[l(f(t,i),q(i),{unsupportedRelatedRoleMessage:"Joined matrix projections support related axis sort fields only when the same related field is used as a row/column axis.",recommendedNextStep:"Use a related field as a row or column axis, or keep axis sort fields on the base source."})]}),...e.values.map(o=>l(o.field,[],{unsupportedRelatedRoleMessage:"Joined matrix projections support related row/column dimensions or dates only. Related value fields are not supported in this phase.",recommendedNextStep:"Keep matrix values on the base source, or use governed SQL for unsupported aggregate-safe joined values."})),...(e.sort||[]).flatMap(o=>{if(o.by.kind!=="field")return[];const t=o.by.field,i=u(S(e),t);return[l(f(t,i),q(i),{unsupportedRelatedRoleMessage:"Joined matrix projections support related top-level sort fields only when the same related field is used as a row/column axis.",recommendedNextStep:"Use a related field as a row or column axis, or keep matrix sort fields on the base source."})]})])}function x(e){const r=e?p(e):void 0;return r==="dimension"?["dimension"]:r==="date"?["date"]:r==="id"?["id"]:["dimension","date","id"]}function q(e){const r=e?p(e):void 0;return r==="date"?["date"]:r==="dimension"?["dimension"]:[]}function l(e,r,o={}){return{field:f(e),allowedRelatedRoles:r,...o}}function _(e){const r=[];return e.forEach(o=>{r.some(t=>ee(t,o))||r.push(o)}),r}function B(e){const r=[...e.fields];return e.dateField&&!r.some(o=>T(o,e.dateField))&&r.push({...e.dateField,role:"date"}),r}function ee(e,r){return D(e.field,r.field)&&e.allowedRelatedRoles.join("|")===r.allowedRelatedRoles.join("|")&&(e.unsupportedRelatedRoleMessage||"")===(r.unsupportedRelatedRoleMessage||"")&&(e.recommendedNextStep||"")===(r.recommendedNextStep||"")}function T(e,r){return v.semaphorFieldRefsMatch(e,r)}function D(e,r){return T(e,r)&&re(p(e),p(r))}function re(e,r){return!!(e&&(!r||e===r))}function p(e){return w(e)}function oe(e){const r=e.split(".");return r.length===4&&r[0]==="spec"&&(r[1]==="rows"||r[1]==="columns")&&b(r[2])&&r[3]==="field"}function te(e){const r=e.split(".");return r.length===6&&r[0]==="spec"&&(r[1]==="rows"||r[1]==="columns")&&b(r[2])&&r[3]==="sortBy"&&r[4]==="by"&&r[5]==="field"||r.length===5&&r[0]==="spec"&&r[1]==="sort"&&b(r[2])&&r[3]==="by"&&r[4]==="field"}function b(e){return e===void 0||e.trim()===""?!1:Number.isInteger(Number(e))&&Number(e)>=0}function ie({intent:e,field:r,relativePath:o,baseCatalog:t,fieldCatalogs:i}){const a=g(r,e.source),s=v.semaphorSourcesReferToSameDataset(a,e.source);if(!s&&!se(e.source,a))return{ok:!1,code:"invalid_source_ref",message:`Field "${r.name}" references a related Semaphor source outside the query's semantic domain.`,pathSuffix:".source",source:a};const n=s?t:k(i,a);if(!n)return{ok:!1,code:"invalid_source_ref",message:`Field "${r.name}" references a Semaphor source that is not present in the visible field catalog.`,pathSuffix:".source",source:a};const d=I(n,r,e.source);return d?!s&&!ae({intent:e,field:r,catalogField:d,relativePath:o})?{ok:!1,code:"unsupported_joined_projection",message:`Field "${r.name}" references a related Semaphor source, but this query kind does not support joined projections for that field yet.`,pathSuffix:".source",source:a}:{ok:!0,source:a,catalogField:d,usesBaseSource:s}:{ok:!1,code:"missing_field",message:`Field "${r.name}" is not visible on the selected Semaphor source.`,source:a}}function ae({intent:e,field:r,catalogField:o,relativePath:t}){return W({intent:e,field:r,catalogField:o,relativePath:t})}function se(e,r){return e.kind==="semantic"&&r.kind==="semantic"&&e.domainId===r.domainId}function k(e,r){return e.find(o=>$(o,r))}function I(e,r,o){const t=g(r,o);if($(e,t))return e.fields.find(i=>ne(i,r)&&$(e,g(i,e.source)))}function C(e){return R.normalizeAnalyticsCatalogName(e)}function g(e,r){return e.source||r}function $(e,r){return[e.source,...e.sourceAliases||[]].some(o=>v.semaphorSourcesReferToSameDataset(o,r))}function ne(e,r){return!!(e.name&&r.name&&e.name===r.name)}function z(e,r={}){const o=r.pathPrefix||"analysisOptions";if(e===void 0)return{ok:!0};if(!e||typeof e!="object"||Array.isArray(e))return c(o,"Data App analysis options must be an object.");const t=e,i={};if(t.chartTitle!==void 0){if(typeof t.chartTitle!="string")return c(`${o}.chartTitle`,'Data App analysis option "chartTitle" must be a string.');i.chartTitle=t.chartTitle}if(t.chartType!==void 0){if(typeof t.chartType!="string")return c(`${o}.chartType`,'Data App analysis option "chartType" must be a string.');i.chartType=t.chartType}if(t.driverMode!==void 0){if(!ce(t.driverMode))return c(`${o}.driverMode`,'Data App analysis option "driverMode" must be absolute_delta, largest_negative, largest_positive, positive_and_negative, or all.');i.driverMode=t.driverMode}if(t.includePopulation!==void 0){if(typeof t.includePopulation!="boolean")return c(`${o}.includePopulation`,'Data App analysis option "includePopulation" must be a boolean.');i.includePopulation=t.includePopulation}if(t.calendarContext!==void 0){const a=fe(t.calendarContext,{pathPrefix:`${o}.calendarContext`,validateTimezone:r.validateTimezone});if(!a.ok)return a;i.calendarContext=a.calendarContext}return{ok:!0,analysisOptions:i}}function de(e){const r=e.queries.map((i,a)=>le(i,a,{fieldCatalogs:e.fieldCatalogs||[],requireFieldCatalog:!!e.requireFieldCatalog,validateTimezone:e.validateTimezone})),o=r.flatMap(i=>i.diagnostics),t=r.map(i=>i.executionResult);return{ok:o.every(i=>i.severity!=="error"),diagnostics:o,queries:r,intents:r.flatMap(i=>i.intent?[i.intent]:[]),executionResults:t}}function le(e,r,o){const t=`queries.${r}`;try{const i=pe(e),a=$e(e,i),s=E.validateSemaphorAnalyticsIntent(i),n=[...ke({querySpec:e,queryId:a,intent:i,pathPrefix:t}),...s.errors.map(h=>P(h,{queryHook:e.queryHook,queryId:a,pathPrefix:t,severity:"error",intent:i})),...s.warnings.map(h=>P(h,{queryHook:e.queryHook,queryId:a,pathPrefix:t,severity:"warning",intent:i})),...ye({querySpec:e,queryId:a,intent:i,pathPrefix:t,fieldCatalogs:o.fieldCatalogs,requireFieldCatalog:o.requireFieldCatalog}),...Ie({querySpec:e,queryId:a,intent:i,pathPrefix:t,validateTimezone:o.validateTimezone})],d=be(s,n);return{queryHook:e.queryHook,queryId:a,intent:i,diagnostics:n,executionResult:j({intent:i,validation:d,diagnostics:n})}}catch(i){const a={severity:"error",code:"invalid_query_spec",message:i instanceof Error?i.message:String(i),path:t,queryHook:e.queryHook,queryId:Q(e.spec)},s=K([a]);return{queryHook:e.queryHook,queryId:a.queryId,diagnostics:[a],executionResult:j({validation:s,diagnostics:[a]})}}}function c(e,r){return{ok:!1,issues:[{code:"invalid_analysis_option",message:r,path:e}]}}function N(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function ce(e){return e==="absolute_delta"||e==="largest_negative"||e==="largest_positive"||e==="positive_and_negative"||e==="all"}function ue(e){return e.trim().length>0&&!Number.isNaN(Date.parse(e))}function fe(e,r){var d;if(!e||typeof e!="object"||Array.isArray(e))return c(r.pathPrefix,'Data App analysis option "calendarContext" must be an object.');const o=e,t=o.tz,i=o.weekStart,a=o.anchor,s=a&&typeof a=="object"&&!Array.isArray(a)?a.iso:void 0,n=typeof t=="string"?((d=r.validateTimezone)==null?void 0:d.call(r,t))??t:null;return n?typeof i!="number"||!Number.isInteger(i)||i<0||i>6?c(`${r.pathPrefix}.weekStart`,'Data App analysis option "calendarContext.weekStart" must be an integer from 0 to 6.'):a!=="now"&&!(typeof s=="string"&&ue(s))?c(`${r.pathPrefix}.anchor`,'Data App analysis option "calendarContext.anchor" must be "now" or an object with a valid iso string.'):{ok:!0,calendarContext:{tz:n,weekStart:i,anchor:a}}:c(`${r.pathPrefix}.tz`,'Data App analysis option "calendarContext.tz" must be a valid timezone string.')}function pe(e){return me(e.spec)}function me(e){if(!N(e))throw new Error("useSemaphorQuery spec must be an object.");if(e.queryKind==="metric")return y.toSemaphorMetricIntent(e);if(e.queryKind==="analysis")return y.toSemaphorAnalysisIntent(e);if(e.queryKind==="records")return y.toSemaphorRecordsIntent(e);if(e.queryKind==="sql")return y.toSemaphorSqlIntent(e);if(e.queryKind==="matrix")return y.toSemaphorMatrixIntent(e);if(e.queryKind==="inputOptions")return y.toSemaphorInputOptionsIntent(e);throw new Error("useSemaphorQuery spec.queryKind must be metric, analysis, records, inputOptions, sql, or matrix.")}function ye(e){if(e.intent.kind==="sql")return[];if(e.fieldCatalogs.length===0&&!e.requireFieldCatalog)return[];const r=k(e.fieldCatalogs,e.intent.source);if(!r)return[{severity:"error",code:"invalid_source_ref",message:`Source ref for ${e.querySpec.queryHook} does not match a visible Semaphor source.`,path:`${e.pathPrefix}.spec.source`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:e.intent.source}];const o=ge({...e,catalog:r}),t={...r,fields:[...r.fields,...Re(e.intent,r,e.intent.source)]};return[...o,...he({...e,fieldCatalogs:e.fieldCatalogs}),...ve({...e,catalog:t,fieldCatalogs:e.fieldCatalogs}),...qe({...e,catalog:t,fieldCatalogs:e.fieldCatalogs})]}function he(e){var o;if(e.intent.kind!=="inputOptions"||((o=e.intent.population)==null?void 0:o.kind)!=="related_population")return[];const r=e.intent.population.baseSource;return k(e.fieldCatalogs,r)?[]:[{severity:"error",code:"invalid_source_ref",message:"Input options related population baseSource does not match a visible Semaphor source.",path:`${e.pathPrefix}.spec.population.baseSource`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:r}]}function ge(e){const r=O(e.intent);if(r.length===0)return[];const o=[],t=new Set;return r.forEach((i,a)=>{const s=`${e.pathPrefix}.spec.derivedFields.${a}`,n=C(i.name);n&&(t.has(n)&&o.push({severity:"error",code:"duplicate_derived_field",message:`Derived field "${i.name}" is declared more than once.`,path:`${s}.name`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:e.intent.source}),t.add(n),e.catalog.fields.some(d=>C(d.name)===n)&&o.push({severity:"error",code:"derived_field_name_collision",message:`Derived field "${i.name}" conflicts with a field already visible on the selected Semaphor source.`,path:`${s}.name`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:e.intent.source})),Object.entries(i.inputs||{}).forEach(([d,h])=>{const m=xe(h);if(!m)return;const F=g(m,e.intent.source);if(!v.semaphorSourcesReferToSameDataset(F,e.intent.source)){o.push({severity:"error",code:"unsupported_derived_field_source",message:`Derived field "${i.name}" input "${d}" references a different Semaphor source. App-local derived fields must use fields from the query source.`,path:`${s}.inputs.${d}`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:F,field:m});return}I(e.catalog,m,e.intent.source)||o.push({severity:"error",code:"missing_field",message:`Derived field "${i.name}" input "${d}" references field "${m.name}", which is not visible on the selected Semaphor source.`,path:`${s}.inputs.${d}`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:F,field:m})})}),o}function ve(e){return Fe(e.intent).flatMap(({field:r,path:o})=>{const t=ie({intent:e.intent,field:r,relativePath:o,baseCatalog:e.catalog,fieldCatalogs:e.fieldCatalogs});return t.ok?[]:[{severity:"error",code:t.code,message:t.message,path:`${e.pathPrefix}.${o}${t.pathSuffix||""}`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:t.source,field:r}]})}function qe(e){return("inputs"in e.intent?e.intent.inputs||[]:[]).flatMap((o,t)=>{if(!o.field)return[];const i=g(o.field,e.intent.source);if(!v.semaphorSourcesReferToSameDataset(i,e.intent.source)){if(Se(e.intent,i)){const a=k(e.fieldCatalogs,i);return a?I(a,o.field,i)?[]:[{severity:"error",code:"missing_field",message:`Input "${o.inputId}" references field "${o.field.name}", which is not visible on the selected Semaphor source.`,path:`${e.pathPrefix}.spec.inputs.${t}.field`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:i,field:o.field}]:[{severity:"error",code:"invalid_source_ref",message:`Input "${o.inputId}" references a Semaphor source that is not present in the visible field catalog.`,path:`${e.pathPrefix}.spec.inputs.${t}.field.source`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:i,field:o.field}]}return[{severity:"error",code:"unsupported_input_filter_composition",message:`Input "${o.inputId}" filters a different Semaphor source than the query, and no relationship-aware semantic validation path is available for this query kind.`,path:`${e.pathPrefix}.spec.inputs.${t}.field`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:i,field:o.field}]}return I(e.catalog,o.field,e.intent.source)?[]:[{severity:"error",code:"missing_field",message:`Input "${o.inputId}" references field "${o.field.name}", which is not visible on the selected Semaphor source.`,path:`${e.pathPrefix}.spec.inputs.${t}.field`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:i,field:o.field}]})}function Se(e,r){return e.source.kind==="semantic"&&r.kind==="semantic"&&r.domainId===e.source.domainId}function Ie(e){if(e.querySpec.spec.queryKind!=="analysis")return[];const r=z(e.querySpec.spec,{pathPrefix:`${e.pathPrefix}.spec`,validateTimezone:e.validateTimezone});return r.ok?[]:r.issues.map(o=>({severity:"error",code:o.code,message:o.message,path:o.path,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:e.intent.source}))}function ke(e){return e.querySpec.spec.queryKind!=="sql"?[]:N(e.querySpec.spec)?Object.prototype.hasOwnProperty.call(e.querySpec.spec,"parameters")?[{severity:"error",code:"deprecated_sql_parameters",message:"semaphor.sql uses defaultParameters for static SQL param(...) fallback values. The legacy parameters field is not supported.",path:`${e.pathPrefix}.spec.parameters`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id}]:[]:[]}function Fe(e){return e.kind==="metric"?[...e.measures.map((r,o)=>({field:r,path:`spec.measures.${o}`})),...e.primaryMeasure?[{field:e.primaryMeasure,path:"spec.primaryMeasure"}]:[],...e.dateField?[{field:e.dateField,path:"spec.dateField"}]:[],...(e.dimensions||[]).map((r,o)=>({field:r,path:`spec.dimensions.${o}`})),...e.orderBy?[{field:e.orderBy.field,path:"spec.orderBy.field"}]:[],...(e.filters||[]).map((r,o)=>({field:r.field,path:`spec.filters.${o}.field`}))]:e.kind==="records"?[...e.fields.map((r,o)=>({field:r,path:`spec.fields.${o}`})),...e.dateField?[{field:e.dateField,path:"spec.dateField"}]:[],...e.orderBy?[{field:e.orderBy.field,path:"spec.orderBy.field"}]:[],...(e.filters||[]).map((r,o)=>({field:r.field,path:`spec.filters.${o}.field`}))]:e.kind==="inputOptions"?[{field:e.labelField,path:"spec.labelField"},{field:e.valueField,path:"spec.valueField"},...e.searchField?[{field:e.searchField,path:"spec.searchField"}]:[],...(e.disambiguationFields||[]).map((r,o)=>({field:r,path:`spec.disambiguationFields.${o}`}))]:e.kind==="matrix"?[...e.rows.map((r,o)=>({field:r.field,path:`spec.rows.${o}.field`})),...e.rows.flatMap((r,o)=>{var t;return((t=r.sortBy)==null?void 0:t.by.kind)==="field"?[{field:r.sortBy.by.field,path:`spec.rows.${o}.sortBy.by.field`}]:[]}),...(e.columns||[]).map((r,o)=>({field:r.field,path:`spec.columns.${o}.field`})),...(e.columns||[]).flatMap((r,o)=>{var t;return((t=r.sortBy)==null?void 0:t.by.kind)==="field"?[{field:r.sortBy.by.field,path:`spec.columns.${o}.sortBy.by.field`}]:[]}),...e.values.map((r,o)=>({field:r.field,path:`spec.values.${o}.field`})),...(e.sort||[]).flatMap((r,o)=>r.by.kind==="field"?[{field:r.by.field,path:`spec.sort.${o}.by.field`}]:[]),...(e.filters||[]).map((r,o)=>({field:r.field,path:`spec.filters.${o}.field`}))]:[]}function O(e){return!("derivedFields"in e)||!Array.isArray(e.derivedFields)?[]:e.derivedFields}function Re(e,r,o){return O(e).map(t=>({name:t.name,label:t.label,role:t.resultRole,dataType:t.dataType,source:r.source||o,...t.defaultAggregate?{aggregate:t.defaultAggregate}:{}}))}function xe(e){if(!(!e||typeof e!="object"))return e.field}function P(e,r){return{severity:r.severity,code:e.code||"invalid_analytics_intent",message:e.message,path:e.path?`${r.pathPrefix}.spec.${e.path}`:r.pathPrefix,queryHook:r.queryHook,queryId:r.queryId,intentId:r.intent.id,source:r.intent.source}}function be(e,r){const o=K(r);return{ok:o.ok&&e.ok,errors:H([...e.errors,...o.errors]),warnings:H([...e.warnings,...o.warnings]),repairHints:[...e.repairHints,...o.repairHints]}}function K(e){const r=e.filter(t=>t.severity==="error").map(A),o=e.filter(t=>t.severity==="warning").map(A);return{ok:r.length===0,errors:r,warnings:o,repairHints:r.map(t=>{var i,a;return{code:t.code,message:t.message,fieldRole:t.fieldRole,invalidField:(i=t.repairHint)==null?void 0:i.invalidField,recommendedNextStep:((a=t.repairHint)==null?void 0:a.recommendedNextStep)||"Update the Data App SDK query spec to use visible Semaphor source and field refs."}})}}function A(e){var r;return{code:e.code,message:e.message,path:e.path,fieldRole:e.code==="invalid_source_ref"?"source":void 0,repairHint:{code:e.code,message:e.message,invalidField:(r=e.field)==null?void 0:r.name,fieldRole:e.code==="invalid_source_ref"?"source":void 0,recommendedNextStep:e.code==="unsupported_input_filter_composition"?"Use an input field from the same Semaphor source as the query, or split the query into separate source-scoped queries.":"Update the query spec to use a visible Semaphor source and field ref."}}}function H(e){const r=new Set;return e.filter(o=>{const t=`${o.code}:${o.path||""}:${o.message}`;return r.has(t)?!1:(r.add(t),!0)})}function j(e){var o,t;const r=e.diagnostics.filter(i=>i.severity==="error");return{intentId:(o=e.intent)==null?void 0:o.id,status:r.length?"failed":"answered",resultShape:(t=e.intent)==null?void 0:t.kind,intent:e.intent,validation:e.validation,coverage:{answeredObligations:r.length?[]:["query_spec_validation"],missingObligations:r.length?["query_spec_validation"]:[],warnings:e.validation.warnings},missingFields:r.filter(i=>i.code==="missing_field").flatMap(i=>{var a;return(a=i.field)!=null&&a.name?[i.field.name]:[]}),warnings:e.diagnostics.filter(i=>i.severity==="warning").map(i=>i.message),metadata:{validationKind:"data_app_sdk_query_spec"}}}function $e(e,r){return r.id||Q(e.spec)}function Q(e){if(!e||typeof e!="object"||!("id"in e))return;const r=e.id;return typeof r=="string"&&r.trim()?r:void 0}exports.fieldWithSelectedProjectionRole=f;exports.findMatchingRelatedProjectionField=u;exports.isAllowedRelatedProjectionRole=M;exports.matrixAxisFieldsForPolicy=S;exports.normalizeSemaphorAnalysisQueryOptions=z;exports.normalizeSemaphorFieldRole=w;exports.relatedProjectionFieldCandidatesForIntent=J;exports.validateSemaphorDataAppQuerySpecs=de;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../chunks/validators-DMlVbd1p.js"),v=require("../chunks/analyze-result-contract-DpDcImgk.js"),y=require("../data-app-sdk-adapters/index.cjs"),R=require("../chunks/catalog-field-grounding-Bnx-3tE0.js");function W({intent:e,field:r,catalogField:o,relativePath:t}){const i=U({intent:e,field:r,relativePath:t});if(!i||i.allowedRelatedRoles.length===0)return!1;const a=f(r,i.selectedField),s=w(o),n=p(a);return M(s,i.allowedRelatedRoles)?n===s:!1}function J(e){return e.kind==="records"?X(e):e.kind==="metric"?Y(e):Z(e)}function w(e){const r=R.normalizeAnalyticsCatalogName(e.role);if(r==="measure")return"measure";if(r==="id")return"id";const o=R.normalizeAnalyticsCatalogDataType(e.dataType);if(r==="date"||o==="date"||o==="datetime")return"date";if(r==="dimension")return"dimension"}function M(e,r){return!!(e&&r.includes(e))}function f(e,r){const o=p(e);if(o)return e.role===o?e:{...e,role:o};const t=r?p(r):void 0;return t?{...e,role:t}:e}function u(e,r){return e.find(o=>D(o,r))}function S(e){return[...e.rows.map(r=>r.field),...(e.columns||[]).map(r=>r.field)]}function U({intent:e,field:r,relativePath:o}){if(e.kind==="records")return L(e,r,o);if(e.kind==="metric")return V(e,r,o);if(e.kind==="matrix")return G(e,r,o)}function L(e,r,o){if(o.startsWith("spec.fields."))return{allowedRelatedRoles:["dimension","date","id"]};if(o==="spec.dateField"&&!e.timeWindow)return{allowedRelatedRoles:["date"]};if(o==="spec.orderBy.field"){const t=u(B(e),r);return{selectedField:t,allowedRelatedRoles:t?x(t):[]}}}function V(e,r,o){if(o.startsWith("spec.dimensions."))return{allowedRelatedRoles:["dimension"]};if(o==="spec.orderBy.field"){const t=u(e.dimensions||[],r);return{selectedField:t,allowedRelatedRoles:t?["dimension"]:[]}}}function G(e,r,o){if(oe(o))return{allowedRelatedRoles:["dimension","date"]};if(te(o)){const t=u(S(e),r);return{selectedField:t,allowedRelatedRoles:q(t)}}}function X(e){var t,i;const r=B(e),o=(t=e.orderBy)!=null&&t.field?u(r,e.orderBy.field):void 0;return _([...r.map(a=>l(a,x(a))),...(i=e.orderBy)!=null&&i.field?[l(f(e.orderBy.field,o),o?x(o):[],{unsupportedRelatedRoleMessage:"Joined records projections support related sort fields only when the same related field is included in spec.fields.",recommendedNextStep:"Add the related sort field to spec.fields, or keep orderBy fields on the base source."})]:[]])}function Y(e){var o,t;const r=(o=e.orderBy)!=null&&o.field?u(e.dimensions||[],e.orderBy.field):void 0;return _([...e.measures.map(i=>l(i,[])),...e.primaryMeasure?[l(e.primaryMeasure,[])]:[],...(e.dimensions||[]).map(i=>l(i,["dimension"])),...e.dateField?[l({...e.dateField,role:"date"},[])]:[],...(t=e.orderBy)!=null&&t.field?[l(f(e.orderBy.field,r),r?["dimension"]:[],{unsupportedRelatedRoleMessage:"Joined metric projections support related orderBy fields only when the same related field is declared in spec.dimensions.",recommendedNextStep:"Add the related field as a metric dimension when it should participate in the grouped result, or keep orderBy fields on the base source."})]:[]])}function Z(e){const r=[...e.rows,...e.columns||[]];return _([...r.map(o=>l(o.field,q(o.field))),...r.flatMap(o=>{var a;if(((a=o.sortBy)==null?void 0:a.by.kind)!=="field")return[];const t=o.sortBy.by.field,i=u(S(e),t);return[l(f(t,i),q(i),{unsupportedRelatedRoleMessage:"Joined matrix projections support related axis sort fields only when the same related field is used as a row/column axis.",recommendedNextStep:"Use a related field as a row or column axis, or keep axis sort fields on the base source."})]}),...e.values.map(o=>l(o.field,[],{unsupportedRelatedRoleMessage:"Joined matrix projections support related row/column dimensions or dates only. Related value fields are not supported in this phase.",recommendedNextStep:"Keep matrix values on the base source, or use governed SQL for unsupported aggregate-safe joined values."})),...(e.sort||[]).flatMap(o=>{if(o.by.kind!=="field")return[];const t=o.by.field,i=u(S(e),t);return[l(f(t,i),q(i),{unsupportedRelatedRoleMessage:"Joined matrix projections support related top-level sort fields only when the same related field is used as a row/column axis.",recommendedNextStep:"Use a related field as a row or column axis, or keep matrix sort fields on the base source."})]})])}function x(e){const r=e?p(e):void 0;return r==="dimension"?["dimension"]:r==="date"?["date"]:r==="id"?["id"]:["dimension","date","id"]}function q(e){const r=e?p(e):void 0;return r==="date"?["date"]:r==="dimension"?["dimension"]:[]}function l(e,r,o={}){return{field:f(e),allowedRelatedRoles:r,...o}}function _(e){const r=[];return e.forEach(o=>{r.some(t=>ee(t,o))||r.push(o)}),r}function B(e){const r=[...e.fields];return e.dateField&&!r.some(o=>T(o,e.dateField))&&r.push({...e.dateField,role:"date"}),r}function ee(e,r){return D(e.field,r.field)&&e.allowedRelatedRoles.join("|")===r.allowedRelatedRoles.join("|")&&(e.unsupportedRelatedRoleMessage||"")===(r.unsupportedRelatedRoleMessage||"")&&(e.recommendedNextStep||"")===(r.recommendedNextStep||"")}function T(e,r){return v.semaphorFieldRefsMatch(e,r)}function D(e,r){return T(e,r)&&re(p(e),p(r))}function re(e,r){return!!(e&&(!r||e===r))}function p(e){return w(e)}function oe(e){const r=e.split(".");return r.length===4&&r[0]==="spec"&&(r[1]==="rows"||r[1]==="columns")&&b(r[2])&&r[3]==="field"}function te(e){const r=e.split(".");return r.length===6&&r[0]==="spec"&&(r[1]==="rows"||r[1]==="columns")&&b(r[2])&&r[3]==="sortBy"&&r[4]==="by"&&r[5]==="field"||r.length===5&&r[0]==="spec"&&r[1]==="sort"&&b(r[2])&&r[3]==="by"&&r[4]==="field"}function b(e){return e===void 0||e.trim()===""?!1:Number.isInteger(Number(e))&&Number(e)>=0}function ie({intent:e,field:r,relativePath:o,baseCatalog:t,fieldCatalogs:i}){const a=g(r,e.source),s=v.semaphorSourcesReferToSameDataset(a,e.source);if(!s&&!se(e.source,a))return{ok:!1,code:"invalid_source_ref",message:`Field "${r.name}" references a related Semaphor source outside the query's semantic domain.`,pathSuffix:".source",source:a};const n=s?t:k(i,a);if(!n)return{ok:!1,code:"invalid_source_ref",message:`Field "${r.name}" references a Semaphor source that is not present in the visible field catalog.`,pathSuffix:".source",source:a};const d=I(n,r,e.source);return d?!s&&!ae({intent:e,field:r,catalogField:d,relativePath:o})?{ok:!1,code:"unsupported_joined_projection",message:`Field "${r.name}" references a related Semaphor source, but this query kind does not support joined projections for that field yet.`,pathSuffix:".source",source:a}:{ok:!0,source:a,catalogField:d,usesBaseSource:s}:{ok:!1,code:"missing_field",message:`Field "${r.name}" is not visible on the selected Semaphor source.`,source:a}}function ae({intent:e,field:r,catalogField:o,relativePath:t}){return W({intent:e,field:r,catalogField:o,relativePath:t})}function se(e,r){return e.kind==="semantic"&&r.kind==="semantic"&&e.domainId===r.domainId}function k(e,r){return e.find(o=>$(o,r))}function I(e,r,o){const t=g(r,o);if($(e,t))return e.fields.find(i=>ne(i,r)&&$(e,g(i,e.source)))}function C(e){return R.normalizeAnalyticsCatalogName(e)}function g(e,r){return e.source||r}function $(e,r){return[e.source,...e.sourceAliases||[]].some(o=>v.semaphorSourcesReferToSameDataset(o,r))}function ne(e,r){return!!(e.name&&r.name&&e.name===r.name)}function z(e,r={}){const o=r.pathPrefix||"analysisOptions";if(e===void 0)return{ok:!0};if(!e||typeof e!="object"||Array.isArray(e))return c(o,"Data App analysis options must be an object.");const t=e,i={};if(t.chartTitle!==void 0){if(typeof t.chartTitle!="string")return c(`${o}.chartTitle`,'Data App analysis option "chartTitle" must be a string.');i.chartTitle=t.chartTitle}if(t.chartType!==void 0){if(typeof t.chartType!="string")return c(`${o}.chartType`,'Data App analysis option "chartType" must be a string.');i.chartType=t.chartType}if(t.driverMode!==void 0){if(!ce(t.driverMode))return c(`${o}.driverMode`,'Data App analysis option "driverMode" must be absolute_delta, largest_negative, largest_positive, positive_and_negative, or all.');i.driverMode=t.driverMode}if(t.includePopulation!==void 0){if(typeof t.includePopulation!="boolean")return c(`${o}.includePopulation`,'Data App analysis option "includePopulation" must be a boolean.');i.includePopulation=t.includePopulation}if(t.calendarContext!==void 0){const a=fe(t.calendarContext,{pathPrefix:`${o}.calendarContext`,validateTimezone:r.validateTimezone});if(!a.ok)return a;i.calendarContext=a.calendarContext}return{ok:!0,analysisOptions:i}}function de(e){const r=e.queries.map((i,a)=>le(i,a,{fieldCatalogs:e.fieldCatalogs||[],requireFieldCatalog:!!e.requireFieldCatalog,validateTimezone:e.validateTimezone})),o=r.flatMap(i=>i.diagnostics),t=r.map(i=>i.executionResult);return{ok:o.every(i=>i.severity!=="error"),diagnostics:o,queries:r,intents:r.flatMap(i=>i.intent?[i.intent]:[]),executionResults:t}}function le(e,r,o){const t=`queries.${r}`;try{const i=pe(e),a=$e(e,i),s=E.validateSemaphorAnalyticsIntent(i),n=[...ke({querySpec:e,queryId:a,intent:i,pathPrefix:t}),...s.errors.map(h=>P(h,{queryHook:e.queryHook,queryId:a,pathPrefix:t,severity:"error",intent:i})),...s.warnings.map(h=>P(h,{queryHook:e.queryHook,queryId:a,pathPrefix:t,severity:"warning",intent:i})),...ye({querySpec:e,queryId:a,intent:i,pathPrefix:t,fieldCatalogs:o.fieldCatalogs,requireFieldCatalog:o.requireFieldCatalog}),...Ie({querySpec:e,queryId:a,intent:i,pathPrefix:t,validateTimezone:o.validateTimezone})],d=be(s,n);return{queryHook:e.queryHook,queryId:a,intent:i,diagnostics:n,executionResult:j({intent:i,validation:d,diagnostics:n})}}catch(i){const a={severity:"error",code:"invalid_query_spec",message:i instanceof Error?i.message:String(i),path:t,queryHook:e.queryHook,queryId:Q(e.spec)},s=K([a]);return{queryHook:e.queryHook,queryId:a.queryId,diagnostics:[a],executionResult:j({validation:s,diagnostics:[a]})}}}function c(e,r){return{ok:!1,issues:[{code:"invalid_analysis_option",message:r,path:e}]}}function N(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function ce(e){return e==="absolute_delta"||e==="largest_negative"||e==="largest_positive"||e==="positive_and_negative"||e==="all"}function ue(e){return e.trim().length>0&&!Number.isNaN(Date.parse(e))}function fe(e,r){var d;if(!e||typeof e!="object"||Array.isArray(e))return c(r.pathPrefix,'Data App analysis option "calendarContext" must be an object.');const o=e,t=o.tz,i=o.weekStart,a=o.anchor,s=a&&typeof a=="object"&&!Array.isArray(a)?a.iso:void 0,n=typeof t=="string"?((d=r.validateTimezone)==null?void 0:d.call(r,t))??t:null;return n?typeof i!="number"||!Number.isInteger(i)||i<0||i>6?c(`${r.pathPrefix}.weekStart`,'Data App analysis option "calendarContext.weekStart" must be an integer from 0 to 6.'):a!=="now"&&!(typeof s=="string"&&ue(s))?c(`${r.pathPrefix}.anchor`,'Data App analysis option "calendarContext.anchor" must be "now" or an object with a valid iso string.'):{ok:!0,calendarContext:{tz:n,weekStart:i,anchor:a}}:c(`${r.pathPrefix}.tz`,'Data App analysis option "calendarContext.tz" must be a valid timezone string.')}function pe(e){return me(e.spec)}function me(e){if(!N(e))throw new Error("useSemaphorQuery spec must be an object.");if(e.queryKind==="metric")return y.toSemaphorMetricIntent(e);if(e.queryKind==="analysis")return y.toSemaphorAnalysisIntent(e);if(e.queryKind==="records")return y.toSemaphorRecordsIntent(e);if(e.queryKind==="sql")return y.toSemaphorSqlIntent(e);if(e.queryKind==="matrix")return y.toSemaphorMatrixIntent(e);if(e.queryKind==="inputOptions")return y.toSemaphorInputOptionsIntent(e);throw new Error("useSemaphorQuery spec.queryKind must be metric, analysis, records, inputOptions, sql, or matrix.")}function ye(e){if(e.intent.kind==="sql")return[];if(e.fieldCatalogs.length===0&&!e.requireFieldCatalog)return[];const r=k(e.fieldCatalogs,e.intent.source);if(!r)return[{severity:"error",code:"invalid_source_ref",message:`Source ref for ${e.querySpec.queryHook} does not match a visible Semaphor source.`,path:`${e.pathPrefix}.spec.source`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:e.intent.source}];const o=ge({...e,catalog:r}),t={...r,fields:[...r.fields,...Re(e.intent,r,e.intent.source)]};return[...o,...he({...e,fieldCatalogs:e.fieldCatalogs}),...ve({...e,catalog:t,fieldCatalogs:e.fieldCatalogs}),...qe({...e,catalog:t,fieldCatalogs:e.fieldCatalogs})]}function he(e){var o;if(e.intent.kind!=="inputOptions"||((o=e.intent.population)==null?void 0:o.kind)!=="related_population")return[];const r=e.intent.population.baseSource;return k(e.fieldCatalogs,r)?[]:[{severity:"error",code:"invalid_source_ref",message:"Input options related population baseSource does not match a visible Semaphor source.",path:`${e.pathPrefix}.spec.population.baseSource`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:r}]}function ge(e){const r=O(e.intent);if(r.length===0)return[];const o=[],t=new Set;return r.forEach((i,a)=>{const s=`${e.pathPrefix}.spec.derivedFields.${a}`,n=C(i.name);n&&(t.has(n)&&o.push({severity:"error",code:"duplicate_derived_field",message:`Derived field "${i.name}" is declared more than once.`,path:`${s}.name`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:e.intent.source}),t.add(n),e.catalog.fields.some(d=>C(d.name)===n)&&o.push({severity:"error",code:"derived_field_name_collision",message:`Derived field "${i.name}" conflicts with a field already visible on the selected Semaphor source.`,path:`${s}.name`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:e.intent.source})),Object.entries(i.inputs||{}).forEach(([d,h])=>{const m=xe(h);if(!m)return;const F=g(m,e.intent.source);if(!v.semaphorSourcesReferToSameDataset(F,e.intent.source)){o.push({severity:"error",code:"unsupported_derived_field_source",message:`Derived field "${i.name}" input "${d}" references a different Semaphor source. App-local derived fields must use fields from the query source.`,path:`${s}.inputs.${d}`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:F,field:m});return}I(e.catalog,m,e.intent.source)||o.push({severity:"error",code:"missing_field",message:`Derived field "${i.name}" input "${d}" references field "${m.name}", which is not visible on the selected Semaphor source.`,path:`${s}.inputs.${d}`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:F,field:m})})}),o}function ve(e){return Fe(e.intent).flatMap(({field:r,path:o})=>{const t=ie({intent:e.intent,field:r,relativePath:o,baseCatalog:e.catalog,fieldCatalogs:e.fieldCatalogs});return t.ok?[]:[{severity:"error",code:t.code,message:t.message,path:`${e.pathPrefix}.${o}${t.pathSuffix||""}`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:t.source,field:r}]})}function qe(e){return("inputs"in e.intent?e.intent.inputs||[]:[]).flatMap((o,t)=>{if(!o.field)return[];const i=g(o.field,e.intent.source);if(!v.semaphorSourcesReferToSameDataset(i,e.intent.source)){if(Se(e.intent,i)){const a=k(e.fieldCatalogs,i);return a?I(a,o.field,i)?[]:[{severity:"error",code:"missing_field",message:`Input "${o.inputId}" references field "${o.field.name}", which is not visible on the selected Semaphor source.`,path:`${e.pathPrefix}.spec.inputs.${t}.field`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:i,field:o.field}]:[{severity:"error",code:"invalid_source_ref",message:`Input "${o.inputId}" references a Semaphor source that is not present in the visible field catalog.`,path:`${e.pathPrefix}.spec.inputs.${t}.field.source`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:i,field:o.field}]}return[{severity:"error",code:"unsupported_input_filter_composition",message:`Input "${o.inputId}" filters a different Semaphor source than the query, and no relationship-aware semantic validation path is available for this query kind.`,path:`${e.pathPrefix}.spec.inputs.${t}.field`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:i,field:o.field}]}return I(e.catalog,o.field,e.intent.source)?[]:[{severity:"error",code:"missing_field",message:`Input "${o.inputId}" references field "${o.field.name}", which is not visible on the selected Semaphor source.`,path:`${e.pathPrefix}.spec.inputs.${t}.field`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:i,field:o.field}]})}function Se(e,r){return e.source.kind==="semantic"&&r.kind==="semantic"&&r.domainId===e.source.domainId}function Ie(e){if(e.querySpec.spec.queryKind!=="analysis")return[];const r=z(e.querySpec.spec,{pathPrefix:`${e.pathPrefix}.spec`,validateTimezone:e.validateTimezone});return r.ok?[]:r.issues.map(o=>({severity:"error",code:o.code,message:o.message,path:o.path,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:e.intent.source}))}function ke(e){return e.querySpec.spec.queryKind!=="sql"?[]:N(e.querySpec.spec)?Object.prototype.hasOwnProperty.call(e.querySpec.spec,"parameters")?[{severity:"error",code:"deprecated_sql_parameters",message:"semaphor.sql uses defaultParameters for static SQL param(...) fallback values. The legacy parameters field is not supported.",path:`${e.pathPrefix}.spec.parameters`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id}]:[]:[]}function Fe(e){return e.kind==="metric"?[...e.measures.map((r,o)=>({field:r,path:`spec.measures.${o}`})),...e.primaryMeasure?[{field:e.primaryMeasure,path:"spec.primaryMeasure"}]:[],...e.dateField?[{field:e.dateField,path:"spec.dateField"}]:[],...(e.dimensions||[]).map((r,o)=>({field:r,path:`spec.dimensions.${o}`})),...e.orderBy?[{field:e.orderBy.field,path:"spec.orderBy.field"}]:[],...(e.filters||[]).map((r,o)=>({field:r.field,path:`spec.filters.${o}.field`}))]:e.kind==="records"?[...e.fields.map((r,o)=>({field:r,path:`spec.fields.${o}`})),...e.dateField?[{field:e.dateField,path:"spec.dateField"}]:[],...e.orderBy?[{field:e.orderBy.field,path:"spec.orderBy.field"}]:[],...(e.filters||[]).map((r,o)=>({field:r.field,path:`spec.filters.${o}.field`}))]:e.kind==="inputOptions"?[{field:e.labelField,path:"spec.labelField"},{field:e.valueField,path:"spec.valueField"},...e.searchField?[{field:e.searchField,path:"spec.searchField"}]:[],...(e.disambiguationFields||[]).map((r,o)=>({field:r,path:`spec.disambiguationFields.${o}`}))]:e.kind==="matrix"?[...e.rows.map((r,o)=>({field:r.field,path:`spec.rows.${o}.field`})),...e.rows.flatMap((r,o)=>{var t;return((t=r.sortBy)==null?void 0:t.by.kind)==="field"?[{field:r.sortBy.by.field,path:`spec.rows.${o}.sortBy.by.field`}]:[]}),...(e.columns||[]).map((r,o)=>({field:r.field,path:`spec.columns.${o}.field`})),...(e.columns||[]).flatMap((r,o)=>{var t;return((t=r.sortBy)==null?void 0:t.by.kind)==="field"?[{field:r.sortBy.by.field,path:`spec.columns.${o}.sortBy.by.field`}]:[]}),...e.values.map((r,o)=>({field:r.field,path:`spec.values.${o}.field`})),...(e.sort||[]).flatMap((r,o)=>r.by.kind==="field"?[{field:r.by.field,path:`spec.sort.${o}.by.field`}]:[]),...(e.filters||[]).map((r,o)=>({field:r.field,path:`spec.filters.${o}.field`}))]:[]}function O(e){return!("derivedFields"in e)||!Array.isArray(e.derivedFields)?[]:e.derivedFields}function Re(e,r,o){return O(e).map(t=>({name:t.name,label:t.label,role:t.resultRole,dataType:t.dataType,source:r.source||o,...t.defaultAggregate?{aggregate:t.defaultAggregate}:{}}))}function xe(e){if(!(!e||typeof e!="object"))return e.field}function P(e,r){return{severity:r.severity,code:e.code||"invalid_analytics_intent",message:e.message,path:e.path?`${r.pathPrefix}.spec.${e.path}`:r.pathPrefix,queryHook:r.queryHook,queryId:r.queryId,intentId:r.intent.id,source:r.intent.source}}function be(e,r){const o=K(r);return{ok:o.ok&&e.ok,errors:H([...e.errors,...o.errors]),warnings:H([...e.warnings,...o.warnings]),repairHints:[...e.repairHints,...o.repairHints]}}function K(e){const r=e.filter(t=>t.severity==="error").map(A),o=e.filter(t=>t.severity==="warning").map(A);return{ok:r.length===0,errors:r,warnings:o,repairHints:r.map(t=>{var i,a;return{code:t.code,message:t.message,fieldRole:t.fieldRole,invalidField:(i=t.repairHint)==null?void 0:i.invalidField,recommendedNextStep:((a=t.repairHint)==null?void 0:a.recommendedNextStep)||"Update the Data App SDK query spec to use visible Semaphor source and field refs."}})}}function A(e){var r;return{code:e.code,message:e.message,path:e.path,fieldRole:e.code==="invalid_source_ref"?"source":void 0,repairHint:{code:e.code,message:e.message,invalidField:(r=e.field)==null?void 0:r.name,fieldRole:e.code==="invalid_source_ref"?"source":void 0,recommendedNextStep:e.code==="unsupported_input_filter_composition"?"Use an input field from the same Semaphor source as the query, or split the query into separate source-scoped queries.":"Update the query spec to use a visible Semaphor source and field ref."}}}function H(e){const r=new Set;return e.filter(o=>{const t=`${o.code}:${o.path||""}:${o.message}`;return r.has(t)?!1:(r.add(t),!0)})}function j(e){var o,t;const r=e.diagnostics.filter(i=>i.severity==="error");return{intentId:(o=e.intent)==null?void 0:o.id,status:r.length?"failed":"answered",resultShape:(t=e.intent)==null?void 0:t.kind,intent:e.intent,validation:e.validation,coverage:{answeredObligations:r.length?[]:["query_spec_validation"],missingObligations:r.length?["query_spec_validation"]:[],warnings:e.validation.warnings},missingFields:r.filter(i=>i.code==="missing_field").flatMap(i=>{var a;return(a=i.field)!=null&&a.name?[i.field.name]:[]}),warnings:e.diagnostics.filter(i=>i.severity==="warning").map(i=>i.message),metadata:{validationKind:"data_app_sdk_query_spec"}}}function $e(e,r){return r.id||Q(e.spec)}function Q(e){if(!e||typeof e!="object"||!("id"in e))return;const r=e.id;return typeof r=="string"&&r.trim()?r:void 0}exports.fieldWithSelectedProjectionRole=f;exports.findMatchingRelatedProjectionField=u;exports.isAllowedRelatedProjectionRole=M;exports.matrixAxisFieldsForPolicy=S;exports.normalizeSemaphorAnalysisQueryOptions=z;exports.normalizeSemaphorFieldRole=w;exports.relatedProjectionFieldCandidatesForIntent=J;exports.validateSemaphorDataAppQuerySpecs=de;
@@ -1,5 +1,5 @@
1
- import { b as O } from "../chunks/validators-D0pfj3jJ.js";
2
- import { s as K, J as q } from "../chunks/analyze-result-contract-sWcmvBOA.js";
1
+ import { b as O } from "../chunks/validators-PXkij33j.js";
2
+ import { s as K, J as q } from "../chunks/analyze-result-contract-D7pjjYPy.js";
3
3
  import { toSemaphorMetricIntent as Q, toSemaphorAnalysisIntent as E, toSemaphorRecordsIntent as J, toSemaphorSqlIntent as U, toSemaphorMatrixIntent as W, toSemaphorInputOptionsIntent as L } from "../data-app-sdk-adapters/index.js";
4
4
  import { n as A, b as V } from "../chunks/catalog-field-grounding-CJKAqtiC.js";
5
5
  function G({
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-BKDQw0aK.js"),d=require("./chunks/common-types-C73-Ud1-.js"),N=require("./chunks/calendar-preferences-dialog-CscmhyuZ.js"),t=require("react/jsx-runtime"),a=require("./chunks/switch-CiOjVyVI.js"),C=require("react"),y=require("./types/index.cjs"),r=require("./chunks/dashboard-briefing-launcher-DmZkzIC3.js"),P=require("./chunks/use-debounced-dirty-check-XHSwAefL.js");require("./chunks/analyze-result-contract-B5Eeu7vD.js");require("react-dom");require("./chunks/index-DRlMUglg.js");const S=require("./chunks/normalize-dashboard-for-dirty-check-BXRUMVb2.js"),_=require("./chunks/x-B6ghREd2.js");function R(i){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const n in i)if(n!=="default"){const u=Object.getOwnPropertyDescriptor(i,n);Object.defineProperty(o,n,u.get?u:{enumerable:!0,get:()=>i[n]})}}return o.default=i,Object.freeze(o)}const h=R(C);function w(i){const{displayPreferences:o,cardId:n,...u}=i,s={...u,id:i.dashboardId};return t.jsx(e.ErrorBoundary,{FallbackComponent:e.Fallback,children:t.jsxs(e.SemaphorContextProvider,{dashboardProps:s,children:[t.jsx(e.SemaphorReadyIndicator,{componentType:"visual",componentId:i.cardId}),t.jsx(e.UXProvider,{appearance:i.appearance,children:t.jsx(e.DisplayPreferencesProvider,{displayPreferences:o,children:t.jsx(e.Container,{type:"visual",cardId:n,...s,children:t.jsx(j,{cardId:n})})})})]})})}function j({cardId:i}){const o=a.useDashboardStore(s=>{var c;return(c=s.dashboard)==null?void 0:c.sheets}),{card:n,frame:u}=C.useMemo(()=>{const s=o==null?void 0:o.flatMap(l=>l.frames),c=s==null?void 0:s.flatMap(l=>l==null?void 0:l.cards),D=c==null?void 0:c.find(l=>(l==null?void 0:l.id)===i),E=s==null?void 0:s.find(l=>{var p;return(p=l==null?void 0:l.cards)==null?void 0:p.find(g=>(g==null?void 0:g.id)===i)});return{card:D,frame:E}},[o,i]);return!n||!u?t.jsx(e.FallbackVisual,{error:new Error("Card not found"),resetErrorBoundary:()=>{},customerFacingMessage:`Card not found with ID: ${i}`}):t.jsx("main",{className:"flex h-full grow flex-col",children:t.jsx(e.ErrorBoundary,{FallbackComponent:({error:s,resetErrorBoundary:c})=>t.jsx(e.FallbackVisual,{error:s,resetErrorBoundary:c,customerFacingMessage:"Error creating visual. Please try again."}),children:t.jsx(e.DashboardCard,{card:n,frame:u})})})}function L(i,o,n,u){C.useEffect(()=>{i&&!n&&o&&u(e.cloneDeep(o))},[i,n,o,u])}function M({name:i,items:o,value:n,onChange:u,isLoading:s,isError:c,refetch:D,className:E,icon:l,showNone:p=!1}){const g=h.useRef(null),[b,T]=h.useState(!1),[B,A]=h.useState("100%"),x=p?[...o||[],{id:"none",name:"None"}]:o;h.useLayoutEffect(()=>{g.current&&A(g.current.offsetWidth)},[]);function v(){var f;return s?"Loading...":c?"Error":n?(f=o==null?void 0:o.find(m=>m.id===n))==null?void 0:f.name:`Select ${i}`}function F(f,m){u(m),T(!1)}return t.jsxs(a.Popover,{open:b,onOpenChange:T,children:[t.jsx(a.PopoverTrigger,{asChild:!0,children:t.jsxs(a.Button,{ref:g,variant:"outline",role:"combobox","aria-expanded":b,className:a.cn("flex h-9 w-full justify-between",E),children:[t.jsxs("div",{className:"flex items-center gap-2",children:[l&&t.jsx("div",{className:"mr-2",children:l}),t.jsx("span",{className:"max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap",children:v()})]}),t.jsx(_.ChevronDown,{className:"size-4 opacity-50"})]})}),t.jsx(a.PopoverContent,{className:"w-full p-0",style:{minWidth:B},children:t.jsxs(e.Command,{children:[t.jsxs("div",{className:"flex h-9 items-center justify-between border-b pr-1",children:[t.jsx(e.CommandInput,{className:"h-9",placeholder:"Search..."}),t.jsx(e.IconButton,{className:"h-7",onClick:D,children:t.jsx(e.RefreshCw,{className:a.cn("size-3.5 opacity-50",s&&"animate-spin")})})]}),t.jsxs(e.CommandList,{children:[t.jsxs(e.CommandEmpty,{children:["No ",i==null?void 0:i.toLowerCase()," found."]}),t.jsx(e.CommandGroup,{children:x==null?void 0:x.map(f=>t.jsx(e.CommandItem,{className:"overflow-x-auto",value:f.name,onSelect:m=>F(m,f.id),children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(a.Check,{className:a.cn("size-4",n===f.id?"opacity-100":"opacity-0")}),t.jsx("div",{title:f.name,children:f.name})]})},f.id))})]})]})})]})}function I(i,o){C.useEffect(()=>(i&&o&&(window.__SEMAPHOR_PRINT_STATE__={...o}),()=>{i&&window.__SEMAPHOR_PRINT_STATE__&&delete window.__SEMAPHOR_PRINT_STATE__}),[i,o])}exports.CardSummary=e.CardSummary;exports.Dashboard=e.Dashboard;exports.DashboardCreateDialogBase=e.DashboardCreateDialogBase;exports.DashboardExportDialog=e.DashboardExportDialog;exports.DashboardWC=e.DashboardWC;exports.ExportError=e.ExportError;exports.MatrixTableVisual=e.MatrixTableVisual;exports.ResourceType=e.ResourceType;exports.SemaphorContextProvider=e.SemaphorContextProvider;exports.SemaphorDataProvider=e.SemaphorQueryClient;exports.SemaphorQueryClient=e.SemaphorQueryClient;exports.ShareDialog=e.ShareDialog;exports.SummaryCard=e.SummaryCard;exports.Surfboard=e.DashboardPlus;exports.cancelExport=e.cancelExport;exports.cloneDeep=e.cloneDeep;exports.createExport=e.createExport;exports.downloadDocumentPdf=e.downloadDocumentPdf;exports.downloadPdf=e.downloadPdf;exports.formatFileSize=e.formatFileSize;exports.getDownloadUrl=e.getDownloadUrl;exports.getExportStatus=e.getExportStatus;exports.getExports=e.getExports;exports.isExportComplete=e.isExportComplete;exports.isExportInProgress=e.isExportInProgress;exports.useActiveExports=e.useActiveExports;exports.useAddNewFrame=e.useAddNewFrame;exports.useCard=e.useCard;exports.useCardSummary=e.useCardSummary;exports.useDashboardById=e.useDashboardById;exports.useDashboardQuery=e.useDashboardQuery;exports.useDashboardSummary=e.useDashboardSummary;exports.useDataColumns=e.useDataColumns;exports.useDateFilterHook=e.useDateFilterHook;exports.useEditorAside=e.useEditorAside;exports.useExportActions=e.useExportActions;exports.useExportStore=e.useExportStore;exports.useInProgressExportsCount=e.useInProgressExportsCount;exports.useManagementStore=e.useManagementStore;exports.useResourceManagement=e.useResourceManagement;exports.useTextFilterHook=e.useTextFilterHook;exports.CALCULATED_FIELD_ENTITY_MARKER=d.CALCULATED_FIELD_ENTITY_MARKER;exports.CONTROL_CARD_DEFAULT_VALUE=d.CONTROL_CARD_DEFAULT_VALUE;exports.DATE_FORMAT_VALUES=d.DATE_FORMAT_VALUES;exports.EMPTY_SELECTION=d.EMPTY_SELECTION;exports.PivotMarkerEnum=d.PivotMarkerEnum;exports.getFieldRuntimeColumnName=d.getFieldRuntimeColumnName;exports.hasCalculatedFieldMarker=d.hasCalculatedFieldMarker;exports.hasCalculatedFormulaInputs=d.hasCalculatedFormulaInputs;exports.isCalculatedDimension=d.isCalculatedDimension;exports.isCalculatedField=d.isCalculatedField;exports.isCalculatedMetric=d.isCalculatedMetric;exports.CalendarPreferencesDialog=N.CalendarPreferencesDialog;exports.createEmptyKpiConfig=a.createEmptyKpiConfig;exports.createSqlGenConfig=a.createSqlGenConfig;exports.emitDashboardLoad=a.emitDashboardLoad;exports.emitDashboardUnload=a.emitDashboardUnload;exports.fmt=a.fmt;exports.getColumnDataType=a.getColumnDataType;exports.getFilterValueType=a.getFilterValueType;exports.getFormattedTableNameForQuery=a.getFormattedTableNameForQuery;exports.getQualifiedTableName=a.getQualifiedTableName;exports.getSql=a.getSql;exports.invalidateToken=a.invalidateToken;exports.isBooleanDataType=a.isBooleanDataType;exports.isColumnInSqlGen=a.isColumnInSqlGen;exports.isDateDataType=a.isDateDataType;exports.isNumberDataType=a.isNumberDataType;exports.isTextDataType=a.isTextDataType;exports.resolveDataType=a.resolveDataType;exports.resolveDatamodelName=a.resolveDatamodelName;exports.useCurrentActiveCard=a.useCurrentActiveCard;exports.useCurrentCardConfig=a.useCurrentCardConfig;exports.useCurrentSheetActiveCards=a.useCurrentSheetActiveCards;exports.useDashboardActions=a.useDashboardActions;exports.useDashboardStore=a.useDashboardStore;exports.useEditorActions=a.useEditorActions;exports.useEditorStore=a.useEditorStore;exports.DEFAULT_CALENDAR_CONTEXT=y.DEFAULT_CALENDAR_CONTEXT;exports.DEFAULT_SEMANTIC_DOMAIN_ACCESS=y.DEFAULT_SEMANTIC_DOMAIN_ACCESS;exports.AdvancedModeToggle=r.AdvancedModeToggle;exports.BriefingAuthor=r.BriefingAuthor;exports.BriefingsApiError=r.BriefingsApiError;exports.DashboardBriefingLauncher=r.DashboardBriefingLauncher;exports.DashboardControlsSettings=r.DashboardControlsSettings;exports.DashboardFilterControlsButton=r.DashboardFilterControlsButton;exports.DashboardFilterControlsLauncher=r.DashboardFilterControlsLauncher;exports.DocumentControlsSettings=r.DocumentControlsSettings;exports.ExportNotificationItem=r.ExportNotificationItem;exports.ExportNotificationList=r.ExportNotificationList;exports.NotificationBell=r.NotificationBell;exports.UnsavedChangesAlert=r.UnsavedChangesAlert;exports.VisualEditingControls=r.VisualEditingControls;exports.VisualsLibraryDialog=r.VisualsLibraryDialog;exports.WatchDashboardButton=r.WatchDashboardButton;exports.applyBriefingFormPatch=r.applyBriefingFormPatch;exports.briefingFormDraftToCreateRequest=r.briefingFormDraftToCreateRequest;exports.briefingFormDraftToUpdateRequest=r.briefingFormDraftToUpdateRequest;exports.briefingToFormDraft=r.briefingToFormDraft;exports.cancelBriefingPreviewRun=r.cancelBriefingPreviewRun;exports.cancelBriefingRun=r.cancelBriefingRun;exports.createBriefing=r.createBriefing;exports.createBriefingFormDraft=r.createBriefingFormDraft;exports.deleteBriefing=r.deleteBriefing;exports.deleteBriefingRun=r.deleteBriefingRun;exports.getBriefing=r.getBriefing;exports.getBriefingArtifact=r.getBriefingArtifact;exports.getBriefingEvidence=r.getBriefingEvidence;exports.getBriefingPreviewRun=r.getBriefingPreviewRun;exports.getBriefingRun=r.getBriefingRun;exports.listBriefingRuns=r.listBriefingRuns;exports.listBriefingTenantSummaries=r.listBriefingTenantSummaries;exports.listBriefings=r.listBriefings;exports.pauseBriefing=r.pauseBriefing;exports.polishBriefingText=r.polishBriefingText;exports.previewBriefingPlan=r.previewBriefingPlan;exports.resumeBriefing=r.resumeBriefing;exports.runBriefingNow=r.runBriefingNow;exports.runBriefingPreview=r.runBriefingPreview;exports.updateBriefing=r.updateBriefing;exports.useExportPolling=r.useExportPolling;exports.useExportRecovery=r.useExportRecovery;exports.validateBriefingFormDraft=r.validateBriefingFormDraft;exports.useDebouncedDirtyCheck=P.useDebouncedDirtyCheck;exports.normalizeDashboardForDirtyCheck=S.normalizeDashboardForDirtyCheck;exports.serializeDashboardForDirtyCheck=S.serializeDashboardForDirtyCheck;exports.Combobox=M;exports.Visual=w;exports.useExposePrintState=I;exports.usePristineSnapshotInitializer=L;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-BPM3gDRw.js"),d=require("./chunks/common-types-C73-Ud1-.js"),P=require("./chunks/calendar-preferences-dialog-CTmeASaM.js"),i=require("react/jsx-runtime"),r=require("./chunks/switch-DMT7qf_R.js"),h=require("react"),B=require("./types/index.cjs"),l=require("./chunks/dashboard-briefing-launcher-S2akO-ub.js"),N=require("./chunks/use-debounced-dirty-check-XHSwAefL.js");require("./chunks/analyze-result-contract-DpDcImgk.js");require("react-dom");require("./chunks/index-DRlMUglg.js");const y=require("./chunks/normalize-dashboard-for-dirty-check-BXRUMVb2.js"),_=require("./chunks/x-B6ghREd2.js");function R(a){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const o in a)if(o!=="default"){const u=Object.getOwnPropertyDescriptor(a,o);Object.defineProperty(t,o,u.get?u:{enumerable:!0,get:()=>a[o]})}}return t.default=a,Object.freeze(t)}const C=R(h);function w(a){const{displayPreferences:t,cardId:o,...u}=a,n={...u,id:a.dashboardId};return i.jsx(e.ErrorBoundary,{FallbackComponent:e.Fallback,children:i.jsxs(e.SemaphorContextProvider,{dashboardProps:n,children:[i.jsx(e.SemaphorReadyIndicator,{componentType:"visual",componentId:a.cardId}),i.jsx(e.UXProvider,{appearance:a.appearance,children:i.jsx(e.DisplayPreferencesProvider,{displayPreferences:t,children:i.jsx(e.Container,{type:"visual",cardId:o,...n,children:i.jsx(j,{cardId:o})})})})]})})}function j({cardId:a}){const t=r.useDashboardStore(n=>{var c;return(c=n.dashboard)==null?void 0:c.sheets}),{card:o,frame:u}=h.useMemo(()=>{const n=t==null?void 0:t.flatMap(s=>s.frames),c=n==null?void 0:n.flatMap(s=>s==null?void 0:s.cards),D=c==null?void 0:c.find(s=>(s==null?void 0:s.id)===a),E=n==null?void 0:n.find(s=>{var m;return(m=s==null?void 0:s.cards)==null?void 0:m.find(g=>(g==null?void 0:g.id)===a)});return{card:D,frame:E}},[t,a]);return!o||!u?i.jsx(e.FallbackVisual,{error:new Error("Card not found"),resetErrorBoundary:()=>{},customerFacingMessage:`Card not found with ID: ${a}`}):i.jsx("main",{className:"flex h-full grow flex-col",children:i.jsx(e.ErrorBoundary,{FallbackComponent:({error:n,resetErrorBoundary:c})=>i.jsx(e.FallbackVisual,{error:n,resetErrorBoundary:c,customerFacingMessage:"Error creating visual. Please try again."}),children:i.jsx(e.DashboardCard,{card:o,frame:u})})})}function L(a,t,o,u){h.useEffect(()=>{a&&!o&&t&&u(e.cloneDeep(t))},[a,o,t,u])}function M({name:a,items:t,value:o,onChange:u,isLoading:n,isError:c,refetch:D,className:E,icon:s,showNone:m=!1}){const g=C.useRef(null),[b,T]=C.useState(!1),[S,A]=C.useState("100%"),x=m?[...t||[],{id:"none",name:"None"}]:t;C.useLayoutEffect(()=>{g.current&&A(g.current.offsetWidth)},[]);function v(){var f;return n?"Loading...":c?"Error":o?(f=t==null?void 0:t.find(p=>p.id===o))==null?void 0:f.name:`Select ${a}`}function F(f,p){u(p),T(!1)}return i.jsxs(r.Popover,{open:b,onOpenChange:T,children:[i.jsx(r.PopoverTrigger,{asChild:!0,children:i.jsxs(r.Button,{ref:g,variant:"outline",role:"combobox","aria-expanded":b,className:r.cn("flex h-9 w-full justify-between",E),children:[i.jsxs("div",{className:"flex items-center gap-2",children:[s&&i.jsx("div",{className:"mr-2",children:s}),i.jsx("span",{className:"max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap",children:v()})]}),i.jsx(_.ChevronDown,{className:"size-4 opacity-50"})]})}),i.jsx(r.PopoverContent,{className:"w-full p-0",style:{minWidth:S},children:i.jsxs(e.Command,{children:[i.jsxs("div",{className:"flex h-9 items-center justify-between border-b pr-1",children:[i.jsx(e.CommandInput,{className:"h-9",placeholder:"Search..."}),i.jsx(e.IconButton,{className:"h-7",onClick:D,children:i.jsx(e.RefreshCw,{className:r.cn("size-3.5 opacity-50",n&&"animate-spin")})})]}),i.jsxs(e.CommandList,{children:[i.jsxs(e.CommandEmpty,{children:["No ",a==null?void 0:a.toLowerCase()," found."]}),i.jsx(e.CommandGroup,{children:x==null?void 0:x.map(f=>i.jsx(e.CommandItem,{className:"overflow-x-auto",value:f.name,onSelect:p=>F(p,f.id),children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(r.Check,{className:r.cn("size-4",o===f.id?"opacity-100":"opacity-0")}),i.jsx("div",{title:f.name,children:f.name})]})},f.id))})]})]})})]})}function I(a,t){h.useEffect(()=>(a&&t&&(window.__SEMAPHOR_PRINT_STATE__={...t}),()=>{a&&window.__SEMAPHOR_PRINT_STATE__&&delete window.__SEMAPHOR_PRINT_STATE__}),[a,t])}exports.BriefingAuthor=e.BriefingAuthor;exports.BriefingAuthorDialog=e.BriefingAuthorDialog;exports.BriefingUiCapabilitiesBoundary=e.BriefingUiCapabilitiesBoundary;exports.BriefingUiCapabilitiesProvider=e.BriefingUiCapabilitiesProvider;exports.BriefingsApiError=e.BriefingsApiError;exports.CardSummary=e.CardSummary;exports.Dashboard=e.Dashboard;exports.DashboardCreateDialogBase=e.DashboardCreateDialogBase;exports.DashboardExportDialog=e.DashboardExportDialog;exports.DashboardWC=e.DashboardWC;exports.ExportError=e.ExportError;exports.MatrixTableVisual=e.MatrixTableVisual;exports.ResourceType=e.ResourceType;exports.SemaphorContextProvider=e.SemaphorContextProvider;exports.SemaphorDataProvider=e.SemaphorQueryClient;exports.SemaphorQueryClient=e.SemaphorQueryClient;exports.ShareDialog=e.ShareDialog;exports.SummaryCard=e.SummaryCard;exports.Surfboard=e.DashboardPlus;exports.applyBriefingFormPatch=e.applyBriefingFormPatch;exports.briefingFormDraftToCreateRequest=e.briefingFormDraftToCreateRequest;exports.briefingFormDraftToUpdateRequest=e.briefingFormDraftToUpdateRequest;exports.briefingToFormDraft=e.briefingToFormDraft;exports.cancelBriefingPreviewRun=e.cancelBriefingPreviewRun;exports.cancelBriefingRun=e.cancelBriefingRun;exports.cancelExport=e.cancelExport;exports.cloneDeep=e.cloneDeep;exports.createBriefing=e.createBriefing;exports.createBriefingFormDraft=e.createBriefingFormDraft;exports.createExport=e.createExport;exports.deleteBriefing=e.deleteBriefing;exports.deleteBriefingRun=e.deleteBriefingRun;exports.downloadDocumentPdf=e.downloadDocumentPdf;exports.downloadPdf=e.downloadPdf;exports.formatFileSize=e.formatFileSize;exports.getBriefing=e.getBriefing;exports.getBriefingArtifact=e.getBriefingArtifact;exports.getBriefingEvidence=e.getBriefingEvidence;exports.getBriefingPreviewRun=e.getBriefingPreviewRun;exports.getBriefingRun=e.getBriefingRun;exports.getDownloadUrl=e.getDownloadUrl;exports.getExportStatus=e.getExportStatus;exports.getExports=e.getExports;exports.isExportComplete=e.isExportComplete;exports.isExportInProgress=e.isExportInProgress;exports.listBriefingRuns=e.listBriefingRuns;exports.listBriefingTenantSummaries=e.listBriefingTenantSummaries;exports.listBriefings=e.listBriefings;exports.pauseBriefing=e.pauseBriefing;exports.polishBriefingText=e.polishBriefingText;exports.previewBriefingPlan=e.previewBriefingPlan;exports.resumeBriefing=e.resumeBriefing;exports.runBriefingNow=e.runBriefingNow;exports.runBriefingPreview=e.runBriefingPreview;exports.updateBriefing=e.updateBriefing;exports.useActiveExports=e.useActiveExports;exports.useAddNewFrame=e.useAddNewFrame;exports.useBriefingUiCapabilities=e.useBriefingUiCapabilities;exports.useCard=e.useCard;exports.useCardSummary=e.useCardSummary;exports.useDashboardById=e.useDashboardById;exports.useDashboardQuery=e.useDashboardQuery;exports.useDashboardSummary=e.useDashboardSummary;exports.useDataColumns=e.useDataColumns;exports.useDateFilterHook=e.useDateFilterHook;exports.useEditorAside=e.useEditorAside;exports.useExportActions=e.useExportActions;exports.useExportStore=e.useExportStore;exports.useInProgressExportsCount=e.useInProgressExportsCount;exports.useManagementStore=e.useManagementStore;exports.useResourceManagement=e.useResourceManagement;exports.useTextFilterHook=e.useTextFilterHook;exports.validateBriefingFormDraft=e.validateBriefingFormDraft;exports.CALCULATED_FIELD_ENTITY_MARKER=d.CALCULATED_FIELD_ENTITY_MARKER;exports.CONTROL_CARD_DEFAULT_VALUE=d.CONTROL_CARD_DEFAULT_VALUE;exports.DATE_FORMAT_VALUES=d.DATE_FORMAT_VALUES;exports.EMPTY_SELECTION=d.EMPTY_SELECTION;exports.PivotMarkerEnum=d.PivotMarkerEnum;exports.getFieldRuntimeColumnName=d.getFieldRuntimeColumnName;exports.hasCalculatedFieldMarker=d.hasCalculatedFieldMarker;exports.hasCalculatedFormulaInputs=d.hasCalculatedFormulaInputs;exports.isCalculatedDimension=d.isCalculatedDimension;exports.isCalculatedField=d.isCalculatedField;exports.isCalculatedMetric=d.isCalculatedMetric;exports.CalendarPreferencesDialog=P.CalendarPreferencesDialog;exports.createEmptyKpiConfig=r.createEmptyKpiConfig;exports.createSqlGenConfig=r.createSqlGenConfig;exports.emitDashboardLoad=r.emitDashboardLoad;exports.emitDashboardUnload=r.emitDashboardUnload;exports.fmt=r.fmt;exports.getColumnDataType=r.getColumnDataType;exports.getFilterValueType=r.getFilterValueType;exports.getFormattedTableNameForQuery=r.getFormattedTableNameForQuery;exports.getQualifiedTableName=r.getQualifiedTableName;exports.getSql=r.getSql;exports.invalidateToken=r.invalidateToken;exports.isBooleanDataType=r.isBooleanDataType;exports.isColumnInSqlGen=r.isColumnInSqlGen;exports.isDateDataType=r.isDateDataType;exports.isNumberDataType=r.isNumberDataType;exports.isTextDataType=r.isTextDataType;exports.resolveDataType=r.resolveDataType;exports.resolveDatamodelName=r.resolveDatamodelName;exports.useCurrentActiveCard=r.useCurrentActiveCard;exports.useCurrentCardConfig=r.useCurrentCardConfig;exports.useCurrentSheetActiveCards=r.useCurrentSheetActiveCards;exports.useDashboardActions=r.useDashboardActions;exports.useDashboardStore=r.useDashboardStore;exports.useEditorActions=r.useEditorActions;exports.useEditorStore=r.useEditorStore;exports.DEFAULT_CALENDAR_CONTEXT=B.DEFAULT_CALENDAR_CONTEXT;exports.DEFAULT_SEMANTIC_DOMAIN_ACCESS=B.DEFAULT_SEMANTIC_DOMAIN_ACCESS;exports.AdvancedModeToggle=l.AdvancedModeToggle;exports.DashboardBriefingLauncher=l.DashboardBriefingLauncher;exports.DashboardControlsSettings=l.DashboardControlsSettings;exports.DashboardFilterControlsButton=l.DashboardFilterControlsButton;exports.DashboardFilterControlsLauncher=l.DashboardFilterControlsLauncher;exports.DocumentControlsSettings=l.DocumentControlsSettings;exports.ExportNotificationItem=l.ExportNotificationItem;exports.ExportNotificationList=l.ExportNotificationList;exports.NotificationBell=l.NotificationBell;exports.UnsavedChangesAlert=l.UnsavedChangesAlert;exports.VisualEditingControls=l.VisualEditingControls;exports.VisualsLibraryDialog=l.VisualsLibraryDialog;exports.WatchDashboardButton=l.WatchDashboardButton;exports.useExportPolling=l.useExportPolling;exports.useExportRecovery=l.useExportRecovery;exports.useDebouncedDirtyCheck=N.useDebouncedDirtyCheck;exports.normalizeDashboardForDirtyCheck=y.normalizeDashboardForDirtyCheck;exports.serializeDashboardForDirtyCheck=y.serializeDashboardForDirtyCheck;exports.Combobox=M;exports.Visual=w;exports.useExposePrintState=I;exports.usePristineSnapshotInitializer=L;
package/dist/index.js CHANGED
@@ -1,37 +1,37 @@
1
- import { E as T, F as N, S, q as P, U as w, r as _, s as F, t as x, v as R, w as M, h as I, i as L, I as k, x as U, j as O, k as V, l as z, m as q } from "./chunks/index-CH2ZzQo4.js";
2
- import { X as fa, D as ma, V as pa, T as ha, O as ga, aa as Ca, M as Da, A as Ea, H as xa, H as Ta, J as ba, W as ya, a as va, a9 as Ba, a5 as Aa, Q as Na, P as Sa, ad as Pa, a8 as wa, a7 as _a, a6 as Fa, ac as Ra, ab as Ma, a2 as Ia, $ as La, N as ka, Z as Ua, L as Oa, z as Va, Y as za, _ as qa, B as Ha, a4 as Wa, a1 as ja, a0 as Ga, a3 as Qa, y as Ka, K as Xa, G as Ya } from "./chunks/index-CH2ZzQo4.js";
3
- import { a as Ja, C as Za, D as ae, E as ee, P as se, g as re, d as oe, h as te, b as ie, c as ne, i as le } from "./chunks/common-types-4bjoIgvm.js";
4
- import { C as ue } from "./chunks/calendar-preferences-dialog-cN3_2C-u.js";
1
+ import { E as b, F as N, S, q as P, U as w, r as _, s as F, t as x, v as R, w as I, h as M, i as L, I as k, x as U, j as O, k as V, l as z, m as q } from "./chunks/index-yHe0SeLO.js";
2
+ import { aw as fa, ax as ma, ay as pa, az as ha, a5 as ga, X as Ca, D as Da, V as Ea, T as xa, O as ba, aG as Ta, M as ya, A as Ba, H as va, H as Aa, J as Na, W as Sa, a as Pa, ar as wa, at as _a, au as Fa, as as Ra, ai as Ia, al as Ma, aF as La, a9 as ka, aq as Ua, aB as Oa, ad as Va, am as za, Q as qa, P as Ha, aJ as Wa, a8 as ja, an as Ga, ao as Qa, ah as Ka, ak as Xa, aE as Ya, aD as $a, aC as Ja, aI as Za, aH as ae, aj as ee, a7 as se, a6 as re, ab as oe, ap as ie, af as te, ac as ne, ae as le, ag as de, aa as ue, a2 as ce, $ as fe, aA as me, N as pe, Z as he, L as ge, z as Ce, Y as De, _ as Ee, B as xe, a4 as be, a1 as Te, a0 as ye, a3 as Be, y as ve, K as Ae, G as Ne, av as Se } from "./chunks/index-yHe0SeLO.js";
3
+ import { a as we, C as _e, D as Fe, E as Re, P as Ie, g as Me, d as Le, h as ke, b as Ue, c as Oe, i as Ve } from "./chunks/common-types-4bjoIgvm.js";
4
+ import { C as qe } from "./chunks/calendar-preferences-dialog-t5ET6MON.js";
5
5
  import { jsx as a, jsxs as d } from "react/jsx-runtime";
6
- import { u as H, P as W, a as j, B as G, c as C, b as Q, d as K } from "./chunks/switch-TbCsyhv9.js";
7
- import { D as fe, o as me, f as pe, g as he, h as ge, q as Ce, p as De, t as Ee, v as xe, n as Te, i as be, m as ye, r as ve, l as Be, k as Ae, j as Ne, w as Se, s as Pe, x as we, z as _e, y as Fe, A as Re, F as Me, E as Ie } from "./chunks/switch-TbCsyhv9.js";
6
+ import { u as H, P as W, a as j, B as G, c as C, b as Q, d as K } from "./chunks/switch-2bh3Hka1.js";
7
+ import { D as We, o as je, f as Ge, g as Qe, h as Ke, q as Xe, p as Ye, t as $e, v as Je, n as Ze, i as as, m as es, r as ss, l as rs, k as os, j as is, w as ts, s as ns, x as ls, z as ds, y as us, A as cs, F as fs, E as ms } from "./chunks/switch-2bh3Hka1.js";
8
8
  import * as m from "react";
9
- import { useMemo as X, useEffect as b } from "react";
10
- import { DEFAULT_CALENDAR_CONTEXT as ke, DEFAULT_SEMANTIC_DOMAIN_ACCESS as Ue } from "./types/index.js";
11
- import { A as Ve, L as ze, B as qe, M as He, D as We, e as je, f as Ge, d as Qe, b as Ke, E as Xe, N as Ye, U as $e, a as Je, V as Ze, W as as, G as es, I as ss, J as rs, H as os, s as ts, w as is, i as ns, F as ls, k as ds, x as us, h as cs, y as fs, z as ms, q as ps, v as hs, t as gs, g as Cs, l as Ds, p as Es, C as xs, n as Ts, r as bs, m as ys, o as vs, j as Bs, u as As, c as Ns, K as Ss } from "./chunks/dashboard-briefing-launcher-BYTBNetR.js";
12
- import { u as ws } from "./chunks/use-debounced-dirty-check-BwAbnX_5.js";
13
- import "./chunks/analyze-result-contract-sWcmvBOA.js";
9
+ import { useMemo as X, useEffect as T } from "react";
10
+ import { DEFAULT_CALENDAR_CONTEXT as hs, DEFAULT_SEMANTIC_DOMAIN_ACCESS as gs } from "./types/index.js";
11
+ import { A as Ds, g as Es, D as xs, e as bs, f as Ts, d as ys, b as Bs, E as vs, N as As, U as Ns, a as Ss, V as Ps, W as ws, u as _s, c as Fs } from "./chunks/dashboard-briefing-launcher-Cavd0QJb.js";
12
+ import { u as Is } from "./chunks/use-debounced-dirty-check-BwAbnX_5.js";
13
+ import "./chunks/analyze-result-contract-D7pjjYPy.js";
14
14
  import "react-dom";
15
15
  import "./chunks/index-CJdxSyQq.js";
16
- import { n as Fs, s as Rs } from "./chunks/normalize-dashboard-for-dirty-check-5KpZN8xr.js";
16
+ import { n as Ls, s as ks } from "./chunks/normalize-dashboard-for-dirty-check-5KpZN8xr.js";
17
17
  import { C as Y } from "./chunks/x-CXDkqdur.js";
18
- function ia(e) {
19
- const { displayPreferences: s, cardId: t, ...l } = e, r = {
18
+ function ta(e) {
19
+ const { displayPreferences: s, cardId: i, ...l } = e, r = {
20
20
  ...l,
21
21
  id: e.dashboardId
22
22
  // override the id to the dashboard id so that the dashboard is not loaded
23
23
  };
24
- return /* @__PURE__ */ a(T, { FallbackComponent: N, children: /* @__PURE__ */ d(S, { dashboardProps: r, children: [
24
+ return /* @__PURE__ */ a(b, { FallbackComponent: N, children: /* @__PURE__ */ d(S, { dashboardProps: r, children: [
25
25
  /* @__PURE__ */ a(P, { componentType: "visual", componentId: e.cardId }),
26
- /* @__PURE__ */ a(w, { appearance: e.appearance, children: /* @__PURE__ */ a(_, { displayPreferences: s, children: /* @__PURE__ */ a(F, { type: "visual", cardId: t, ...r, children: /* @__PURE__ */ a($, { cardId: t }) }) }) })
26
+ /* @__PURE__ */ a(w, { appearance: e.appearance, children: /* @__PURE__ */ a(_, { displayPreferences: s, children: /* @__PURE__ */ a(F, { type: "visual", cardId: i, ...r, children: /* @__PURE__ */ a($, { cardId: i }) }) }) })
27
27
  ] }) });
28
28
  }
29
29
  function $({ cardId: e }) {
30
30
  const s = H((r) => {
31
- var i;
32
- return (i = r.dashboard) == null ? void 0 : i.sheets;
33
- }), { card: t, frame: l } = X(() => {
34
- const r = s == null ? void 0 : s.flatMap((o) => o.frames), i = r == null ? void 0 : r.flatMap((o) => o == null ? void 0 : o.cards), p = i == null ? void 0 : i.find((o) => (o == null ? void 0 : o.id) === e), h = r == null ? void 0 : r.find(
31
+ var t;
32
+ return (t = r.dashboard) == null ? void 0 : t.sheets;
33
+ }), { card: i, frame: l } = X(() => {
34
+ const r = s == null ? void 0 : s.flatMap((o) => o.frames), t = r == null ? void 0 : r.flatMap((o) => o == null ? void 0 : o.cards), p = t == null ? void 0 : t.find((o) => (o == null ? void 0 : o.id) === e), h = r == null ? void 0 : r.find(
35
35
  (o) => {
36
36
  var f;
37
37
  return (f = o == null ? void 0 : o.cards) == null ? void 0 : f.find((u) => (u == null ? void 0 : u.id) === e);
@@ -39,7 +39,7 @@ function $({ cardId: e }) {
39
39
  );
40
40
  return { card: p, frame: h };
41
41
  }, [s, e]);
42
- return !t || !l ? /* @__PURE__ */ a(
42
+ return !i || !l ? /* @__PURE__ */ a(
43
43
  x,
44
44
  {
45
45
  error: new Error("Card not found"),
@@ -48,47 +48,47 @@ function $({ cardId: e }) {
48
48
  customerFacingMessage: `Card not found with ID: ${e}`
49
49
  }
50
50
  ) : /* @__PURE__ */ a("main", { className: "flex h-full grow flex-col", children: /* @__PURE__ */ a(
51
- T,
51
+ b,
52
52
  {
53
53
  FallbackComponent: ({
54
54
  error: r,
55
- resetErrorBoundary: i
55
+ resetErrorBoundary: t
56
56
  }) => /* @__PURE__ */ a(
57
57
  x,
58
58
  {
59
59
  error: r,
60
- resetErrorBoundary: i,
60
+ resetErrorBoundary: t,
61
61
  customerFacingMessage: "Error creating visual. Please try again."
62
62
  }
63
63
  ),
64
- children: /* @__PURE__ */ a(R, { card: t, frame: l })
64
+ children: /* @__PURE__ */ a(R, { card: i, frame: l })
65
65
  }
66
66
  ) });
67
67
  }
68
- function na(e, s, t, l) {
69
- b(() => {
70
- e && !t && s && l(M(s));
71
- }, [e, t, s, l]);
68
+ function na(e, s, i, l) {
69
+ T(() => {
70
+ e && !i && s && l(I(s));
71
+ }, [e, i, s, l]);
72
72
  }
73
73
  function la({
74
74
  name: e,
75
75
  items: s,
76
- value: t,
76
+ value: i,
77
77
  onChange: l,
78
78
  isLoading: r,
79
- isError: i,
79
+ isError: t,
80
80
  refetch: p,
81
81
  className: h,
82
82
  icon: o,
83
83
  showNone: f = !1
84
84
  }) {
85
- const u = m.useRef(null), [D, E] = m.useState(!1), [y, v] = m.useState("100%"), g = f ? [...s || [], { id: "none", name: "None" }] : s;
85
+ const u = m.useRef(null), [D, E] = m.useState(!1), [y, B] = m.useState("100%"), g = f ? [...s || [], { id: "none", name: "None" }] : s;
86
86
  m.useLayoutEffect(() => {
87
- u.current && v(u.current.offsetWidth);
87
+ u.current && B(u.current.offsetWidth);
88
88
  }, []);
89
- function B() {
89
+ function v() {
90
90
  var n;
91
- return r ? "Loading..." : i ? "Error" : t ? (n = s == null ? void 0 : s.find((c) => c.id === t)) == null ? void 0 : n.name : `Select ${e}`;
91
+ return r ? "Loading..." : t ? "Error" : i ? (n = s == null ? void 0 : s.find((c) => c.id === i)) == null ? void 0 : n.name : `Select ${e}`;
92
92
  }
93
93
  function A(n, c) {
94
94
  l(c), E(!1);
@@ -105,7 +105,7 @@ function la({
105
105
  children: [
106
106
  /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
107
107
  o && /* @__PURE__ */ a("div", { className: "mr-2", children: o }),
108
- /* @__PURE__ */ a("span", { className: "max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap", children: B() })
108
+ /* @__PURE__ */ a("span", { className: "max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap", children: v() })
109
109
  ] }),
110
110
  /* @__PURE__ */ a(Y, { className: "size-4 opacity-50" })
111
111
  ]
@@ -116,7 +116,7 @@ function la({
116
116
  {
117
117
  className: "w-full p-0",
118
118
  style: { minWidth: y },
119
- children: /* @__PURE__ */ d(I, { children: [
119
+ children: /* @__PURE__ */ d(M, { children: [
120
120
  /* @__PURE__ */ d("div", { className: "flex h-9 items-center justify-between border-b pr-1", children: [
121
121
  /* @__PURE__ */ a(L, { className: "h-9", placeholder: "Search..." }),
122
122
  /* @__PURE__ */ a(k, { className: "h-7", onClick: p, children: /* @__PURE__ */ a(
@@ -147,7 +147,7 @@ function la({
147
147
  {
148
148
  className: C(
149
149
  "size-4",
150
- t === n.id ? "opacity-100" : "opacity-0"
150
+ i === n.id ? "opacity-100" : "opacity-0"
151
151
  )
152
152
  }
153
153
  ),
@@ -163,141 +163,145 @@ function la({
163
163
  ] });
164
164
  }
165
165
  function da(e, s) {
166
- b(() => (e && s && (window.__SEMAPHOR_PRINT_STATE__ = {
166
+ T(() => (e && s && (window.__SEMAPHOR_PRINT_STATE__ = {
167
167
  ...s
168
168
  }), () => {
169
169
  e && window.__SEMAPHOR_PRINT_STATE__ && delete window.__SEMAPHOR_PRINT_STATE__;
170
170
  }), [e, s]);
171
171
  }
172
172
  export {
173
- Ve as AdvancedModeToggle,
174
- ze as BriefingAuthor,
175
- qe as BriefingsApiError,
176
- Ja as CALCULATED_FIELD_ENTITY_MARKER,
177
- Za as CONTROL_CARD_DEFAULT_VALUE,
178
- ue as CalendarPreferencesDialog,
179
- fa as CardSummary,
173
+ Ds as AdvancedModeToggle,
174
+ fa as BriefingAuthor,
175
+ ma as BriefingAuthorDialog,
176
+ pa as BriefingUiCapabilitiesBoundary,
177
+ ha as BriefingUiCapabilitiesProvider,
178
+ ga as BriefingsApiError,
179
+ we as CALCULATED_FIELD_ENTITY_MARKER,
180
+ _e as CONTROL_CARD_DEFAULT_VALUE,
181
+ qe as CalendarPreferencesDialog,
182
+ Ca as CardSummary,
180
183
  la as Combobox,
181
- ae as DATE_FORMAT_VALUES,
182
- ke as DEFAULT_CALENDAR_CONTEXT,
183
- Ue as DEFAULT_SEMANTIC_DOMAIN_ACCESS,
184
- ma as Dashboard,
185
- He as DashboardBriefingLauncher,
186
- We as DashboardControlsSettings,
187
- pa as DashboardCreateDialogBase,
188
- ha as DashboardExportDialog,
189
- je as DashboardFilterControlsButton,
190
- Ge as DashboardFilterControlsLauncher,
191
- ga as DashboardWC,
192
- Qe as DocumentControlsSettings,
193
- ee as EMPTY_SELECTION,
194
- Ca as ExportError,
195
- Ke as ExportNotificationItem,
196
- Xe as ExportNotificationList,
197
- Da as MatrixTableVisual,
198
- Ye as NotificationBell,
199
- se as PivotMarkerEnum,
200
- Ea as ResourceType,
184
+ Fe as DATE_FORMAT_VALUES,
185
+ hs as DEFAULT_CALENDAR_CONTEXT,
186
+ gs as DEFAULT_SEMANTIC_DOMAIN_ACCESS,
187
+ Da as Dashboard,
188
+ Es as DashboardBriefingLauncher,
189
+ xs as DashboardControlsSettings,
190
+ Ea as DashboardCreateDialogBase,
191
+ xa as DashboardExportDialog,
192
+ bs as DashboardFilterControlsButton,
193
+ Ts as DashboardFilterControlsLauncher,
194
+ ba as DashboardWC,
195
+ ys as DocumentControlsSettings,
196
+ Re as EMPTY_SELECTION,
197
+ Ta as ExportError,
198
+ Bs as ExportNotificationItem,
199
+ vs as ExportNotificationList,
200
+ ya as MatrixTableVisual,
201
+ As as NotificationBell,
202
+ Ie as PivotMarkerEnum,
203
+ Ba as ResourceType,
201
204
  S as SemaphorContextProvider,
202
- xa as SemaphorDataProvider,
203
- Ta as SemaphorQueryClient,
204
- ba as ShareDialog,
205
- ya as SummaryCard,
206
- va as Surfboard,
207
- $e as UnsavedChangesAlert,
208
- ia as Visual,
209
- Je as VisualEditingControls,
210
- Ze as VisualsLibraryDialog,
211
- as as WatchDashboardButton,
212
- es as applyBriefingFormPatch,
213
- ss as briefingFormDraftToCreateRequest,
214
- rs as briefingFormDraftToUpdateRequest,
215
- os as briefingToFormDraft,
216
- ts as cancelBriefingPreviewRun,
217
- is as cancelBriefingRun,
218
- Ba as cancelExport,
219
- M as cloneDeep,
220
- ns as createBriefing,
221
- ls as createBriefingFormDraft,
222
- fe as createEmptyKpiConfig,
223
- Aa as createExport,
224
- me as createSqlGenConfig,
225
- ds as deleteBriefing,
226
- us as deleteBriefingRun,
227
- Na as downloadDocumentPdf,
228
- Sa as downloadPdf,
229
- pe as emitDashboardLoad,
230
- he as emitDashboardUnload,
231
- ge as fmt,
232
- Pa as formatFileSize,
233
- cs as getBriefing,
234
- fs as getBriefingArtifact,
235
- ms as getBriefingEvidence,
236
- ps as getBriefingPreviewRun,
237
- hs as getBriefingRun,
238
- Ce as getColumnDataType,
239
- wa as getDownloadUrl,
240
- _a as getExportStatus,
241
- Fa as getExports,
242
- re as getFieldRuntimeColumnName,
243
- De as getFilterValueType,
244
- Ee as getFormattedTableNameForQuery,
245
- xe as getQualifiedTableName,
246
- Te as getSql,
247
- oe as hasCalculatedFieldMarker,
248
- te as hasCalculatedFormulaInputs,
249
- be as invalidateToken,
250
- ye as isBooleanDataType,
251
- ie as isCalculatedDimension,
252
- ne as isCalculatedField,
253
- le as isCalculatedMetric,
254
- ve as isColumnInSqlGen,
255
- Be as isDateDataType,
256
- Ra as isExportComplete,
257
- Ma as isExportInProgress,
258
- Ae as isNumberDataType,
259
- Ne as isTextDataType,
260
- gs as listBriefingRuns,
261
- Cs as listBriefingTenantSummaries,
262
- Ds as listBriefings,
263
- Fs as normalizeDashboardForDirtyCheck,
264
- Es as pauseBriefing,
265
- xs as polishBriefingText,
266
- Ts as previewBriefingPlan,
267
- Se as resolveDataType,
268
- Pe as resolveDatamodelName,
269
- bs as resumeBriefing,
270
- ys as runBriefingNow,
271
- vs as runBriefingPreview,
272
- Rs as serializeDashboardForDirtyCheck,
273
- Bs as updateBriefing,
274
- Ia as useActiveExports,
275
- La as useAddNewFrame,
276
- ka as useCard,
277
- Ua as useCardSummary,
278
- we as useCurrentActiveCard,
279
- _e as useCurrentCardConfig,
280
- Fe as useCurrentSheetActiveCards,
281
- Re as useDashboardActions,
282
- Oa as useDashboardById,
283
- Va as useDashboardQuery,
205
+ va as SemaphorDataProvider,
206
+ Aa as SemaphorQueryClient,
207
+ Na as ShareDialog,
208
+ Sa as SummaryCard,
209
+ Pa as Surfboard,
210
+ Ns as UnsavedChangesAlert,
211
+ ta as Visual,
212
+ Ss as VisualEditingControls,
213
+ Ps as VisualsLibraryDialog,
214
+ ws as WatchDashboardButton,
215
+ wa as applyBriefingFormPatch,
216
+ _a as briefingFormDraftToCreateRequest,
217
+ Fa as briefingFormDraftToUpdateRequest,
218
+ Ra as briefingToFormDraft,
219
+ Ia as cancelBriefingPreviewRun,
220
+ Ma as cancelBriefingRun,
221
+ La as cancelExport,
222
+ I as cloneDeep,
223
+ ka as createBriefing,
224
+ Ua as createBriefingFormDraft,
225
+ We as createEmptyKpiConfig,
226
+ Oa as createExport,
227
+ je as createSqlGenConfig,
228
+ Va as deleteBriefing,
229
+ za as deleteBriefingRun,
230
+ qa as downloadDocumentPdf,
231
+ Ha as downloadPdf,
232
+ Ge as emitDashboardLoad,
233
+ Qe as emitDashboardUnload,
234
+ Ke as fmt,
235
+ Wa as formatFileSize,
236
+ ja as getBriefing,
237
+ Ga as getBriefingArtifact,
238
+ Qa as getBriefingEvidence,
239
+ Ka as getBriefingPreviewRun,
240
+ Xa as getBriefingRun,
241
+ Xe as getColumnDataType,
242
+ Ya as getDownloadUrl,
243
+ $a as getExportStatus,
244
+ Ja as getExports,
245
+ Me as getFieldRuntimeColumnName,
246
+ Ye as getFilterValueType,
247
+ $e as getFormattedTableNameForQuery,
248
+ Je as getQualifiedTableName,
249
+ Ze as getSql,
250
+ Le as hasCalculatedFieldMarker,
251
+ ke as hasCalculatedFormulaInputs,
252
+ as as invalidateToken,
253
+ es as isBooleanDataType,
254
+ Ue as isCalculatedDimension,
255
+ Oe as isCalculatedField,
256
+ Ve as isCalculatedMetric,
257
+ ss as isColumnInSqlGen,
258
+ rs as isDateDataType,
259
+ Za as isExportComplete,
260
+ ae as isExportInProgress,
261
+ os as isNumberDataType,
262
+ is as isTextDataType,
263
+ ee as listBriefingRuns,
264
+ se as listBriefingTenantSummaries,
265
+ re as listBriefings,
266
+ Ls as normalizeDashboardForDirtyCheck,
267
+ oe as pauseBriefing,
268
+ ie as polishBriefingText,
269
+ te as previewBriefingPlan,
270
+ ts as resolveDataType,
271
+ ns as resolveDatamodelName,
272
+ ne as resumeBriefing,
273
+ le as runBriefingNow,
274
+ de as runBriefingPreview,
275
+ ks as serializeDashboardForDirtyCheck,
276
+ ue as updateBriefing,
277
+ ce as useActiveExports,
278
+ fe as useAddNewFrame,
279
+ me as useBriefingUiCapabilities,
280
+ pe as useCard,
281
+ he as useCardSummary,
282
+ ls as useCurrentActiveCard,
283
+ ds as useCurrentCardConfig,
284
+ us as useCurrentSheetActiveCards,
285
+ cs as useDashboardActions,
286
+ ge as useDashboardById,
287
+ Ce as useDashboardQuery,
284
288
  H as useDashboardStore,
285
- za as useDashboardSummary,
286
- qa as useDataColumns,
287
- Ha as useDateFilterHook,
288
- ws as useDebouncedDirtyCheck,
289
- Me as useEditorActions,
290
- Wa as useEditorAside,
291
- Ie as useEditorStore,
292
- ja as useExportActions,
293
- As as useExportPolling,
294
- Ns as useExportRecovery,
295
- Ga as useExportStore,
289
+ De as useDashboardSummary,
290
+ Ee as useDataColumns,
291
+ xe as useDateFilterHook,
292
+ Is as useDebouncedDirtyCheck,
293
+ fs as useEditorActions,
294
+ be as useEditorAside,
295
+ ms as useEditorStore,
296
+ Te as useExportActions,
297
+ _s as useExportPolling,
298
+ Fs as useExportRecovery,
299
+ ye as useExportStore,
296
300
  da as useExposePrintState,
297
- Qa as useInProgressExportsCount,
298
- Ka as useManagementStore,
301
+ Be as useInProgressExportsCount,
302
+ ve as useManagementStore,
299
303
  na as usePristineSnapshotInitializer,
300
- Xa as useResourceManagement,
301
- Ya as useTextFilterHook,
302
- Ss as validateBriefingFormDraft
304
+ Ae as useResourceManagement,
305
+ Ne as useTextFilterHook,
306
+ Se as validateBriefingFormDraft
303
307
  };