@e-llm-studio/federated-dashboard-components 2.2.9-rca-test-13 → 2.2.9-rca-test-15

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 (90) hide show
  1. package/dist/ExecutiveDashboard/ExecutiveDashboardWrapper.js +1 -1
  2. package/dist/ExecutiveDashboard/api/insightsApi.js +1 -1
  3. package/dist/ExecutiveDashboard/components/DashboardDateFilter/DashboardDateFilter.js +1 -1
  4. package/dist/ExecutiveDashboard/components/DashboardHeader/DashboardHeader.js +1 -1
  5. package/dist/ExecutiveDashboard/components/ExecutiveDashboard.js +1 -1
  6. package/dist/ExecutiveDashboard/components/Graph/LineChart.js +1 -1
  7. package/dist/ExecutiveDashboard/components/Graph/axisDomain.js +2 -0
  8. package/dist/ExecutiveDashboard/components/Graph/axisDomain.js.map +1 -0
  9. package/dist/ExecutiveDashboard/components/Insights/AgCharts.js +1 -1
  10. package/dist/ExecutiveDashboard/components/Insights/AgReport.js +1 -1
  11. package/dist/ExecutiveDashboard/components/Insights/DecisionAdvantageCard.js +1 -1
  12. package/dist/ExecutiveDashboard/components/Insights/DrillLevel.js +1 -1
  13. package/dist/ExecutiveDashboard/components/Insights/DrillTable.js +1 -1
  14. package/dist/ExecutiveDashboard/components/Insights/InsightsContext.js +1 -1
  15. package/dist/ExecutiveDashboard/components/Insights/KpiChart.js +2 -0
  16. package/dist/ExecutiveDashboard/components/Insights/KpiChart.js.map +1 -0
  17. package/dist/ExecutiveDashboard/components/Insights/L1Report.js +1 -1
  18. package/dist/ExecutiveDashboard/components/Insights/RowDetail.js +1 -1
  19. package/dist/ExecutiveDashboard/components/Insights/agPrimitives.js +1 -1
  20. package/dist/ExecutiveDashboard/components/Insights/insightsFormat.js +2 -0
  21. package/dist/ExecutiveDashboard/components/Insights/insightsFormat.js.map +1 -0
  22. package/dist/ExecutiveDashboard/components/Insights/insightsUtils.js +1 -1
  23. package/dist/ExecutiveDashboard/components/RcaDecisionComponent/RcaDecisionComponent.js +1 -1
  24. package/dist/cjs/ExecutiveDashboard/ExecutiveDashboardWrapper.js +1 -1
  25. package/dist/cjs/ExecutiveDashboard/api/insightsApi.js +1 -1
  26. package/dist/cjs/ExecutiveDashboard/components/DashboardDateFilter/DashboardDateFilter.js +1 -1
  27. package/dist/cjs/ExecutiveDashboard/components/DashboardHeader/DashboardHeader.js +1 -1
  28. package/dist/cjs/ExecutiveDashboard/components/ExecutiveDashboard.js +1 -1
  29. package/dist/cjs/ExecutiveDashboard/components/Graph/LineChart.js +1 -1
  30. package/dist/cjs/ExecutiveDashboard/components/Graph/axisDomain.js +2 -0
  31. package/dist/cjs/ExecutiveDashboard/components/Graph/axisDomain.js.map +1 -0
  32. package/dist/cjs/ExecutiveDashboard/components/Insights/AgCharts.js +1 -1
  33. package/dist/cjs/ExecutiveDashboard/components/Insights/AgReport.js +1 -1
  34. package/dist/cjs/ExecutiveDashboard/components/Insights/DecisionAdvantageCard.js +1 -1
  35. package/dist/cjs/ExecutiveDashboard/components/Insights/DrillLevel.js +1 -1
  36. package/dist/cjs/ExecutiveDashboard/components/Insights/DrillTable.js +1 -1
  37. package/dist/cjs/ExecutiveDashboard/components/Insights/InsightsContext.js +1 -1
  38. package/dist/cjs/ExecutiveDashboard/components/Insights/KpiChart.js +2 -0
  39. package/dist/cjs/ExecutiveDashboard/components/Insights/KpiChart.js.map +1 -0
  40. package/dist/cjs/ExecutiveDashboard/components/Insights/L1Report.js +1 -1
  41. package/dist/cjs/ExecutiveDashboard/components/Insights/RowDetail.js +1 -1
  42. package/dist/cjs/ExecutiveDashboard/components/Insights/agPrimitives.js +1 -1
  43. package/dist/cjs/ExecutiveDashboard/components/Insights/insightsFormat.js +2 -0
  44. package/dist/cjs/ExecutiveDashboard/components/Insights/insightsFormat.js.map +1 -0
  45. package/dist/cjs/ExecutiveDashboard/components/Insights/insightsUtils.js +1 -1
  46. package/dist/cjs/ExecutiveDashboard/components/RcaDecisionComponent/RcaDecisionComponent.js +1 -1
  47. package/dist/cjs/styles.css +1 -1
  48. package/dist/styles.css +1 -1
  49. package/dist/types/ExecutiveDashboard/ExecutiveDashboardWrapper.d.ts +1 -1
  50. package/dist/types/ExecutiveDashboard/ExecutiveDashboardWrapper.d.ts.map +1 -1
  51. package/dist/types/ExecutiveDashboard/TestExecutiveDashboard.d.ts.map +1 -1
  52. package/dist/types/ExecutiveDashboard/api/insightsApi.d.ts +2 -0
  53. package/dist/types/ExecutiveDashboard/api/insightsApi.d.ts.map +1 -1
  54. package/dist/types/ExecutiveDashboard/components/DashboardDateFilter/DashboardDateFilter.d.ts +3 -1
  55. package/dist/types/ExecutiveDashboard/components/DashboardDateFilter/DashboardDateFilter.d.ts.map +1 -1
  56. package/dist/types/ExecutiveDashboard/components/DashboardHeader/DashboardHeader.d.ts +8 -1
  57. package/dist/types/ExecutiveDashboard/components/DashboardHeader/DashboardHeader.d.ts.map +1 -1
  58. package/dist/types/ExecutiveDashboard/components/ExecutiveDashboard.d.ts +3 -1
  59. package/dist/types/ExecutiveDashboard/components/ExecutiveDashboard.d.ts.map +1 -1
  60. package/dist/types/ExecutiveDashboard/components/Graph/LineChart.d.ts.map +1 -1
  61. package/dist/types/ExecutiveDashboard/components/Graph/axisDomain.d.ts +24 -0
  62. package/dist/types/ExecutiveDashboard/components/Graph/axisDomain.d.ts.map +1 -0
  63. package/dist/types/ExecutiveDashboard/components/Graph/types.d.ts +22 -0
  64. package/dist/types/ExecutiveDashboard/components/Graph/types.d.ts.map +1 -1
  65. package/dist/types/ExecutiveDashboard/components/Insights/AgCharts.d.ts +5 -1
  66. package/dist/types/ExecutiveDashboard/components/Insights/AgCharts.d.ts.map +1 -1
  67. package/dist/types/ExecutiveDashboard/components/Insights/AgReport.d.ts.map +1 -1
  68. package/dist/types/ExecutiveDashboard/components/Insights/DecisionAdvantageCard.d.ts.map +1 -1
  69. package/dist/types/ExecutiveDashboard/components/Insights/DrillTable.d.ts.map +1 -1
  70. package/dist/types/ExecutiveDashboard/components/Insights/InsightsContext.d.ts.map +1 -1
  71. package/dist/types/ExecutiveDashboard/components/Insights/KpiChart.d.ts +90 -0
  72. package/dist/types/ExecutiveDashboard/components/Insights/KpiChart.d.ts.map +1 -0
  73. package/dist/types/ExecutiveDashboard/components/Insights/L1Report.d.ts.map +1 -1
  74. package/dist/types/ExecutiveDashboard/components/Insights/agPrimitives.d.ts +10 -2
  75. package/dist/types/ExecutiveDashboard/components/Insights/agPrimitives.d.ts.map +1 -1
  76. package/dist/types/ExecutiveDashboard/components/Insights/insightsContextCore.d.ts +9 -1
  77. package/dist/types/ExecutiveDashboard/components/Insights/insightsContextCore.d.ts.map +1 -1
  78. package/dist/types/ExecutiveDashboard/components/Insights/insightsFormat.d.ts +49 -0
  79. package/dist/types/ExecutiveDashboard/components/Insights/insightsFormat.d.ts.map +1 -0
  80. package/dist/types/ExecutiveDashboard/components/Insights/insightsUtils.d.ts +10 -4
  81. package/dist/types/ExecutiveDashboard/components/Insights/insightsUtils.d.ts.map +1 -1
  82. package/dist/types/ExecutiveDashboard/components/RcaDecisionComponent/RcaDecisionComponent.d.ts +1 -1
  83. package/dist/types/ExecutiveDashboard/components/RcaDecisionComponent/RcaDecisionComponent.d.ts.map +1 -1
  84. package/dist/types/ExecutiveDashboard/components/RcaDecisionComponent/types.d.ts +11 -0
  85. package/dist/types/ExecutiveDashboard/components/RcaDecisionComponent/types.d.ts.map +1 -1
  86. package/dist/types/ExecutiveDashboard/types/index.d.ts +14 -0
  87. package/dist/types/ExecutiveDashboard/types/index.d.ts.map +1 -1
  88. package/dist/types/ExecutiveDashboard/types/insights.d.ts +112 -0
  89. package/dist/types/ExecutiveDashboard/types/insights.d.ts.map +1 -1
  90. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),n=require("react"),t=require("../../api/insightsApi.js"),r=require("./agPrimitives.js"),i=require("./insightsContextCore.js");var o=function(e){var n=e.slice(0,10).split("-").map(Number),t=n[0],r=n[1],i=n[2];return new Date(t,(r||1)-1,i||1)};function a(e){if(!(null==e?void 0:e.start)||!(null==e?void 0:e.end))return"";var n=o(e.start),t=o(e.end),r=function(e){return e.getDate()},i=function(e){return e.toLocaleString("en-GB",{month:"short"})};return e.start===e.end?"".concat(r(t)," ").concat(i(t)," ").concat(t.getFullYear()):n.getFullYear()===t.getFullYear()&&n.getMonth()===t.getMonth()?"".concat(r(n),"–").concat(r(t)," ").concat(i(t)," ").concat(t.getFullYear()):n.getFullYear()===t.getFullYear()?"".concat(r(n)," ").concat(i(n)," – ").concat(r(t)," ").concat(i(t)," ").concat(t.getFullYear()):"".concat(r(n)," ").concat(i(n)," ").concat(n.getFullYear()," – ").concat(r(t)," ").concat(i(t)," ").concat(t.getFullYear())}var l={spike:"Spike",drop:"Drop",fast_mover:"Fast mover",slow_mover:"Slow mover",new_entity:"New",dormant_entity:"Went quiet",recovered:"Recovered",stable:"Stable"};var s="insights:open-entity-report";var u=function(e,n){return Array.from(new Set(e.map(function(e){return(null!=e?e:"").trim()}).filter(Boolean))).slice(0,n)};exports.OPEN_INSIGHTS_ENTITY_REPORT=s,exports.formatPeriod=a,exports.formatReportDate=function(e){return(null==e?void 0:e.end)?a({start:e.end,end:e.end}):""},exports.formatValue=function(e){return null!=e&&Number.isFinite(e)?String(e):"—"},exports.insightTabItems=function(e){var n,t;return(null!==(t=null===(n=null==e?void 0:e.tabs)||void 0===n?void 0:n.items)&&void 0!==t?t:[]).filter(function(e){return e&&"string"==typeof e.entityKey&&e.entityKey})},exports.isInsightsOn=function(e){var n=null==e?void 0:e.enabled;return!0===n||"string"==typeof n&&["true","yes","y","1"].includes(n.trim().toLowerCase())},exports.movementLabel=function(e){var n;return e?null!==(n=l[e])&&void 0!==n?n:e.replace(/_/g," "):""},exports.previousDayLabel=function(e){var n=e?new Date("".concat(e.slice(0,10),"T00:00:00")).getDay():1;return 0===n||6===n?"vs previous weekend day":"vs previous working day"},exports.reportDecisioning=function(n,t){var r,i,o,a,l;if(!n||"generated"!==n.status)return null;var s=e.__spreadArray(e.__spreadArray([],null!==(r=n.rootCause)&&void 0!==r?r:[],!0),null!==(i=n.nextSteps)&&void 0!==i?i:[],!0).map(function(e){return e.decisioning}).filter(Boolean),c=u(s.flatMap(function(e){var n;return null!==(n=e.decisionMakingFactors)&&void 0!==n?n:[]}),3),d=u(s.flatMap(function(e){var n;return null!==(n=e.gapsInDecision)&&void 0!==n?n:[]}),4);return c.length||d.length||null!=n.score?{explanation:null!=t?t:(null===(o=n.summary)||void 0===o?void 0:o.body)||(null===(a=s[0])||void 0===a?void 0:a.explanation)||void 0,decisionMakingFactors:c,gapsInDecision:d,score:null!==(l=n.score)&&void 0!==l?l:void 0}:null},exports.sentimentColor=function(e,n){return void 0===n&&(n="up"),"up"!==e&&"down"!==e?"#d97706":e===n?"#16a34a":"#dc2626"},exports.shortDay=function(e){var n=String(e);return/^\d{4}-\d{2}-\d{2}/.test(n)?"".concat(n.slice(5,7),"/").concat(n.slice(8,10)):n},exports.summaryCardConfig=function(e){var n=null==e?void 0:e.summaryCard;return n&&!1!==n.enabled?n:null},exports.toRcaItems=function(e,t){return(null!=e?e:[]).map(function(e){var i,o,a,l,s,u,c,d,v,g;return{id:e.id,content:(null===(i=e.links)||void 0===i?void 0:i.length)&&t?n.createElement(r.VerdictSentence,{text:e.content,arrowsFollowVerdict:!0,renderText:r.linkedText(e.links,t)}):/^(Good|Bad) news\s*[-–—]|[↑↓]/.test(e.content)?n.createElement(r.VerdictSentence,{text:e.content,arrowsFollowVerdict:!0}):e.content,decisioning:e.decisioning?{explanation:null!==(o=e.decisioning.explanation)&&void 0!==o?o:void 0,decisionMakingFactors:(null!==(a=e.decisioning.decisionMakingFactors)&&void 0!==a?a:[]).slice(0,3),gapsInDecision:null!==(l=e.decisioning.gapsInDecision)&&void 0!==l?l:[],score:null!==(s=e.decisioning.score)&&void 0!==s?s:void 0,evidence:e.decisioning.evidence?{label:e.decisioning.evidence.label,title:null!==(u=e.decisioning.evidence.title)&&void 0!==u?u:void 0,description:null!==(c=e.decisioning.evidence.description)&&void 0!==c?c:void 0,items:null!==(d=e.decisioning.evidence.items)&&void 0!==d?d:[],highlight:null!==(v=e.decisioning.evidence.highlight)&&void 0!==v?v:void 0,footer:null!==(g=e.decisioning.evidence.footer)&&void 0!==g?g:void 0}:void 0}:void 0}})},exports.useInsightsFetch=function(t,r,i){var o=n.useState({loading:Boolean(t),identityKey:i}),a=o[0],l=o[1],s=n.useState(0),u=s[0],c=s[1],d=n.useRef(t);d.current=t,n.useEffect(function(){var n=d.current;if(n){var t=new AbortController;return l(function(e){return{data:e.identityKey===i?e.data:void 0,loading:!0,identityKey:i}}),n(t.signal).then(function(e){t.signal.aborted||l({data:e,loading:!1,identityKey:i})}).catch(function(e){t.signal.aborted||"AbortError"===(null==e?void 0:e.name)||l({error:e,loading:!1,identityKey:i})}),function(){return t.abort()}}l(function(n){return e.__assign(e.__assign({},n),{data:n.identityKey===i?n.data:void 0,error:void 0,loading:!1,identityKey:i})})},e.__spreadArray(e.__spreadArray([],r,!0),[u,i],!1));var v=void 0===i||a.identityKey===i;return e.__assign(e.__assign({},a),{data:v?a.data:void 0,error:v?a.error:void 0,loading:v?a.loading:Boolean(t),reload:function(){return c(function(e){return e+1})},updateData:function(n){return l(function(t){return e.__assign(e.__assign({},t),{data:n(t.identityKey===i?t.data:void 0),identityKey:i})})}})},exports.useJob=function(r,i,o){var a=this,l=n.useState({status:null,error:null}),s=l[0],u=l[1],c=n.useRef(o);return c.current=o,n.useEffect(function(){if(r&&i){var n,o=!1,l=function(){return e.__awaiter(a,void 0,void 0,function(){var a,s,d;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,t.fetchInsightsJob(i,r)];case 1:return a=e.sent(),o?[2]:(u({status:a.status,error:"failed"===a.status?a.error||"The job failed.":null}),"succeeded"===a.status?null===(d=c.current)||void 0===d||d.call(c,a.reportId):"failed"!==a.status&&(n=setTimeout(l,4e3)),[3,3]);case 2:return s=e.sent(),o||u({status:"failed",error:s.message||"The job couldn't be checked."}),[3,3];case 3:return[2]}})})};return l(),function(){o=!0,clearTimeout(n)}}u({status:null,error:null})},[r,i]),s},exports.useOpenRow=function(){var n=this,r=i.useInsights();return function(i){return e.__awaiter(n,void 0,void 0,function(){var n,o,a,l;return e.__generator(this,function(e){switch(e.label){case 0:if(!r)return[2];if(n=new CustomEvent(s,{detail:i,cancelable:!0}),window.dispatchEvent(n),n.defaultPrevented)return[3,4];if(!(o=r.headlineKpi))return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,t.fetchRowReport(r.api,i.nodeKey,{kpiId:o,dataDay:i.dataDay||t.toIsoDay(r.range.endDate)})];case 2:return a=e.sent(),(null===(l=a.report)||void 0===l?void 0:l.reportId)&&r.openReport({reportId:a.report.reportId,title:i.label}),[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}})})}},exports.viewerFromToken=function(e){var n,t,r;try{var i=null==e?void 0:e.replace(/^bearer\s+/i,"").split(".")[1];if(!i)return{email:null,isAdmin:!1};var o=JSON.parse(decodeURIComponent(escape(atob(i.replace(/-/g,"+").replace(/_/g,"/"))))),a=[].concat(null!==(n=o.rolename)&&void 0!==n?n:[],null!==(t=o.role)&&void 0!==t?t:[],null!==(r=o.roles)&&void 0!==r?r:[]).map(String);return{email:o.email||o.sub||null,isAdmin:a.some(function(e){return"cw-admin"===e||/ Admin$/.test(e)})}}catch(e){return{email:null,isAdmin:!1}}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),t=require("react"),n=require("../../api/insightsApi.js"),r=require("./agPrimitives.js"),i=require("./insightsFormat.js"),o=require("./insightsContextCore.js");var a=function(e){var t=e?new Date("".concat(e.slice(0,10),"T00:00:00")).getDay():1;return 0===t||6===t?"vs previous weekend day":"vs previous working day"},l=function(e){var t=e.slice(0,10).split("-").map(Number),n=t[0],r=t[1],i=t[2];return new Date(n,(r||1)-1,i||1)};function s(e){if(null==e?void 0:e.label)return e.label;if(!(null==e?void 0:e.start)||!(null==e?void 0:e.end))return"";var t=l(e.start),n=l(e.end),r=function(e){return e.getDate()},i=function(e){return e.toLocaleString("en-GB",{month:"short"})};return e.start===e.end?"".concat(r(n)," ").concat(i(n)," ").concat(n.getFullYear()):t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()?"".concat(r(t),"–").concat(r(n)," ").concat(i(n)," ").concat(n.getFullYear()):t.getFullYear()===n.getFullYear()?"".concat(r(t)," ").concat(i(t)," – ").concat(r(n)," ").concat(i(n)," ").concat(n.getFullYear()):"".concat(r(t)," ").concat(i(t)," ").concat(t.getFullYear()," – ").concat(r(n)," ").concat(i(n)," ").concat(n.getFullYear())}var u={spike:"Spike",drop:"Drop",fast_mover:"Fast mover",slow_mover:"Slow mover",new_entity:"New",dormant_entity:"Went quiet",recovered:"Recovered",stable:"Stable"};var d="insights:open-entity-report";var c=function(e,t){return Array.from(new Set(e.map(function(e){return(null!=e?e:"").trim()}).filter(Boolean))).slice(0,t)};exports.averageLabel=i.averageLabel,exports.averageLineLabel=i.averageLineLabel,exports.averageShort=i.averageShort,exports.formatAxisFigure=i.formatAxisFigure,exports.formatFigure=i.formatFigure,exports.longPeriod=i.longPeriod,exports.periodWordsOf=i.periodWordsOf,exports.rootCauseTag=i.rootCauseTag,exports.shortPeriod=i.shortPeriod,exports.OPEN_INSIGHTS_ENTITY_REPORT=d,exports.formatPeriod=s,exports.formatReportDate=function(e){return(null==e?void 0:e.label)?e.label:(null==e?void 0:e.end)?s({start:e.end,end:e.end}):""},exports.formatValue=function(e){return null!=e&&Number.isFinite(e)?String(e):"—"},exports.insightTabItems=function(e){var t,n;return(null!==(n=null===(t=null==e?void 0:e.tabs)||void 0===t?void 0:t.items)&&void 0!==n?n:[]).filter(function(e){return e&&"string"==typeof e.entityKey&&e.entityKey})},exports.isInsightsOn=function(e){var t=null==e?void 0:e.enabled;return!0===t||"string"==typeof t&&["true","yes","y","1"].includes(t.trim().toLowerCase())},exports.movementLabel=function(e){var t;return e?null!==(t=u[e])&&void 0!==t?t:e.replace(/_/g," "):""},exports.periodName=function(e,t){if(!t||"day"===t||!e)return"today";var n=i.longPeriod(e,t);return"month"===t?n.split(" ")[0]:n},exports.previousDayLabel=a,exports.previousPeriodLabel=function(e,t){return t&&"day"!==t?"vs previous ".concat(t):a(e)},exports.reportDecisioning=function(t,n){var r,i,o,a,l;if(!t||"generated"!==t.status)return null;var s=e.__spreadArray(e.__spreadArray([],null!==(r=t.rootCause)&&void 0!==r?r:[],!0),null!==(i=t.nextSteps)&&void 0!==i?i:[],!0).map(function(e){return e.decisioning}).filter(Boolean),u=c(s.flatMap(function(e){var t;return null!==(t=e.decisionMakingFactors)&&void 0!==t?t:[]}),3),d=c(s.flatMap(function(e){var t;return null!==(t=e.gapsInDecision)&&void 0!==t?t:[]}),4);return u.length||d.length||null!=t.score?{explanation:null!=n?n:(null===(o=t.summary)||void 0===o?void 0:o.body)||(null===(a=s[0])||void 0===a?void 0:a.explanation)||void 0,decisionMakingFactors:u,gapsInDecision:d,score:null!==(l=t.score)&&void 0!==l?l:void 0}:null},exports.sentimentColor=function(e,t){return void 0===t&&(t="up"),"up"!==e&&"down"!==e?"#d97706":e===t?"#16a34a":"#dc2626"},exports.shortDay=function(e){var t=String(e);return/^\d{4}-\d{2}-\d{2}/.test(t)?"".concat(t.slice(5,7),"/").concat(t.slice(8,10)):t},exports.summaryCardConfig=function(e){var t=null==e?void 0:e.summaryCard;return t&&!1!==t.enabled?t:null},exports.toRcaItems=function(e,n,o){return(null!=e?e:[]).map(function(e){var a,l,s,u,d,c,v,g,p,f,m,y;return{id:e.id,tag:i.rootCauseTag(e.tag,o),title:i.rootCauseTitle(e.content,e.links),detail:null!==(l=null===(a=e.decisioning)||void 0===a?void 0:a.explanation)&&void 0!==l?l:void 0,content:(null===(s=e.links)||void 0===s?void 0:s.length)&&n?t.createElement(r.VerdictSentence,{text:e.content,arrowsFollowVerdict:!0,renderText:r.linkedText(e.links,n)}):/^(Good|Bad) news\s*[-–—]|[↑↓]/.test(e.content)?t.createElement(r.VerdictSentence,{text:e.content,arrowsFollowVerdict:!0}):e.content,decisioning:e.decisioning?{explanation:null!==(u=e.decisioning.explanation)&&void 0!==u?u:void 0,decisionMakingFactors:(null!==(d=e.decisioning.decisionMakingFactors)&&void 0!==d?d:[]).slice(0,3),gapsInDecision:null!==(c=e.decisioning.gapsInDecision)&&void 0!==c?c:[],score:null!==(v=e.decisioning.score)&&void 0!==v?v:void 0,evidence:e.decisioning.evidence?{label:e.decisioning.evidence.label,title:null!==(g=e.decisioning.evidence.title)&&void 0!==g?g:void 0,description:null!==(p=e.decisioning.evidence.description)&&void 0!==p?p:void 0,items:null!==(f=e.decisioning.evidence.items)&&void 0!==f?f:[],highlight:null!==(m=e.decisioning.evidence.highlight)&&void 0!==m?m:void 0,footer:null!==(y=e.decisioning.evidence.footer)&&void 0!==y?y:void 0}:void 0}:void 0}})},exports.useInsightsFetch=function(n,r,i){var o=t.useState({loading:Boolean(n),identityKey:i}),a=o[0],l=o[1],s=t.useState(0),u=s[0],d=s[1],c=t.useRef(n);c.current=n,t.useEffect(function(){var t=c.current;if(t){var n=new AbortController;return l(function(e){return{data:e.identityKey===i?e.data:void 0,loading:!0,identityKey:i}}),t(n.signal).then(function(e){n.signal.aborted||l({data:e,loading:!1,identityKey:i})}).catch(function(e){n.signal.aborted||"AbortError"===(null==e?void 0:e.name)||l({error:e,loading:!1,identityKey:i})}),function(){return n.abort()}}l(function(t){return e.__assign(e.__assign({},t),{data:t.identityKey===i?t.data:void 0,error:void 0,loading:!1,identityKey:i})})},e.__spreadArray(e.__spreadArray([],r,!0),[u,i],!1));var v=void 0===i||a.identityKey===i;return e.__assign(e.__assign({},a),{data:v?a.data:void 0,error:v?a.error:void 0,loading:v?a.loading:Boolean(n),reload:function(){return d(function(e){return e+1})},updateData:function(t){return l(function(n){return e.__assign(e.__assign({},n),{data:t(n.identityKey===i?n.data:void 0),identityKey:i})})}})},exports.useJob=function(r,i,o){var a=this,l=t.useState({status:null,error:null}),s=l[0],u=l[1],d=t.useRef(o);return d.current=o,t.useEffect(function(){if(r&&i){var t,o=!1,l=function(){return e.__awaiter(a,void 0,void 0,function(){var a,s,c;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,n.fetchInsightsJob(i,r)];case 1:return a=e.sent(),o?[2]:(u({status:a.status,error:"failed"===a.status?a.error||"The job failed.":null}),"succeeded"===a.status?null===(c=d.current)||void 0===c||c.call(d,a.reportId):"failed"!==a.status&&(t=setTimeout(l,4e3)),[3,3]);case 2:return s=e.sent(),o||u({status:"failed",error:s.message||"The job couldn't be checked."}),[3,3];case 3:return[2]}})})};return l(),function(){o=!0,clearTimeout(t)}}u({status:null,error:null})},[r,i]),s},exports.useOpenRow=function(){var t=this,r=o.useInsights();return function(i){return e.__awaiter(t,void 0,void 0,function(){var t,o,a,l;return e.__generator(this,function(e){switch(e.label){case 0:if(!r)return[2];if(t=new CustomEvent(d,{detail:i,cancelable:!0}),window.dispatchEvent(t),t.defaultPrevented)return[3,4];if(!(o=r.headlineKpi))return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,n.fetchRowReport(r.api,i.nodeKey,{kpiId:o,dataDay:i.dataDay||n.toIsoDay(r.range.endDate)})];case 2:return a=e.sent(),(null===(l=a.report)||void 0===l?void 0:l.reportId)&&r.openReport({reportId:a.report.reportId,title:i.label}),[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}})})}},exports.viewerFromToken=function(e){var t,n,r;try{var i=null==e?void 0:e.replace(/^bearer\s+/i,"").split(".")[1];if(!i)return{email:null,isAdmin:!1};var o=JSON.parse(decodeURIComponent(escape(atob(i.replace(/-/g,"+").replace(/_/g,"/"))))),a=[].concat(null!==(t=o.rolename)&&void 0!==t?t:[],null!==(n=o.role)&&void 0!==n?n:[],null!==(r=o.roles)&&void 0!==r?r:[]).map(String);return{email:o.email||o.sub||null,isAdmin:a.some(function(e){return"cw-admin"===e||/ Admin$/.test(e)})}}catch(e){return{email:null,isAdmin:!1}}};
