react-semaphor 0.1.515 → 0.1.516

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 (210) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -1
  2. package/dist/analytics-protocol/index.js +226 -225
  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 +8 -8
  7. package/dist/chunks/{calculated-field-identity-BiTGmnST.cjs → calculated-field-identity-5bg9oHTw.cjs} +1 -1
  8. package/dist/chunks/{calculated-field-identity-DnRd4YIY.js → calculated-field-identity-DzJBs2J8.js} +4 -4
  9. package/dist/chunks/{card-config-utils-B2cDWQqB.js → card-config-utils-Cxnq2R6z.js} +14 -14
  10. package/dist/chunks/{card-config-utils-CMO4_zVs.cjs → card-config-utils-z86y6tSq.cjs} +1 -1
  11. package/dist/chunks/column-bands-CU0byntA.cjs +1 -0
  12. package/dist/chunks/column-bands-RdM-kjDe.js +47 -0
  13. package/dist/chunks/{dashboard-briefing-launcher-BA_bl05p.js → dashboard-briefing-launcher-BCEHJ_eD.js} +15 -12
  14. package/dist/chunks/{dashboard-briefing-launcher-B7zqm8P1.cjs → dashboard-briefing-launcher-CjZ4aE34.cjs} +2 -2
  15. package/dist/chunks/{dashboard-controls-QMW17RKx.js → dashboard-controls-DFfit5KH.js} +12 -12
  16. package/dist/chunks/{dashboard-controls-x_v9wLOU.cjs → dashboard-controls-f9aJ70Zu.cjs} +1 -1
  17. package/dist/chunks/{dashboard-date-comparison-definition-D7Bl-YAl.js → dashboard-date-comparison-definition-BqNhECUr.js} +6 -6
  18. package/dist/chunks/{dashboard-date-comparison-definition-C_w-GO_5.cjs → dashboard-date-comparison-definition-Y6JZwpcr.cjs} +1 -1
  19. package/dist/chunks/{dashboard-json-DRnpkNwO.js → dashboard-json-DVtcA02f.js} +7 -7
  20. package/dist/chunks/{dashboard-json-0ZLLBlHj.cjs → dashboard-json-deqQC-UR.cjs} +1 -1
  21. package/dist/chunks/edit-dashboard-visual-DK6lSC_p.cjs +172 -0
  22. package/dist/chunks/{edit-dashboard-visual-1ISjhwry.js → edit-dashboard-visual-lJ6rDH3w.js} +4338 -4324
  23. package/dist/chunks/{editor-action-buttons-BTCKZERI.js → editor-action-buttons-Bnxxa439.js} +7 -7
  24. package/dist/chunks/{editor-action-buttons-Czq5SnA9.cjs → editor-action-buttons-CmDaQbPN.cjs} +1 -1
  25. package/dist/chunks/{field-aggregations-CzuQKtqx.js → field-aggregations-Dl2A3rbV.js} +461 -358
  26. package/dist/chunks/field-aggregations-pH_3kymD.cjs +1 -0
  27. package/dist/chunks/{field-dependencies-DIab72rQ.cjs → field-dependencies-EB485TdB.cjs} +1 -1
  28. package/dist/chunks/{field-dependencies-DXW4jtvJ.js → field-dependencies-v-lJNzC7.js} +1 -1
  29. package/dist/chunks/{index-Dlic9KZs.js → index-BVVl2JDK.js} +57730 -54586
  30. package/dist/chunks/index-DfqMtR9S.cjs +4 -0
  31. package/dist/chunks/index-UNKSfi7s.cjs +1434 -0
  32. package/dist/chunks/{index-v1OE4-eA.js → index-ylOpKRDu.js} +877 -849
  33. package/dist/chunks/{matrix-analytical-definition-Ct5Tu8np.cjs → matrix-analytical-definition-BWd159lN.cjs} +1 -1
  34. package/dist/chunks/{matrix-analytical-definition-BDAK2aEi.js → matrix-analytical-definition-BimC4XIV.js} +1 -1
  35. package/dist/chunks/{matrix-card-U4c72doZ.cjs → matrix-card-C2RjEYZ8.cjs} +1 -1
  36. package/dist/chunks/{matrix-card-DOIeTmjh.js → matrix-card-CIlz0Dnp.js} +2 -2
  37. package/dist/chunks/{matrix-control-sources-FjxGIbqk.cjs → matrix-control-sources-BvEJF7d3.cjs} +1 -1
  38. package/dist/chunks/{matrix-control-sources-BxKH2yu2.js → matrix-control-sources-KbZe1gj_.js} +51 -51
  39. package/dist/chunks/{matrix-definition-CBJW_4ii.cjs → matrix-definition-DanUT11P.cjs} +1 -1
  40. package/dist/chunks/{matrix-definition-I9rHB9zN.js → matrix-definition-E5gXXSTZ.js} +1 -1
  41. package/dist/chunks/matrix-formatter-BJTO8ky9.cjs +1 -0
  42. package/dist/chunks/{matrix-formatter-BdIsE7Qu.js → matrix-formatter-CCXNRt3s.js} +81 -81
  43. package/dist/chunks/{matrix-member-presentation-DO1VSqfh.js → matrix-member-presentation-Bw7-JCrr.js} +64 -64
  44. package/dist/chunks/matrix-member-presentation-DvXDEo0U.cjs +1 -0
  45. package/dist/chunks/{matrix-operation-contract-DoiWTUbT.cjs → matrix-operation-contract-0RxoU_M3.cjs} +1 -1
  46. package/dist/chunks/{matrix-operation-contract-D0HfzwZg.js → matrix-operation-contract-D32U2CSw.js} +19 -19
  47. package/dist/chunks/{metric-comparison-Dqc7_tnW.js → metric-comparison-BphoJ9bq.js} +1 -1
  48. package/dist/chunks/{metric-comparison-DBQ3EJTz.cjs → metric-comparison-CUmltzpz.cjs} +1 -1
  49. package/dist/chunks/pivot-header-presentation-BSZhB1g-.js +661 -0
  50. package/dist/chunks/pivot-header-presentation-EoUS5ze5.cjs +5 -0
  51. package/dist/chunks/{pivot-result-identity-8M-bZrw9.js → pivot-result-identity-BzUQiCEV.js} +4 -4
  52. package/dist/chunks/{pivot-result-identity-uTiylUNr.cjs → pivot-result-identity-gquWljbd.cjs} +1 -1
  53. package/dist/chunks/{pivot-result-lifecycle-vg_suUNb.cjs → pivot-result-lifecycle-gl9cBfB-.cjs} +1 -1
  54. package/dist/chunks/{pivot-result-lifecycle-CEmyU2At.js → pivot-result-lifecycle-kRhiJkzg.js} +8 -8
  55. package/dist/chunks/{raw-temporal-Bj6_w9cG.js → raw-temporal-BqOfk-xN.js} +16 -16
  56. package/dist/chunks/{raw-temporal-contract-CFLGwTiI.js → raw-temporal-contract-BQZIJ1fn.js} +1 -1
  57. package/dist/chunks/{raw-temporal-contract-DECbTuzA.cjs → raw-temporal-contract-CklMVG_1.cjs} +1 -1
  58. package/dist/chunks/{raw-temporal-CeblVJbu.cjs → raw-temporal-eJXecCyJ.cjs} +1 -1
  59. package/dist/chunks/{report-preferences-dialog-b8J6KjSy.js → report-preferences-dialog-CHXPEl7v.js} +6 -6
  60. package/dist/chunks/{report-preferences-dialog-Dr1BYwuf.cjs → report-preferences-dialog-Cto0vDwI.cjs} +1 -1
  61. package/dist/chunks/{report-runtime-context-Cs65Mrxj.js → report-runtime-context-CxIoGyNM.js} +1 -1
  62. package/dist/chunks/{report-runtime-context-DzvHBPxl.cjs → report-runtime-context-CzSrCBsu.cjs} +1 -1
  63. package/dist/chunks/{selection-reducer-BIiQXbGM.js → selection-reducer-CvCBQbl2.js} +1 -1
  64. package/dist/chunks/{selection-reducer-CGKKsaPa.cjs → selection-reducer-Kl22OzIk.cjs} +1 -1
  65. package/dist/chunks/{semantic-format-Dt-nUxFB.js → semantic-format-DwqGYx4V.js} +2 -2
  66. package/dist/chunks/{semantic-format-DFI1iszk.cjs → semantic-format-mVI32OJH.cjs} +1 -1
  67. package/dist/chunks/{source-entity-resolution-D7vnmDwm.js → source-entity-resolution-Bzefiive.js} +7 -7
  68. package/dist/chunks/{source-entity-resolution-CjbgnwyX.cjs → source-entity-resolution-R46X34SE.cjs} +1 -1
  69. package/dist/chunks/switch-DNbWXEOP.cjs +134 -0
  70. package/dist/chunks/{switch-D5_tjsIS.js → switch-DNv-hVmt.js} +8230 -7681
  71. package/dist/chunks/{temporal-bucket-B9hMwemw.js → temporal-bucket-DlFuhCnT.js} +6 -6
  72. package/dist/chunks/{temporal-bucket-contract-IWDgyTMw.js → temporal-bucket-contract-DTLDRzgV.js} +1 -1
  73. package/dist/chunks/{temporal-bucket-contract-ZctiyXYk.cjs → temporal-bucket-contract-nTv6gvX5.cjs} +1 -1
  74. package/dist/chunks/{token-types-Dl0hcKBX.js → token-types-BC6RcUY8.js} +1 -1
  75. package/dist/chunks/{token-types-Ahh5u4iT.cjs → token-types-aWrzwonf.cjs} +1 -1
  76. package/dist/chunks/{update-policy-COjFudhl.cjs → update-policy-DRDLWe7Y.cjs} +1 -1
  77. package/dist/chunks/{update-policy-BeQqjupC.js → update-policy-DhAUtiC8.js} +2 -2
  78. package/dist/chunks/{validators-CkHsAvwB.js → validators-CsdOtZI6.js} +411 -397
  79. package/dist/chunks/validators-DFeDcdpA.cjs +1 -0
  80. package/dist/dashboard/index.cjs +1 -1
  81. package/dist/dashboard/index.js +1 -1
  82. package/dist/dashboard-authoring/index.cjs +3 -3
  83. package/dist/dashboard-authoring/index.js +233 -227
  84. package/dist/data-app-builder/index.cjs +1 -1
  85. package/dist/data-app-builder/index.js +3 -3
  86. package/dist/data-app-codegen/index.cjs +1 -1
  87. package/dist/data-app-codegen/index.js +2 -2
  88. package/dist/data-app-codegen-node/index.cjs +1 -1
  89. package/dist/data-app-codegen-node/index.js +3 -3
  90. package/dist/data-app-sdk/index.cjs +1 -1
  91. package/dist/data-app-sdk/index.js +5 -5
  92. package/dist/data-app-sdk-adapters/index.cjs +1 -1
  93. package/dist/data-app-sdk-adapters/index.js +2 -2
  94. package/dist/data-app-sdk-validation/index.cjs +1 -1
  95. package/dist/data-app-sdk-validation/index.js +5 -5
  96. package/dist/format-utils/index.cjs +3 -3
  97. package/dist/format-utils/index.js +291 -402
  98. package/dist/index.cjs +1 -1
  99. package/dist/index.js +15 -15
  100. package/dist/pdf-table-layout/index.cjs +1 -0
  101. package/dist/pdf-table-layout/index.js +993 -0
  102. package/dist/report-runtime-context/index.cjs +1 -1
  103. package/dist/report-runtime-context/index.js +2 -2
  104. package/dist/style.css +1 -1
  105. package/dist/surfboard/index.cjs +1 -1
  106. package/dist/surfboard/index.js +2 -2
  107. package/dist/types/briefings/index.d.ts +1 -1
  108. package/dist/types/components/document-sheet/document-input-bar.d.ts +1 -3
  109. package/dist/types/components/document-sheet/document-insert-picker.d.ts +37 -0
  110. package/dist/types/components/document-sheet/document-kpi-section.d.ts +17 -0
  111. package/dist/types/components/document-sheet/document-matrix-layout-context.d.ts +10 -0
  112. package/dist/types/components/document-sheet/document-matrix-section.d.ts +27 -0
  113. package/dist/types/components/document-sheet/document-measure-layer.d.ts +45 -0
  114. package/dist/types/components/document-sheet/document-outline.d.ts +7 -1
  115. package/dist/types/components/document-sheet/document-page-navigation.d.ts +22 -0
  116. package/dist/types/components/document-sheet/document-page.d.ts +9 -5
  117. package/dist/types/components/document-sheet/document-panel/document-side-panel.d.ts +36 -0
  118. package/dist/types/components/document-sheet/document-panel/inputs-panel.d.ts +9 -0
  119. package/dist/types/components/document-sheet/document-panel/page-panel.d.ts +5 -0
  120. package/dist/types/components/document-sheet/document-panel/panel-controls.d.ts +14 -0
  121. package/dist/types/components/document-sheet/document-panel/region-panels.d.ts +11 -0
  122. package/dist/types/components/document-sheet/document-panel/section-panel.d.ts +25 -0
  123. package/dist/types/components/document-sheet/document-section-print-boundary.d.ts +9 -0
  124. package/dist/types/components/document-sheet/document-table-chrome.d.ts +22 -0
  125. package/dist/types/components/document-sheet/document-table-section.d.ts +3 -7
  126. package/dist/types/components/document-sheet/document-text-preview-context.d.ts +8 -0
  127. package/dist/types/components/document-sheet/use-first-fitting-variant.d.ts +18 -0
  128. package/dist/types/components/editor/editor-main/dashboard-variable-node.d.ts +12 -2
  129. package/dist/types/components/explorer/chart-configuration/matrix-authoring-controls.d.ts +7 -2
  130. package/dist/types/components/text-variables/variable-chip-plugin.d.ts +23 -0
  131. package/dist/types/components/text-variables/variable-chip.d.ts +18 -0
  132. package/dist/types/components/text-variables/variable-picker.d.ts +27 -0
  133. package/dist/types/components/visual/settings/table-presentation-settings.d.ts +27 -1
  134. package/dist/types/index.cjs +1 -1
  135. package/dist/types/index.js +5 -5
  136. package/dist/types/lib/dashboard-inputs/text-variable-options.d.ts +15 -0
  137. package/dist/types/lib/document/document-canvas-actions.d.ts +22 -0
  138. package/dist/types/lib/document/document-edits.d.ts +119 -0
  139. package/dist/types/lib/document/document-kpi-figure.d.ts +27 -0
  140. package/dist/types/lib/document/document-kpi-layout.d.ts +29 -0
  141. package/dist/types/lib/document/document-kpi-section-edits.d.ts +15 -0
  142. package/dist/types/lib/document/document-matrix-bands.d.ts +66 -0
  143. package/dist/types/lib/document/document-matrix-print.d.ts +11 -0
  144. package/dist/types/lib/document/document-pagination.d.ts +56 -3
  145. package/dist/types/lib/document/document-panel-target.d.ts +19 -0
  146. package/dist/types/lib/document/document-section-editor.d.ts +8 -7
  147. package/dist/types/lib/document/document-section-kinds.d.ts +49 -0
  148. package/dist/types/lib/document/document-section-query-options.d.ts +25 -0
  149. package/dist/types/lib/document/document-section-render-state.d.ts +26 -0
  150. package/dist/types/lib/document/document-section-utils.d.ts +11 -4
  151. package/dist/types/lib/document/document-table-dom.d.ts +4 -6
  152. package/dist/types/lib/document/document-table-pagination-model.d.ts +0 -5
  153. package/dist/types/lib/document/document-table-print-model.d.ts +4 -3
  154. package/dist/types/lib/document/document-table-style.d.ts +15 -4
  155. package/dist/types/lib/document/document-table-surface.d.ts +15 -0
  156. package/dist/types/lib/document/document-variables.d.ts +40 -6
  157. package/dist/types/lib/document/use-document-section-data.d.ts +39 -0
  158. package/dist/types/lib/document/use-measured-document-table-layout.d.ts +50 -0
  159. package/dist/types/lib/formatters/kpi-result-values.d.ts +20 -0
  160. package/dist/types/lib/hooks/query-context/use-dashboard-card-execution-snapshot.d.ts +8 -2
  161. package/dist/types/lib/hooks/use-dashboard-frame-query.d.ts +6 -0
  162. package/dist/types/lib/hooks/use-dashboard-kpi-actions.d.ts +1 -1
  163. package/dist/types/lib/hooks/use-document-section-editor.d.ts +2 -2
  164. package/dist/types/lib/hooks/use-document-section-session.d.ts +36 -0
  165. package/dist/types/lib/hooks/use-editor-preview.d.ts +17 -0
  166. package/dist/types/lib/hooks/use-is-editing-card.d.ts +7 -0
  167. package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +2 -0
  168. package/dist/types/lib/matrix-table/matrix-card-draft.d.ts +2 -0
  169. package/dist/types/lib/matrix-table/matrix-delivery.d.ts +4 -0
  170. package/dist/types/lib/matrix-table/matrix-layout-read.d.ts +68 -0
  171. package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +8 -1
  172. package/dist/types/lib/query-context/build-dashboard-frame-base-query-contexts.d.ts +4 -2
  173. package/dist/types/lib/query-context/card-execution.d.ts +30 -0
  174. package/dist/types/lib/query-context/document-section-card-query.d.ts +37 -0
  175. package/dist/types/lib/stores/dashboard-store.d.ts +12 -8
  176. package/dist/types/lib/stores/editor-store.d.ts +2 -0
  177. package/dist/types/lib/text-variables/text-variable-types.d.ts +39 -0
  178. package/dist/types/lib/types/common-types.d.ts +34 -1
  179. package/dist/types/lib/utils/card-definition.d.ts +2 -0
  180. package/dist/types/lib/utils/card-utils.d.ts +13 -6
  181. package/dist/types/pdf-table-layout.d.ts +2 -0
  182. package/dist/types/shared/analytics-protocol/index.d.ts +1 -1
  183. package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +45 -0
  184. package/dist/types/shared/analytics-protocol/matrix-member-presentation.d.ts +4 -0
  185. package/dist/types/shared/dashboard-authoring/document-section-cards.d.ts +56 -0
  186. package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
  187. package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +36 -1
  188. package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +5 -0
  189. package/dist/types/shared/format-utils/index.d.ts +1 -0
  190. package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +690 -1
  191. package/dist/types/shared/format-utils/matrix-print.d.ts +38 -0
  192. package/dist/types/shared/format-utils/pdf-table-layout/column-bands.d.ts +55 -0
  193. package/dist/types/shared/format-utils/pdf-table-layout/index.d.ts +6 -0
  194. package/dist/types/shared/format-utils/pdf-table-layout/page-size.d.ts +7 -0
  195. package/dist/types/shared/format-utils/pdf-table-layout/table-column-semantics.d.ts +106 -0
  196. package/dist/types/shared/format-utils/pdf-table-layout/table-column-widths.d.ts +13 -0
  197. package/dist/types/shared/format-utils/pdf-table-layout/table-page-geometry.d.ts +19 -0
  198. package/dist/types/shared/format-utils/pdf-table-layout/wide-table-layout.d.ts +46 -0
  199. package/dist/types/shared/format-utils/table-structure.d.ts +9 -0
  200. package/package.json +6 -1
  201. package/dist/chunks/edit-dashboard-visual-CI0EqzKj.cjs +0 -172
  202. package/dist/chunks/field-aggregations-jSi77h9Z.cjs +0 -1
  203. package/dist/chunks/index-BMMXKK3G.cjs +0 -4
  204. package/dist/chunks/index-C6_xef4P.cjs +0 -1424
  205. package/dist/chunks/matrix-formatter-Dajj91Ni.cjs +0 -1
  206. package/dist/chunks/matrix-member-presentation-CFHjdrxT.cjs +0 -1
  207. package/dist/chunks/pivot-header-presentation-BIf4HW3L.js +0 -414
  208. package/dist/chunks/pivot-header-presentation-B_N11CgN.cjs +0 -5
  209. package/dist/chunks/switch-Ced9ZZwI.cjs +0 -134
  210. package/dist/chunks/validators-DVYAnnX0.cjs +0 -1