2
2
  //# sourceMappingURL=insightsUtils.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),i=require("react/jsx-runtime"),n=require("react"),s=require("lucide-react"),a=require("../../../assets/icons/cognitive_desicioning_icon_brain.svg.js"),c=function(e){return void 0===e&&(e=0),Math.max(0,Math.min(100,Math.round(e)))};function r(n){var s=n.text.split(/(\*\*[^*]+\*\*|`[^`]+`)/g);return i.jsx(i.Fragment,{children:s.map(function(n,s){return/^\*\*[^*]+\*\*$/.test(n)?i.jsx("strong",e.__assign({className:"rca-decision__strong"},{children:n.slice(2,-2)}),s):/^`[^`]+`$/.test(n)?i.jsx("code",e.__assign({className:"rca-decision__code"},{children:n.slice(1,-1)}),s):n})})}function t(n){var c=n.open,r=n.onToggle,t=n.label,o=void 0===t?"cognitive decisioning":t;return i.jsxs("button",e.__assign({type:"button",className:"rca-decision__reasoning-trigger","aria-label":"".concat(c?"Hide":"Show"," ").concat(o),"aria-expanded":c,onClick:r},{children:[i.jsx("img",{src:a.default,alt:""}),c?i.jsx(s.ChevronUp,{"aria-hidden":"true"}):i.jsx(s.ChevronDown,{"aria-hidden":"true"})]}))}function o(r){var t,o,d=r.decisioning,_=n.useState(!1),h=_[0],u=_[1],g=c(d.score),x=null!==(t=d.decisionMakingFactors)&&void 0!==t?t:[],j=null!==(o=d.gapsInDecision)&&void 0!==o?o:[];return i.jsxs("div",e.__assign({className:"rca-decision__reasoning"},{children:[d.explanation?i.jsxs("section",e.__assign({className:"rca-decision__explanation"},{children:[i.jsx("h3",{children:"Explanation"}),i.jsx("div",{children:d.explanation})]})):null,i.jsxs("section",e.__assign({className:"rca-decision__cognitive"},{children:[i.jsxs("button",e.__assign({type:"button",className:"rca-decision__cognitive-toggle","aria-expanded":h,onClick:function(){return u(function(e){return!e})}},{children:[i.jsxs("span",e.__assign({className:"rca-decision__cognitive-title"},{children:[i.jsx("img",{src:a.default,alt:""}),"Cognitive Decisioning AI"]})),i.jsxs("span",e.__assign({className:"rca-decision__score"},{children:[i.jsx(s.Sparkles,{"aria-hidden":"true"}),g,"%"]})),h?i.jsx(s.ChevronUp,{"aria-hidden":"true"}):i.jsx(s.ChevronDown,{"aria-hidden":"true"})]})),h?i.jsxs("div",e.__assign({className:"rca-decision__cognitive-body"},{children:[i.jsx(l,{icon:i.jsx(s.Lightbulb,{"aria-hidden":"true"}),title:"Decision Making Factors",items:x,evidence:d.evidence}),i.jsx(l,{icon:i.jsx(s.Search,{"aria-hidden":"true"}),title:"Gaps in Decision",items:j.length?j:["No gaps identified"]})]})):null]}))]}))}function l(a){var c=a.icon,r=a.title,t=a.items,o=a.evidence,l=n.useState(!1),_=l[0],h=l[1];return t.length?i.jsxs("div",e.__assign({className:"rca-decision__reasoning-section"},{children:[i.jsxs("h4",{children:[i.jsx("span",e.__assign({className:"rca-decision__subsection-icon"},{children:c})),r]}),i.jsx("ol",{children:t.map(function(n,a){return i.jsxs("li",{children:[n,0===a&&o?i.jsxs(i.Fragment,{children:[i.jsxs("button",e.__assign({type:"button",className:"rca-decision__evidence-trigger","aria-expanded":_,onClick:function(){return h(function(e){return!e})}},{children:[i.jsx(s.Sparkles,{"aria-hidden":"true"}),o.label,_?i.jsx(s.ChevronUp,{"aria-hidden":"true"}):i.jsx(s.ChevronDown,{"aria-hidden":"true"})]})),_?i.jsx(d,{evidence:o,onClose:function(){return h(!1)}}):null]}):null]},"".concat(r,"-").concat(a))})})]})):null}function d(n){var a,c,r=n.evidence,t=n.onClose,o=function(e){if(!r.highlight||"string"!=typeof e)return e;var n=e.indexOf(r.highlight);return n<0?e:i.jsxs(i.Fragment,{children:[e.slice(0,n),i.jsx("mark",{children:r.highlight}),e.slice(n+r.highlight.length)]})};return i.jsxs("div",e.__assign({className:"rca-decision__evidence-detail"},{children:[i.jsxs("button",e.__assign({type:"button",className:"rca-decision__evidence-header",onClick:t},{children:[i.jsx("span",{children:null!==(a=r.title)&&void 0!==a?a:r.label}),i.jsx(s.ChevronUp,{"aria-hidden":"true"})]})),i.jsxs("div",e.__assign({className:"rca-decision__evidence-body"},{children:[r.description?i.jsx("p",{children:r.description}):null,null===(c=r.items)||void 0===c?void 0:c.map(function(e,n){return i.jsx("p",{children:o(e)},n)})]})),r.footer?i.jsx("div",e.__assign({className:"rca-decision__evidence-footer"},{children:r.footer})):null]}))}function _(a){var c=a.title,l=a.items,d=a.tone,_=a.icon,h=n.useState(null),u=h[0],g=h[1],x=n.useState(!1),j=x[0],m=x[1],v=n.useId(),p=j?l:l.slice(0,3);return i.jsxs("section",e.__assign({className:"rca-decision__section"},{children:[i.jsxs("h2",{children:[i.jsx("span",e.__assign({className:"rca-decision__section-icon rca-decision__section-icon--".concat(d)},{children:_})),c]}),i.jsx("ol",e.__assign({className:"rca-decision__items",id:v},{children:p.map(function(n,s){var a,c=null!==(a=n.id)&&void 0!==a?a:"".concat(d,"-").concat(s),l=u===c;return i.jsxs("li",{children:[i.jsxs("div",e.__assign({className:"rca-decision__item-row"},{children:[i.jsx("div",e.__assign({className:"rca-decision__item-content"},{children:"string"==typeof n.content?i.jsx(r,{text:n.content}):n.content})),n.decisioning?i.jsx(t,{open:l,onToggle:function(){return g(l?null:c)}}):null]})),l&&n.decisioning?i.jsx(o,{decisioning:n.decisioning}):null]},c)})})),l.length>3?i.jsxs("button",e.__assign({type:"button",className:"rca-decision__see-more","aria-controls":v,"aria-expanded":j,onClick:function(){m(!j),g(null)}},{children:[j?"See Less":"See More (".concat(l.length-3,")"),j?i.jsx(s.ChevronUp,{"aria-hidden":"true"}):i.jsx(s.ChevronDown,{"aria-hidden":"true"})]})):null]}))}function h(a){var r=a.title,l=void 0===r?"Decision Advantage":r,d=a.score,h=a.summary,u=a.footer,g=a.evidenceNote,x=a.notice,j=a.headerActions,m=a.afterSections,v=a.decisioning,p=a.rootCause,N=a.nextSteps,f=a.width,b=a.maxWidth,y=a.height,C=a.className,S=void 0===C?"":C,k=n.useState(!1),w=k[0],D=k[1];return i.jsxs("article",e.__assign({className:"rca-decision ".concat(void 0!==y?"rca-decision--fixed-height":""," ").concat(S).trim(),style:{width:f,height:y,maxWidth:null!=b?b:f?"none":void 0}},{children:[i.jsxs("header",e.__assign({className:"rca-decision__header"},{children:[i.jsx("span",{children:l}),i.jsxs("span",e.__assign({className:"rca-decision__header-end"},{children:[j,v?i.jsx(t,{open:w,onToggle:function(){return D(function(e){return!e})},label:"how the AI reached this report"}):null,null!=d?i.jsxs("span",e.__assign({className:"rca-decision__header-score"},{children:[i.jsx(s.Sparkles,{"aria-hidden":"true"}),c(d),"%"]})):null]}))]})),i.jsxs("div",e.__assign({className:"rca-decision__body"},{children:[x?i.jsx("div",e.__assign({className:"rca-decision__notice"},{children:x})):null,w&&v?i.jsx("div",e.__assign({className:"rca-decision__header-reasoning"},{children:i.jsx(o,{decisioning:v})})):null,h&&(h.headline||h.body)?i.jsxs("section",e.__assign({className:"rca-decision__summary"},{children:[h.eyebrow?i.jsx("span",e.__assign({className:"rca-decision__eyebrow"},{children:h.eyebrow})):null,h.headline?i.jsx("h2",e.__assign({className:"rca-decision__headline"},{children:h.headline})):null,h.body?i.jsx("p",e.__assign({className:"rca-decision__summary-body"},{children:h.body})):null,g?i.jsx("p",e.__assign({className:"rca-decision__evidence-note"},{children:g})):null]})):g?i.jsx("p",e.__assign({className:"rca-decision__evidence-note"},{children:g})):null,p.length?i.jsx(_,{title:"Root Cause",items:p,tone:"root-cause",icon:i.jsx(s.Search,{"aria-hidden":"true"})}):null,N.length?i.jsx(_,{title:"Next Steps",items:N,tone:"next-steps",icon:i.jsx(s.CheckCircle2,{"aria-hidden":"true"})}):null,m,u?i.jsx("p",e.__assign({className:"rca-decision__footer"},{children:u})):null]}))]}))}exports.RcaDecisionComponent=h,exports.ReasoningPanel=o,exports.ReasoningTrigger=t,exports.default=h;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),n=require("react/jsx-runtime"),i=require("react"),s=require("lucide-react"),a=require("../../../assets/icons/cognitive_desicioning_icon_brain.svg.js"),c=function(e){return void 0===e&&(e=0),Math.max(0,Math.min(100,Math.round(e)))};function r(i){var s=i.text.split(/(\*\*[^*]+\*\*|`[^`]+`)/g);return n.jsx(n.Fragment,{children:s.map(function(i,s){return/^\*\*[^*]+\*\*$/.test(i)?n.jsx("strong",e.__assign({className:"rca-decision__strong"},{children:i.slice(2,-2)}),s):/^`[^`]+`$/.test(i)?n.jsx("code",e.__assign({className:"rca-decision__code"},{children:i.slice(1,-1)}),s):i})})}function t(i){var c=i.open,r=i.onToggle,t=i.label,o=void 0===t?"cognitive decisioning":t;return n.jsxs("button",e.__assign({type:"button",className:"rca-decision__reasoning-trigger","aria-label":"".concat(c?"Hide":"Show"," ").concat(o),"aria-expanded":c,onClick:r},{children:[n.jsx("img",{src:a.default,alt:""}),c?n.jsx(s.ChevronUp,{"aria-hidden":"true"}):n.jsx(s.ChevronDown,{"aria-hidden":"true"})]}))}function o(r){var t,o,d=r.decisioning,_=i.useState(!1),u=_[0],h=_[1],g=c(d.score),x=null!==(t=d.decisionMakingFactors)&&void 0!==t?t:[],j=null!==(o=d.gapsInDecision)&&void 0!==o?o:[];return n.jsxs("div",e.__assign({className:"rca-decision__reasoning"},{children:[d.explanation?n.jsxs("section",e.__assign({className:"rca-decision__explanation"},{children:[n.jsx("h3",{children:"Explanation"}),n.jsx("div",{children:d.explanation})]})):null,n.jsxs("section",e.__assign({className:"rca-decision__cognitive"},{children:[n.jsxs("button",e.__assign({type:"button",className:"rca-decision__cognitive-toggle","aria-expanded":u,onClick:function(){return h(function(e){return!e})}},{children:[n.jsxs("span",e.__assign({className:"rca-decision__cognitive-title"},{children:[n.jsx("img",{src:a.default,alt:""}),"Cognitive Decisioning AI"]})),n.jsxs("span",e.__assign({className:"rca-decision__score"},{children:[n.jsx(s.Sparkles,{"aria-hidden":"true"}),g,"%"]})),u?n.jsx(s.ChevronUp,{"aria-hidden":"true"}):n.jsx(s.ChevronDown,{"aria-hidden":"true"})]})),u?n.jsxs("div",e.__assign({className:"rca-decision__cognitive-body"},{children:[n.jsx(l,{icon:n.jsx(s.Lightbulb,{"aria-hidden":"true"}),title:"Decision Making Factors",items:x,evidence:d.evidence}),n.jsx(l,{icon:n.jsx(s.Search,{"aria-hidden":"true"}),title:"Gaps in Decision",items:j.length?j:["No gaps identified"]})]})):null]}))]}))}function l(a){var c=a.icon,r=a.title,t=a.items,o=a.evidence,l=i.useState(!1),_=l[0],u=l[1];return t.length?n.jsxs("div",e.__assign({className:"rca-decision__reasoning-section"},{children:[n.jsxs("h4",{children:[n.jsx("span",e.__assign({className:"rca-decision__subsection-icon"},{children:c})),r]}),n.jsx("ol",{children:t.map(function(i,a){return n.jsxs("li",{children:[i,0===a&&o?n.jsxs(n.Fragment,{children:[n.jsxs("button",e.__assign({type:"button",className:"rca-decision__evidence-trigger","aria-expanded":_,onClick:function(){return u(function(e){return!e})}},{children:[n.jsx(s.Sparkles,{"aria-hidden":"true"}),o.label,_?n.jsx(s.ChevronUp,{"aria-hidden":"true"}):n.jsx(s.ChevronDown,{"aria-hidden":"true"})]})),_?n.jsx(d,{evidence:o,onClose:function(){return u(!1)}}):null]}):null]},"".concat(r,"-").concat(a))})})]})):null}function d(i){var a,c,r=i.evidence,t=i.onClose,o=function(e){if(!r.highlight||"string"!=typeof e)return e;var i=e.indexOf(r.highlight);return i<0?e:n.jsxs(n.Fragment,{children:[e.slice(0,i),n.jsx("mark",{children:r.highlight}),e.slice(i+r.highlight.length)]})};return n.jsxs("div",e.__assign({className:"rca-decision__evidence-detail"},{children:[n.jsxs("button",e.__assign({type:"button",className:"rca-decision__evidence-header",onClick:t},{children:[n.jsx("span",{children:null!==(a=r.title)&&void 0!==a?a:r.label}),n.jsx(s.ChevronUp,{"aria-hidden":"true"})]})),n.jsxs("div",e.__assign({className:"rca-decision__evidence-body"},{children:[r.description?n.jsx("p",{children:r.description}):null,null===(c=r.items)||void 0===c?void 0:c.map(function(e,i){return n.jsx("p",{children:o(e)},i)})]})),r.footer?n.jsx("div",e.__assign({className:"rca-decision__evidence-footer"},{children:r.footer})):null]}))}function _(a){var c=a.title,l=a.items,d=a.tone,_=a.icon,u=a.layout,h=void 0===u?"list":u,g=i.useState(null),x=g[0],j=g[1],m=i.useState(function(){return new Set}),v=m[0],p=m[1],N=i.useState(!1),f=N[0],b=N[1],y=i.useId(),C=f?l:l.slice(0,3),w="cards"===h;return n.jsxs("section",e.__assign({className:"rca-decision__section"},{children:[n.jsxs("h2",{children:[n.jsx("span",e.__assign({className:"rca-decision__section-icon rca-decision__section-icon--".concat(d)},{children:_})),c]}),n.jsx("ol",e.__assign({className:"rca-decision__items".concat(w?" rca-decision__items--cards":""),id:y},{children:C.map(function(i,a){var c,l,_,u=null!==(c=i.id)&&void 0!==c?c:"".concat(d,"-").concat(a),h=x===u;if(w){var g=v.has(u),m=i.tag?n.jsx("span",e.__assign({className:"rca-decision__tag rca-decision__tag--".concat(null!==(l=i.tag.tone)&&void 0!==l?l:"neutral")},{children:i.tag.label})):null;return n.jsxs("li",e.__assign({className:"rca-decision__card"},{children:[i.title?n.jsxs("div",e.__assign({className:"rca-decision__card-head"},{children:[n.jsxs("span",e.__assign({className:"rca-decision__card-title"},{children:[a+1,". ",i.title]})),m]})):null,n.jsxs("div",e.__assign({className:"rca-decision__item-row"},{children:[i.title?null:m,i.title?null:n.jsxs("span",e.__assign({className:"rca-decision__card-number"},{children:[a+1,". "]})),n.jsx("div",e.__assign({className:"rca-decision__item-content"},{children:"string"==typeof i.content?n.jsx(r,{text:i.content}):i.content})),i.decisioning?n.jsx(t,{open:h,onToggle:function(){return j(h?null:u)}}):null]})),i.detail?n.jsxs("button",e.__assign({type:"button",className:"rca-decision__view-more","aria-expanded":g,onClick:function(){return e=u,p(function(n){var i=new Set(n);return i.has(e)?i.delete(e):i.add(e),i});var e}},{children:[g?"View Less":"View More",g?n.jsx(s.ChevronUp,{"aria-hidden":"true"}):n.jsx(s.ChevronDown,{"aria-hidden":"true"})]})):null,g&&i.detail?n.jsx("p",e.__assign({className:"rca-decision__card-detail"},{children:i.detail})):null,h&&i.decisioning?n.jsx(o,{decisioning:i.decisioning}):null]}),u)}return n.jsxs("li",{children:[n.jsxs("div",e.__assign({className:"rca-decision__item-row"},{children:[i.tag?n.jsx("span",e.__assign({className:"rca-decision__tag rca-decision__tag--".concat(null!==(_=i.tag.tone)&&void 0!==_?_:"neutral")},{children:i.tag.label})):null,n.jsx("div",e.__assign({className:"rca-decision__item-content"},{children:"string"==typeof i.content?n.jsx(r,{text:i.content}):i.content})),i.decisioning?n.jsx(t,{open:h,onToggle:function(){return j(h?null:u)}}):null]})),h&&i.decisioning?n.jsx(o,{decisioning:i.decisioning}):null]},u)})})),l.length>3?n.jsxs("button",e.__assign({type:"button",className:"rca-decision__see-more","aria-controls":y,"aria-expanded":f,onClick:function(){b(!f),j(null)}},{children:[f?"See Less":"See More (".concat(l.length-3,")"),f?n.jsx(s.ChevronUp,{"aria-hidden":"true"}):n.jsx(s.ChevronDown,{"aria-hidden":"true"})]})):null]}))}function u(a){var r=a.title,l=void 0===r?"Decision Advantage":r,d=a.score,u=a.summary,h=a.footer,g=a.evidenceNote,x=a.notice,j=a.headerActions,m=a.afterSections,v=a.decisioning,p=a.rootCause,N=a.rootCauseLayout,f=void 0===N?"list":N,b=a.nextSteps,y=a.width,C=a.maxWidth,w=a.height,S=a.className,k=void 0===S?"":S,D=i.useState(!1),M=D[0],U=D[1];return n.jsxs("article",e.__assign({className:"rca-decision ".concat(void 0!==w?"rca-decision--fixed-height":""," ").concat(k).trim(),style:{width:y,height:w,maxWidth:null!=C?C:y?"none":void 0}},{children:[n.jsxs("header",e.__assign({className:"rca-decision__header"},{children:[n.jsx("span",{children:l}),n.jsxs("span",e.__assign({className:"rca-decision__header-end"},{children:[j,v?n.jsx(t,{open:M,onToggle:function(){return U(function(e){return!e})},label:"how the AI reached this report"}):null,null!=d?n.jsxs("span",e.__assign({className:"rca-decision__header-score"},{children:[n.jsx(s.Sparkles,{"aria-hidden":"true"}),c(d),"%"]})):null]}))]})),n.jsxs("div",e.__assign({className:"rca-decision__body"},{children:[x?n.jsx("div",e.__assign({className:"rca-decision__notice"},{children:x})):null,M&&v?n.jsx("div",e.__assign({className:"rca-decision__header-reasoning"},{children:n.jsx(o,{decisioning:v})})):null,u&&(u.headline||u.body)?n.jsxs("section",e.__assign({className:"rca-decision__summary"},{children:[u.eyebrow?n.jsx("span",e.__assign({className:"rca-decision__eyebrow"},{children:u.eyebrow})):null,u.headline?n.jsx("h2",e.__assign({className:"rca-decision__headline"},{children:u.headline})):null,u.body?n.jsx("p",e.__assign({className:"rca-decision__summary-body"},{children:u.body})):null,g?n.jsx("p",e.__assign({className:"rca-decision__evidence-note"},{children:g})):null]})):g?n.jsx("p",e.__assign({className:"rca-decision__evidence-note"},{children:g})):null,p.length?n.jsx(_,{title:"Root Cause",items:p,tone:"root-cause",icon:n.jsx(s.Search,{"aria-hidden":"true"}),layout:f}):null,b.length?n.jsx(_,{title:"Next Steps",items:b,tone:"next-steps",icon:n.jsx(s.CheckCircle2,{"aria-hidden":"true"})}):null,m,h?n.jsx("p",e.__assign({className:"rca-decision__footer"},{children:h})):null]}))]}))}exports.RcaDecisionComponent=u,exports.ReasoningPanel=o,exports.ReasoningTrigger=t,exports.default=u;
2
2
  //# sourceMappingURL=RcaDecisionComponent.js.map