@@ -1 +0,0 @@
1
- "use strict";const d=require("./validators-DVYAnnX0.cjs");require("./matrix-operation-contract-DoiWTUbT.cjs");const l=require("./semantic-format-DFI1iszk.cjs"),v=require("./index-Cw2ypaFl.cjs"),y=require("./raw-temporal-CeblVJbu.cjs"),T=require("./constants-B00YUv89.cjs"),w=require("./temporal-bucket-4YEPEKlJ.cjs");function b(t,e){const n=l.toDate(t),s=l.toDate(e),r=n.getTime()-s.getTime();return r<0?-1:r>0?1:r}function A(t){return l.constructFrom(t,Date.now())}function O(t,e){const n=l.toDate(t),s=l.toDate(e),r=n.getFullYear()-s.getFullYear(),o=n.getMonth()-s.getMonth();return r*12+o}function R(t){return e=>{const s=(t?Math[t]:Math.trunc)(e);return s===0?0:s}}function S(t,e){return+l.toDate(t)-+l.toDate(e)}function Z(t){const e=l.toDate(t);return e.setHours(23,59,59,999),e}function k(t){const e=l.toDate(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}function V(t){const e=l.toDate(t);return+Z(e)==+k(e)}function q(t,e){const n=l.toDate(t),s=l.toDate(e),r=b(n,s),o=Math.abs(O(n,s));let f;if(o<1)f=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-r*o);let a=b(n,s)===-r;V(l.toDate(t))&&o===1&&b(t,s)===1&&(a=!1),f=r*(o-Number(a))}return f===0?0:f}function X(t,e,n){const s=S(t,e)/1e3;return R(n==null?void 0:n.roundingMethod)(s)}function P(t,e,n){const s=l.getDefaultOptions(),r=(n==null?void 0:n.locale)??s.locale??l.enUS,o=2520,f=b(t,e);if(isNaN(f))throw new RangeError("Invalid time value");const a=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:f});let h,u;f>0?(h=l.toDate(e),u=l.toDate(t)):(h=l.toDate(t),u=l.toDate(e));const m=X(u,h),c=(l.getTimezoneOffsetInMilliseconds(u)-l.getTimezoneOffsetInMilliseconds(h))/1e3,i=Math.round((m-c)/60);let D;if(i<2)return n!=null&&n.includeSeconds?m<5?r.formatDistance("lessThanXSeconds",5,a):m<10?r.formatDistance("lessThanXSeconds",10,a):m<20?r.formatDistance("lessThanXSeconds",20,a):m<40?r.formatDistance("halfAMinute",0,a):m<60?r.formatDistance("lessThanXMinutes",1,a):r.formatDistance("xMinutes",1,a):i===0?r.formatDistance("lessThanXMinutes",1,a):r.formatDistance("xMinutes",i,a);if(i<45)return r.formatDistance("xMinutes",i,a);if(i<90)return r.formatDistance("aboutXHours",1,a);if(i<T.minutesInDay){const M=Math.round(i/60);return r.formatDistance("aboutXHours",M,a)}else{if(i<o)return r.formatDistance("xDays",1,a);if(i<T.minutesInMonth){const M=Math.round(i/T.minutesInDay);return r.formatDistance("xDays",M,a)}else if(i<T.minutesInMonth*2)return D=Math.round(i/T.minutesInMonth),r.formatDistance("aboutXMonths",D,a)}if(D=q(u,h),D<12){const M=Math.round(i/T.minutesInMonth);return r.formatDistance("xMonths",M,a)}else{const M=D%12,p=Math.trunc(D/12);return M<3?r.formatDistance("aboutXYears",p,a):M<9?r.formatDistance("overXYears",p,a):r.formatDistance("almostXYears",p+1,a)}}function N(t,e){return P(t,A(t),e)}function $(t,e){return t&&t!=="auto"?t:e}function Y(t,e=new Date){try{const n={timeZone:t,timeZoneName:"short"},r=new Intl.DateTimeFormat("en-US",n).formatToParts(e).find(o=>o.type==="timeZoneName");return(r==null?void 0:r.value)||t}catch{return t}}function B(t){try{const e={timeZone:t,timeZoneName:"long"},s=new Intl.DateTimeFormat("en-US",e).formatToParts(new Date).find(r=>r.type==="timeZoneName");return(s==null?void 0:s.value)||t}catch{return t}}function x(t,e="auto"){if(!t)return new Date(NaN);const n=t.endsWith("Z"),s=/[+-]\d{2}:?\d{2}$/.test(t),r=/\([A-Z]{3,4}\)$/.test(t);if(e==="auto")return n||s||r?new Date(t):new Date(t+"Z");if(e==="local"){if(n||s){const o=t.replace(/Z$/,"").replace(/[+-]\d{2}:?\d{2}$/,"");return new Date(o)}return new Date(t)}else return e==="UTC"?n?new Date(t):s?new Date(t):new Date(t+"Z"):n||s||r?new Date(t):v.fromZonedTime(t,e)}const E="MM/dd/yyyy",L=(t,e,n,s="auto")=>{if(!t)return"";try{const r=x(t,s);if(isNaN(r.getTime()))return t;const f=(e&&e.trim()?e:E).replace(/LLLL/g,"MMMM").replace(/LLL/g,"MMM");return n&&n!=="auto"?l.formatInTimeZone(r,n,f):l.format(r,f)}catch(r){return console.error("Date formatting error:",r),t}},I=(t,e="auto")=>{if(!t)return"";try{const n=x(t,e);return isNaN(n.getTime())?t:N(n,{addSuffix:!0})}catch(n){return console.error("Relative time formatting error:",n),t}};function j(t,e,n,s){const r=t instanceof Date?t.toISOString():String(t),o=(s==null?void 0:s.browserTimezone)||n,f=(s==null?void 0:s.isSqlCard)??!1;if(e!=null&&e.useRelativeTime)return I(r,(e==null?void 0:e.sourceTimezone)||"auto");const a=e!=null&&e.useCustomFormat&&(e!=null&&e.customFormat)?e.customFormat:(e==null?void 0:e.format)||"MM/dd/yyyy";return L(r,a,e!=null&&e.timezone&&(e==null?void 0:e.timezone)!=="auto"?e.timezone:f?o:n,(e==null?void 0:e.sourceTimezone)||"auto")}function g(t,e,n){var f,a;if(t==null)return t===null?((f=n.absence)==null?void 0:f.nullText)??"":((a=n.absence)==null?void 0:a.emptyText)??"";const s=d.isExactNumericValue(t)?t:void 0,r=s?s.value:t,o=s??(typeof t=="number"?t:void 0);if(!n.useFormattedValues||!e)return String(r);switch(e.type){case"number":return o!==void 0?y.formatNumberWithColumnSettings(o,e.numberFormat,n.locale):String(r);case"date":return j(r,e.dateFormat,n.timezone,{browserTimezone:n.browserTimezone,isSqlCard:n.isSqlCard});case"progress":return o!==void 0?`${r}%`:String(r);case"badge":case"link":case"text":case"none":default:return String(r)}}function U(t,e){return e.visibleColumns.map(n=>{const s=t[n],r=e.columnSettings[n];return g(s,r,{useFormattedValues:e.useFormattedValues,timezone:e.timezone,locale:e.locale})})}function _(t,e){var r;const n=t[t.length-1];if(!n)return"";if(n.member.kind==="others")return"Others";const s=n.member.value;return s===null?"(Blank)":((r=e==null?void 0:e.get(n.levelId))==null?void 0:r(s))??(typeof s=="object"?s.value:String(s))}function z(t,e,n){return t==="grand_total"?n??"Grand Total":t==="subtotal"?n??`${e} Total`:e}function W(t,e,n,s){var f;const r=t[t.length-1],o=e==="grand_total"?n.grand.label:r?(f=n.levels[r.levelId])==null?void 0:f.label:void 0;return z(e,_(t,s),o)}function H(t,e,n){return t.kind==="value"?(e==null?void 0:e(t.value))??"":t.kind==="null"?n.nullText:n.emptyText}function K(t){const{path:e,previousPath:n,role:s,repeatLabels:r,levelCount:o}=t;return Array.from({length:o},(f,a)=>{const h=e.slice(0,a+1),u=s==="grand_total"?a===0:s==="subtotal"&&a===e.length-1,m=n&&n.length>a&&d.matrixPathKey(n.slice(0,a+1))===d.matrixPathKey(h);return{path:h,total:u,visible:u||e.length>a&&(r||!m||a===e.length-1)}})}function C(t,e){return l.fromSemanticFormat(t??e,{preserveOmittedProperties:!0,numericInput:"canonical"})}function F(t,e,n){const s=new Map,r=(o,f)=>{const a=(f==="levels"?e.levelFormats:e.measureFormats)[o.id],h=o.semanticFormat,u=C(a,h);f==="measures"&&s.set(o.id,{isNumeric:d.normalizeAnalyticsCatalogDataType(o.column.dataType)==="number",hasTextAffixes:!!u&&!!("prefix"in u&&u.prefix||"suffix"in u&&u.suffix)});const m=c=>g(c,void 0,{useFormattedValues:!0,timezone:n.calendar.tz,locale:n.valueFormat.locale,absence:e.absence});if(o.column.temporalBucket){const c=o.column.temporalBucket,i=w.resolveTemporalBucketPresentation({metadata:c,cardFormat:(a==null?void 0:a.type)==="temporal_bucket"?a:void 0,semanticFormat:(h==null?void 0:h.type)==="temporal_bucket"?{granularity:c.granularity,format:h}:void 0,locale:n.valueFormat.locale,styles:{dateStyle:n.valueFormat.dateStyle,dateTime:n.valueFormat.dateTime}});return D=>typeof D=="string"?w.formatTemporalBucket({value:D,metadata:c,format:i.format}):m(D)}if(o.column.rawTemporal){const c=y.prepareRawTemporalFormatter({metadata:o.column.rawTemporal,format:y.resolveRawTemporalFormat({format:(u==null?void 0:u.type)==="date"?{type:"raw_temporal",timezone:u.timezone,sourceTimezone:u.sourceTimezone,presentation:u.pattern?{mode:"pattern",dialect:"semaphor_tokens",pattern:u.pattern}:{mode:"auto"}}:void 0,preferences:n.valueFormat,calendar:n.calendar})});return i=>{if(typeof i!="string")return m(i);const D=c(i);return D.ok?D.text:m(i)}}if(v.isNumericCanonicalFormat(u)){const c=y.resolveNumericPresentation(u,n.valueFormat);return i=>typeof i=="number"||typeof i=="object"&&i!==null?y.formatNumericCanonical(i,c):m(i)}return(u==null?void 0:u.type)==="duration"?c=>typeof c=="number"||typeof c=="string"||typeof c=="object"&&c!==null?y.formatDuration(typeof c=="object"?c.value:c,u):m(c):(u==null?void 0:u.type)==="string"?c=>c===null?m(c):`${u.prefix??""}${m(c)}${u.suffix??""}`:m};return{levels:new Map(t.levels.map(o=>[o.id,r(o,"levels")])),measures:new Map(t.measures.map(o=>[o.id,r(o,"measures")])),measureSemantics:s}}exports.formatCellValue=g;exports.formatDate=L;exports.formatDistanceToNow=N;exports.formatRelativeTime=I;exports.formatRowForExport=U;exports.getTimezoneAbbreviation=Y;exports.getTimezoneName=B;exports.matrixAxisLabel=W;exports.matrixCellText=H;exports.matrixLevelLabels=K;exports.matrixMemberLabel=_;exports.matrixTotalLabel=z;exports.parseWithSourceTimezone=x;exports.prepareMatrixFormatting=F;exports.resolveMatrixValueFormat=C;exports.resolveTimezone=$;
@@ -1 +0,0 @@
1
- "use strict";const d=require("./validators-DVYAnnX0.cjs"),f=["=","!=",">","<",">=","<=","like","not like","between","not between","in","not in","is null","is not null"],y=new Set(["string","number","date","boolean"]);function P(t){return typeof t=="string"&&f.includes(t)}function b(t,e){switch(t){case"is null":case"is not null":return e.length===0;case"between":case"not between":return e.length===2;case"in":case"not in":return e.length>=1;default:return e.length===1}}function m(t){if(!t||typeof t!="object"||Array.isArray(t))return;const e=t,n={};for(const i of S)e[i]!==void 0&&(n[i]=e[i]);return n}const S=["operation","values","valueType","temporalBucket","relativeMeta","temporalPrecision"];function v(t){const e=m(t);if(!e)return;const{operation:n,values:i}=e;if(!P(n)||!Array.isArray(i)||!b(n,i))return;const r=typeof e.valueType=="string"&&y.has(e.valueType)?e.valueType:void 0;return{operation:n,values:i,...r?{valueType:r}:{},...e.temporalBucket!==void 0?{temporalBucket:e.temporalBucket}:{},...e.relativeMeta!==void 0?{relativeMeta:e.relativeMeta}:{},...e.temporalPrecision!==void 0?{temporalPrecision:e.temporalPrecision}:{}}}function E(t){const e=v(t);if(!e)throw new Error(`Filter operation "${String(t.operation)}" cannot be expressed as predicate semantics.`);return e}function N(t){return t.operation==="is null"||t.operation==="is not null"}function c(t){var e;return JSON.stringify([((e=t.field)==null?void 0:e.id)??"",t.operator,t.value??null,t.temporalBucket??null])}function A(t){return JSON.stringify(t.map(c).sort())}function g(t){const e=new Map;for(const n of t)for(const i of n.tuples){const r=i.conditions.filter(l=>{var o;return(o=l.field)==null?void 0:o.id});if(r.length===0)continue;let a=e.get(n.sourceCardId);a||(a=new Map,e.set(n.sourceCardId,a));const s=[...r].sort((l,o)=>c(l).localeCompare(c(o)));a.set(A(s),s)}return[...e.entries()].sort(([n],[i])=>n.localeCompare(i)).map(([n,i])=>({sourceCardId:n,tuples:[...i.entries()].sort(([r],[a])=>r.localeCompare(a)).map(([,r])=>({conditions:r}))}))}function C(t){const e=g(t);if(e.length!==0)return{id:"selection",logicalOperator:"AND",negate:!1,conditions:[],groups:e.map(n=>{const i=`selection:${n.sourceCardId}`;return{id:i,logicalOperator:"OR",negate:!1,conditions:[],groups:n.tuples.map((r,a)=>{const s=`${i}:${a}`;return{id:s,logicalOperator:"AND",negate:!1,conditions:r.conditions.map((l,o)=>({...l,id:`${s}:${o}`})),groups:[]}})}})}}function I(t){return JSON.stringify(g(t).map(e=>[e.sourceCardId,e.tuples.map(n=>n.conditions.map(c))]))}function h(t,e){var i;if(e===null)return!0;if(e.overrides.length===0)return t.length<=e.depth;const n=d.matrixPathKey(t);return((i=e.overrides.find(r=>r.path.length===t.length&&d.matrixPathKey(r.path)===n))==null?void 0:i.expanded)??t.length<=e.depth}function T(t){var p;const{path:e,levelCount:n,expansion:i,total:r,axis:a}=t,s=e.length>=n||((p=e[e.length-1])==null?void 0:p.member.kind)==="others",l=!s&&!t.childrenEmpty,o=l&&h(e,i),u=a==="rows"&&t.rowLayout!=="tabular";return{expandable:l,expanded:o,memberVisible:u||!o,valueVisible:s||!!(r!=null&&r.visible)&&(!o||r.position==="before"),subtotalBefore:!u&&o&&!!(r!=null&&r.visible)&&r.position==="before",subtotalAfter:o&&!!(r!=null&&r.visible)&&r.position==="after"}}exports.NATIVE_PREDICATE_OPERATIONS=f;exports.compileSelectionFilterGroup=C;exports.isMatrixPathExpanded=h;exports.isNullCheckPredicate=N;exports.parseNativePredicateSemantics=v;exports.projectNativePredicateSemantics=m;exports.resolveMatrixMemberPresentation=T;exports.selectionFilterGroupKey=I;exports.toNativePredicateSemantics=E;
@@ -1,414 +0,0 @@
1
- var x = Object.defineProperty;
2
- var T = (e, r, t) => r in e ? x(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
3
- var y = (e, r, t) => T(e, typeof r != "symbol" ? r + "" : r, t);
4
- import { i as C } from "./index-C8w91oj4.js";
5
- import { h as g, j as _ } from "./raw-temporal-Bj6_w9cG.js";
6
- import { PDF_SAFETY_LIMIT_EXCEEDED as S, getUtf8ByteLength as V, FAST_PDF_POLICY as M } from "../pdf-export-policy/index.js";
7
- import { f as P } from "./temporal-bucket-B9hMwemw.js";
8
- function R(e, r, t) {
9
- const n = {
10
- ...r,
11
- locale: r.locale ?? t
12
- };
13
- if (n.type === "number")
14
- return g(e, n);
15
- const { prefix: o, suffix: a, ...s } = n;
16
- return `${o ?? ""}${g(e, {
17
- ...s,
18
- negativeStyle: n.type === "currency" ? n.negativeStyle : "minus"
19
- })}${a ?? ""}`;
20
- }
21
- function w(e, r, t) {
22
- return e === null ? { value: e, text: null } : !r || !C(r) && r.type !== "duration" ? {
23
- value: e,
24
- text: g(e, { type: "number", locale: t })
25
- } : r.type === "duration" ? {
26
- value: e,
27
- text: _(e, {
28
- inputUnit: r.inputUnit,
29
- outputStyle: r.outputStyle,
30
- largestUnit: r.largestUnit,
31
- smallestUnit: r.smallestUnit,
32
- maxUnits: r.maxUnits,
33
- prefix: r.prefix,
34
- suffix: r.suffix,
35
- negativeInParentheses: r.negativeStyle === "parentheses"
36
- })
37
- } : { value: e, text: R(e, r, t) };
38
- }
39
- function h(e, r, t, n) {
40
- return e === null ? { value: e, text: null } : n === "percent" ? {
41
- value: e,
42
- text: g(e, {
43
- type: "percent",
44
- locale: t,
45
- minimumFractionDigits: r,
46
- maximumFractionDigits: r,
47
- percentValueMode: "fraction"
48
- })
49
- } : {
50
- value: e,
51
- text: g(e, {
52
- type: "number",
53
- locale: t,
54
- minimumFractionDigits: r,
55
- maximumFractionDigits: r,
56
- suffix: "×"
57
- })
58
- };
59
- }
60
- function b(e, r) {
61
- if (e === void 0) return r;
62
- if (!Number.isInteger(e) || e < 0 || e > 6)
63
- throw new RangeError("Comparison precision must be an integer from 0 to 6.");
64
- return e;
65
- }
66
- function Y(e, r) {
67
- const t = {
68
- mode: r.displayMode,
69
- current: w(
70
- e.currentValue,
71
- r.metricFormat,
72
- r.locale
73
- ),
74
- comparison: w(
75
- e.comparisonValue,
76
- r.metricFormat,
77
- r.locale
78
- )
79
- };
80
- return (r.displayMode === "difference" || r.displayMode === "both") && (t.difference = w(
81
- e.delta,
82
- r.metricFormat,
83
- r.locale
84
- )), (r.displayMode === "percent_change" || r.displayMode === "both") && (t.percentChange = h(
85
- e.percentChange,
86
- b(r.precision, 1),
87
- r.locale,
88
- "percent"
89
- )), r.displayMode === "ratio" && (t.ratio = h(
90
- e.ratio,
91
- b(r.precision, 2),
92
- r.locale,
93
- "ratio"
94
- )), t;
95
- }
96
- function z(e) {
97
- const r = e.trimStart().charAt(0);
98
- return ["=", "+", "-", "@"].includes(r) || [" ", "\r", `
99
- `].includes(e.charAt(0)) ? `'${e}` : e;
100
- }
101
- function v(e, r = ",") {
102
- if (e == null)
103
- return "";
104
- const t = String(e);
105
- return t.includes(r) || t.includes('"') || t.includes(`
106
- `) || t.includes("\r") ? `"${t.replace(/"/g, '""')}"` : t;
107
- }
108
- function F(e, r = ",") {
109
- return e.map((t) => v(t, r)).join(r);
110
- }
111
- function k(e, r = {}) {
112
- const { delimiter: t = ",", lineEnding: n = `
113
- ` } = r;
114
- return e.map((o) => F(o, t)).join(n);
115
- }
116
- function W(e, r = {}) {
117
- if (e.length === 0)
118
- return "";
119
- const {
120
- delimiter: t = ",",
121
- lineEnding: n = `
122
- `,
123
- includeHeaders: o = !0,
124
- columns: a
125
- } = r, s = a || Object.keys(e[0]), l = [];
126
- o && l.push(s);
127
- for (const u of e) {
128
- const i = s.map((f) => {
129
- const c = u[f];
130
- return c == null ? "" : String(c);
131
- });
132
- l.push(i);
133
- }
134
- return k(l, { delimiter: t, lineEnding: n });
135
- }
136
- const I = 1e4, J = 1e6, Q = 5e6, Z = 1024 ** 3, ee = 1024 ** 3;
137
- function re(e) {
138
- return e > I;
139
- }
140
- class $ extends Error {
141
- constructor() {
142
- super(...arguments);
143
- y(this, "code", S);
144
- }
145
- }
146
- function A(e) {
147
- if (!e || typeof e != "object")
148
- return;
149
- const { error: r, message: t, detail: n } = e;
150
- for (const o of [r, t, n])
151
- if (typeof o == "string" && o.trim())
152
- return o.trim();
153
- }
154
- async function D(e) {
155
- const r = `PDF request failed: ${e.status} ${e.statusText}`.trim(), t = e.headers.get("content-type") || "";
156
- try {
157
- if (t.includes("application/json")) {
158
- const o = await e.json(), a = typeof o.code == "string" ? o.code : typeof o.errorCode == "string" ? o.errorCode : void 0;
159
- return { message: A(o) || r, code: a };
160
- }
161
- const n = await e.text();
162
- if (!n.trim())
163
- return { message: r };
164
- try {
165
- const o = JSON.parse(n), a = typeof o.code == "string" ? o.code : typeof o.errorCode == "string" ? o.errorCode : void 0;
166
- return {
167
- message: A(o) || n.trim(),
168
- code: a
169
- };
170
- } catch {
171
- return { message: n.trim() };
172
- }
173
- } catch {
174
- return { message: r };
175
- }
176
- }
177
- async function te(e) {
178
- if (!e.token) throw new Error("Missing auth token for PDF export");
179
- if (V(e.serializedPayload) > M.maxRequestBytes)
180
- throw new Error("Fast-path PDF request exceeds the structured body limit");
181
- const r = await (e.fetchImpl ?? fetch)(e.url, {
182
- method: "POST",
183
- headers: { "Content-Type": "application/json", Authorization: `Bearer ${e.token}` },
184
- body: e.serializedPayload,
185
- signal: e.signal
186
- });
187
- if (!r.ok) {
188
- const n = await D(r);
189
- throw n.code === S ? new $(n.message) : new Error(n.message);
190
- }
191
- const t = await r.json();
192
- if (t != null && t.error) throw new Error(t.error);
193
- if (typeof (t == null ? void 0 : t.url) != "string" || !t.url.trim())
194
- throw new Error("Fast-path PDF response missing download URL");
195
- return t;
196
- }
197
- const oe = "pdf-group-continuation";
198
- function O(e) {
199
- if (!e.previousRow || e.row.isSubtotal === !0 || e.row.isGrandTotal === !0 || e.previousRow.isSubtotal === !0 || e.previousRow.isGrandTotal === !0)
200
- return !0;
201
- for (let r = 0; r <= e.levelIndex; r++)
202
- if (e.getValue(e.row, r) !== e.getValue(e.previousRow, r))
203
- return !0;
204
- return !1;
205
- }
206
- const B = "__TOTAL__";
207
- function d(e) {
208
- return typeof e == "object" && e !== null && !Array.isArray(e);
209
- }
210
- function p(e) {
211
- return e === B;
212
- }
213
- function ne(e) {
214
- const r = /* @__PURE__ */ new Map(), t = (e.groupByColumns ?? []).map((o, a) => {
215
- var i, f, c;
216
- if (!d(o))
217
- throw new Error(`Aggregate groupByColumns[${a}] is invalid`);
218
- const s = typeof o.id == "string" && o.id.length > 0 ? o.id : void 0, l = s ? (c = (f = (i = e.columnKeyMap) == null ? void 0 : i.byRole) == null ? void 0 : f.groupby) == null ? void 0 : c[s] : void 0, u = (l == null ? void 0 : l.outputKey) || (l == null ? void 0 : l.rawKey) || (typeof o.alias == "string" && o.alias.length > 0 ? o.alias : typeof o.name == "string" && o.name.length > 0 ? o.name : void 0);
219
- if (!u)
220
- throw new Error(`Aggregate groupByColumns[${a}] has no output key`);
221
- return [s, o.alias, o.name, u].forEach((m) => {
222
- typeof m == "string" && m.length > 0 && r.set(m, u);
223
- }), u;
224
- }), n = (e.rowAggregates ?? []).flatMap((o) => !d(o) || typeof o.function != "string" || typeof o.groupLevel != "string" ? [] : [
225
- {
226
- function: o.function,
227
- groupLevel: o.groupLevel === "ALL" ? "ALL" : r.get(o.groupLevel) || o.groupLevel,
228
- ...typeof o.label == "string" ? { label: o.label } : {}
229
- }
230
- ]);
231
- return { groupColumnKeys: t, rowAggregates: n };
232
- }
233
- function E(e) {
234
- return e === "SUM" ? "Total" : e.charAt(0).toUpperCase() + e.slice(1).toLowerCase();
235
- }
236
- function U(e) {
237
- var t;
238
- if (e.customLabel) return e.customLabel;
239
- const r = E(e.aggregateFunction);
240
- if (e.levelValue !== void 0 && !p(e.levelValue)) {
241
- if (e.levelValue === null) {
242
- const o = (t = e.formatValue) == null ? void 0 : t.call(e, null);
243
- return o ? `Subtotal ${o}` : `Subtotal ${r}`;
244
- }
245
- const n = e.formatValue ? e.formatValue(e.levelValue) : String(e.levelValue);
246
- if (n) return `Subtotal (${n})`;
247
- }
248
- return `Subtotal ${r}`;
249
- }
250
- function G(e, r) {
251
- return r || `Grand ${E(e)}`;
252
- }
253
- function ae(e) {
254
- const r = e.context.groupColumnKeys.indexOf(e.columnKey);
255
- if (r < 0)
256
- throw new Error(
257
- `Aggregate group column "${e.columnKey}" is unknown`
258
- );
259
- return O({
260
- row: e.row,
261
- previousRow: e.previousRow,
262
- levelIndex: r,
263
- getValue: (t, n) => t[e.context.groupColumnKeys[n]]
264
- });
265
- }
266
- function L(e) {
267
- var n, o;
268
- const r = e.context.groupColumnKeys, t = typeof e.row.aggregate == "string" ? e.row.aggregate : "SUM";
269
- if (e.row.isGrandTotal === !0) {
270
- const a = (n = e.context.rowAggregates.find(
271
- (s) => s.groupLevel === "ALL"
272
- )) == null ? void 0 : n.label;
273
- return {
274
- kind: "grand-total",
275
- cells: r.map((s, l) => ({
276
- columnKey: s,
277
- text: l === 0 ? G(t, a) : "",
278
- placement: l === 0 ? "label" : "empty",
279
- colSpan: l === 0 ? r.length : 1
280
- }))
281
- };
282
- }
283
- if (e.row.isSubtotal === !0) {
284
- if (typeof e.row.subtotalLevel != "string")
285
- throw new Error("Aggregate subtotal row is missing subtotalLevel");
286
- const a = r.indexOf(e.row.subtotalLevel);
287
- if (a < 0)
288
- throw new Error(
289
- `Aggregate subtotal level "${e.row.subtotalLevel}" has no group column`
290
- );
291
- const s = d(e.row.subtotalContext) ? e.row.subtotalContext : void 0, l = d(s == null ? void 0 : s.groupByValues) ? s.groupByValues : {}, u = (o = e.context.rowAggregates.find(
292
- (i) => i.groupLevel === e.row.subtotalLevel && i.function === t
293
- )) == null ? void 0 : o.label;
294
- return {
295
- kind: "subtotal",
296
- cells: r.map((i, f) => {
297
- if (f > a)
298
- return {
299
- columnKey: i,
300
- text: "",
301
- placement: "empty",
302
- colSpan: 1
303
- };
304
- if (f < a) {
305
- const c = e.row[i];
306
- return {
307
- columnKey: i,
308
- text: c === void 0 || p(c) ? "" : e.formatValue(c, i),
309
- placement: "value",
310
- colSpan: 1
311
- };
312
- }
313
- return {
314
- columnKey: i,
315
- text: U({
316
- aggregateFunction: t,
317
- customLabel: u,
318
- levelValue: l[i],
319
- formatValue: (c) => e.formatLabelValue ? e.formatLabelValue(c, i) : String(e.formatValue(c, i) ?? "")
320
- }),
321
- placement: "label",
322
- colSpan: r.length - a
323
- };
324
- })
325
- };
326
- }
327
- return {
328
- kind: "data",
329
- cells: r.map((a) => {
330
- const s = e.row[a];
331
- return {
332
- columnKey: a,
333
- text: s === void 0 || p(s) ? "" : e.formatValue(s, a),
334
- placement: "value",
335
- colSpan: 1
336
- };
337
- })
338
- };
339
- }
340
- function se(e) {
341
- const r = L(e).cells.find(
342
- (t) => t.columnKey === e.columnKey
343
- );
344
- if (!r)
345
- throw new Error(`Aggregate group column "${e.columnKey}" is unknown`);
346
- return r.text;
347
- }
348
- function le(e) {
349
- return L(e).cells.map((r) => r.text);
350
- }
351
- class X extends Error {
352
- constructor(t, n) {
353
- super(`${t}: ${n}`);
354
- y(this, "deliveryBlocking", !0);
355
- this.code = t, this.name = "PivotHeaderPresentationError";
356
- }
357
- }
358
- function ie(e) {
359
- var o;
360
- const r = e.mode ?? "formatted", t = e.members.map((a) => {
361
- var l;
362
- if (r === "canonical" || !a.temporalBucket)
363
- return a.value === null ? "" : String(a.value);
364
- const s = (l = e.resolveTemporalFormat) == null ? void 0 : l.call(e, a.fieldId);
365
- if (!s)
366
- throw new X(
367
- "missing_resolved_temporal_format",
368
- `Missing resolved temporal presentation for pivot field "${a.fieldId}"`
369
- );
370
- return P({
371
- value: a.value,
372
- metadata: a.temporalBucket,
373
- format: s
374
- });
375
- }), n = ((o = e.metricLabel) == null ? void 0 : o.trim()) || void 0;
376
- return {
377
- memberLabels: t,
378
- ...n ? { metricLabel: n } : {},
379
- flattenedLabel: [
380
- ...t,
381
- ...n ? [n] : []
382
- ].join(" / ")
383
- };
384
- }
385
- export {
386
- B as A,
387
- I as D,
388
- J as F,
389
- Q as M,
390
- oe as P,
391
- F as a,
392
- k as b,
393
- Z as c,
394
- ee as d,
395
- v as e,
396
- Y as f,
397
- $ as g,
398
- D as h,
399
- te as i,
400
- p as j,
401
- ne as k,
402
- U as l,
403
- G as m,
404
- L as n,
405
- W as o,
406
- z as p,
407
- se as q,
408
- re as r,
409
- ae as s,
410
- le as t,
411
- X as u,
412
- ie as v,
413
- O as w
414
- };
@@ -1,5 +0,0 @@
1
- "use strict";var v=Object.defineProperty;var X=(e,r,t)=>r in e?v(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var w=(e,r,t)=>X(e,typeof r!="symbol"?r+"":r,t);const D=require("./index-Cw2ypaFl.cjs"),f=require("./raw-temporal-CeblVJbu.cjs"),d=require("../pdf-export-policy/index.cjs"),k=require("./temporal-bucket-4YEPEKlJ.cjs");function G(e,r,t){const n={...r,locale:r.locale??t};if(n.type==="number")return f.formatNumericCanonical(e,n);const{prefix:o,suffix:a,...s}=n;return`${o??""}${f.formatNumericCanonical(e,{...s,negativeStyle:n.type==="currency"?n.negativeStyle:"minus"})}${a??""}`}function A(e,r,t){return e===null?{value:e,text:null}:!r||!D.isNumericCanonicalFormat(r)&&r.type!=="duration"?{value:e,text:f.formatNumericCanonical(e,{type:"number",locale:t})}:r.type==="duration"?{value:e,text:f.formatDuration(e,{inputUnit:r.inputUnit,outputStyle:r.outputStyle,largestUnit:r.largestUnit,smallestUnit:r.smallestUnit,maxUnits:r.maxUnits,prefix:r.prefix,suffix:r.suffix,negativeInParentheses:r.negativeStyle==="parentheses"})}:{value:e,text:G(e,r,t)}}function T(e,r,t,n){return e===null?{value:e,text:null}:n==="percent"?{value:e,text:f.formatNumericCanonical(e,{type:"percent",locale:t,minimumFractionDigits:r,maximumFractionDigits:r,percentValueMode:"fraction"})}:{value:e,text:f.formatNumericCanonical(e,{type:"number",locale:t,minimumFractionDigits:r,maximumFractionDigits:r,suffix:"×"})}}function _(e,r){if(e===void 0)return r;if(!Number.isInteger(e)||e<0||e>6)throw new RangeError("Comparison precision must be an integer from 0 to 6.");return e}function B(e,r){const t={mode:r.displayMode,current:A(e.currentValue,r.metricFormat,r.locale),comparison:A(e.comparisonValue,r.metricFormat,r.locale)};return(r.displayMode==="difference"||r.displayMode==="both")&&(t.difference=A(e.delta,r.metricFormat,r.locale)),(r.displayMode==="percent_change"||r.displayMode==="both")&&(t.percentChange=T(e.percentChange,_(r.precision,1),r.locale,"percent")),r.displayMode==="ratio"&&(t.ratio=T(e.ratio,_(r.precision,2),r.locale,"ratio")),t}function $(e){const r=e.trimStart().charAt(0);return["=","+","-","@"].includes(r)||[" ","\r",`
2
- `].includes(e.charAt(0))?`'${e}`:e}function C(e,r=","){if(e==null)return"";const t=String(e);return t.includes(r)||t.includes('"')||t.includes(`
3
- `)||t.includes("\r")?`"${t.replace(/"/g,'""')}"`:t}function b(e,r=","){return e.map(t=>C(t,r)).join(r)}function h(e,r={}){const{delimiter:t=",",lineEnding:n=`
4
- `}=r;return e.map(o=>b(o,t)).join(n)}function U(e,r={}){if(e.length===0)return"";const{delimiter:t=",",lineEnding:n=`
5
- `,includeHeaders:o=!0,columns:a}=r,s=a||Object.keys(e[0]),l=[];o&&l.push(s);for(const u of e){const i=s.map(g=>{const c=u[g];return c==null?"":String(c)});l.push(i)}return h(l,{delimiter:t,lineEnding:n})}const L=1e4,N=1e6,j=5e6,q=1024**3,Y=1024**3;function H(e){return e>L}class R extends Error{constructor(){super(...arguments);w(this,"code",d.PDF_SAFETY_LIMIT_EXCEEDED)}}function S(e){if(!e||typeof e!="object")return;const{error:r,message:t,detail:n}=e;for(const o of[r,t,n])if(typeof o=="string"&&o.trim())return o.trim()}async function x(e){const r=`PDF request failed: ${e.status} ${e.statusText}`.trim(),t=e.headers.get("content-type")||"";try{if(t.includes("application/json")){const o=await e.json(),a=typeof o.code=="string"?o.code:typeof o.errorCode=="string"?o.errorCode:void 0;return{message:S(o)||r,code:a}}const n=await e.text();if(!n.trim())return{message:r};try{const o=JSON.parse(n),a=typeof o.code=="string"?o.code:typeof o.errorCode=="string"?o.errorCode:void 0;return{message:S(o)||n.trim(),code:a}}catch{return{message:n.trim()}}}catch{return{message:r}}}async function K(e){if(!e.token)throw new Error("Missing auth token for PDF export");if(d.getUtf8ByteLength(e.serializedPayload)>d.FAST_PDF_POLICY.maxRequestBytes)throw new Error("Fast-path PDF request exceeds the structured body limit");const r=await(e.fetchImpl??fetch)(e.url,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:e.serializedPayload,signal:e.signal});if(!r.ok){const n=await x(r);throw n.code===d.PDF_SAFETY_LIMIT_EXCEEDED?new R(n.message):new Error(n.message)}const t=await r.json();if(t!=null&&t.error)throw new Error(t.error);if(typeof(t==null?void 0:t.url)!="string"||!t.url.trim())throw new Error("Fast-path PDF response missing download URL");return t}const W="pdf-group-continuation";function P(e){if(!e.previousRow||e.row.isSubtotal===!0||e.row.isGrandTotal===!0||e.previousRow.isSubtotal===!0||e.previousRow.isGrandTotal===!0)return!0;for(let r=0;r<=e.levelIndex;r++)if(e.getValue(e.row,r)!==e.getValue(e.previousRow,r))return!0;return!1}const V="__TOTAL__";function m(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function p(e){return e===V}function z(e){const r=new Map,t=(e.groupByColumns??[]).map((o,a)=>{var i,g,c;if(!m(o))throw new Error(`Aggregate groupByColumns[${a}] is invalid`);const s=typeof o.id=="string"&&o.id.length>0?o.id:void 0,l=s?(c=(g=(i=e.columnKeyMap)==null?void 0:i.byRole)==null?void 0:g.groupby)==null?void 0:c[s]:void 0,u=(l==null?void 0:l.outputKey)||(l==null?void 0:l.rawKey)||(typeof o.alias=="string"&&o.alias.length>0?o.alias:typeof o.name=="string"&&o.name.length>0?o.name:void 0);if(!u)throw new Error(`Aggregate groupByColumns[${a}] has no output key`);return[s,o.alias,o.name,u].forEach(y=>{typeof y=="string"&&y.length>0&&r.set(y,u)}),u}),n=(e.rowAggregates??[]).flatMap(o=>!m(o)||typeof o.function!="string"||typeof o.groupLevel!="string"?[]:[{function:o.function,groupLevel:o.groupLevel==="ALL"?"ALL":r.get(o.groupLevel)||o.groupLevel,...typeof o.label=="string"?{label:o.label}:{}}]);return{groupColumnKeys:t,rowAggregates:n}}function M(e){return e==="SUM"?"Total":e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function O(e){var t;if(e.customLabel)return e.customLabel;const r=M(e.aggregateFunction);if(e.levelValue!==void 0&&!p(e.levelValue)){if(e.levelValue===null){const o=(t=e.formatValue)==null?void 0:t.call(e,null);return o?`Subtotal ${o}`:`Subtotal ${r}`}const n=e.formatValue?e.formatValue(e.levelValue):String(e.levelValue);if(n)return`Subtotal (${n})`}return`Subtotal ${r}`}function F(e,r){return r||`Grand ${M(e)}`}function J(e){const r=e.context.groupColumnKeys.indexOf(e.columnKey);if(r<0)throw new Error(`Aggregate group column "${e.columnKey}" is unknown`);return P({row:e.row,previousRow:e.previousRow,levelIndex:r,getValue:(t,n)=>t[e.context.groupColumnKeys[n]]})}function E(e){var n,o;const r=e.context.groupColumnKeys,t=typeof e.row.aggregate=="string"?e.row.aggregate:"SUM";if(e.row.isGrandTotal===!0){const a=(n=e.context.rowAggregates.find(s=>s.groupLevel==="ALL"))==null?void 0:n.label;return{kind:"grand-total",cells:r.map((s,l)=>({columnKey:s,text:l===0?F(t,a):"",placement:l===0?"label":"empty",colSpan:l===0?r.length:1}))}}if(e.row.isSubtotal===!0){if(typeof e.row.subtotalLevel!="string")throw new Error("Aggregate subtotal row is missing subtotalLevel");const a=r.indexOf(e.row.subtotalLevel);if(a<0)throw new Error(`Aggregate subtotal level "${e.row.subtotalLevel}" has no group column`);const s=m(e.row.subtotalContext)?e.row.subtotalContext:void 0,l=m(s==null?void 0:s.groupByValues)?s.groupByValues:{},u=(o=e.context.rowAggregates.find(i=>i.groupLevel===e.row.subtotalLevel&&i.function===t))==null?void 0:o.label;return{kind:"subtotal",cells:r.map((i,g)=>{if(g>a)return{columnKey:i,text:"",placement:"empty",colSpan:1};if(g<a){const c=e.row[i];return{columnKey:i,text:c===void 0||p(c)?"":e.formatValue(c,i),placement:"value",colSpan:1}}return{columnKey:i,text:O({aggregateFunction:t,customLabel:u,levelValue:l[i],formatValue:c=>e.formatLabelValue?e.formatLabelValue(c,i):String(e.formatValue(c,i)??"")}),placement:"label",colSpan:r.length-a}})}}return{kind:"data",cells:r.map(a=>{const s=e.row[a];return{columnKey:a,text:s===void 0||p(s)?"":e.formatValue(s,a),placement:"value",colSpan:1}})}}function Q(e){const r=E(e).cells.find(t=>t.columnKey===e.columnKey);if(!r)throw new Error(`Aggregate group column "${e.columnKey}" is unknown`);return r.text}function Z(e){return E(e).cells.map(r=>r.text)}class I extends Error{constructor(t,n){super(`${t}: ${n}`);w(this,"deliveryBlocking",!0);this.code=t,this.name="PivotHeaderPresentationError"}}function ee(e){var o;const r=e.mode??"formatted",t=e.members.map(a=>{var l;if(r==="canonical"||!a.temporalBucket)return a.value===null?"":String(a.value);const s=(l=e.resolveTemporalFormat)==null?void 0:l.call(e,a.fieldId);if(!s)throw new I("missing_resolved_temporal_format",`Missing resolved temporal presentation for pivot field "${a.fieldId}"`);return k.formatTemporalBucket({value:a.value,metadata:a.temporalBucket,format:s})}),n=((o=e.metricLabel)==null?void 0:o.trim())||void 0;return{memberLabels:t,...n?{metricLabel:n}:{},flattenedLabel:[...t,...n?[n]:[]].join(" / ")}}exports.AGGREGATE_TOTAL_MEMBER_MARKER=V;exports.DIRECT_CSV_EXPORT_MAX_ROWS=L;exports.FULL_DATASET_CSV_EXPORT_MAX_ROWS=N;exports.MATRIX_EXPORT_MAX_ARTIFACT_BYTES=Y;exports.MATRIX_EXPORT_MAX_CELLS=j;exports.MATRIX_EXPORT_MAX_ENCODED_BYTES=q;exports.PDF_GROUP_CONTINUATION_CLASS=W;exports.PdfSafetyLimitError=R;exports.PivotHeaderPresentationError=I;exports.arrayToCSV=h;exports.arrayToCSVRow=b;exports.escapeCSVValue=C;exports.formatAggregateGrandTotalLabel=F;exports.formatAggregateGroupCell=Q;exports.formatAggregateGroupRow=Z;exports.formatAggregateSubtotalLabel=O;exports.formatMetricComparison=B;exports.isAggregateTotalMemberMarker=p;exports.objectsToCSV=U;exports.presentAggregateGroupRow=E;exports.presentPivotHeader=ee;exports.protectCSVText=$;exports.readPdfErrorResponse=x;exports.requestStructuredPdf=K;exports.requiresChunkedCsvExport=H;exports.resolveAggregateTablePresentationContext=z;exports.shouldPresentAggregateGroupValue=J;exports.shouldPresentGroupedTableValue=P;