@e-llm-studio/instant-learning 1.3.0-alpha.247 → 1.3.0-alpha.249

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 (294) hide show
  1. package/README.md +0 -6
  2. package/dist/ContinueWithTemplateModal.js +1 -1
  3. package/dist/ContinueWithTemplateModal.module.css.js +1 -1
  4. package/dist/ILMarketplaceWrapper.js +1 -1
  5. package/dist/ILMarketplaceWrapper.module.css.js +1 -1
  6. package/dist/cjs/ContinueWithTemplateModal.js +1 -1
  7. package/dist/cjs/ContinueWithTemplateModal.module.css.js +1 -1
  8. package/dist/cjs/ILMarketplaceWrapper.js +1 -1
  9. package/dist/cjs/ILMarketplaceWrapper.module.css.js +1 -1
  10. package/dist/cjs/features/IL-OTJ/ILOTJ.js +1 -1
  11. package/dist/cjs/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.js +1 -1
  12. package/dist/cjs/features/IL-OTJ/ValueTypeWrappers/TeachMeWrapper.js +1 -1
  13. package/dist/cjs/features/IL-OTJ/_components/AccordianSection.js +1 -1
  14. package/dist/cjs/features/IL-OTJ/_components/ChatComponents/ChatComponent.module.css.js +1 -1
  15. package/dist/cjs/features/IL-OTJ/_components/ChatComponents/ChatHeader.module.css.js +1 -1
  16. package/dist/cjs/features/IL-OTJ/_components/CitationLink.js +1 -1
  17. package/dist/cjs/features/IL-OTJ/_components/CriticalGaps.js +1 -1
  18. package/dist/cjs/features/IL-OTJ/_components/ILPopup.js +1 -1
  19. package/dist/cjs/features/IL-OTJ/_components/ILPopup.styles.js +1 -1
  20. package/dist/cjs/features/IL-OTJ/_components/InputDataReasoningCard.js +1 -1
  21. package/dist/cjs/features/IL-OTJ/_components/MarkdownComponents/MarkdownElements.js +1 -1
  22. package/dist/cjs/features/IL-OTJ/_components/MarkdownComponents/MarkdownSelect.js +1 -1
  23. package/dist/cjs/features/IL-OTJ/_components/MarkdownRenderer.module.css.js +1 -1
  24. package/dist/cjs/features/IL-OTJ/_components/MessageRendering/ChatFeedback.js +1 -1
  25. package/dist/cjs/features/IL-OTJ/_components/MessageRendering/ClickableChatComponents.js +1 -1
  26. package/dist/cjs/features/IL-OTJ/_components/MessageRendering/RuleValidationCard.js +1 -1
  27. package/dist/cjs/features/IL-OTJ/_components/MessageRendering/RuleVariantCard.js +1 -1
  28. package/dist/cjs/features/IL-OTJ/_components/ViewFormUpdateCard.js +1 -1
  29. package/dist/cjs/features/IL-OTJ/_components/ViewIdentifiedFieldsCard.js +1 -1
  30. package/dist/cjs/features/IL-OTJ/_components/_svg/ButtonCognitiveIcon.js +1 -1
  31. package/dist/cjs/features/IL-OTJ/_components/atoms/SkeletonLoader/SkeletonLoader.module.css.js +1 -1
  32. package/dist/cjs/features/IL-OTJ/_components/atoms/Textarea/Textarea.js +1 -1
  33. package/dist/cjs/features/IL-OTJ/_components/molecules/Condition/ConditionList.js +1 -1
  34. package/dist/cjs/features/IL-OTJ/_components/molecules/Sections/SectionWrapper.js +1 -1
  35. package/dist/cjs/features/IL-OTJ/_components/organisms/ConfigSection/ConfigSection.js +1 -1
  36. package/dist/cjs/features/IL-OTJ/_components/organisms/ScopeSection/ScopeSection.js +1 -1
  37. package/dist/cjs/features/IL-OTJ/_components/organisms/TextSection/TextSection.js +1 -1
  38. package/dist/cjs/features/IL-OTJ/_components/templates/RuleComparison/AgentComposerRuleComparison.js +1 -1
  39. package/dist/cjs/features/IL-OTJ/_components/templates/RuleComparison/RuleComparisonNew.js +1 -1
  40. package/dist/cjs/features/IL-OTJ/_components/templates/TrafficManager/CreateRule.js +1 -1
  41. package/dist/cjs/features/IL-marketplace/components/GuidelineCardMenu.module.css.js +1 -1
  42. package/dist/cjs/features/IL-marketplace/components/GuidelineCart.module.css.js +1 -1
  43. package/dist/cjs/features/IL-marketplace/components/GuidelineCartHeader.module.css.js +1 -1
  44. package/dist/cjs/features/IL-marketplace/components/GuidelineCartItem.module.css.js +1 -1
  45. package/dist/cjs/features/IL-marketplace/components/GuidelineConfirmDialog.module.css.js +1 -1
  46. package/dist/cjs/features/IL-marketplace/components/GuidelineEmptyState.module.css.js +1 -1
  47. package/dist/cjs/features/IL-marketplace/components/GuidelineFilterPanel.module.css.js +1 -1
  48. package/dist/cjs/features/IL-marketplace/components/GuidelineHeader.module.css.js +1 -1
  49. package/dist/cjs/features/IL-marketplace/components/GuidelineIconButton.module.css.js +1 -1
  50. package/dist/cjs/features/IL-marketplace/components/GuidelineLandingPage.module.css.js +1 -1
  51. package/dist/cjs/features/IL-marketplace/components/GuidelineLibrary.module.css.js +1 -1
  52. package/dist/cjs/features/IL-marketplace/components/GuidelineLibraryCard.js +1 -1
  53. package/dist/cjs/features/IL-marketplace/components/GuidelineLibraryCard.module.css.js +1 -1
  54. package/dist/cjs/features/IL-marketplace/components/GuidelineProceedButton.module.css.js +1 -1
  55. package/dist/cjs/features/IL-marketplace/components/GuidelineSelectButton.module.css.js +1 -1
  56. package/dist/cjs/features/IL-marketplace/components/GuidelineStatusChip.js +1 -1
  57. package/dist/cjs/features/IL-marketplace/components/GuidelineStatusChip.module.css.js +1 -1
  58. package/dist/cjs/features/IL-marketplace/components/ILMarketPlacePublish/PublishEmptyState.module.css.js +1 -1
  59. package/dist/cjs/features/IL-marketplace/components/ILMarketPlacePublish/PublishStepBody.module.css.js +1 -1
  60. package/dist/cjs/features/IL-marketplace/components/ILMarketPlacePublish/PublishStepFooter.module.css.js +1 -1
  61. package/dist/cjs/features/IL-marketplace/components/ILMarketPlacePublish/PublishStepper.module.css.js +1 -1
  62. package/dist/cjs/features/IL-marketplace/components/ILMarketPlacePublish/PublishToMarketplaceCompnent.js +1 -1
  63. package/dist/cjs/features/IL-marketplace/components/ILMarketPlacePublish/PublishToMarketplaceCompnent.module.css.js +1 -1
  64. package/dist/cjs/features/IL-marketplace/components/ILMarketPlacePublish/ReleaseSummaryBody.module.css.js +1 -1
  65. package/dist/cjs/features/IL-marketplace/components/ILMarketPlacePublish/TemplateDetailsBody.module.css.js +1 -1
  66. package/dist/cjs/features/IL-marketplace/components/LearningManagementWrapper.js +1 -1
  67. package/dist/cjs/features/IL-marketplace/components/VersionSelectDropdown.module.css.js +1 -1
  68. package/dist/cjs/features/LearningManagement/LearningManagement.js +1 -1
  69. package/dist/cjs/features/LearningManagement/LearningManagementTest.js +1 -1
  70. package/dist/cjs/features/LearningManagement/RBAC/AccessPanel.module.css.js +1 -1
  71. package/dist/cjs/features/LearningManagement/RuleContent/ApprovalLearningDialog.js +1 -1
  72. package/dist/cjs/features/LearningManagement/RuleContent/RuleContent.js +1 -1
  73. package/dist/cjs/features/LearningManagement/RuleContent/TierCard.js +1 -1
  74. package/dist/cjs/features/LearningManagement/RuleContent/VariantCard.js +1 -1
  75. package/dist/cjs/features/LearningManagement/components/CreateLearningSetModal.js +2 -0
  76. package/dist/cjs/features/LearningManagement/components/CreateLearningSetModal.js.map +1 -0
  77. package/dist/cjs/features/LearningManagement/components/InstantLearningModal.js +1 -1
  78. package/dist/cjs/features/LearningManagement/components/InstantLearningModalDynamic.js +1 -1
  79. package/dist/cjs/features/LearningManagement/components/ScopeTree/TreeMenu.js +1 -1
  80. package/dist/cjs/features/LearningManagement/components/StationOnboarding/StationOnboardModal.js +1 -1
  81. package/dist/cjs/features/LearningManagement/styles/CardSkeleton.module.css.js +1 -1
  82. package/dist/cjs/features/LearningManagement/styles/ConfirmationModal.module.css.js +1 -1
  83. package/dist/cjs/features/LearningManagement/styles/CreateLearningSetModal.module.css.js +2 -0
  84. package/dist/cjs/features/LearningManagement/styles/CreateLearningSetModal.module.css.js.map +1 -0
  85. package/dist/cjs/features/LearningManagement/styles/CustomTooltip.module.css.js +1 -1
  86. package/dist/cjs/features/LearningManagement/styles/EmptyRuleState.module.css.js +1 -1
  87. package/dist/cjs/features/LearningManagement/styles/ErrorStateDisplay.module.css.js +1 -1
  88. package/dist/cjs/features/LearningManagement/styles/InputField.module.css.js +1 -1
  89. package/dist/cjs/features/LearningManagement/styles/InstantLearningModal.module.css.js +1 -1
  90. package/dist/cjs/features/LearningManagement/styles/LearningContent.module.css.js +1 -1
  91. package/dist/cjs/features/LearningManagement/styles/LearningContentSkeleton.module.css.js +1 -1
  92. package/dist/cjs/features/LearningManagement/styles/LearningTemplateLayout.module.css.js +1 -1
  93. package/dist/cjs/features/LearningManagement/styles/LearningTemplateManagement.module.css.js +1 -1
  94. package/dist/cjs/features/LearningManagement/styles/LearningTemplateManagementSkeleton.module.css.js +1 -1
  95. package/dist/cjs/features/LearningManagement/styles/OnboardingLoader.module.css.js +1 -1
  96. package/dist/cjs/features/LearningManagement/styles/OverrideTimeline.module.css.js +1 -1
  97. package/dist/cjs/features/LearningManagement/styles/PromptTextEditor.module.css.js +1 -1
  98. package/dist/cjs/features/LearningManagement/styles/RuleAccordion.module.css.js +1 -1
  99. package/dist/cjs/features/LearningManagement/styles/RuleHeader.module.css.js +1 -1
  100. package/dist/cjs/features/LearningManagement/styles/ScopeTree.module.css.js +1 -1
  101. package/dist/cjs/features/LearningManagement/styles/Sidebar.module.css.js +1 -1
  102. package/dist/cjs/features/LearningManagement/styles/StationAutocomplete.module.css.js +1 -1
  103. package/dist/cjs/features/LearningManagement/styles/StationOnboardModal.module.css.js +1 -1
  104. package/dist/cjs/features/LearningManagement/styles/StationsContent.module.css.js +1 -1
  105. package/dist/cjs/features/LearningManagement/styles/TemplateCard.module.css.js +1 -1
  106. package/dist/cjs/features/LearningManagement/styles/TierCard.module.css.js +1 -1
  107. package/dist/cjs/features/LearningManagement/styles/ToastContent.module.css.js +1 -1
  108. package/dist/cjs/features/LearningManagement/styles/ToolTip.module.css.js +1 -1
  109. package/dist/cjs/features/LearningManagement/styles/VariantCard.module.css.js +1 -1
  110. package/dist/cjs/features/LearningManagement/styles/VariantList.module.css.js +1 -1
  111. package/dist/cjs/features/LearningManagement/styles/common.module.css.js +1 -1
  112. package/dist/cjs/features/LearningManagement/styles/skeleton.module.css.js +1 -1
  113. package/dist/cjs/index.js +1 -1
  114. package/dist/cjs/schema-driven/BPARenderer.js +1 -1
  115. package/dist/cjs/schema-driven/components/GlobalSetupAccordionField.js +1 -1
  116. package/dist/cjs/schema-driven/components/GroupEditRow.js +1 -1
  117. package/dist/cjs/schema-driven/components/PromptTextEditorField.js +1 -1
  118. package/dist/cjs/schema-driven/components/VariantListField.js +1 -1
  119. package/dist/cjs/schema-driven/primitives/Accordion.js +1 -1
  120. package/dist/features/IL-OTJ/ILOTJ.js +1 -1
  121. package/dist/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.js +1 -1
  122. package/dist/features/IL-OTJ/ValueTypeWrappers/TeachMeWrapper.js +1 -1
  123. package/dist/features/IL-OTJ/_components/AccordianSection.js +1 -1
  124. package/dist/features/IL-OTJ/_components/ChatComponents/ChatComponent.module.css.js +1 -1
  125. package/dist/features/IL-OTJ/_components/ChatComponents/ChatHeader.module.css.js +1 -1
  126. package/dist/features/IL-OTJ/_components/CitationLink.js +1 -1
  127. package/dist/features/IL-OTJ/_components/CriticalGaps.js +1 -1
  128. package/dist/features/IL-OTJ/_components/ILPopup.js +1 -1
  129. package/dist/features/IL-OTJ/_components/ILPopup.styles.js +1 -1
  130. package/dist/features/IL-OTJ/_components/InputDataReasoningCard.js +1 -1
  131. package/dist/features/IL-OTJ/_components/MarkdownComponents/MarkdownElements.js +1 -1
  132. package/dist/features/IL-OTJ/_components/MarkdownComponents/MarkdownSelect.js +1 -1
  133. package/dist/features/IL-OTJ/_components/MarkdownRenderer.module.css.js +1 -1
  134. package/dist/features/IL-OTJ/_components/MessageRendering/ChatFeedback.js +1 -1
  135. package/dist/features/IL-OTJ/_components/MessageRendering/ClickableChatComponents.js +1 -1
  136. package/dist/features/IL-OTJ/_components/MessageRendering/RuleValidationCard.js +1 -1
  137. package/dist/features/IL-OTJ/_components/MessageRendering/RuleVariantCard.js +1 -1
  138. package/dist/features/IL-OTJ/_components/ViewFormUpdateCard.js +1 -1
  139. package/dist/features/IL-OTJ/_components/ViewIdentifiedFieldsCard.js +1 -1
  140. package/dist/features/IL-OTJ/_components/_svg/ButtonCognitiveIcon.js +1 -1
  141. package/dist/features/IL-OTJ/_components/atoms/SkeletonLoader/SkeletonLoader.module.css.js +1 -1
  142. package/dist/features/IL-OTJ/_components/atoms/Textarea/Textarea.js +1 -1
  143. package/dist/features/IL-OTJ/_components/molecules/Condition/ConditionList.js +1 -1
  144. package/dist/features/IL-OTJ/_components/molecules/Sections/SectionWrapper.js +1 -1
  145. package/dist/features/IL-OTJ/_components/organisms/ConfigSection/ConfigSection.js +1 -1
  146. package/dist/features/IL-OTJ/_components/organisms/ScopeSection/ScopeSection.js +1 -1
  147. package/dist/features/IL-OTJ/_components/organisms/TextSection/TextSection.js +1 -1
  148. package/dist/features/IL-OTJ/_components/templates/RuleComparison/AgentComposerRuleComparison.js +1 -1
  149. package/dist/features/IL-OTJ/_components/templates/RuleComparison/RuleComparisonNew.js +1 -1
  150. package/dist/features/IL-OTJ/_components/templates/TrafficManager/CreateRule.js +1 -1
  151. package/dist/features/IL-marketplace/components/GuidelineCardMenu.module.css.js +1 -1
  152. package/dist/features/IL-marketplace/components/GuidelineCart.module.css.js +1 -1
  153. package/dist/features/IL-marketplace/components/GuidelineCartHeader.module.css.js +1 -1
  154. package/dist/features/IL-marketplace/components/GuidelineCartItem.module.css.js +1 -1
  155. package/dist/features/IL-marketplace/components/GuidelineConfirmDialog.module.css.js +1 -1
  156. package/dist/features/IL-marketplace/components/GuidelineEmptyState.module.css.js +1 -1
  157. package/dist/features/IL-marketplace/components/GuidelineFilterPanel.module.css.js +1 -1
  158. package/dist/features/IL-marketplace/components/GuidelineHeader.module.css.js +1 -1
  159. package/dist/features/IL-marketplace/components/GuidelineIconButton.module.css.js +1 -1
  160. package/dist/features/IL-marketplace/components/GuidelineLandingPage.module.css.js +1 -1
  161. package/dist/features/IL-marketplace/components/GuidelineLibrary.module.css.js +1 -1
  162. package/dist/features/IL-marketplace/components/GuidelineLibraryCard.js +1 -1
  163. package/dist/features/IL-marketplace/components/GuidelineLibraryCard.module.css.js +1 -1
  164. package/dist/features/IL-marketplace/components/GuidelineProceedButton.module.css.js +1 -1
  165. package/dist/features/IL-marketplace/components/GuidelineSelectButton.module.css.js +1 -1
  166. package/dist/features/IL-marketplace/components/GuidelineStatusChip.js +1 -1
  167. package/dist/features/IL-marketplace/components/GuidelineStatusChip.module.css.js +1 -1
  168. package/dist/features/IL-marketplace/components/ILMarketPlacePublish/PublishEmptyState.module.css.js +1 -1
  169. package/dist/features/IL-marketplace/components/ILMarketPlacePublish/PublishStepBody.module.css.js +1 -1
  170. package/dist/features/IL-marketplace/components/ILMarketPlacePublish/PublishStepFooter.module.css.js +1 -1
  171. package/dist/features/IL-marketplace/components/ILMarketPlacePublish/PublishStepper.module.css.js +1 -1
  172. package/dist/features/IL-marketplace/components/ILMarketPlacePublish/PublishToMarketplaceCompnent.js +1 -1
  173. package/dist/features/IL-marketplace/components/ILMarketPlacePublish/PublishToMarketplaceCompnent.module.css.js +1 -1
  174. package/dist/features/IL-marketplace/components/ILMarketPlacePublish/ReleaseSummaryBody.module.css.js +1 -1
  175. package/dist/features/IL-marketplace/components/ILMarketPlacePublish/TemplateDetailsBody.module.css.js +1 -1
  176. package/dist/features/IL-marketplace/components/LearningManagementWrapper.js +1 -1
  177. package/dist/features/IL-marketplace/components/VersionSelectDropdown.module.css.js +1 -1
  178. package/dist/features/LearningManagement/LearningManagement.js +1 -1
  179. package/dist/features/LearningManagement/LearningManagementTest.js +1 -1
  180. package/dist/features/LearningManagement/RBAC/AccessPanel.module.css.js +1 -1
  181. package/dist/features/LearningManagement/RuleContent/ApprovalLearningDialog.js +1 -1
  182. package/dist/features/LearningManagement/RuleContent/RuleContent.js +1 -1
  183. package/dist/features/LearningManagement/RuleContent/TierCard.js +1 -1
  184. package/dist/features/LearningManagement/RuleContent/VariantCard.js +1 -1
  185. package/dist/features/LearningManagement/components/CreateLearningSetModal.js +2 -0
  186. package/dist/features/LearningManagement/components/CreateLearningSetModal.js.map +1 -0
  187. package/dist/features/LearningManagement/components/InstantLearningModal.js +1 -1
  188. package/dist/features/LearningManagement/components/InstantLearningModalDynamic.js +1 -1
  189. package/dist/features/LearningManagement/components/ScopeTree/TreeMenu.js +1 -1
  190. package/dist/features/LearningManagement/components/StationOnboarding/StationOnboardModal.js +1 -1
  191. package/dist/features/LearningManagement/styles/CardSkeleton.module.css.js +1 -1
  192. package/dist/features/LearningManagement/styles/ConfirmationModal.module.css.js +1 -1
  193. package/dist/features/LearningManagement/styles/CreateLearningSetModal.module.css.js +2 -0
  194. package/dist/features/LearningManagement/styles/CreateLearningSetModal.module.css.js.map +1 -0
  195. package/dist/features/LearningManagement/styles/CustomTooltip.module.css.js +1 -1
  196. package/dist/features/LearningManagement/styles/EmptyRuleState.module.css.js +1 -1
  197. package/dist/features/LearningManagement/styles/ErrorStateDisplay.module.css.js +1 -1
  198. package/dist/features/LearningManagement/styles/InputField.module.css.js +1 -1
  199. package/dist/features/LearningManagement/styles/InstantLearningModal.module.css.js +1 -1
  200. package/dist/features/LearningManagement/styles/LearningContent.module.css.js +1 -1
  201. package/dist/features/LearningManagement/styles/LearningContentSkeleton.module.css.js +1 -1
  202. package/dist/features/LearningManagement/styles/LearningTemplateLayout.module.css.js +1 -1
  203. package/dist/features/LearningManagement/styles/LearningTemplateManagement.module.css.js +1 -1
  204. package/dist/features/LearningManagement/styles/LearningTemplateManagementSkeleton.module.css.js +1 -1
  205. package/dist/features/LearningManagement/styles/OnboardingLoader.module.css.js +1 -1
  206. package/dist/features/LearningManagement/styles/OverrideTimeline.module.css.js +1 -1
  207. package/dist/features/LearningManagement/styles/PromptTextEditor.module.css.js +1 -1
  208. package/dist/features/LearningManagement/styles/RuleAccordion.module.css.js +1 -1
  209. package/dist/features/LearningManagement/styles/RuleHeader.module.css.js +1 -1
  210. package/dist/features/LearningManagement/styles/ScopeTree.module.css.js +1 -1
  211. package/dist/features/LearningManagement/styles/Sidebar.module.css.js +1 -1
  212. package/dist/features/LearningManagement/styles/StationAutocomplete.module.css.js +1 -1
  213. package/dist/features/LearningManagement/styles/StationOnboardModal.module.css.js +1 -1
  214. package/dist/features/LearningManagement/styles/StationsContent.module.css.js +1 -1
  215. package/dist/features/LearningManagement/styles/TemplateCard.module.css.js +1 -1
  216. package/dist/features/LearningManagement/styles/TierCard.module.css.js +1 -1
  217. package/dist/features/LearningManagement/styles/ToastContent.module.css.js +1 -1
  218. package/dist/features/LearningManagement/styles/ToolTip.module.css.js +1 -1
  219. package/dist/features/LearningManagement/styles/VariantCard.module.css.js +1 -1
  220. package/dist/features/LearningManagement/styles/VariantList.module.css.js +1 -1
  221. package/dist/features/LearningManagement/styles/common.module.css.js +1 -1
  222. package/dist/features/LearningManagement/styles/skeleton.module.css.js +1 -1
  223. package/dist/index.js +1 -1
  224. package/dist/schema-driven/BPARenderer.js +1 -1
  225. package/dist/schema-driven/components/GlobalSetupAccordionField.js +1 -1
  226. package/dist/schema-driven/components/GroupEditRow.js +1 -1
  227. package/dist/schema-driven/components/PromptTextEditorField.js +1 -1
  228. package/dist/schema-driven/components/VariantListField.js +1 -1
  229. package/dist/schema-driven/primitives/Accordion.js +1 -1
  230. package/dist/types/src/ContinueWithTemplateModal.d.ts.map +1 -1
  231. package/dist/types/src/ILMarketplaceMockTest.d.ts.map +1 -1
  232. package/dist/types/src/ILMarketplaceWrapper.d.ts +1 -10
  233. package/dist/types/src/ILMarketplaceWrapper.d.ts.map +1 -1
  234. package/dist/types/src/features/IL-OTJ/ILOTJ.d.ts.map +1 -1
  235. package/dist/types/src/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.d.ts +0 -3
  236. package/dist/types/src/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.d.ts.map +1 -1
  237. package/dist/types/src/features/IL-OTJ/ValueTypeWrappers/TeachMeWrapper.d.ts.map +1 -1
  238. package/dist/types/src/features/IL-OTJ/_components/AccordianSection.d.ts.map +1 -1
  239. package/dist/types/src/features/IL-OTJ/_components/CitationLink.d.ts.map +1 -1
  240. package/dist/types/src/features/IL-OTJ/_components/CognitiveDecisioningCard.d.ts.map +1 -1
  241. package/dist/types/src/features/IL-OTJ/_components/CriticalGaps.d.ts.map +1 -1
  242. package/dist/types/src/features/IL-OTJ/_components/ILPopup.d.ts.map +1 -1
  243. package/dist/types/src/features/IL-OTJ/_components/ILPopup.styles.d.ts +1 -1
  244. package/dist/types/src/features/IL-OTJ/_components/ILPopup.styles.d.ts.map +1 -1
  245. package/dist/types/src/features/IL-OTJ/_components/InputDataReasoningCard.d.ts.map +1 -1
  246. package/dist/types/src/features/IL-OTJ/_components/MarkdownComponents/MarkdownElements.d.ts.map +1 -1
  247. package/dist/types/src/features/IL-OTJ/_components/MarkdownComponents/MarkdownSelect.d.ts.map +1 -1
  248. package/dist/types/src/features/IL-OTJ/_components/MessageRendering/ClickableChatComponents.d.ts.map +1 -1
  249. package/dist/types/src/features/IL-OTJ/_components/MessageRendering/RuleValidationCard.d.ts.map +1 -1
  250. package/dist/types/src/features/IL-OTJ/_components/MessageRendering/RuleVariantCard.d.ts.map +1 -1
  251. package/dist/types/src/features/IL-OTJ/_components/ViewFormUpdateCard.d.ts.map +1 -1
  252. package/dist/types/src/features/IL-OTJ/_components/ViewIdentifiedFieldsCard.d.ts.map +1 -1
  253. package/dist/types/src/features/IL-OTJ/_components/_svg/ButtonCognitiveIcon.d.ts +1 -1
  254. package/dist/types/src/features/IL-OTJ/_components/_svg/ButtonCognitiveIcon.d.ts.map +1 -1
  255. package/dist/types/src/features/IL-OTJ/_components/templates/RuleComparison/AgentComposerRuleComparison.d.ts.map +1 -1
  256. package/dist/types/src/features/IL-OTJ/_components/templates/RuleComparison/RuleComparisonNew.d.ts.map +1 -1
  257. package/dist/types/src/features/IL-OTJ/_components/templates/TrafficManager/CreateRule.d.ts.map +1 -1
  258. package/dist/types/src/features/IL-marketplace/components/GuidelineLibraryCard.d.ts.map +1 -1
  259. package/dist/types/src/features/IL-marketplace/components/GuidelineStatusChip.d.ts +2 -3
  260. package/dist/types/src/features/IL-marketplace/components/GuidelineStatusChip.d.ts.map +1 -1
  261. package/dist/types/src/features/IL-marketplace/components/LearningManagementWrapper.d.ts +1 -4
  262. package/dist/types/src/features/IL-marketplace/components/LearningManagementWrapper.d.ts.map +1 -1
  263. package/dist/types/src/features/IL-marketplace/types.d.ts +1 -1
  264. package/dist/types/src/features/IL-marketplace/types.d.ts.map +1 -1
  265. package/dist/types/src/features/LearningManagement/LearningManagement.d.ts +2 -5
  266. package/dist/types/src/features/LearningManagement/LearningManagement.d.ts.map +1 -1
  267. package/dist/types/src/features/LearningManagement/RuleContent/ApprovalLearningDialog.d.ts.map +1 -1
  268. package/dist/types/src/features/LearningManagement/RuleContent/TierCard.d.ts.map +1 -1
  269. package/dist/types/src/features/LearningManagement/RuleContent/VariantCard.d.ts.map +1 -1
  270. package/dist/types/src/features/LearningManagement/components/ScopeTree/TreeMenu.d.ts.map +1 -1
  271. package/dist/types/src/features/LearningManagement/components/StationOnboarding/StationOnboardModal.d.ts.map +1 -1
  272. package/dist/types/src/index.d.ts +0 -4
  273. package/dist/types/src/index.d.ts.map +1 -1
  274. package/package.json +1 -1
  275. package/dist/6fbbe065ef78c384.gif +0 -0
  276. package/dist/cjs/6fbbe065ef78c384.gif +0 -0
  277. package/dist/cjs/features/IL-OTJ/_components/cognitiveDecisioningThemeStyles.js +0 -2
  278. package/dist/cjs/features/IL-OTJ/_components/cognitiveDecisioningThemeStyles.js.map +0 -1
  279. package/dist/cjs/features/IL-marketplace/marketplaceTheme.js +0 -2
  280. package/dist/cjs/features/IL-marketplace/marketplaceTheme.js.map +0 -1
  281. package/dist/cjs/features/LearningManagement/public/ThinkingBulbIcon.gif.js +0 -2
  282. package/dist/cjs/features/LearningManagement/public/ThinkingBulbIcon.gif.js.map +0 -1
  283. package/dist/features/IL-OTJ/_components/cognitiveDecisioningThemeStyles.js +0 -2
  284. package/dist/features/IL-OTJ/_components/cognitiveDecisioningThemeStyles.js.map +0 -1
  285. package/dist/features/IL-marketplace/marketplaceTheme.js +0 -2
  286. package/dist/features/IL-marketplace/marketplaceTheme.js.map +0 -1
  287. package/dist/features/LearningManagement/public/ThinkingBulbIcon.gif.js +0 -2
  288. package/dist/features/LearningManagement/public/ThinkingBulbIcon.gif.js.map +0 -1
  289. package/dist/types/src/ThinkingBulbIconComponent.d.ts +0 -4
  290. package/dist/types/src/ThinkingBulbIconComponent.d.ts.map +0 -1
  291. package/dist/types/src/features/IL-OTJ/_components/cognitiveDecisioningThemeStyles.d.ts +0 -98
  292. package/dist/types/src/features/IL-OTJ/_components/cognitiveDecisioningThemeStyles.d.ts.map +0 -1
  293. package/dist/types/src/features/IL-marketplace/marketplaceTheme.d.ts +0 -99
  294. package/dist/types/src/features/IL-marketplace/marketplaceTheme.d.ts.map +0 -1
@@ -1,2 +1,2 @@
1
- import{__assign as i}from"tslib";import{jsxs as e,jsx as r}from"react/jsx-runtime";import n from"react";import{FileText as o,ChevronUp as t,ChevronDown as a}from"lucide-react";import{CognitiveDecisioningCard as l}from"@e-llm-studio/citation";import{ButtonCognitiveIcon as s}from"./_svg/ButtonCognitiveIcon.js";import{getCognitiveDecisioningThemeStyles as d}from"./cognitiveDecisioningThemeStyles.js";var p=function(p){var c=p.data,g=p.cardMdComponents,u=n.useState(!0),m=u[0],f=u[1],x=n.useState({}),v=x[0],h=x[1];return e("span",i({style:{display:"inline",verticalAlign:"middle",marginLeft:"4px"}},{children:[e("button",i({onClick:function(){return f(!m)},style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"6px 4px",borderRadius:"8px",border:"none",backgroundColor:"var(--il-identified-details-bg, var(--il-primary-subtle, #F5F3FF))",color:"var(--il-identified-details-fg, var(--il-primary, #6D28D9))",fontWeight:500,fontSize:"14px",cursor:"pointer"}},{children:[r(o,{size:15}),r("span",{children:"View Identified Details"}),r(m?t:a,{size:16})]})),m&&e("div",i({style:{position:"relative",zIndex:10,marginTop:"8px",marginBottom:"8px",width:"100%",minWidth:"300px",border:"1px solid var(--il-border, #F1F5F9)",borderRadius:"8px",backgroundColor:"var(--il-surface, #FFFFFF)",color:"var(--il-foreground, #1E293B)",padding:"12px",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1)"}},{children:[r("div",i({style:{fontSize:"14px",fontWeight:600,color:"var(--il-secondary-fg, #475569)",marginBottom:"4px"}},{children:c.title})),r("div",i({style:{backgroundColor:"var(--il-surface-alt, #F8FAFC)",borderRadius:"8px",padding:"12px",display:"flex",flexDirection:"column",gap:"12px"}},{children:c.fields.map(function(n,o){var p=v[o];return e("div",i({style:{display:"flex",flexDirection:"column",gap:"6px"}},{children:[e("div",i({style:{fontSize:"14px",color:"var(--il-foreground, #1E293B)",lineHeight:"1.6",fontWeight:400}},{children:[e("span",{children:[o+1,". ",n.label]}),n.reasoning&&e("span",i({onClick:function(e){e.stopPropagation(),h(function(e){var r;return i(i({},e),((r={})[o]=!e[o],r))})},style:{display:"inline-flex",alignItems:"center",gap:"2px",marginLeft:"6px",cursor:"pointer",verticalAlign:"middle"}},{children:[r(s,{size:18}),r(p?t:a,{size:12,color:"var(--il-muted, #667085)"})]}))]})),n.reasoning&&p&&r("div",i({style:{width:"100%"}},{children:r(l,{reasoningTitle:"Decision Making Factors",reasoningSubtitle:"Why is this Suggested?",gapTitle:"Gaps in Decision",gapSubtitle:"What's missing or unclear?",headerIcon:r(s,{}),reasoning:n.reasoning.reason.replace(/\\n/g,"\n"),gap:n.reasoning.gap,score:n.reasoning.score,isOpen:!0,onToggle:function(){return h(function(e){var r;return i(i({},e),((r={})[o]=!1,r))})},hideTrigger:!0,mdComponents:g,styles:d()})}))]}),o)})}))]}))]}))};export{p as ViewIdentifiedFieldsCard};
1
+ import{__assign as i}from"tslib";import{jsxs as e,jsx as n}from"react/jsx-runtime";import r from"react";import{FileText as o,ChevronUp as t,ChevronDown as a}from"lucide-react";import{CognitiveDecisioningCard as l}from"@e-llm-studio/citation";import{ButtonCognitiveIcon as s}from"./_svg/ButtonCognitiveIcon.js";var p=function(p){var d=p.data,c=p.cardMdComponents,g=r.useState(!0),u=g[0],x=g[1],m=r.useState({}),f=m[0],h=m[1];return e("span",i({style:{display:"inline",verticalAlign:"middle",marginLeft:"4px"}},{children:[e("button",i({onClick:function(){return x(!u)},style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"6px 4px",borderRadius:"8px",border:"none",backgroundColor:"#F5F3FF",color:"#6D28D9",fontWeight:500,fontSize:"14px",cursor:"pointer"}},{children:[n(o,{size:15}),n("span",{children:"View Identified Details"}),n(u?t:a,{size:16})]})),u&&e("div",i({style:{position:"relative",zIndex:10,marginTop:"8px",marginBottom:"8px",width:"100%",minWidth:"300px",border:"1px solid #F1F5F9",borderRadius:"8px",backgroundColor:"#FFFFFF",padding:"12px",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1)"}},{children:[n("div",i({style:{fontSize:"14px",fontWeight:600,color:"#475569",marginBottom:"4px"}},{children:d.title})),n("div",i({style:{backgroundColor:"#F8FAFC",borderRadius:"8px",padding:"12px",display:"flex",flexDirection:"column",gap:"12px"}},{children:d.fields.map(function(r,o){var p=f[o];return e("div",i({style:{display:"flex",flexDirection:"column",gap:"6px"}},{children:[e("div",i({style:{fontSize:"14px",color:"#1E293B",lineHeight:"1.6",fontWeight:400}},{children:[e("span",{children:[o+1,". ",r.label]}),r.reasoning&&e("span",i({onClick:function(e){e.stopPropagation(),h(function(e){var n;return i(i({},e),((n={})[o]=!e[o],n))})},style:{display:"inline-flex",alignItems:"center",gap:"2px",marginLeft:"6px",cursor:"pointer",verticalAlign:"middle"}},{children:[n(s,{size:18}),n(p?t:a,{size:12,color:"#667085"})]}))]})),r.reasoning&&p&&n("div",i({style:{width:"100%"}},{children:n(l,{reasoningTitle:"Decision Making Factors",reasoningSubtitle:"Why is this Suggested?",gapTitle:"Gaps in Decision",gapSubtitle:"What's missing or unclear?",headerIcon:n(s,{}),reasoning:r.reasoning.reason.replace(/\\n/g,"\n"),gap:r.reasoning.gap,score:r.reasoning.score,isOpen:!0,onToggle:function(){return h(function(e){var n;return i(i({},e),((n={})[o]=!1,n))})},hideTrigger:!0,mdComponents:c,styles:{pill:{gap:"2px",border:"none",backgroundColor:"transparent"}}})}))]}),o)})}))]}))]}))};export{p as ViewIdentifiedFieldsCard};
2
2
  //# sourceMappingURL=ViewIdentifiedFieldsCard.js.map
@@ -1,2 +1,2 @@
1
- import{__rest as C,__assign as i}from"tslib";import{jsxs as l,jsx as r}from"react/jsx-runtime";var e=function(e){var o=e.size,t=void 0===o?20:o,c=e.color,d=void 0===c?"#344054":c,h=C(e,["size","color"]);return l("svg",i({width:t,height:t,viewBox:"0 0 13 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:d},h,{children:[l("g",i({"clip-path":"url(#clip0_7146_59770)"},{children:[r("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.870143 7.4728C1.05898 7.12852 1.27464 6.8046 1.51383 6.50373L1.18293 7.96614C0.979942 8.80183 0.898342 9.61402 1.17775 10.2711C1.21942 10.3691 1.26815 10.4612 1.32333 10.5469C1.31329 10.7241 1.31151 10.9023 1.31813 11.0806C1.35384 12.0427 1.63248 12.9774 2.12537 13.7883C2.61826 14.5994 3.30759 15.2574 4.12238 15.6948C4.23255 15.7549 4.32499 15.8457 4.38965 15.9572C4.45431 16.0686 4.48873 16.1966 4.48918 16.3274V19.2231C4.48918 19.3163 4.47174 19.4086 4.43785 19.4947C4.40397 19.5808 4.3543 19.6591 4.29169 19.7249C4.22908 19.7908 4.15475 19.8432 4.07294 19.8788C3.99114 19.9145 3.90346 19.9328 3.81492 19.9328C3.72637 19.9328 3.63869 19.9145 3.55689 19.8788C3.47508 19.8432 3.40075 19.7908 3.33814 19.7249C3.27553 19.6591 3.22587 19.5808 3.19198 19.4947C3.1581 19.4086 3.14066 19.3163 3.14066 19.2231V16.7453C1.68401 15.8205 0.630139 14.3313 0.205569 12.5974C-0.219001 10.8635 0.0196202 9.02345 0.870143 7.4728ZM2.90096 5.19659C2.88899 5.25028 2.87501 5.30914 2.85914 5.37342L2.35372 7.6047C2.74036 7.06579 3.22081 6.60571 3.77188 6.25032C3.86004 6.19348 3.94964 6.13953 4.04056 6.08854L4.37488 4.7326C4.4043 4.6181 4.42962 4.50778 4.45073 4.40202C3.89913 4.59451 3.3785 4.86265 2.90096 5.19659ZM5.56585 4.12493C5.53444 4.42314 5.47335 4.72393 5.39987 5.0116L5.25401 5.6033C5.6147 5.51175 5.98526 5.46115 6.35938 5.45343C7.27383 5.43458 8.17653 5.67261 8.97455 6.14302C9.77256 6.61343 10.437 7.29923 10.8996 8.1298C11.3621 8.96038 11.606 9.90572 11.6062 10.8685V15.3246C11.6062 15.4318 11.5657 15.5346 11.4937 15.6104C11.4216 15.6863 11.324 15.7288 11.2221 15.7288H9.10545C8.92662 15.7288 8.75512 15.8037 8.62867 15.9367C8.50223 16.0699 8.43119 16.2504 8.43119 16.4386V19.2231C8.43119 19.4114 8.50223 19.5919 8.62867 19.7249C8.75512 19.8581 8.92662 19.9328 9.10545 19.9328C9.28428 19.9328 9.45578 19.8581 9.58223 19.7249C9.70867 19.5919 9.77971 19.4114 9.77971 19.2231V17.1483H11.2221C11.4496 17.1483 11.6749 17.1012 11.8851 17.0096C12.0953 16.9179 12.2863 16.7836 12.4472 16.6142C12.6081 16.4448 12.7357 16.2438 12.8228 16.0225C12.9099 15.8013 12.9547 15.5641 12.9547 15.3246V10.8696C12.9545 9.65475 12.6467 8.46189 12.0631 7.4138C11.4794 6.36573 10.641 5.50029 9.63407 4.90657C8.38865 4.18261 6.95913 3.91301 5.56585 4.12493ZM3.70049 8.44134C3.42465 8.78904 3.20515 9.1864 3.05432 9.61774C2.98799 9.80743 2.93585 10.0011 2.89791 10.1971C3.31428 10.1882 3.71718 10.1018 4.57574 9.3851L5.00851 9.00583C5.17133 8.85685 5.2371 8.62777 5.20005 8.40752L5.17831 8.31379C5.07205 8.04339 4.74203 7.96266 4.50119 8.1089C4.25222 8.26007 3.98261 8.37306 3.70049 8.44134ZM6.15774 7.88766C6.02755 7.55613 5.82305 7.3186 5.58321 7.1627C6.10638 7.00991 6.65842 6.97659 7.20161 7.07001C8.06073 7.21777 8.84495 7.67345 9.42154 8.35994C9.80992 8.82213 9.70204 9.48646 9.30287 9.86461C8.12912 10.9809 6.18401 12.4277 4.25076 12.9671C3.75882 13.1034 3.21941 12.8535 3.03925 12.3198C2.92908 11.9929 2.86081 11.6548 2.8344 11.314C3.15405 11.3123 3.55309 11.2871 4.0591 11.0503C4.53459 10.8279 5.0516 10.4444 5.70426 9.84718C6.24535 9.35195 6.37813 8.59572 6.18673 7.97158L6.1743 7.92908L6.15774 7.88766Z",fill:"currentColor"}),r("path",{d:"M2.78566 10.2017C2.21589 10.2017 1.79754 9.83133 2.19656 8.2028L2.85082 5.3137C2.96495 4.85111 2.98338 4.66616 2.85082 4.66616C2.36416 4.7953 2.60848 4.71503 2.19651 4.89983L1.91211 4.39986C3.29881 3.15966 3.32335 2.83187 4.00636 2.83187C4.57614 2.83187 4.6714 3.55367 4.38607 4.66428L3.63745 7.70142C3.50444 8.23827 3.56196 8.42321 3.69406 8.42321C3.98316 8.35428 4.2596 8.24005 4.5145 8.08528C4.75852 7.93711 5.09207 8.01872 5.19962 8.29281C5.27637 8.54288 5.21676 8.82053 5.02834 8.99293C3.76206 10.1516 3.31404 10.2017 2.78566 10.2017ZM4.0972 0.00281947C4.22705 -0.00766091 4.35753 0.0111517 4.47993 0.0580007C4.60232 0.10485 4.71381 0.178656 4.80694 0.274487C4.90007 0.370319 4.97269 0.485969 5.01996 0.61371C5.06723 0.74145 5.08806 0.878339 5.08105 1.01523V1.01265C5.06571 1.36127 4.9234 1.69028 4.68365 1.93134C4.44391 2.17242 4.12517 2.30702 3.79362 2.3072L3.76707 2.30677C3.63546 2.32186 3.50354 2.30544 3.3788 2.25874C3.25407 2.21205 3.14097 2.13628 3.04797 2.0371C2.95497 1.93792 2.88447 1.8179 2.84174 1.68601C2.79934 1.55514 2.78536 1.41595 2.80082 1.27867C2.81343 0.928866 2.95678 0.598439 3.1997 0.359319C3.44286 0.119957 3.76606 -0.00849914 4.09883 0.00195941L4.0972 0.00281947Z",fill:"currentColor"})]})),r("defs",{children:r("clipPath",i({id:"clip0_7146_59770"},{children:r("rect",{width:"13",height:"20",fill:"white"})}))})]}))};export{e as ButtonCognitiveIcon};
1
+ import{__rest as C,__assign as i}from"tslib";import{jsxs as l,jsx as e}from"react/jsx-runtime";var r=function(r){var t=r.size,h=void 0===t?20:t,d=C(r,["size"]);return l("svg",i({width:h,height:h,viewBox:"0 0 13 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d,{children:[l("g",i({"clip-path":"url(#clip0_7146_59770)"},{children:[e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.870143 7.4728C1.05898 7.12852 1.27464 6.8046 1.51383 6.50373L1.18293 7.96614C0.979942 8.80183 0.898342 9.61402 1.17775 10.2711C1.21942 10.3691 1.26815 10.4612 1.32333 10.5469C1.31329 10.7241 1.31151 10.9023 1.31813 11.0806C1.35384 12.0427 1.63248 12.9774 2.12537 13.7883C2.61826 14.5994 3.30759 15.2574 4.12238 15.6948C4.23255 15.7549 4.32499 15.8457 4.38965 15.9572C4.45431 16.0686 4.48873 16.1966 4.48918 16.3274V19.2231C4.48918 19.3163 4.47174 19.4086 4.43785 19.4947C4.40397 19.5808 4.3543 19.6591 4.29169 19.7249C4.22908 19.7908 4.15475 19.8432 4.07294 19.8788C3.99114 19.9145 3.90346 19.9328 3.81492 19.9328C3.72637 19.9328 3.63869 19.9145 3.55689 19.8788C3.47508 19.8432 3.40075 19.7908 3.33814 19.7249C3.27553 19.6591 3.22587 19.5808 3.19198 19.4947C3.1581 19.4086 3.14066 19.3163 3.14066 19.2231V16.7453C1.68401 15.8205 0.630139 14.3313 0.205569 12.5974C-0.219001 10.8635 0.0196202 9.02345 0.870143 7.4728ZM2.90096 5.19659C2.88899 5.25028 2.87501 5.30914 2.85914 5.37342L2.35372 7.6047C2.74036 7.06579 3.22081 6.60571 3.77188 6.25032C3.86004 6.19348 3.94964 6.13953 4.04056 6.08854L4.37488 4.7326C4.4043 4.6181 4.42962 4.50778 4.45073 4.40202C3.89913 4.59451 3.3785 4.86265 2.90096 5.19659ZM5.56585 4.12493C5.53444 4.42314 5.47335 4.72393 5.39987 5.0116L5.25401 5.6033C5.6147 5.51175 5.98526 5.46115 6.35938 5.45343C7.27383 5.43458 8.17653 5.67261 8.97455 6.14302C9.77256 6.61343 10.437 7.29923 10.8996 8.1298C11.3621 8.96038 11.606 9.90572 11.6062 10.8685V15.3246C11.6062 15.4318 11.5657 15.5346 11.4937 15.6104C11.4216 15.6863 11.324 15.7288 11.2221 15.7288H9.10545C8.92662 15.7288 8.75512 15.8037 8.62867 15.9367C8.50223 16.0699 8.43119 16.2504 8.43119 16.4386V19.2231C8.43119 19.4114 8.50223 19.5919 8.62867 19.7249C8.75512 19.8581 8.92662 19.9328 9.10545 19.9328C9.28428 19.9328 9.45578 19.8581 9.58223 19.7249C9.70867 19.5919 9.77971 19.4114 9.77971 19.2231V17.1483H11.2221C11.4496 17.1483 11.6749 17.1012 11.8851 17.0096C12.0953 16.9179 12.2863 16.7836 12.4472 16.6142C12.6081 16.4448 12.7357 16.2438 12.8228 16.0225C12.9099 15.8013 12.9547 15.5641 12.9547 15.3246V10.8696C12.9545 9.65475 12.6467 8.46189 12.0631 7.4138C11.4794 6.36573 10.641 5.50029 9.63407 4.90657C8.38865 4.18261 6.95913 3.91301 5.56585 4.12493ZM3.70049 8.44134C3.42465 8.78904 3.20515 9.1864 3.05432 9.61774C2.98799 9.80743 2.93585 10.0011 2.89791 10.1971C3.31428 10.1882 3.71718 10.1018 4.57574 9.3851L5.00851 9.00583C5.17133 8.85685 5.2371 8.62777 5.20005 8.40752L5.17831 8.31379C5.07205 8.04339 4.74203 7.96266 4.50119 8.1089C4.25222 8.26007 3.98261 8.37306 3.70049 8.44134ZM6.15774 7.88766C6.02755 7.55613 5.82305 7.3186 5.58321 7.1627C6.10638 7.00991 6.65842 6.97659 7.20161 7.07001C8.06073 7.21777 8.84495 7.67345 9.42154 8.35994C9.80992 8.82213 9.70204 9.48646 9.30287 9.86461C8.12912 10.9809 6.18401 12.4277 4.25076 12.9671C3.75882 13.1034 3.21941 12.8535 3.03925 12.3198C2.92908 11.9929 2.86081 11.6548 2.8344 11.314C3.15405 11.3123 3.55309 11.2871 4.0591 11.0503C4.53459 10.8279 5.0516 10.4444 5.70426 9.84718C6.24535 9.35195 6.37813 8.59572 6.18673 7.97158L6.1743 7.92908L6.15774 7.88766Z",fill:"#344054"}),e("path",{d:"M2.78566 10.2017C2.21589 10.2017 1.79754 9.83133 2.19656 8.2028L2.85082 5.3137C2.96495 4.85111 2.98338 4.66616 2.85082 4.66616C2.36416 4.7953 2.60848 4.71503 2.19651 4.89983L1.91211 4.39986C3.29881 3.15966 3.32335 2.83187 4.00636 2.83187C4.57614 2.83187 4.6714 3.55367 4.38607 4.66428L3.63745 7.70142C3.50444 8.23827 3.56196 8.42321 3.69406 8.42321C3.98316 8.35428 4.2596 8.24005 4.5145 8.08528C4.75852 7.93711 5.09207 8.01872 5.19962 8.29281C5.27637 8.54288 5.21676 8.82053 5.02834 8.99293C3.76206 10.1516 3.31404 10.2017 2.78566 10.2017ZM4.0972 0.00281947C4.22705 -0.00766091 4.35753 0.0111517 4.47993 0.0580007C4.60232 0.10485 4.71381 0.178656 4.80694 0.274487C4.90007 0.370319 4.97269 0.485969 5.01996 0.61371C5.06723 0.74145 5.08806 0.878339 5.08105 1.01523V1.01265C5.06571 1.36127 4.9234 1.69028 4.68365 1.93134C4.44391 2.17242 4.12517 2.30702 3.79362 2.3072L3.76707 2.30677C3.63546 2.32186 3.50354 2.30544 3.3788 2.25874C3.25407 2.21205 3.14097 2.13628 3.04797 2.0371C2.95497 1.93792 2.88447 1.8179 2.84174 1.68601C2.79934 1.55514 2.78536 1.41595 2.80082 1.27867C2.81343 0.928866 2.95678 0.598439 3.1997 0.359319C3.44286 0.119957 3.76606 -0.00849914 4.09883 0.00195941L4.0972 0.00281947Z",fill:"#344054"})]})),e("defs",{children:e("clipPath",i({id:"clip0_7146_59770"},{children:e("rect",{width:"13",height:"20",fill:"white"})}))})]}))};export{r as ButtonCognitiveIcon};
2
2
  //# sourceMappingURL=ButtonCognitiveIcon.js.map
@@ -1,2 +1,2 @@
1
- import e from"../../../../../node_modules/style-inject/dist/style-inject.es.js";var o={skeleton:"SkeletonLoader-module_skeleton__CznvH","skeleton-loading":"SkeletonLoader-module_skeleton-loading__MVHfe","skeleton-text":"SkeletonLoader-module_skeleton-text__V5j2O","skeleton-title":"SkeletonLoader-module_skeleton-title__goxHt","skeleton-avatar":"SkeletonLoader-module_skeleton-avatar__Ihuh7","skeleton-image":"SkeletonLoader-module_skeleton-image__ddADp"};e(".SkeletonLoader-module_skeleton__CznvH{animation:SkeletonLoader-module_skeleton-loading__MVHfe 1.4s ease infinite;background:linear-gradient(90deg,var(--il-color-e0e0e0,#e0e0e0) 25%,var(--il-color-f0f0f0,#f0f0f0) 37%,var(--il-color-e0e0e0,#e0e0e0) 63%);background-size:400% 100%;border-radius:4px;display:inline-flex;margin:0}.SkeletonLoader-module_skeleton-text__V5j2O{height:14px;width:100%}.SkeletonLoader-module_skeleton-title__goxHt{height:20px;width:60%}.SkeletonLoader-module_skeleton-avatar__Ihuh7{border-radius:50%;height:48px;width:48px}.SkeletonLoader-module_skeleton-image__ddADp{border-radius:8px;height:180px;width:100%}@keyframes SkeletonLoader-module_skeleton-loading__MVHfe{0%{background-position:100% 0}to{background-position:0 0}}");export{o as default};
1
+ import e from"../../../../../node_modules/style-inject/dist/style-inject.es.js";var o={skeleton:"SkeletonLoader-module_skeleton__CznvH","skeleton-loading":"SkeletonLoader-module_skeleton-loading__MVHfe","skeleton-text":"SkeletonLoader-module_skeleton-text__V5j2O","skeleton-title":"SkeletonLoader-module_skeleton-title__goxHt","skeleton-avatar":"SkeletonLoader-module_skeleton-avatar__Ihuh7","skeleton-image":"SkeletonLoader-module_skeleton-image__ddADp"};e(".SkeletonLoader-module_skeleton__CznvH{animation:SkeletonLoader-module_skeleton-loading__MVHfe 1.4s ease infinite;background:linear-gradient(90deg,#e0e0e0 25%,#f0f0f0 37%,#e0e0e0 63%);background-size:400% 100%;border-radius:4px;display:inline-flex;margin:0}.SkeletonLoader-module_skeleton-text__V5j2O{height:14px;width:100%}.SkeletonLoader-module_skeleton-title__goxHt{height:20px;width:60%}.SkeletonLoader-module_skeleton-avatar__Ihuh7{border-radius:50%;height:48px;width:48px}.SkeletonLoader-module_skeleton-image__ddADp{border-radius:8px;height:180px;width:100%}@keyframes SkeletonLoader-module_skeleton-loading__MVHfe{0%{background-position:100% 0}to{background-position:0 0}}");export{o as default};
2
2
  //# sourceMappingURL=SkeletonLoader.module.css.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsxs as n,jsx as r}from"react/jsx-runtime";import{forwardRef as i,useRef as t,useCallback as o,useEffect as a}from"react";import l from"../../_svg/CognitiveDecisioning.js";import{AlertTriangle as c,ChevronUpIcon as d,ChevronDownIcon as s}from"lucide-react";import p from"../../TooltipComponent.js";import{ConflictReasoningCard as u}from"../../ConflictingReasoningCard.js";import{useLearningTemplateStore as g}from"../../../../LearningManagement/store/useLearningTemplateStore.js";var f=i(function(i,f){var x=i.rows,v=void 0===x?1:x,m=i.placeholder,h=i.value,b=i.onChange,y=i.onFocus,w=i.isHighlighted,C=void 0!==w&&w,k=i.customClass,S=i.showNumber,z=i.numberIndex,I=i.isReadOnly,T=void 0!==I&&I,D=i.isOpen,R=void 0!==D&&D,j=i.onToggle,E=i.showCognitiveIcon,F=void 0!==E&&E,L=i.cognitiveIcon,M=i.tooltipDescription,O=i.isConflicting,H=i.conflictMsg,N=i.conflictingReasoning,V=i.decisionStrength,W=i.conflictingGap,A=i.errorMessage,G=i.inputReadOnly,Y=void 0!==G&&G,_=i.citations,q=void 0===_?[]:_,B=function(){return L||r(l,{})},J=t(null),K=o(function(e){e.style.height="auto",e.style.height="".concat(e.scrollHeight,"px")},[]);a(function(){var e=function(){J.current&&K(J.current)};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[K]);var P=o(function(e){J.current=e,f&&("function"==typeof f?f(e):f.current=e),e&&K(e)},[f,K]),Q=g(function(e){return e.backwardCompatibility})?"37, 99, 235":"89, 37, 220";return n("div",e({style:{width:"100%"}},{children:[n("div",e({style:{display:"flex",flexDirection:"column",width:"100%",border:"1px solid ".concat(O||A?"var(--il-danger, #ef4444)":C?"var(--il-primary, #5925DC)":"var(--il-border, #ccc)"),borderRadius:"0.5rem",backgroundColor:T?"var(--il-surface-alt, #f9fafb)":"var(--il-input-bg, #ffffff)",color:"var(--il-input-fg, #101828)",opacity:T?.8:1,cursor:T?"not-allowed":"text",pointerEvents:"auto",transition:"all 0.3s ease-in-out",overflow:"hidden",boxShadow:O&&C?"0 0 20px 3px rgba(239, 68, 68, 0.45)":C?"\n 0 0 12px 3px rgba(".concat(Q,", 0.3),\n -6px 0 10px rgba(").concat(Q,", 0.2),\n 6px 0 10px rgba(").concat(Q,", 0.2)\n "):"none"},onMouseEnter:function(e){C||O||T||(e.currentTarget.style.border="1px solid var(--il-primary, #5925DC)"),T&&(e.currentTarget.style.cursor="not-allowed")},onMouseLeave:function(e){C||O||T||(e.currentTarget.style.border="1px solid var(--il-border, #ccc)")}},{children:[r("div",e({style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},{children:O&&H&&r("div",e({style:{padding:"12px 12px 0 12px"}},{children:n("div",e({style:{display:"inline-flex",alignItems:"center",gap:"6px",backgroundColor:"#FFE9E980",padding:"4px 10px",borderRadius:"16px",color:"var(--il-danger, #b91c1c)",fontSize:"12px",fontWeight:500}},{children:[r(c,{size:14,strokeWidth:2}),H]}))}))})),n("div",e({style:{display:"flex",alignItems:"flex-start"}},{children:[S&&void 0!==z&&n("span",e({style:{fontSize:"14px",padding:"12px 0",width:"40px",textAlign:"center",color:"var(--il-muted, #666)"}},{children:[z,"."]})),r("textarea",{ref:P,rows:v,placeholder:m,className:"textarea ".concat(k),value:h,onChange:b,onFocus:y,readOnly:Y,style:{border:"none",background:"transparent",flex:1,padding:"12px 12px 12px 12px",fontFamily:"inherit",fontSize:"14px",color:"var(--il-input-fg, #101828)",resize:"both",width:"100%",boxSizing:"border-box",maxHeight:"200px",overflowY:"auto",outline:"none",display:"block",margin:"0 auto",alignSelf:"center",cursor:Y?"default":"text"},onInput:function(e){return K(e.target)}}),O&&N&&r(p,e({description:"View Conflict Details"},{children:n("button",e({onClick:function(e){e.preventDefault(),null==j||j()},style:{display:"flex",alignItems:"center",gap:"4px",padding:"4px 8px",border:"none",backgroundColor:"transparent",borderRadius:"4px",margin:"8px",cursor:"pointer",flexShrink:0}},{children:[B(),r(R?d:s,{size:14})]}))})),F&&!O&&r(p,e({description:null!=M?M:""},{children:n("button",e({onClick:function(e){e.preventDefault(),null==j||j()},style:{display:"flex",alignItems:"center",gap:"4px",padding:"4px 8px",border:"none",backgroundColor:"transparent",borderRadius:"4px",margin:"8px",cursor:"pointer",flexShrink:0}},{children:[B(),r(R?d:s,{size:14})]}))}))]}))]})),O&&R&&r("div",e({style:{marginTop:"8px"}},{children:r(u,{isVisible:!0,decisionStrength:V,reasoning:N,gap:W,citations:q})})),A&&r("div",e({style:{color:"var(--il-danger, #ef4444)",fontSize:"12px",marginTop:"4px"}},{children:A}))]}))});f.displayName="Textarea";export{f as Textarea};
1
+ import{__assign as e}from"tslib";import{jsxs as n,jsx as i}from"react/jsx-runtime";import{forwardRef as t,useRef as o,useCallback as r,useEffect as a}from"react";import l from"../../_svg/CognitiveDecisioning.js";import{AlertTriangle as c,ChevronUpIcon as s,ChevronDownIcon as d}from"lucide-react";import p from"../../TooltipComponent.js";import{ConflictReasoningCard as u}from"../../ConflictingReasoningCard.js";import{useLearningTemplateStore as g}from"../../../../LearningManagement/store/useLearningTemplateStore.js";var x=t(function(t,x){var f=t.rows,h=void 0===f?1:f,m=t.placeholder,b=t.value,v=t.onChange,y=t.onFocus,w=t.isHighlighted,C=void 0!==w&&w,k=t.customClass,S=t.showNumber,z=t.numberIndex,I=t.isReadOnly,T=void 0!==I&&I,R=t.isOpen,D=void 0!==R&&R,E=t.onToggle,j=t.showCognitiveIcon,F=void 0!==j&&j,L=t.cognitiveIcon,M=t.tooltipDescription,O=t.isConflicting,H=t.conflictMsg,N=t.conflictingReasoning,V=t.decisionStrength,W=t.conflictingGap,A=t.errorMessage,B=t.inputReadOnly,G=void 0!==B&&B,Y=t.citations,_=void 0===Y?[]:Y,q=function(){return L||i(l,{})},J=o(null),K=r(function(e){e.style.height="auto",e.style.height="".concat(e.scrollHeight,"px")},[]);a(function(){var e=function(){J.current&&K(J.current)};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[K]);var P=r(function(e){J.current=e,x&&("function"==typeof x?x(e):x.current=e),e&&K(e)},[x,K]),Q=g(function(e){return e.backwardCompatibility}),U=Q?"37, 99, 235":"89, 37, 220";return n("div",e({style:{width:"100%"}},{children:[n("div",e({style:{display:"flex",flexDirection:"column",width:"100%",border:"1px solid ".concat(O||A?"#ef4444":C?Q?"#2563EB":"#5925DC":"#ccc"),borderRadius:"0.5rem",backgroundColor:T?"#f9fafb":"white",opacity:T?.8:1,cursor:T?"not-allowed":"text",pointerEvents:"auto",transition:"all 0.3s ease-in-out",overflow:"hidden",boxShadow:O&&C?"0 0 20px 3px rgba(239, 68, 68, 0.45)":C?"\n 0 0 12px 3px rgba(".concat(U,", 0.3),\n -6px 0 10px rgba(").concat(U,", 0.2),\n 6px 0 10px rgba(").concat(U,", 0.2)\n "):"none"},onMouseEnter:function(e){C||O||T||(e.currentTarget.style.border="1px solid black"),T&&(e.currentTarget.style.cursor="not-allowed")},onMouseLeave:function(e){C||O||T||(e.currentTarget.style.border="1px solid #ccc")}},{children:[i("div",e({style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},{children:O&&H&&i("div",e({style:{padding:"12px 12px 0 12px"}},{children:n("div",e({style:{display:"inline-flex",alignItems:"center",gap:"6px",backgroundColor:"#FFE9E980",padding:"4px 10px",borderRadius:"16px",color:"#b91c1c",fontSize:"12px",fontWeight:500}},{children:[i(c,{size:14,strokeWidth:2}),H]}))}))})),n("div",e({style:{display:"flex",alignItems:"flex-start"}},{children:[S&&void 0!==z&&n("span",e({style:{fontSize:"14px",padding:"12px 0",width:"40px",textAlign:"center",color:"#666"}},{children:[z,"."]})),i("textarea",{ref:P,rows:h,placeholder:m,className:"textarea ".concat(k),value:b,onChange:v,onFocus:y,readOnly:G,style:{border:"none",background:"transparent",flex:1,padding:"12px 12px 12px 12px",fontFamily:"inherit",fontSize:"14px",color:"#101828",resize:"both",width:"100%",boxSizing:"border-box",maxHeight:"200px",overflowY:"auto",outline:"none",display:"block",margin:"0 auto",alignSelf:"center",cursor:G?"default":"text"},onInput:function(e){return K(e.target)}}),O&&N&&i(p,e({description:"View Conflict Details"},{children:n("button",e({onClick:function(e){e.preventDefault(),null==E||E()},style:{display:"flex",alignItems:"center",gap:"4px",padding:"4px 8px",border:"none",backgroundColor:"transparent",borderRadius:"4px",margin:"8px",cursor:"pointer",flexShrink:0}},{children:[q(),i(D?s:d,{size:14})]}))})),F&&!O&&i(p,e({description:null!=M?M:""},{children:n("button",e({onClick:function(e){e.preventDefault(),null==E||E()},style:{display:"flex",alignItems:"center",gap:"4px",padding:"4px 8px",border:"none",backgroundColor:"transparent",borderRadius:"4px",margin:"8px",cursor:"pointer",flexShrink:0}},{children:[q(),i(D?s:d,{size:14})]}))}))]}))]})),O&&D&&i("div",e({style:{marginTop:"8px"}},{children:i(u,{isVisible:!0,decisionStrength:V,reasoning:N,gap:W,citations:_})})),A&&i("div",e({style:{color:"#ef4444",fontSize:"12px",marginTop:"4px"}},{children:A}))]}))});x.displayName="Textarea";export{x as Textarea};
2
2
  //# sourceMappingURL=Textarea.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as n}from"tslib";import{jsxs as i,jsx as t,Fragment as e}from"react/jsx-runtime";import{Trash2 as o,Check as r,X as c,Pencil as l,AlertTriangle as a,Loader2Icon as d,Plus as s}from"lucide-react";import{useState as u,useRef as f,useEffect as v,useCallback as m}from"react";import{Button as g}from"../../atoms/Button/Button.js";import{Textarea as p}from"../../atoms/Textarea/Textarea.js";import{InputDataReasoningCard as h}from"../../InputDataReasoningCard.js";import x from"../../TooltipComponent.js";import{ButtonCognitiveIcon as y}from"../../_svg/ButtonCognitiveIcon.js";import{useLearningTemplateStore as b}from"../../../../LearningManagement/store/useLearningTemplateStore.js";var C=function(n){return!!n&&/[a-z0-9À-￿]/i.test(n)},N=function(N){var w=N.idPrefix,S=N.items,_=N.onAdd,I=N.onRemove,E=N.onEdit,k=N.index,z=N.tierKey,A=N.readOnly,j=void 0!==A&&A,T=N.placeholder,D=void 0===T?"Enter your condition":T,R=N.addLabel,M=void 0===R?"Add Condition":R,O=N.showAddButton,B=void 0===O||O;N.isHighlighted;var H=N.highlightedIds;N.footer;var L=N.tooltipDescription,W=N.citations,K=void 0===W?[]:W,P=N.setSendMessageInChat,V=N.fieldName,F=N.isAiStreaming,G=void 0!==F&&F,U=N.activeEditId,q=N.setActiveEditId,J=N.pendingEditId;N.setPendingEditId;var Q=N.errorMessage,X=N.hideEditControls,Y=void 0!==X&&X,Z=N.parentEditing,$=void 0!==Z&&Z,nn=b(function(n){return n.backwardCompatibility}),tn=u({}),en=tn[0],on=tn[1],rn=u(null),cn=rn[0],ln=rn[1],an=u(null),dn=an[0],sn=an[1],un=u(null),fn=un[0],vn=un[1],mn=f(G),gn=f(new Map),pn=f(S);v(function(){mn.current&&!G&&null!==fn&&vn(null),mn.current=G},[G,fn]);v(function(){var i=pn.current,t=S.filter(function(n){return!i.find(function(i){return i.id===n.id})});if(Y)return pn.current=S,void(t.length>0&&ln(t[t.length-1].id));if(t.length>0){var e=t[t.length-1],o="".concat(w,"-").concat(z,"-").concat(k,"-").concat(e.id);e.text&&""!==e.text.trim()||(q&&q(o),on(function(i){var t;return n(n({},i),((t={})[e.id]="",t))}),ln(e.id))}pn.current=S},[S,z,k,q,w,Y]),v(function(){if(cn){var n=gn.current.get(cn);if(n){n.focus();var i=n.value.length;n.setSelectionRange(i,i)}ln(null)}},[cn,S]);var hn=m(function(n){n&&(n.style.height="auto",n.style.height="".concat(n.scrollHeight,"px"))},[]),xn=Object.values(en).some(function(n){return!n||""===n.trim()}),yn=S.some(function(n){var i,t,e=en[n.id];return void 0!==e&&e.trim()===(null!==(t=null===(i=n.text)||void 0===i?void 0:i.trim())&&void 0!==t?t:"")}),bn=S.filter(function(n){return n.text&&""!==n.text.trim()}),Cn=new Set(bn.map(function(n){return n.text.trim()})).size!==bn.length,Nn=Y?!$||G||Cn||S.some(function(n){return!C(n.text)}):xn||Cn||null!==U||G,wn=xn||Cn||G||yn;return i("div",n({className:"condition-wrapper"},{children:[S.map(function(d,s){var u,f,v,m,b,C,N,_;if(d.id===fn&&G)return null;var A="".concat(w,"-").concat(z,"-").concat(k,"-").concat(d.id),T=d.id in en,R=null!==U&&U!==A,M=(null==H?void 0:H.has(d.id))&&!G,O=!!d.conflict,B=(null===(u=d.conflict)||void 0===u?void 0:u.reason)||(O?"Conflicting":null),W=Array.isArray(null===(f=d.conflict)||void 0===f?void 0:f.conflicting_reasoning)?d.conflict.conflicting_reasoning.map(function(n){return"- ".concat(n)}).join("\n"):(null===(v=d.conflict)||void 0===v?void 0:v.conflicting_reasoning)||null,F=(null===(m=d.conflict)||void 0===m?void 0:m.decision_strength)||null,Q=Array.isArray(null===(b=d.conflict)||void 0===b?void 0:b.conflicting_gap)?d.conflict.conflicting_gap.map(function(n){return"- ".concat(n)}).join("\n"):(null===(C=d.conflict)||void 0===C?void 0:C.conflicting_gap)||null,X=!!d.reasoning,Z=dn===d.id,nn=Y?null!==(N=d.text)&&void 0!==N?N:"":T?null!==(_=en[d.id])&&void 0!==_?_:"":d.text,tn=Y?j||G||!$:j||G||!T;return i("div",n({className:"condition-row-container","data-edit-id":A,style:{marginBottom:X&&Z?"16px":"8px"}},{children:[i("div",n({className:"condition-item ".concat(O?"border-red-500":""," ").concat(T?"is-editing":""),style:{pointerEvents:"auto"}},{children:[t("div",n({className:"condition-left"},{children:t(p,{ref:function(n){n?(gn.current.set(d.id,n),hn(n)):gn.current.delete(d.id)},rows:1,placeholder:D,value:nn,onChange:function(i){Y?$&&E(z,k,d.id,i.target.value):T&&on(function(t){var e;return n(n({},t),((e={})[d.id]=i.target.value,e))})},showNumber:!0,numberIndex:s+1,isReadOnly:j||G,inputReadOnly:tn,isOpen:Z&&!T,onToggle:function(){return n=d.id,void sn(function(i){return i===n?null:n});var n},showCognitiveIcon:X&&!T&&!O,cognitiveIcon:t(y,{color:"var(--il-rhs-cognitive-icon, var(--il-foreground, #ffffff))"}),tooltipDescription:L,isConflicting:O,conflictMsg:B,conflictingReasoning:W,isHighlighted:M,decisionStrength:F,conflictingGap:Q,citations:K})})),!j&&Y&&$&&t("div",n({className:"action-buttons"},{children:t(x,n({description:"Delete this condition"},{children:t(g,{onClick:function(){return I(z,k,d.id)},className:"btn-icon btn-delete",icon:t(o,{size:18}),disabled:G})}))})),!j&&!Y&&t("div",n({className:"action-buttons"},{children:T?t("div",n({className:"action-buttons-inline"},{children:i(e,{children:[t(x,n({description:"Apply"},{children:t(g,n({onClick:function(){return function(i){var t,e,o,r=null!==(t=en[i.id])&&void 0!==t?t:"";if(r.trim()&&!S.some(function(n){return n.id!==i.id&&n.text.trim()===r.trim()})){var c=null!==(o=null===(e=i.text)||void 0===e?void 0:e.trim())&&void 0!==o?o:"";if(r.trim()===c)return on(function(t){var e=n({},t);return delete e[i.id],e}),void(q&&q(null));var l=!c;if(P){var a="sk-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),d="string"==typeof V&&""!==V.trim()?V:"field",s=l?"Add a new ".concat(d," condition: ").concat(r):"Update existing ".concat(d," condition: ").concat(c," with a new condition: ").concat(r);vn(i.id),P("__SKELETON__:".concat(a,":").concat(s))}on(function(t){var e=n({},t);return delete e[i.id],e}),q&&q(null)}}(d)},disabled:wn,className:"btn-apply",style:{cursor:wn?"not-allowed":"pointer",opacity:wn?.5:1},icon:t(r,{size:20,strokeWidth:2.5})},{children:"Apply"}))})),t(x,n({description:"Cancel"},{children:t(g,{onClick:function(){return function(i){var t=""===i.text||void 0===i.text;on(function(t){var e=n({},t);return delete e[i.id],e}),q&&q(null),t&&I(z,k,i.id)}(d)},className:"btn-cancel-inline",icon:t(c,{size:20,strokeWidth:2.5})})}))]})})):i("div",n({className:"action-buttons"},{children:[t(x,n({description:R?"Save active edits first":"Edit this condition"},{children:t(g,{onClick:function(){return function(i){var t="".concat(w,"-").concat(z,"-").concat(k,"-").concat(i.id);U&&U!==t||(q&&q(t),on(function(t){var e;return n(n({},t),((e={})[i.id]=i.text,e))}),ln(i.id))}(d)},className:"btn-icon btn-edit",icon:t(l,{size:18}),disabled:G||R})})),t(x,n({description:R?"Save active edits first":"Delete this condition"},{children:t(g,{onClick:function(){return function(i){var t,e="".concat(w,"-").concat(z,"-").concat(k,"-").concat(i.id);if(U===e&&q&&q(null),on(function(t){var e=n({},t);return delete e[i.id],e}),null===(t=i.text)||void 0===t?void 0:t.trim()){if(P){var o="sk-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),r="string"==typeof V&&""!==V.trim()?V:"field";vn(i.id),P("__SKELETON__:".concat(o,":Remove ").concat(r," ").concat(i.text))}}else I(z,k,i.id)}(d)},className:"btn-icon btn-delete",icon:t(o,{size:18}),disabled:G||R})}))]}))}))]})),J===A&&T&&i("div",n({style:{display:"flex",alignItems:"center",gap:"6px",marginTop:"10px"}},{children:[t(a,{size:14,style:{color:"var(--il-warning, #C2410C)"}}),t("div",n({style:{color:"var(--il-warning, #C2410C)",fontSize:"13px"}},{children:"Pending - Changes not applied yet. Apply or discard them to continue."}))]})),X&&!O&&t("div",n({style:{maxHeight:Z?"1000px":"0",overflow:"hidden",transition:"all 0.3s ease-in-out",marginTop:Z?"1.5px":"0"}},{children:t(h,{isVisible:Z,citation:d.reasoning,citations:K,fieldName:"Condition ".concat(s+1),fieldValue:d.text})}))]}),d.id)}),null!==fn&&G&&i(e,{children:[t("style",{children:"\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),i("div",n({style:{display:"flex",alignItems:"center",justifyContent:"flex-start",padding:"4px 0 12px 12px",color:"var(--il-muted, #141414)",fontSize:"13px",fontWeight:500,fontStyle:"italic"}},{children:[t(d,{style:{marginRight:8,animation:"spin 1s linear infinite"}}),"Checking the correctness of your updated condition..."]}))]}),0===S.length&&t("div",n({style:{display:"flex",alignItems:"center",color:"var(--il-muted, #bbb)",fontFamily:"Inter",fontWeight:400,fontSize:"14px",fontStyle:"italic",lineHeight:"130%",height:"40px",marginBottom:"8px"}},{children:"No items to show"})),Q&&t("div",n({style:{color:"var(--il-danger, #ef4444)",fontSize:"12px",marginTop:"4px"}},{children:Q})),B&&!j&&i("div",n({className:"condition-add ".concat(Nn?"disabled":""),onClick:function(){return!Nn&&_()},role:"button",style:n({opacity:Nn?.5:1,cursor:Nn?"not-allowed":"pointer"},nn?{}:{color:"var(--il-primary, #5925DC)"})},{children:[t(s,{size:20,className:"condition-add-icon"}),t("span",n({className:"condition-add-text"},{children:M}))]}))]}))};export{N as ConditionList,C as hasMeaningfulText};
1
+ import{__assign as n}from"tslib";import{jsxs as i,jsx as t,Fragment as e}from"react/jsx-runtime";import{Trash2 as o,Check as c,X as r,Pencil as l,AlertTriangle as a,Loader2Icon as d,Plus as s}from"lucide-react";import{useState as u,useRef as f,useEffect as v,useCallback as m}from"react";import{Button as p}from"../../atoms/Button/Button.js";import{Textarea as g}from"../../atoms/Textarea/Textarea.js";import{InputDataReasoningCard as h}from"../../InputDataReasoningCard.js";import x from"../../TooltipComponent.js";import{ButtonCognitiveIcon as y}from"../../_svg/ButtonCognitiveIcon.js";import{useLearningTemplateStore as b}from"../../../../LearningManagement/store/useLearningTemplateStore.js";var C=function(n){return!!n&&/[a-z0-9À-￿]/i.test(n)},N=function(N){var w=N.idPrefix,S=N.items,_=N.onAdd,E=N.onRemove,I=N.onEdit,k=N.index,z=N.tierKey,A=N.readOnly,j=void 0!==A&&A,T=N.placeholder,D=void 0===T?"Enter your condition":T,R=N.addLabel,B=void 0===R?"Add Condition":R,M=N.showAddButton,O=void 0===M||M;N.isHighlighted;var H=N.highlightedIds;N.footer;var L=N.tooltipDescription,W=N.citations,K=void 0===W?[]:W,P=N.setSendMessageInChat,V=N.fieldName,F=N.isAiStreaming,G=void 0!==F&&F,U=N.activeEditId,q=N.setActiveEditId,J=N.pendingEditId;N.setPendingEditId;var Q=N.errorMessage,X=N.hideEditControls,Y=void 0!==X&&X,Z=N.parentEditing,$=void 0!==Z&&Z,nn=b(function(n){return n.backwardCompatibility}),tn=nn?"#2563EB":"#5925DC",en=u({}),on=en[0],cn=en[1],rn=u(null),ln=rn[0],an=rn[1],dn=u(null),sn=dn[0],un=dn[1],fn=u(null),vn=fn[0],mn=fn[1],pn=f(G),gn=f(new Map),hn=f(S);v(function(){pn.current&&!G&&null!==vn&&mn(null),pn.current=G},[G,vn]);v(function(){var i=hn.current,t=S.filter(function(n){return!i.find(function(i){return i.id===n.id})});if(Y)return hn.current=S,void(t.length>0&&an(t[t.length-1].id));if(t.length>0){var e=t[t.length-1],o="".concat(w,"-").concat(z,"-").concat(k,"-").concat(e.id);e.text&&""!==e.text.trim()||(q&&q(o),cn(function(i){var t;return n(n({},i),((t={})[e.id]="",t))}),an(e.id))}hn.current=S},[S,z,k,q,w,Y]),v(function(){if(ln){var n=gn.current.get(ln);if(n){n.focus();var i=n.value.length;n.setSelectionRange(i,i)}an(null)}},[ln,S]);var xn=m(function(n){n&&(n.style.height="auto",n.style.height="".concat(n.scrollHeight,"px"))},[]),yn=Object.values(on).some(function(n){return!n||""===n.trim()}),bn=S.some(function(n){var i,t,e=on[n.id];return void 0!==e&&e.trim()===(null!==(t=null===(i=n.text)||void 0===i?void 0:i.trim())&&void 0!==t?t:"")}),Cn=S.filter(function(n){return n.text&&""!==n.text.trim()}),Nn=new Set(Cn.map(function(n){return n.text.trim()})).size!==Cn.length,wn=Y?!$||G||Nn||S.some(function(n){return!C(n.text)}):yn||Nn||null!==U||G,Sn=yn||Nn||G||bn;return i("div",n({className:"condition-wrapper"},{children:[S.map(function(d,s){var u,f,v,m,b,C,N,_;if(d.id===vn&&G)return null;var A="".concat(w,"-").concat(z,"-").concat(k,"-").concat(d.id),T=d.id in on,R=null!==U&&U!==A,B=(null==H?void 0:H.has(d.id))&&!G,M=!!d.conflict,O=(null===(u=d.conflict)||void 0===u?void 0:u.reason)||(M?"Conflicting":null),W=Array.isArray(null===(f=d.conflict)||void 0===f?void 0:f.conflicting_reasoning)?d.conflict.conflicting_reasoning.map(function(n){return"- ".concat(n)}).join("\n"):(null===(v=d.conflict)||void 0===v?void 0:v.conflicting_reasoning)||null,F=(null===(m=d.conflict)||void 0===m?void 0:m.decision_strength)||null,Q=Array.isArray(null===(b=d.conflict)||void 0===b?void 0:b.conflicting_gap)?d.conflict.conflicting_gap.map(function(n){return"- ".concat(n)}).join("\n"):(null===(C=d.conflict)||void 0===C?void 0:C.conflicting_gap)||null,X=!!d.reasoning,Z=sn===d.id,nn=Y?null!==(N=d.text)&&void 0!==N?N:"":T?null!==(_=on[d.id])&&void 0!==_?_:"":d.text,tn=Y?j||G||!$:j||G||!T;return i("div",n({className:"condition-row-container","data-edit-id":A,style:{marginBottom:X&&Z?"16px":"8px"}},{children:[i("div",n({className:"condition-item ".concat(M?"border-red-500":""," ").concat(T?"is-editing":""),style:{pointerEvents:"auto"}},{children:[t("div",n({className:"condition-left"},{children:t(g,{ref:function(n){n?(gn.current.set(d.id,n),xn(n)):gn.current.delete(d.id)},rows:1,placeholder:D,value:nn,onChange:function(i){Y?$&&I(z,k,d.id,i.target.value):T&&cn(function(t){var e;return n(n({},t),((e={})[d.id]=i.target.value,e))})},showNumber:!0,numberIndex:s+1,isReadOnly:j||G,inputReadOnly:tn,isOpen:Z&&!T,onToggle:function(){return n=d.id,void un(function(i){return i===n?null:n});var n},showCognitiveIcon:X&&!T&&!M,cognitiveIcon:t(y,{}),tooltipDescription:L,isConflicting:M,conflictMsg:O,conflictingReasoning:W,isHighlighted:B,decisionStrength:F,conflictingGap:Q,citations:K})})),!j&&Y&&$&&t("div",n({className:"action-buttons"},{children:t(x,n({description:"Delete this condition"},{children:t(p,{onClick:function(){return E(z,k,d.id)},className:"btn-icon btn-delete",icon:t(o,{size:18}),disabled:G})}))})),!j&&!Y&&t("div",n({className:"action-buttons"},{children:T?t("div",n({className:"action-buttons-inline"},{children:i(e,{children:[t(x,n({description:"Apply"},{children:t(p,n({onClick:function(){return function(i){var t,e,o,c=null!==(t=on[i.id])&&void 0!==t?t:"";if(c.trim()&&!S.some(function(n){return n.id!==i.id&&n.text.trim()===c.trim()})){var r=null!==(o=null===(e=i.text)||void 0===e?void 0:e.trim())&&void 0!==o?o:"";if(c.trim()===r)return cn(function(t){var e=n({},t);return delete e[i.id],e}),void(q&&q(null));var l=!r;if(P){var a="sk-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),d="string"==typeof V&&""!==V.trim()?V:"field",s=l?"Add a new ".concat(d," condition: ").concat(c):"Update existing ".concat(d," condition: ").concat(r," with a new condition: ").concat(c);mn(i.id),P("__SKELETON__:".concat(a,":").concat(s))}cn(function(t){var e=n({},t);return delete e[i.id],e}),q&&q(null)}}(d)},disabled:Sn,className:"btn-apply",style:{cursor:Sn?"not-allowed":"pointer",opacity:Sn?.5:1},icon:t(c,{size:20,strokeWidth:2.5})},{children:"Apply"}))})),t(x,n({description:"Cancel"},{children:t(p,{onClick:function(){return function(i){var t=""===i.text||void 0===i.text;cn(function(t){var e=n({},t);return delete e[i.id],e}),q&&q(null),t&&E(z,k,i.id)}(d)},className:"btn-cancel-inline",icon:t(r,{size:20,strokeWidth:2.5})})}))]})})):i("div",n({className:"action-buttons"},{children:[t(x,n({description:R?"Save active edits first":"Edit this condition"},{children:t(p,{onClick:function(){return function(i){var t="".concat(w,"-").concat(z,"-").concat(k,"-").concat(i.id);U&&U!==t||(q&&q(t),cn(function(t){var e;return n(n({},t),((e={})[i.id]=i.text,e))}),an(i.id))}(d)},className:"btn-icon btn-edit",icon:t(l,{size:18}),disabled:G||R})})),t(x,n({description:R?"Save active edits first":"Delete this condition"},{children:t(p,{onClick:function(){return function(i){var t,e="".concat(w,"-").concat(z,"-").concat(k,"-").concat(i.id);if(U===e&&q&&q(null),cn(function(t){var e=n({},t);return delete e[i.id],e}),null===(t=i.text)||void 0===t?void 0:t.trim()){if(P){var o="sk-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),c="string"==typeof V&&""!==V.trim()?V:"field";mn(i.id),P("__SKELETON__:".concat(o,":Remove ").concat(c," ").concat(i.text))}}else E(z,k,i.id)}(d)},className:"btn-icon btn-delete",icon:t(o,{size:18}),disabled:G||R})}))]}))}))]})),J===A&&T&&i("div",n({style:{display:"flex",alignItems:"center",gap:"6px",marginTop:"10px"}},{children:[t(a,{size:14,style:{color:"#C2410C"}}),t("div",n({style:{color:"#C2410C",fontSize:"13px"}},{children:"Pending - Changes not applied yet. Apply or discard them to continue."}))]})),X&&!M&&t("div",n({style:{maxHeight:Z?"1000px":"0",overflow:"hidden",transition:"all 0.3s ease-in-out",marginTop:Z?"1.5px":"0"}},{children:t(h,{isVisible:Z,citation:d.reasoning,citations:K,fieldName:"Condition ".concat(s+1),fieldValue:d.text})}))]}),d.id)}),null!==vn&&G&&i(e,{children:[t("style",{children:"\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),i("div",n({style:{display:"flex",alignItems:"center",justifyContent:"flex-start",padding:"4px 0 12px 12px",color:"#141414ff",fontSize:"13px",fontWeight:500,fontStyle:"italic"}},{children:[t(d,{style:{marginRight:8,animation:"spin 1s linear infinite"}}),"Checking the correctness of your updated condition..."]}))]}),0===S.length&&t("div",n({style:{display:"flex",alignItems:"center",color:"#bbb",fontFamily:"Inter",fontWeight:400,fontSize:"14px",fontStyle:"italic",lineHeight:"130%",height:"40px",marginBottom:"8px"}},{children:"No items to show"})),Q&&t("div",n({style:{color:"#ef4444",fontSize:"12px",marginTop:"4px"}},{children:Q})),O&&!j&&i("div",n({className:"condition-add ".concat(wn?"disabled":""),onClick:function(){return!wn&&_()},role:"button",style:n({opacity:wn?.5:1,cursor:wn?"not-allowed":"pointer"},nn?{}:{color:tn})},{children:[t(s,{size:20,className:"condition-add-icon"}),t("span",n({className:"condition-add-text"},{children:B}))]}))]}))};export{N as ConditionList,C as hasMeaningfulText};
2
2
  //# sourceMappingURL=ConditionList.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsxs as t,jsx as i,Fragment as r}from"react/jsx-runtime";import{ChevronDown as n}from"lucide-react";import{useState as l,useCallback as o}from"react";var a=function(a){var c=a.id,s=a.required,d=a.title,p=a.subtitle,m=a.children,u=a.openSections,f=a.setOpenSections;a.dividerRequired;var h=a.defaultOpen,v=void 0===h||h,x=a.collapsible,y=void 0!==x&&x,g=a.bordered,b=void 0!==g&&g,w=a.customStyles,I=a.readOnly,N=a.headerActions,S=l(v),C=S[0],O=S[1],R=void 0!==u&&void 0!==f&&u.has(c),j=!y||(R?u.has(c):C),k=o(function(){y&&(R?f(function(e){var t=new Set(e);return t.has(c)?t.delete(c):t.add(c),t}):O(function(e){return!e}))},[c,f,y,R]);return t("div",e({className:"section-wrapper",style:b?{border:"1px solid var(--il-border, #ccc)",padding:"8px 12px",borderRadius:"8px"}:{}},{children:[t("div",e({className:"section-header",onClick:k,role:y?"button":"presentation",style:{cursor:y?"pointer":"default",display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"4px"}},{children:[t("div",e({style:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"}},{children:[t("div",e({className:"section-header-title ".concat(j?"active":""),style:{display:"flex",alignItems:"center",gap:"1.5px"}},{children:[s&&i("span",e({style:{color:"var(--il-danger, #8F2C23)",marginRight:"2px"}},{children:"*"})),i("span",e({style:{cursor:I?"not-allowed":"pointer"}},{children:d}))]})),t("div",e({style:{display:"flex",alignItems:"center",gap:"8px"},onClick:function(e){return e.stopPropagation()}},{children:[N,y&&i(n,{size:24,className:"section-chevron ".concat(j?"open":"")})]}))]})),p&&i("div",e({style:{fontFamily:"Inter",fontWeight:400,fontSize:"12px",lineHeight:"130%",color:"var(--il-muted, #64748B)",marginLeft:"0px"}},{children:p}))]})),j&&i(r,{children:i("div",e({className:"section-content",style:w},{children:m}))})]}))};export{a as SectionWrapper};
1
+ import{__assign as e}from"tslib";import{jsxs as t,jsx as i,Fragment as n}from"react/jsx-runtime";import{ChevronDown as r}from"lucide-react";import{useState as l,useCallback as o}from"react";var c=function(c){var s=c.id,a=c.required,d=c.title,p=c.subtitle,m=c.children,u=c.openSections,f=c.setOpenSections;c.dividerRequired;var h=c.defaultOpen,v=void 0===h||h,x=c.collapsible,y=void 0!==x&&x,g=c.bordered,b=void 0!==g&&g,w=c.customStyles,I=c.readOnly,N=c.headerActions,S=l(v),C=S[0],O=S[1],R=void 0!==u&&void 0!==f&&u.has(s),j=!y||(R?u.has(s):C),k=o(function(){y&&(R?f(function(e){var t=new Set(e);return t.has(s)?t.delete(s):t.add(s),t}):O(function(e){return!e}))},[s,f,y,R]);return t("div",e({className:"section-wrapper",style:b?{border:"1px solid #ccc",padding:"8px 12px",borderRadius:"8px"}:{}},{children:[t("div",e({className:"section-header",onClick:k,role:y?"button":"presentation",style:{cursor:y?"pointer":"default",display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"4px"}},{children:[t("div",e({style:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"}},{children:[t("div",e({className:"section-header-title ".concat(j?"active":""),style:{display:"flex",alignItems:"center",gap:"1.5px"}},{children:[a&&i("span",e({style:{color:"#8F2C23",marginRight:"2px"}},{children:"*"})),i("span",e({style:{cursor:I?"not-allowed":"pointer"}},{children:d}))]})),t("div",e({style:{display:"flex",alignItems:"center",gap:"8px"},onClick:function(e){return e.stopPropagation()}},{children:[N,y&&i(r,{size:24,className:"section-chevron ".concat(j?"open":"")})]}))]})),p&&i("div",e({style:{fontFamily:"Inter",fontWeight:400,fontSize:"12px",lineHeight:"130%",color:"#64748B",marginLeft:"0px"}},{children:p}))]})),j&&i(n,{children:i("div",e({className:"section-content",style:w},{children:m}))})]}))};export{c as SectionWrapper};
2
2
  //# sourceMappingURL=SectionWrapper.js.map
@@ -1,2 +1,2 @@
1
- import{__rest as n,__assign as e}from"tslib";import{jsxs as i,jsx as t,Fragment as o}from"react/jsx-runtime";import{SectionWrapper as r}from"../../molecules/Sections/SectionWrapper.js";import{SeparationRow as a}from"../../molecules/SeperationRow/SeparationRow.js";import{Toggle as l}from"../../atoms/Toggle/Toggle.js";import{Pencil as c,Loader2Icon as d,Check as s,AlertTriangle as p}from"lucide-react";import{useState as u,useRef as f,useEffect as g}from"react";var m=function(m){var h=m.separationItems,b=void 0===h?[]:h,y=m.toggles,v=void 0===y?[]:y;m.onConfigChange;var x=m.highlights,S=void 0===x?{}:x,_=m.index,C=m.openSections,k=m.readOnly,I=void 0!==k&&k,E=m.setOpenSections,w=m.activeEditId,j=m.setActiveEditId,z=m.pendingEditId,T=m.setPendingEditId,O=m.isAiStreaming,A=m.setSendMessageInChat,D=m.id,N=n(m,["separationItems","toggles","onConfigChange","highlights","index","openSections","readOnly","setOpenSections","activeEditId","setActiveEditId","pendingEditId","setPendingEditId","isAiStreaming","setSendMessageInChat","id"]),R=D||"config-section-".concat(null!=_?_:0),W=w===R,B=!!w&&w!==R,P=u(null),M=P[0],H=P[1],K=u(null),L=K[0],U=K[1],q=u(!1),F=q[0],G=q[1],J=f(O),Q="\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n ";g(function(){J.current&&!O&&F&&G(!1),J.current=O},[O,F]);var V,X,Y=I||!W||F,Z=i("div",e({style:{display:"flex",alignItems:"center"}},{children:[!I&&!W&&!F&&t("button",e({title:B?"Save active edits first":"Edit Configuration",onClick:function(n){n.stopPropagation(),B?T&&T(null!=w?w:null):(H(b.map(function(n){return e({},n)})),U(v.map(function(n){return e({},n)})),j&&j(R),E&&C&&!C.has(R)&&E(function(n){var e=new Set(n);return e.add(R),e}))},style:e(e({},{display:"flex",alignItems:"center",justifyContent:"center",padding:"6px 8px",border:"1px solid var(--il-border, #e5e7eb)",borderRadius:"8px",cursor:"pointer",backgroundColor:"var(--il-surface, #ffffff)",color:"var(--il-muted, #64748B)"}),{opacity:B?.5:1,cursor:B?"not-allowed":"pointer",border:"none",background:"transparent"})},{children:t(c,{size:16})})),F&&O&&i(o,{children:[t("style",{children:Q}),t(d,{size:16,style:{animation:"spin 1s linear infinite",color:"var(--il-muted, #64748B)"}})]})]})),$=(V=M?M.filter(function(n,e){var i=b[e];return!i||n.enabled!==i.enabled||n.global_min_separation_seconds!==i.global_min_separation_seconds}):[],X=L?L.filter(function(n,e){var i=v[e];return!i||n.enabled!==i.enabled}):[],0===V.length&&0===X.length);return t("div",e({"data-edit-id":R},{children:i(r,e({},N,{id:R,collapsible:!0,defaultOpen:!1,openSections:C,setOpenSections:E,headerActions:Z},{children:[i("div",e({className:"config-content-grid",style:{opacity:Y&&!I?.6:1,transition:"opacity 0.2s"}},{children:[(M||b).map(function(n,i){return t(a,{label:"".concat(n.label," Separation"),isEnabled:n.enabled,duration:n.global_min_separation_seconds,onToggle:function(){return function(n){W&&!F&&H(function(i){return i?i.map(function(i){return i.key===n.key?e(e({},i),{enabled:!i.enabled}):i}):null})}(n)},onDurationChange:function(i){return function(n,i){W&&!F&&H(function(t){return t?t.map(function(t){return t.key===n.key?e(e({},t),{global_min_separation_seconds:i}):t}):null})}(n,i)},isHighlighted:S["config_".concat(n.key)],isDisabled:Y},n.key)}),(L||v).map(function(n,o){return t("div",e({className:"separation-row-container"},{children:i("div",e({className:"separation-header-row"},{children:[t("div",e({className:"separation-label"},{children:n.label})),t(l,{isEnabled:n.enabled,onToggle:function(){return function(n){W&&!F&&U(function(i){return i?i.map(function(i){return i.key===n.key?e(e({},i),{enabled:!i.enabled}):i}):null})}(n)},isDisabled:Y})]}))}),n.key)})]})),F&&O&&i(o,{children:[t("style",{children:Q}),i("div",e({style:{display:"flex",alignItems:"center",padding:"4px 0 12px 12px",color:"var(--il-muted, #141414)",fontSize:"13px",fontWeight:500,fontStyle:"italic",marginTop:"8px"}},{children:[t(d,{style:{marginRight:8,animation:"spin 1s linear infinite"}}),"Checking the correctness of your Configuration..."]}))]}),W&&!F&&i("div",e({style:{display:"flex",flexDirection:"column",marginTop:"12px"}},{children:[i("div",e({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[t("button",e({onClick:function(){H(null),U(null),j&&j(null)},style:{background:"none",border:"none",color:"var(--il-muted, #64748B)",fontSize:"14px",fontWeight:"500",cursor:"pointer",padding:"0"}},{children:"Discard Changes"})),i("button",e({onClick:function(){if(M&&L){var n=M.filter(function(n,e){var i=b[e];return!i||n.enabled!==i.enabled||n.global_min_separation_seconds!==i.global_min_separation_seconds}),e=L.filter(function(n,e){var i=v[e];return!i||n.enabled!==i.enabled});if(0===n.length&&0===e.length)return H(null),U(null),void(j&&j(null));if(A){var i="sk-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),t=[];n.length>0&&t.push("Enable ".concat(n.map(function(n){return"".concat(n.label," (").concat(n.global_min_separation_seconds,"min)")}).join(", "))),e.length>0&&t.push("enable ".concat(e.map(function(n){return"".concat(n.label," (").concat(n.enabled,")")}).join(", ")));var o="__SKELETON__:".concat(i,":Update Configuration - ").concat(t.join("; "));A(o)}G(!0),H(null),U(null),j&&j(null)}else j&&j(null)},disabled:$,style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 16px",borderRadius:"12px",border:"none",backgroundColor:"var(--il-primary, #2563EB)",color:"var(--il-primary-fg, #ffffff)",fontSize:"14px",fontWeight:"500",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",cursor:$?"not-allowed":"pointer",opacity:$?.5:1}},{children:[t(s,{size:18,strokeWidth:2.5,color:"#ffffff"}),"Save Changes"]}))]})),z===R&&i("div",e({style:{display:"flex",alignItems:"center",gap:"6px",marginTop:"10px"}},{children:[t(p,{size:14,style:{color:"#C2410C"}}),t("div",e({style:{color:"#C2410C",fontSize:"13px"}},{children:"Pending - Changes not applied yet. Apply or discard them to continue."}))]}))]}))]}))}))};export{m as ConfigSection};
1
+ import{__rest as n,__assign as e}from"tslib";import{jsxs as i,jsx as t,Fragment as o}from"react/jsx-runtime";import{SectionWrapper as r}from"../../molecules/Sections/SectionWrapper.js";import{SeparationRow as a}from"../../molecules/SeperationRow/SeparationRow.js";import{Toggle as l}from"../../atoms/Toggle/Toggle.js";import{Pencil as c,Loader2Icon as s,Check as d,AlertTriangle as p}from"lucide-react";import{useState as u,useRef as f,useEffect as g}from"react";var m=function(m){var b=m.separationItems,h=void 0===b?[]:b,y=m.toggles,v=void 0===y?[]:y;m.onConfigChange;var x=m.highlights,S=void 0===x?{}:x,_=m.index,C=m.openSections,k=m.readOnly,I=void 0!==k&&k,E=m.setOpenSections,w=m.activeEditId,j=m.setActiveEditId,z=m.pendingEditId,T=m.setPendingEditId,O=m.isAiStreaming,A=m.setSendMessageInChat,D=m.id,N=n(m,["separationItems","toggles","onConfigChange","highlights","index","openSections","readOnly","setOpenSections","activeEditId","setActiveEditId","pendingEditId","setPendingEditId","isAiStreaming","setSendMessageInChat","id"]),R=D||"config-section-".concat(null!=_?_:0),W=w===R,P=!!w&&w!==R,M=u(null),H=M[0],K=M[1],L=u(null),U=L[0],q=L[1],B=u(!1),F=B[0],G=B[1],J=f(O),Q="\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n ";g(function(){J.current&&!O&&F&&G(!1),J.current=O},[O,F]);var V,X,Y=I||!W||F,Z=i("div",e({style:{display:"flex",alignItems:"center"}},{children:[!I&&!W&&!F&&t("button",e({title:P?"Save active edits first":"Edit Configuration",onClick:function(n){n.stopPropagation(),P?T&&T(null!=w?w:null):(K(h.map(function(n){return e({},n)})),q(v.map(function(n){return e({},n)})),j&&j(R),E&&C&&!C.has(R)&&E(function(n){var e=new Set(n);return e.add(R),e}))},style:e(e({},{display:"flex",alignItems:"center",justifyContent:"center",padding:"6px 8px",border:"1px solid #e5e7eb",borderRadius:"8px",cursor:"pointer",backgroundColor:"#ffffff",color:"#6b7280"}),{opacity:P?.5:1,cursor:P?"not-allowed":"pointer",border:"none",background:"transparent"})},{children:t(c,{size:16})})),F&&O&&i(o,{children:[t("style",{children:Q}),t(s,{size:16,style:{animation:"spin 1s linear infinite",color:"#6b7280"}})]})]})),$=(V=H?H.filter(function(n,e){var i=h[e];return!i||n.enabled!==i.enabled||n.global_min_separation_seconds!==i.global_min_separation_seconds}):[],X=U?U.filter(function(n,e){var i=v[e];return!i||n.enabled!==i.enabled}):[],0===V.length&&0===X.length);return t("div",e({"data-edit-id":R},{children:i(r,e({},N,{id:R,collapsible:!0,defaultOpen:!1,openSections:C,setOpenSections:E,headerActions:Z},{children:[i("div",e({className:"config-content-grid",style:{opacity:Y&&!I?.6:1,transition:"opacity 0.2s"}},{children:[(H||h).map(function(n,i){return t(a,{label:"".concat(n.label," Separation"),isEnabled:n.enabled,duration:n.global_min_separation_seconds,onToggle:function(){return function(n){W&&!F&&K(function(i){return i?i.map(function(i){return i.key===n.key?e(e({},i),{enabled:!i.enabled}):i}):null})}(n)},onDurationChange:function(i){return function(n,i){W&&!F&&K(function(t){return t?t.map(function(t){return t.key===n.key?e(e({},t),{global_min_separation_seconds:i}):t}):null})}(n,i)},isHighlighted:S["config_".concat(n.key)],isDisabled:Y},n.key)}),(U||v).map(function(n,o){return t("div",e({className:"separation-row-container"},{children:i("div",e({className:"separation-header-row"},{children:[t("div",e({className:"separation-label"},{children:n.label})),t(l,{isEnabled:n.enabled,onToggle:function(){return function(n){W&&!F&&q(function(i){return i?i.map(function(i){return i.key===n.key?e(e({},i),{enabled:!i.enabled}):i}):null})}(n)},isDisabled:Y})]}))}),n.key)})]})),F&&O&&i(o,{children:[t("style",{children:Q}),i("div",e({style:{display:"flex",alignItems:"center",padding:"4px 0 12px 12px",color:"#141414ff",fontSize:"13px",fontWeight:500,fontStyle:"italic",marginTop:"8px"}},{children:[t(s,{style:{marginRight:8,animation:"spin 1s linear infinite"}}),"Checking the correctness of your Configuration..."]}))]}),W&&!F&&i("div",e({style:{display:"flex",flexDirection:"column",marginTop:"12px"}},{children:[i("div",e({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[t("button",e({onClick:function(){K(null),q(null),j&&j(null)},style:{background:"none",border:"none",color:"#6b7280",fontSize:"14px",fontWeight:"500",cursor:"pointer",padding:"0"}},{children:"Discard Changes"})),i("button",e({onClick:function(){if(H&&U){var n=H.filter(function(n,e){var i=h[e];return!i||n.enabled!==i.enabled||n.global_min_separation_seconds!==i.global_min_separation_seconds}),e=U.filter(function(n,e){var i=v[e];return!i||n.enabled!==i.enabled});if(0===n.length&&0===e.length)return K(null),q(null),void(j&&j(null));if(A){var i="sk-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),t=[];n.length>0&&t.push("Enable ".concat(n.map(function(n){return"".concat(n.label," (").concat(n.global_min_separation_seconds,"min)")}).join(", "))),e.length>0&&t.push("enable ".concat(e.map(function(n){return"".concat(n.label," (").concat(n.enabled,")")}).join(", ")));var o="__SKELETON__:".concat(i,":Update Configuration - ").concat(t.join("; "));A(o)}G(!0),K(null),q(null),j&&j(null)}else j&&j(null)},disabled:$,style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 16px",borderRadius:"12px",border:"none",backgroundColor:"#2563eb",color:"#ffffff",fontSize:"14px",fontWeight:"500",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",cursor:$?"not-allowed":"pointer",opacity:$?.5:1}},{children:[t(d,{size:18,strokeWidth:2.5,color:"#ffffff"}),"Save Changes"]}))]})),z===R&&i("div",e({style:{display:"flex",alignItems:"center",gap:"6px",marginTop:"10px"}},{children:[t(p,{size:14,style:{color:"#C2410C"}}),t("div",e({style:{color:"#C2410C",fontSize:"13px"}},{children:"Pending - Changes not applied yet. Apply or discard them to continue."}))]}))]}))]}))}))};export{m as ConfigSection};
2
2
  //# sourceMappingURL=ConfigSection.js.map
@@ -1,2 +1,2 @@
1
- import{__rest as e,__assign as i}from"tslib";import{jsx as o,jsxs as r}from"react/jsx-runtime";import{SectionWrapper as t}from"../../molecules/Sections/SectionWrapper.js";import n from"../../_svg/CognitiveDecisioning.js";import{ChevronUpIcon as l,ChevronDownIcon as s}from"lucide-react";import a from"../../TooltipComponent.js";var d=function(d){var p=d.id,c=d.title,g=void 0===c?"Scope":c,h=d.required,x=void 0!==h&&h,u=d.openSections,f=d.setOpenSections,v=d.scopeData,m=d.onScopeChange;d.stationOptions;var b=d.tierOptions,y=void 0===b?[]:b;d.stationLabel;var S=d.tierLabel,C=void 0===S?"Where should this rule apply?":S,O=d.highlights,w=void 0===O?{}:O,I=d.isOpen,k=d.onToggle,z=d.showCognitiveIcon,j=d.cognitiveIcon,D=d.tooltipDescription,L=d.errorMessage,M=d.stationErrorMessage,T=d.tierErrorMessage,E=e(d,["id","title","required","openSections","setOpenSections","scopeData","onScopeChange","stationOptions","tierOptions","stationLabel","tierLabel","highlights","isOpen","onToggle","showCognitiveIcon","cognitiveIcon","tooltipDescription","errorMessage","stationErrorMessage","tierErrorMessage"]);return o(t,i({id:p,title:g,required:x,openSections:u,setOpenSections:f},E,{children:r("div",i({className:"scope-content"},{children:[y.length>0&&r("div",i({className:"form-group"},{children:[r("div",i({style:{display:"flex",alignItems:"center",gap:"4px",marginBottom:"4px"}},{children:[o("span",i({style:{color:"#8F2C23",lineHeight:1}},{children:"*"})),o("label",i({className:(null==E?void 0:E.readOnly)?"readOnly":"form-label",style:{margin:0}},{children:C}))]})),r("div",i({style:{display:"flex",alignItems:"center",gap:"12px",flexWrap:"wrap"}},{children:[o("div",i({className:"checkbox-group",style:{display:"flex",gap:"16px"}},{children:y.map(function(e){var t,n,l=w["scope_".concat(e)],s="tier-".concat(p,"-").concat(e.replace(/\s+/g,"-").toLowerCase());return r("div",i({className:"checkbox-item",style:{display:"flex",alignItems:"center",gap:"6px",position:"relative"}},{children:[o("input",{type:"radio",name:"scope-tiers-".concat(p),id:s,checked:null===(t=v.tiers)||void 0===t?void 0:t.includes(e),onChange:function(){m("tiers",[e])},disabled:(null==E?void 0:E.readOnly)||!1,style:{position:"absolute",opacity:0,cursor:"pointer",width:"16px",height:"16px",zIndex:1}}),o("div",i({style:{width:"16px",height:"16px",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s ease",boxShadow:l?"0 0 14px 4px rgba(37, 99, 235, 0.35)":"none",borderRadius:"50%"}},{children:(null===(n=v.tiers)||void 0===n?void 0:n.includes(e))?o("div",{style:{width:"16px",height:"16px",borderRadius:"50%",border:"5px solid var(--il-primary, #2563EB)",backgroundColor:"var(--il-surface, #ffffff)",boxSizing:"border-box"}}):o("div",{style:{width:"16px",height:"16px",border:"1px solid var(--il-border, #64748B)",borderRadius:"50%",backgroundColor:"var(--il-surface, #ffffff)",boxSizing:"border-box"}})})),o("label",i({style:{color:(null==E?void 0:E.readOnly)?"var(--il-disabled, #9CA3AF)":void 0,cursor:(null==E?void 0:E.readOnly)?"not-allowed":"pointer",margin:0,fontSize:"14px"},htmlFor:s},{children:e}))]}),s)})})),o("div",i({style:{width:"fit-content"}},{children:o(a,i({description:null!=D?D:""},{children:z&&r("button",i({onClick:function(e){e.preventDefault(),null==k||k()},style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"2px",padding:"2px 6px ",flexShrink:0,border:"none",backgroundColor:"transparent",borderRadius:"4px",cursor:"pointer",outline:"none",maxWidth:"fit-content",transition:"background-color 0.2s ease",marginTop:"6px",marginLeft:"6px"}},{children:[j||o(n,{}),o(I?l:s,{size:16})]}))}))}))]})),T&&o("div",i({style:{color:"#ef4444",fontSize:"12px",marginTop:"4px"}},{children:T}))]})),L&&!M&&!T&&o("div",i({style:{color:"#ef4444",fontSize:"12px",marginTop:"4px"}},{children:L}))]}))}))};export{d as ScopeSection};
1
+ import{__rest as e,__assign as i}from"tslib";import{jsx as o,jsxs as t}from"react/jsx-runtime";import{SectionWrapper as n}from"../../molecules/Sections/SectionWrapper.js";import r from"../../_svg/CognitiveDecisioning.js";import{ChevronUpIcon as l,ChevronDownIcon as s}from"lucide-react";import a from"../../TooltipComponent.js";var d=function(d){var p=d.id,c=d.title,g=void 0===c?"Scope":c,h=d.required,x=void 0!==h&&h,u=d.openSections,m=d.setOpenSections,v=d.scopeData,b=d.onScopeChange;d.stationOptions;var f=d.tierOptions,y=void 0===f?[]:f;d.stationLabel;var S=d.tierLabel,C=void 0===S?"Where should this rule apply?":S,O=d.highlights,w=void 0===O?{}:O,I=d.isOpen,k=d.onToggle,z=d.showCognitiveIcon,j=d.cognitiveIcon,D=d.tooltipDescription,L=d.errorMessage,M=d.stationErrorMessage,T=d.tierErrorMessage,E=e(d,["id","title","required","openSections","setOpenSections","scopeData","onScopeChange","stationOptions","tierOptions","stationLabel","tierLabel","highlights","isOpen","onToggle","showCognitiveIcon","cognitiveIcon","tooltipDescription","errorMessage","stationErrorMessage","tierErrorMessage"]);return o(n,i({id:p,title:g,required:x,openSections:u,setOpenSections:m},E,{children:t("div",i({className:"scope-content"},{children:[y.length>0&&t("div",i({className:"form-group"},{children:[t("div",i({style:{display:"flex",alignItems:"center",gap:"4px",marginBottom:"4px"}},{children:[o("span",i({style:{color:"#8F2C23",lineHeight:1}},{children:"*"})),o("label",i({className:(null==E?void 0:E.readOnly)?"readOnly":"form-label",style:{margin:0}},{children:C}))]})),t("div",i({style:{display:"flex",alignItems:"center",gap:"12px",flexWrap:"wrap"}},{children:[o("div",i({className:"checkbox-group",style:{display:"flex",gap:"16px"}},{children:y.map(function(e){var n,r,l=w["scope_".concat(e)],s="tier-".concat(p,"-").concat(e.replace(/\s+/g,"-").toLowerCase());return t("div",i({className:"checkbox-item",style:{display:"flex",alignItems:"center",gap:"6px",position:"relative"}},{children:[o("input",{type:"radio",name:"scope-tiers-".concat(p),id:s,checked:null===(n=v.tiers)||void 0===n?void 0:n.includes(e),onChange:function(){b("tiers",[e])},disabled:(null==E?void 0:E.readOnly)||!1,style:{position:"absolute",opacity:0,cursor:"pointer",width:"16px",height:"16px",zIndex:1}}),o("div",i({style:{width:"16px",height:"16px",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s ease",boxShadow:l?"0 0 14px 4px rgba(37, 99, 235, 0.35)":"none",borderRadius:"50%"}},{children:(null===(r=v.tiers)||void 0===r?void 0:r.includes(e))?o("div",{style:{width:"16px",height:"16px",borderRadius:"50%",border:"5px solid #2563EB",backgroundColor:"white",boxSizing:"border-box"}}):o("div",{style:{width:"16px",height:"16px",border:"1px solid #64748B",borderRadius:"50%",backgroundColor:"white",boxSizing:"border-box"}})})),o("label",i({style:{color:(null==E?void 0:E.readOnly)?"#9CA3AF":void 0,cursor:(null==E?void 0:E.readOnly)?"not-allowed":"pointer",margin:0,fontSize:"14px"},htmlFor:s},{children:e}))]}),s)})})),o("div",i({style:{width:"fit-content"}},{children:o(a,i({description:null!=D?D:""},{children:z&&t("button",i({onClick:function(e){e.preventDefault(),null==k||k()},style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"2px",padding:"2px 6px ",flexShrink:0,border:"none",backgroundColor:"transparent",borderRadius:"4px",cursor:"pointer",outline:"none",maxWidth:"fit-content",transition:"background-color 0.2s ease",marginTop:"6px",marginLeft:"6px"}},{children:[j||o(r,{}),o(I?l:s,{size:16})]}))}))}))]})),T&&o("div",i({style:{color:"#ef4444",fontSize:"12px",marginTop:"4px"}},{children:T}))]})),L&&!M&&!T&&o("div",i({style:{color:"#ef4444",fontSize:"12px",marginTop:"4px"}},{children:L}))]}))}))};export{d as ScopeSection};
2
2
  //# sourceMappingURL=ScopeSection.js.map
@@ -1,2 +1,2 @@
1
- import{__rest as e,__assign as i}from"tslib";import{jsx as t,jsxs as n,Fragment as r}from"react/jsx-runtime";import{SectionWrapper as l}from"../../molecules/Sections/SectionWrapper.js";import{Textarea as o}from"../../atoms/Textarea/Textarea.js";import{ButtonCognitiveIcon as a}from"../../_svg/ButtonCognitiveIcon.js";import{useState as d,useRef as s,useEffect as c}from"react";import{Check as p,X as g,Pencil as f,AlertTriangle as u,Loader2Icon as m}from"lucide-react";var h=function(h){var v=h.rows,y=h.value,x=h.errorMessage,C=h.onChange,I=h.placeholder,b=h.title,w=h.subtitle,E=h.isHighlighted,S=h.isOpen,k=h.readOnly,O=h.showCognitiveIcon,T=h.onToggle,j=h.tooltipDescription,A=h.enableInlineEdit,z=h.setSendMessageInChat,D=h.isAiStreaming,M=h.fieldName,R=h.id,W=h.activeEditId,_=h.setActiveEditId,N=h.pendingEditId;h.setPendingEditId;var B=e(h,["rows","value","errorMessage","onChange","placeholder","title","subtitle","isHighlighted","isOpen","readOnly","showCognitiveIcon","onToggle","tooltipDescription","enableInlineEdit","setSendMessageInChat","isAiStreaming","fieldName","id","activeEditId","setActiveEditId","pendingEditId","setPendingEditId"]),H=d(null),P=H[0],K=H[1],L=d(!1),U=L[0],q=L[1],F=s(D);c(function(){F.current&&!D&&U&&q(!1),F.current=D},[D,U]);var G=null!==P,J=!!W&&W!==R&&A,Q=(null==P?void 0:P.trim())||"",V=Q===((null==y?void 0:y.trim())||"")||null!==P&&""===Q,X=k||D||A&&!G,Y=t("div",i({style:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"}},{children:t("span",{children:b})})),Z={display:"flex",alignItems:"center",justifyContent:"center",padding:"8px",border:"1px solid var(--il-border, #e5e7eb)",borderRadius:"8px",cursor:"pointer",width:"36px",height:"36px",backgroundColor:"var(--il-surface, #ffffff)"},$={cursor:V?"not-allowed":"pointer",opacity:V?.5:1};return n(l,i({},B,{readOnly:k,title:Y,subtitle:w,customStyles:{margin:"0 0.2rem 0.2rem 0.2rem"}},{children:[n("div",i({className:"textarea-wrapper",style:{display:"flex",alignItems:"flex-start",gap:"8px",width:"100%"},"data-edit-id":R},{children:[t("div",i({style:{flex:1,minWidth:0}},{children:t(o,{cognitiveIcon:t(a,{}),rows:v,placeholder:I,value:G?P:y,onChange:function(e){G?K(e.target.value):C&&C(e.target.value)},isHighlighted:E,isOpen:S,isReadOnly:k||D,inputReadOnly:X,onToggle:T,showCognitiveIcon:O,tooltipDescription:j,errorMessage:x})})),A&&!k&&t("div",i({style:{display:"flex",flexDirection:"row",gap:"8px",marginTop:"0px"}},{children:G?n(r,{children:[n("button",i({title:"Apply",onClick:function(){if(null!==P){if(P===(null!=y?y:""))return K(null),void(_&&_(null));if(z){var e="sk-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),i=M||"Description",t=P&&""!==P.trim()?"Update ".concat(i," with ").concat(P):"Remove ".concat(i);q(!0),z("__SKELETON__:".concat(e,":").concat(t))}K(null),_&&_(null)}},disabled:V,style:i(i(i({},Z),$),{backgroundColor:"var(--il-primary, #2563EB)",color:"var(--il-primary-fg, #ffffff)",width:"auto",padding:"8px 12px"})},{children:[t(p,{size:20,strokeWidth:2.5})," Apply"]})),t("button",i({title:"Cancel",onClick:function(){K(null),_&&_(null)},style:i(i({},Z),{borderColor:"#E3E8E9",color:"#dc2626"})},{children:t(g,{size:20,strokeWidth:2.5})}))]}):t("button",i({title:J?"Save active edits first":"Edit",onClick:function(){W&&W!==R||(_&&_(R),K(null!=y?y:""))},disabled:D||J,style:i(i({},Z),{color:"var(--il-muted, #64748B)",cursor:D||J?"not-allowed":"pointer",opacity:D||J?.5:1})},{children:t(f,{size:20})}))}))]})),N===R&&G&&n("div",i({style:{display:"flex",alignItems:"center",gap:"6px",marginTop:"10px"}},{children:[t(u,{size:14,style:{color:"#C2410C"}}),t("div",i({style:{color:"#C2410C",fontSize:"13px"}},{children:"Pending - Changes not applied yet. Apply or discard them to continue."}))]})),U&&D&&A&&n(r,{children:[t("style",{children:"\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),n("div",i({style:{display:"flex",alignItems:"center",justifyContent:"flex-start",padding:"4px 0 12px 12px",color:"var(--il-muted, #141414)",fontSize:"13px",fontWeight:500,fontStyle:"italic",marginTop:"8px"}},{children:[t(m,{style:{marginRight:8,animation:"spin 1s linear infinite"}}),"Checking the correctness of your ",M||"description","..."]}))]})]}))};export{h as TextSection};
1
+ import{__rest as e,__assign as t}from"tslib";import{jsx as i,jsxs as n,Fragment as o}from"react/jsx-runtime";import{SectionWrapper as l}from"../../molecules/Sections/SectionWrapper.js";import{Textarea as r}from"../../atoms/Textarea/Textarea.js";import{ButtonCognitiveIcon as a}from"../../_svg/ButtonCognitiveIcon.js";import{useState as d,useRef as s,useEffect as c}from"react";import{Check as p,X as g,Pencil as u,AlertTriangle as f,Loader2Icon as h}from"lucide-react";var m=function(m){var y=m.rows,v=m.value,x=m.errorMessage,C=m.onChange,I=m.placeholder,b=m.title,w=m.subtitle,E=m.isHighlighted,S=m.isOpen,k=m.readOnly,O=m.showCognitiveIcon,T=m.onToggle,j=m.tooltipDescription,A=m.enableInlineEdit,z=m.setSendMessageInChat,D=m.isAiStreaming,M=m.fieldName,R=m.id,W=m.activeEditId,_=m.setActiveEditId,N=m.pendingEditId;m.setPendingEditId;var H=e(m,["rows","value","errorMessage","onChange","placeholder","title","subtitle","isHighlighted","isOpen","readOnly","showCognitiveIcon","onToggle","tooltipDescription","enableInlineEdit","setSendMessageInChat","isAiStreaming","fieldName","id","activeEditId","setActiveEditId","pendingEditId","setPendingEditId"]),P=d(null),B=P[0],K=P[1],L=d(!1),U=L[0],q=L[1],F=s(D);c(function(){F.current&&!D&&U&&q(!1),F.current=D},[D,U]);var G=null!==B,J=!!W&&W!==R&&A,Q=(null==B?void 0:B.trim())||"",V=Q===((null==v?void 0:v.trim())||"")||null!==B&&""===Q,X=k||D||A&&!G,Y=i("div",t({style:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"}},{children:i("span",{children:b})})),Z={display:"flex",alignItems:"center",justifyContent:"center",padding:"8px",border:"1px solid #e5e7eb",borderRadius:"8px",cursor:"pointer",width:"36px",height:"36px",backgroundColor:"#ffffff"},$={cursor:V?"not-allowed":"pointer",opacity:V?.5:1};return n(l,t({},H,{readOnly:k,title:Y,subtitle:w,customStyles:{margin:"0 0.2rem 0.2rem 0.2rem"}},{children:[n("div",t({className:"textarea-wrapper",style:{display:"flex",alignItems:"flex-start",gap:"8px",width:"100%"},"data-edit-id":R},{children:[i("div",t({style:{flex:1,minWidth:0}},{children:i(r,{cognitiveIcon:i(a,{}),rows:y,placeholder:I,value:G?B:v,onChange:function(e){G?K(e.target.value):C&&C(e.target.value)},isHighlighted:E,isOpen:S,isReadOnly:k||D,inputReadOnly:X,onToggle:T,showCognitiveIcon:O,tooltipDescription:j,errorMessage:x})})),A&&!k&&i("div",t({style:{display:"flex",flexDirection:"row",gap:"8px",marginTop:"0px"}},{children:G?n(o,{children:[n("button",t({title:"Apply",onClick:function(){if(null!==B){if(B===(null!=v?v:""))return K(null),void(_&&_(null));if(z){var e="sk-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),t=M||"Description",i=B&&""!==B.trim()?"Update ".concat(t," with ").concat(B):"Remove ".concat(t);q(!0),z("__SKELETON__:".concat(e,":").concat(i))}K(null),_&&_(null)}},disabled:V,style:t(t(t({},Z),$),{backgroundColor:"#2563EB",color:"white",width:"auto",padding:"8px 12px"})},{children:[i(p,{size:20,strokeWidth:2.5})," Apply"]})),i("button",t({title:"Cancel",onClick:function(){K(null),_&&_(null)},style:t(t({},Z),{borderColor:"#E3E8E9",color:"#dc2626"})},{children:i(g,{size:20,strokeWidth:2.5})}))]}):i("button",t({title:J?"Save active edits first":"Edit",onClick:function(){W&&W!==R||(_&&_(R),K(null!=v?v:""))},disabled:D||J,style:t(t({},Z),{color:"#6b7280",cursor:D||J?"not-allowed":"pointer",opacity:D||J?.5:1})},{children:i(u,{size:20})}))}))]})),N===R&&G&&n("div",t({style:{display:"flex",alignItems:"center",gap:"6px",marginTop:"10px"}},{children:[i(f,{size:14,style:{color:"#C2410C"}}),i("div",t({style:{color:"#C2410C",fontSize:"13px"}},{children:"Pending - Changes not applied yet. Apply or discard them to continue."}))]})),U&&D&&A&&n(o,{children:[i("style",{children:"\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),n("div",t({style:{display:"flex",alignItems:"center",justifyContent:"flex-start",padding:"4px 0 12px 12px",color:"#141414ff",fontSize:"13px",fontWeight:500,fontStyle:"italic",marginTop:"8px"}},{children:[i(h,{style:{marginRight:8,animation:"spin 1s linear infinite"}}),"Checking the correctness of your ",M||"description","..."]}))]})]}))};export{m as TextSection};
2
2
  //# sourceMappingURL=TextSection.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e,__spreadArray as n,__rest as t}from"tslib";import{jsxs as i,jsx as r}from"react/jsx-runtime";import o,{useState as l,useRef as a,useEffect as d,useMemo as s}from"react";import{Box as c,Typography as p,IconButton as h,Skeleton as u}from"@mui/material";import{ArrowLeft as g,ArrowRight as f}from"lucide-react";import x from"../../_svg/SparkleIcon.js";import{CognitiveDecisioningCard as m}from"@e-llm-studio/citation";import{ButtonCognitiveIcon as b}from"../../_svg/ButtonCognitiveIcon.js";import{getCognitiveDecisioningThemeStyles as v}from"../../cognitiveDecisioningThemeStyles.js";var y=function(e,n){if(!n)return null;var t=new RegExp("<".concat(e,"[^>]*>([\\s\\S]*?)<\\/").concat(e,">"),"i"),i=n.match(t);return i?i[1].replace(/\\n/g,"\n"):null},w=function(e,n,t){var i=100*e;if(!t)return{bg:"#FFFFFF",border:"#E2E8F0",badgeBg:"#F1F5F9",badgeBorder:"#CBD5E1",badgeText:"#64748B",highlightBg:"transparent",label:"Not Defined"};var r=function(e){return e&&"null"!==e.toLowerCase()?e.split("_").map(function(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}).join(" "):"Different"}(n);return i>=70?{bg:"#FEF2F2",border:"#FEE2E2",badgeBg:"#FEF2F2",badgeBorder:"#FECACA",badgeText:"#B91C1C",highlightBg:"#FECACA",label:r}:i>=40?{bg:"#FFFCF6",border:"#FFDD80",badgeBg:"#FEF9C3",badgeBorder:"#FEF08A",badgeText:"#A16207",highlightBg:"#FDDEB3",label:r}:{bg:"#FFFFFF",border:"#E2E8F0",badgeBg:"#F1F5F9",badgeBorder:"#CBD5E1",badgeText:"#64748B",highlightBg:"transparent",label:r}},F=o.forwardRef(function(n,t){var o=n.label,l=n.content,a=n.highlights,d=void 0===a?[]:a,s=n.styleVariant,h=n.isHighlighted,u=void 0!==h&&h,g=Array.isArray(l)?l.join("\n"):l||"",f="#B91C1C"===s.badgeText?{borderColor:"#EF4444",shadow:"rgba(239, 68, 68, 0.25)"}:"#A16207"===s.badgeText?{borderColor:"#F59E0B",shadow:"rgba(245, 158, 11, 0.25)"}:{borderColor:"#6366F1",shadow:"rgba(99, 102, 241, 0.25)"};return i(c,e({sx:{mb:1.5}},{children:[r(p,e({sx:{fontSize:"12px",color:"#19213D",mb:.5,fontWeight:500,lineHeight:"130%"}},{children:o})),r(c,e({ref:t,sx:{p:"8px 12px",borderRadius:"6px",border:u?"1.5px solid ".concat(f.borderColor):"1px solid ".concat(s.border),boxShadow:u?"0px 0px 0px 2px ".concat(f.shadow):"none",bgcolor:s.bg,fontSize:"13px",color:"#0B0E1A",lineHeight:1.4,minHeight:"28px",display:"flex",alignItems:"center",whiteSpace:"pre-line",wordBreak:"break-word"}},{children:r(c,{children:function(){if(!g)return r(p,e({sx:{color:"#94A3B8",fontSize:"12px",fontStyle:"italic"}},{children:"Not Defined"}));if(!d||0===d.length)return g;var n=d.filter(function(e){return e&&e.length>0}).map(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")});if(0===n.length)return g;var t=new RegExp("(".concat(n.join("|"),")"),"gi");return g.split(t).map(function(n,t){return d.some(function(e){return e&&e.toLowerCase()===n.toLowerCase()})?r(c,e({component:"span",sx:{bgcolor:s.highlightBg,borderRadius:"2px",px:"2px"}},{children:n}),t):n})}()})}))]}))}),_=function(n){var t=n.data,o=n.isSelected,l=n.isCognitiveOpen,a=n.onToggleCognitive,d=n.onClick,s=t.summaryText||t.description||"",h=s.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),g=h?s.replace(h[0],"").trim():s,f=!!h;return i(c,e({id:"variant-card-".concat(t.id),onClick:d,sx:{minWidth:"280px",maxWidth:"280px",p:2,m:.5,bgcolor:o?"#EFF6FF99":"#FFFFFF",borderRadius:"8px",cursor:"pointer",transition:"all 0.2s",display:"flex",flexDirection:"column",gap:1,flexShrink:0,opacity:t.isLoading?.7:1,border:o?"1.4px solid #2563EB":null,boxShadow:o?"none":"0px 2px 4px 0px #19213D14","&:hover":{borderColor:o?"#2563EB":"#CBD5E1",boxShadow:o?"none":"0px 4px 8px 0px #19213D1F"}}},{children:[r(c,e({sx:{display:"flex",alignItems:"center",gap:1.5}},{children:t.isLoading?r(u,{variant:"rounded",width:80,height:20}):i(c,e({sx:{bgcolor:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:600,px:1,py:.5,borderRadius:"100px",border:"1px solid #FFE1E1"}},{children:[void 0!==t.similarity?t.similarity:0,"% Similarity"]}))})),i(c,e({sx:{display:"flex",flexDirection:"column",gap:1}},{children:[r(p,e({sx:{fontWeight:500,fontSize:"14px",color:"#19213D",lineHeight:1.2}},{children:t.title})),t.isLoading?i(c,{children:[r(u,{width:"90%"}),r(u,{width:"60%"})]}):i(p,e({sx:{fontWeight:400,fontSize:"13px",color:"#666F8D",display:"-webkit-box",lineHeight:1.4}},{children:[g,f&&i(c,e({component:"span",onClick:function(e){e.stopPropagation(),o||d(),a()},sx:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 6px",borderRadius:"4px",cursor:"pointer",transition:"all 0.2s ease",verticalAlign:"middle",marginLeft:"6px"}},{children:[r("div",e({style:{width:"13px",height:"13px",display:"flex",alignItems:"center"}},{children:r(b,{})})),r("svg",e({width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#4B5563",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:o&&l?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}},{children:r("path",{d:"M6 9l6 6 6-6"})}))]}))]}))]}))]}))},C=function(o){var u,C,B=o.proposedRule,E=o.variants,k=void 0===E?[]:E,S=o.onSelectVariant,A=o.onSkip,D=o.onBack,T=o.targetVariantId,z=o.highlightedField,L=l(T||null),W=L[0],I=L[1],R=l(!1),j=R[0],H=R[1],M=l(null),O=M[0],V=M[1],G=a(null),N=a(null),P=a(null),U=l([]),$=U[0],q=U[1],J=l(!1),X=J[0],Y=J[1],K=l(!1),Q=K[0],Z=K[1];d(function(){if(T&&I(T),V(null!=z?z:null),z){var e=setTimeout(function(){return V(null)},6e3);return function(){return clearTimeout(e)}}},[T,z]);var ee=s(function(){return n([],k,!0).sort(function(e,n){return(n.similarity||0)-(e.similarity||0)})},[k]),ne=s(function(){if(W){var e=String(W).trim();return k.find(function(n){return n.id&&String(n.id).trim()===e})||ee[0]}return ee.length>0?ee[0]:null},[W,k,ee]);d(function(){if(W&&G.current){var e=W.trim();setTimeout(function(){var n=document.getElementById("variant-card-".concat(e)),t=G.current;if(n&&t){var i=n.offsetLeft-t.offsetLeft-t.clientWidth/2+n.clientWidth/2;t.scrollTo({left:i,behavior:"smooth"})}},150)}},[W,ee]);var te=ne||{title:"",description:"",wta:"",wnta:""},ie=null==ne?void 0:ne.analysis,re=(null===(C=null===(u=null==ie?void 0:ie.rule_difference_comparison)||void 0===u?void 0:u.summary)||void 0===C?void 0:C.overall_summary)||"",oe=re.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),le=!!oe,ae=oe?oe[1]:"",de=y("reason",ae)||"",se=y("gap",ae)||"",ce=y("relevance_score",ae)||"",pe=s(function(){return{ul:function(n){n.node;var i=t(n,["node"]);return r("ol",e({},i,{style:{paddingLeft:"1.25rem",listStyleType:"decimal",margin:0}}))},li:function(n){n.node;var i=t(n,["node"]);return r("li",e({},i,{style:{marginBottom:"4px",listStyleType:"decimal"}},{children:i.children}))},ol:function(n){n.node;var i=t(n,["node"]);return r("li",e({},i,{style:{marginBottom:"4px",listStyleType:"decimal"}},{children:i.children}))},a:function(n){var o=n.href,l=n.children,a=t(n,["href","children"]);if(!o)return r("a",e({},a,{children:l}));var d=o||"";try{d=decodeURIComponent(o)}catch(e){console.error("Error decoding href",e)}if(d.includes("variant_id=")){var s="",c="",p=d.match(/variant_id=([^?&]+)/);p&&(s=p[1]);var h=d.match(/field_name=([^&]+)/);return h&&(c=h[1]),i("button",e({type:"button",onClick:function(e){e.preventDefault(),e.stopPropagation(),I(s),V(c),setTimeout(function(){return V(null)},6e3)},style:{background:"none",border:"none",outline:"none",borderRadius:"6px",padding:"1px 4px",color:"#0F172A",cursor:"pointer",fontSize:"13px",fontWeight:500,display:"inline-flex",alignItems:"center",gap:"2px",margin:"0 1px",verticalAlign:"baseline",textDecoration:"none",boxShadow:"none",WebkitAppearance:"none",MozAppearance:"none"},title:"View Comparison"},{children:[l,r("svg",e({width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:r("path",{d:"M10.2082 8.67708H2.0415M2.0415 8.67708L4.08317 6.63542M2.0415 8.67708L4.08317 10.7188M2.0415 3.57292H10.2082M10.2082 3.57292L8.1665 1.53125M10.2082 3.57292L8.1665 5.61458",stroke:"#0F172A",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})}))]}))}return r("a",e({href:o,target:"_blank",rel:"noopener noreferrer",style:{color:"#7C3AED"}},a,{children:l}))}}},[]),he=["title","description","when_to_apply","when_not_to_apply"],ue={title:a(null),description:a(null),wta:a(null),wnta:a(null)},ge={title:a(null),description:a(null),wta:a(null),wnta:a(null)};d(function(){if(O){var e="when_to_apply"===O?"wta":"when_not_to_apply"===O?"wnta":O,n=ue[e]||ge[e];n&&n.current&&setTimeout(function(){n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}},[O]);var fe=function(e){var n,t,i,r,o,l=null===(n=null==ie?void 0:ie.rule_difference_comparison)||void 0===n?void 0:n.fields,a="when_to_apply"===e?"wta":"when_not_to_apply"===e?"wnta":e,d=!(!B[a]&&!te[a]);if(!l||!l[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var s=l[e];if(s.mappings){var c=s.mappings[0]||{};return{score:s.score,relation:c.relation||"",highlightsA:(null===(t=c.highlights)||void 0===t?void 0:t.ruleA_spans)||[],highlightsB:(null===(i=c.highlights)||void 0===i?void 0:i.ruleB_spans)||[],hasContent:d}}return{score:s.score,relation:s.relation||"",highlightsA:(null===(r=s.highlights)||void 0===r?void 0:r.ruleA_spans)||[],highlightsB:(null===(o=s.highlights)||void 0===o?void 0:o.ruleB_spans)||[],hasContent:d}},xe=function(){if(P.current){var e=P.current.getBoundingClientRect(),n=[];he.forEach(function(t){var i="when_to_apply"===t?ue.wta:"when_not_to_apply"===t?ue.wnta:ue[t],r="when_to_apply"===t?ge.wta:"when_not_to_apply"===t?ge.wnta:ge[t];if(i.current&&r.current){var o=fe(t),l=w(o.score,o.relation,o.hasContent),a=i.current.getBoundingClientRect(),d=r.current.getBoundingClientRect();n.push({x1:a.right-e.left,y1:a.top+a.height/2-e.top,x2:d.left-e.left,y2:d.top+d.height/2-e.top,style:l})}}),q(n)}};d(function(){var e=setTimeout(xe,250);window.addEventListener("resize",xe);var n=null;return P.current&&(n=new ResizeObserver(function(){window.requestAnimationFrame(function(){xe()})})).observe(P.current),function(){clearTimeout(e),window.removeEventListener("resize",xe),n&&n.disconnect()}},[B,te,ie,j]),d(function(){var e=G.current;if(e){var n=function(){Y(e.scrollLeft>0),Z(e.scrollLeft+e.clientWidth<e.scrollWidth-1)};return n(),e.addEventListener("scroll",n),window.addEventListener("resize",n),function(){e.removeEventListener("scroll",n),window.removeEventListener("resize",n)}}},[ee]),d(function(){!W&&!T&&ee.length>0&&!ee[0].isLoading&&I(ee[0].id)},[ee,W,T]);var me=function(e){G.current&&G.current.scrollBy({left:"left"===e?-300:300,behavior:"smooth"})};return i(c,e({sx:{display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif',overflow:"hidden"}},{children:[i(c,e({sx:{px:2,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#FFFFFF",border:"1.5px solid #EEF0F4"}},{children:[i(c,e({sx:{display:"flex",alignItems:"center",gap:1}},{children:[r(h,e({onClick:D,size:"small"},{children:r(g,{})})),r(p,e({sx:{fontSize:"16px",fontWeight:450,color:"#0F172A"}},{children:"Conflict Resolution"}))]})),r(h,e({onClick:A,size:"small"},{children:r(c,e({sx:{fontSize:24,lineHeight:.5}},{children:"×"}))}))]})),ee.length>0&&i(c,e({sx:{px:3,pb:.25}},{children:[i(c,e({sx:{display:"flex",alignItems:"center",justifyContent:"space-between",py:1}},{children:[r(p,e({sx:{fontSize:"13px",color:"#475569"}},{children:"Choose the guideline you want to compare with."})),i(c,e({sx:{display:"flex",gap:.5,flexShrink:0,ml:1}},{children:[r(h,e({onClick:function(){return me("left")},size:"small",disabled:!X},{children:r(g,{size:18})})),r(h,e({onClick:function(){return me("right")},size:"small",disabled:!Q},{children:r(f,{size:18})}))]}))]})),r(c,e({ref:G,sx:{display:"flex",gap:1,overflowX:"auto",pb:.05,"&::-webkit-scrollbar":{height:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"transparent",borderRadius:"10px"},"&::-webkit-scrollbar-thumb:hover":{background:"transparent"}}},{children:ee.map(function(e){return r(_,{data:e,isSelected:(null==ne?void 0:ne.id)===e.id,isCognitiveOpen:j,onToggleCognitive:function(){H(function(e){var n=!e;return n&&N.current&&N.current.scrollTo({top:0,behavior:"smooth"}),n})},onClick:function(){return I((n=e).id),S(n),void H(!1);var n}},e.id)})}))]})),r(c,e({ref:N,sx:{flex:1,overflowY:"auto",py:1.5,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",borderTop:re&&le&&j?"none":"1.5px solid #EEF0F4"}},{children:i(c,e({sx:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"}},{children:[re&&le&&j&&r(c,e({sx:{width:"100%",pb:1,animation:"fadeIn 0.2s ease-out","& > div > button":{display:"none !important"},"& > div > div":{marginTop:"0px"}}},{children:r(m,{headerIcon:r(b,{}),reasoning:de,gap:se,score:ce,mdComponents:pe,isOpen:!0,onToggle:function(){return H(!1)},styles:v()})})),i(c,e({ref:P,sx:{display:"grid",gridTemplateColumns:"1fr auto 1fr",gap:"60px",maxWidth:"1200px",width:"100%",position:"relative"}},{children:[r("svg",e({style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:10}},{children:$.map(function(n,t){var o=(n.x1+n.x2)/2,l=(n.y1+n.y2)/2;return i("g",{children:[r("line",{x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2,stroke:n.style.badgeBorder,strokeWidth:"1"}),r("foreignObject",e({x:o-125,y:l-16,width:"250",height:"32"},{children:r(c,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:r(c,e({sx:{fontSize:"11px",bgcolor:n.style.badgeBg,color:n.style.badgeText,border:"1px solid ".concat(n.style.badgeBorder),borderRadius:"12px",px:1.5,py:.25,fontWeight:500,textAlign:"center",whiteSpace:"nowrap"}},{children:n.style.label}))}))}))]},t)})})),i(c,e({sx:{border:"1px dashed #B0B0B0",borderRadius:"8px",bgcolor:"#FFFFFF",display:"flex",flexDirection:"column",position:"relative",zIndex:2,filter:"drop-shadow(0px 2px 4px #F2F2F2)",minWidth:0}},{children:[r(c,e({sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px dashed #B0B0B0",borderRadius:"8px 8px 0 0",display:"flex",minHeight:"24px",alignItems:"center"}},{children:r(p,e({sx:{fontSize:"16px",fontWeight:500,color:"#19213D"}},{children:"Conflicting Guideline 1"}))})),r(c,e({sx:{p:"12px",display:"flex",flexDirection:"column"}},{children:he.map(function(e){var n=fe(e),t=w(n.score,n.relation,n.hasContent),i="when_to_apply"===e?ue.wta:"when_not_to_apply"===e?ue.wnta:ue[e],o=B["when_to_apply"===e?"wta":"when_not_to_apply"===e?"wnta":e];return r(F,{ref:i,label:"when_to_apply"===e?"When to apply":"when_not_to_apply"===e?"When NOT to apply":"title"===e?"Guideline Title":"Guideline Description",content:o,highlights:n.highlightsA,styleVariant:t,isHighlighted:O===e},"left-".concat(e))})}))]})),r(c,{sx:{width:"1px"}}),i(c,e({sx:{border:"1px solid #E3E6EA",borderRadius:"8px",bgcolor:"#FFFFFF",boxShadow:"0px 1px 4px #F7F4FE",position:"relative",zIndex:2,display:"flex",flexDirection:"column",minWidth:0}},{children:[r(c,e({sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E3E6EA",borderRadius:"8px 8px 0 0",minHeight:"24px",display:"flex",alignItems:"center"}},{children:i(p,e({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",display:"flex",alignItems:"center",gap:1}},{children:[r("div",e({style:{width:"18px",height:"18px",display:"flex",alignItems:"center",justifyContent:"center"}},{children:r(x,{})})),"Conflicting Guideline 2"]}))})),r(c,e({sx:{p:"12px",display:"flex",flexDirection:"column"}},{children:he.map(function(e){var n=fe(e),t=w(n.score,n.relation,n.hasContent),i="when_to_apply"===e?ge.wta:"when_not_to_apply"===e?ge.wnta:ge[e],o=te["when_to_apply"===e?"wta":"when_not_to_apply"===e?"wnta":e];return r(F,{ref:i,label:"when_to_apply"===e?"When to apply":"when_not_to_apply"===e?"When NOT to apply":"title"===e?"Guideline Title":"Guideline Description",content:o,highlights:n.highlightsB,styleVariant:t,isHighlighted:O===e},"right-".concat(e))})}))]}))]}))]}))}))]}))};export{C as default};
1
+ import{__assign as e,__spreadArray as n,__rest as t}from"tslib";import{jsxs as i,jsx as r}from"react/jsx-runtime";import o,{useState as l,useRef as a,useEffect as d,useMemo as s}from"react";import{Box as c,Typography as p,IconButton as h,Skeleton as u}from"@mui/material";import{ArrowLeft as g,ArrowRight as f}from"lucide-react";import x from"../../_svg/SparkleIcon.js";import{CognitiveDecisioningCard as m}from"@e-llm-studio/citation";import{ButtonCognitiveIcon as b}from"../../_svg/ButtonCognitiveIcon.js";var v=function(e,n){if(!n)return null;var t=new RegExp("<".concat(e,"[^>]*>([\\s\\S]*?)<\\/").concat(e,">"),"i"),i=n.match(t);return i?i[1].replace(/\\n/g,"\n"):null},y=function(e,n,t){var i=100*e;if(!t)return{bg:"#FFFFFF",border:"#E2E8F0",badgeBg:"#F1F5F9",badgeBorder:"#CBD5E1",badgeText:"#64748B",highlightBg:"transparent",label:"Not Defined"};var r=function(e){return e&&"null"!==e.toLowerCase()?e.split("_").map(function(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}).join(" "):"Different"}(n);return i>=70?{bg:"#FEF2F2",border:"#FEE2E2",badgeBg:"#FEF2F2",badgeBorder:"#FECACA",badgeText:"#B91C1C",highlightBg:"#FECACA",label:r}:i>=40?{bg:"#FFFCF6",border:"#FFDD80",badgeBg:"#FEF9C3",badgeBorder:"#FEF08A",badgeText:"#A16207",highlightBg:"#FDDEB3",label:r}:{bg:"#FFFFFF",border:"#E2E8F0",badgeBg:"#F1F5F9",badgeBorder:"#CBD5E1",badgeText:"#64748B",highlightBg:"transparent",label:r}},w=o.forwardRef(function(n,t){var o=n.label,l=n.content,a=n.highlights,d=void 0===a?[]:a,s=n.styleVariant,h=n.isHighlighted,u=void 0!==h&&h,g=Array.isArray(l)?l.join("\n"):l||"",f="#B91C1C"===s.badgeText?{borderColor:"#EF4444",shadow:"rgba(239, 68, 68, 0.25)"}:"#A16207"===s.badgeText?{borderColor:"#F59E0B",shadow:"rgba(245, 158, 11, 0.25)"}:{borderColor:"#6366F1",shadow:"rgba(99, 102, 241, 0.25)"};return i(c,e({sx:{mb:1.5}},{children:[r(p,e({sx:{fontSize:"12px",color:"#19213D",mb:.5,fontWeight:500,lineHeight:"130%"}},{children:o})),r(c,e({ref:t,sx:{p:"8px 12px",borderRadius:"6px",border:u?"1.5px solid ".concat(f.borderColor):"1px solid ".concat(s.border),boxShadow:u?"0px 0px 0px 2px ".concat(f.shadow):"none",bgcolor:s.bg,fontSize:"13px",color:"#0B0E1A",lineHeight:1.4,minHeight:"28px",display:"flex",alignItems:"center",whiteSpace:"pre-line",wordBreak:"break-word"}},{children:r(c,{children:function(){if(!g)return r(p,e({sx:{color:"#94A3B8",fontSize:"12px",fontStyle:"italic"}},{children:"Not Defined"}));if(!d||0===d.length)return g;var n=d.filter(function(e){return e&&e.length>0}).map(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")});if(0===n.length)return g;var t=new RegExp("(".concat(n.join("|"),")"),"gi");return g.split(t).map(function(n,t){return d.some(function(e){return e&&e.toLowerCase()===n.toLowerCase()})?r(c,e({component:"span",sx:{bgcolor:s.highlightBg,borderRadius:"2px",px:"2px"}},{children:n}),t):n})}()})}))]}))}),F=function(n){var t=n.data,o=n.isSelected,l=n.isCognitiveOpen,a=n.onToggleCognitive,d=n.onClick,s=t.summaryText||t.description||"",h=s.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),g=h?s.replace(h[0],"").trim():s,f=!!h;return i(c,e({id:"variant-card-".concat(t.id),onClick:d,sx:{minWidth:"280px",maxWidth:"280px",p:2,m:.5,bgcolor:o?"#EFF6FF99":"#FFFFFF",borderRadius:"8px",cursor:"pointer",transition:"all 0.2s",display:"flex",flexDirection:"column",gap:1,flexShrink:0,opacity:t.isLoading?.7:1,border:o?"1.4px solid #2563EB":null,boxShadow:o?"none":"0px 2px 4px 0px #19213D14","&:hover":{borderColor:o?"#2563EB":"#CBD5E1",boxShadow:o?"none":"0px 4px 8px 0px #19213D1F"}}},{children:[r(c,e({sx:{display:"flex",alignItems:"center",gap:1.5}},{children:t.isLoading?r(u,{variant:"rounded",width:80,height:20}):i(c,e({sx:{bgcolor:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:600,px:1,py:.5,borderRadius:"100px",border:"1px solid #FFE1E1"}},{children:[void 0!==t.similarity?t.similarity:0,"% Similarity"]}))})),i(c,e({sx:{display:"flex",flexDirection:"column",gap:1}},{children:[r(p,e({sx:{fontWeight:500,fontSize:"14px",color:"#19213D",lineHeight:1.2}},{children:t.title})),t.isLoading?i(c,{children:[r(u,{width:"90%"}),r(u,{width:"60%"})]}):i(p,e({sx:{fontWeight:400,fontSize:"13px",color:"#666F8D",display:"-webkit-box",lineHeight:1.4}},{children:[g,f&&i(c,e({component:"span",onClick:function(e){e.stopPropagation(),o||d(),a()},sx:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 6px",borderRadius:"4px",cursor:"pointer",transition:"all 0.2s ease",verticalAlign:"middle",marginLeft:"6px"}},{children:[r("div",e({style:{width:"13px",height:"13px",display:"flex",alignItems:"center"}},{children:r(b,{})})),r("svg",e({width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#4B5563",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:o&&l?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}},{children:r("path",{d:"M6 9l6 6 6-6"})}))]}))]}))]}))]}))},_=function(o){var u,_,C=o.proposedRule,B=o.variants,E=void 0===B?[]:B,k=o.onSelectVariant,S=o.onSkip,A=o.onBack,D=o.targetVariantId,T=o.highlightedField,z=l(D||null),L=z[0],W=z[1],I=l(!1),R=I[0],j=I[1],H=l(null),M=H[0],O=H[1],V=a(null),G=a(null),N=a(null),P=l([]),U=P[0],$=P[1],q=l(!1),J=q[0],X=q[1],Y=l(!1),K=Y[0],Q=Y[1];d(function(){if(D&&W(D),O(null!=T?T:null),T){var e=setTimeout(function(){return O(null)},6e3);return function(){return clearTimeout(e)}}},[D,T]);var Z=s(function(){return n([],E,!0).sort(function(e,n){return(n.similarity||0)-(e.similarity||0)})},[E]),ee=s(function(){if(L){var e=String(L).trim();return E.find(function(n){return n.id&&String(n.id).trim()===e})||Z[0]}return Z.length>0?Z[0]:null},[L,E,Z]);d(function(){if(L&&V.current){var e=L.trim();setTimeout(function(){var n=document.getElementById("variant-card-".concat(e)),t=V.current;if(n&&t){var i=n.offsetLeft-t.offsetLeft-t.clientWidth/2+n.clientWidth/2;t.scrollTo({left:i,behavior:"smooth"})}},150)}},[L,Z]);var ne=ee||{title:"",description:"",wta:"",wnta:""},te=null==ee?void 0:ee.analysis,ie=(null===(_=null===(u=null==te?void 0:te.rule_difference_comparison)||void 0===u?void 0:u.summary)||void 0===_?void 0:_.overall_summary)||"",re=ie.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),oe=!!re,le=re?re[1]:"",ae=v("reason",le)||"",de=v("gap",le)||"",se=v("relevance_score",le)||"",ce=s(function(){return{ul:function(n){n.node;var i=t(n,["node"]);return r("ol",e({},i,{style:{paddingLeft:"1.25rem",listStyleType:"decimal",margin:0}}))},li:function(n){n.node;var i=t(n,["node"]);return r("li",e({},i,{style:{marginBottom:"4px",listStyleType:"decimal"}},{children:i.children}))},ol:function(n){n.node;var i=t(n,["node"]);return r("li",e({},i,{style:{marginBottom:"4px",listStyleType:"decimal"}},{children:i.children}))},a:function(n){var o=n.href,l=n.children,a=t(n,["href","children"]);if(!o)return r("a",e({},a,{children:l}));var d=o||"";try{d=decodeURIComponent(o)}catch(e){console.error("Error decoding href",e)}if(d.includes("variant_id=")){var s="",c="",p=d.match(/variant_id=([^?&]+)/);p&&(s=p[1]);var h=d.match(/field_name=([^&]+)/);return h&&(c=h[1]),i("button",e({type:"button",onClick:function(e){e.preventDefault(),e.stopPropagation(),W(s),O(c),setTimeout(function(){return O(null)},6e3)},style:{background:"none",border:"none",outline:"none",borderRadius:"6px",padding:"1px 4px",color:"#0F172A",cursor:"pointer",fontSize:"13px",fontWeight:500,display:"inline-flex",alignItems:"center",gap:"2px",margin:"0 1px",verticalAlign:"baseline",textDecoration:"none",boxShadow:"none",WebkitAppearance:"none",MozAppearance:"none"},title:"View Comparison"},{children:[l,r("svg",e({width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:r("path",{d:"M10.2082 8.67708H2.0415M2.0415 8.67708L4.08317 6.63542M2.0415 8.67708L4.08317 10.7188M2.0415 3.57292H10.2082M10.2082 3.57292L8.1665 1.53125M10.2082 3.57292L8.1665 5.61458",stroke:"#0F172A",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})}))]}))}return r("a",e({href:o,target:"_blank",rel:"noopener noreferrer",style:{color:"#7C3AED"}},a,{children:l}))}}},[]),pe=["title","description","when_to_apply","when_not_to_apply"],he={title:a(null),description:a(null),wta:a(null),wnta:a(null)},ue={title:a(null),description:a(null),wta:a(null),wnta:a(null)};d(function(){if(M){var e="when_to_apply"===M?"wta":"when_not_to_apply"===M?"wnta":M,n=he[e]||ue[e];n&&n.current&&setTimeout(function(){n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}},[M]);var ge=function(e){var n,t,i,r,o,l=null===(n=null==te?void 0:te.rule_difference_comparison)||void 0===n?void 0:n.fields,a="when_to_apply"===e?"wta":"when_not_to_apply"===e?"wnta":e,d=!(!C[a]&&!ne[a]);if(!l||!l[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var s=l[e];if(s.mappings){var c=s.mappings[0]||{};return{score:s.score,relation:c.relation||"",highlightsA:(null===(t=c.highlights)||void 0===t?void 0:t.ruleA_spans)||[],highlightsB:(null===(i=c.highlights)||void 0===i?void 0:i.ruleB_spans)||[],hasContent:d}}return{score:s.score,relation:s.relation||"",highlightsA:(null===(r=s.highlights)||void 0===r?void 0:r.ruleA_spans)||[],highlightsB:(null===(o=s.highlights)||void 0===o?void 0:o.ruleB_spans)||[],hasContent:d}},fe=function(){if(N.current){var e=N.current.getBoundingClientRect(),n=[];pe.forEach(function(t){var i="when_to_apply"===t?he.wta:"when_not_to_apply"===t?he.wnta:he[t],r="when_to_apply"===t?ue.wta:"when_not_to_apply"===t?ue.wnta:ue[t];if(i.current&&r.current){var o=ge(t),l=y(o.score,o.relation,o.hasContent),a=i.current.getBoundingClientRect(),d=r.current.getBoundingClientRect();n.push({x1:a.right-e.left,y1:a.top+a.height/2-e.top,x2:d.left-e.left,y2:d.top+d.height/2-e.top,style:l})}}),$(n)}};d(function(){var e=setTimeout(fe,250);window.addEventListener("resize",fe);var n=null;return N.current&&(n=new ResizeObserver(function(){window.requestAnimationFrame(function(){fe()})})).observe(N.current),function(){clearTimeout(e),window.removeEventListener("resize",fe),n&&n.disconnect()}},[C,ne,te,R]),d(function(){var e=V.current;if(e){var n=function(){X(e.scrollLeft>0),Q(e.scrollLeft+e.clientWidth<e.scrollWidth-1)};return n(),e.addEventListener("scroll",n),window.addEventListener("resize",n),function(){e.removeEventListener("scroll",n),window.removeEventListener("resize",n)}}},[Z]),d(function(){!L&&!D&&Z.length>0&&!Z[0].isLoading&&W(Z[0].id)},[Z,L,D]);var xe=function(e){V.current&&V.current.scrollBy({left:"left"===e?-300:300,behavior:"smooth"})};return i(c,e({sx:{display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif',overflow:"hidden"}},{children:[i(c,e({sx:{px:2,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#FFFFFF",border:"1.5px solid #EEF0F4"}},{children:[i(c,e({sx:{display:"flex",alignItems:"center",gap:1}},{children:[r(h,e({onClick:A,size:"small"},{children:r(g,{})})),r(p,e({sx:{fontSize:"16px",fontWeight:450,color:"#0F172A"}},{children:"Conflict Resolution"}))]})),r(h,e({onClick:S,size:"small"},{children:r(c,e({sx:{fontSize:24,lineHeight:.5}},{children:"×"}))}))]})),Z.length>0&&i(c,e({sx:{px:3,pb:.25}},{children:[i(c,e({sx:{display:"flex",alignItems:"center",justifyContent:"space-between",py:1}},{children:[r(p,e({sx:{fontSize:"13px",color:"#475569"}},{children:"Choose the guideline you want to compare with."})),i(c,e({sx:{display:"flex",gap:.5,flexShrink:0,ml:1}},{children:[r(h,e({onClick:function(){return xe("left")},size:"small",disabled:!J},{children:r(g,{size:18})})),r(h,e({onClick:function(){return xe("right")},size:"small",disabled:!K},{children:r(f,{size:18})}))]}))]})),r(c,e({ref:V,sx:{display:"flex",gap:1,overflowX:"auto",pb:.05,"&::-webkit-scrollbar":{height:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"transparent",borderRadius:"10px"},"&::-webkit-scrollbar-thumb:hover":{background:"transparent"}}},{children:Z.map(function(e){return r(F,{data:e,isSelected:(null==ee?void 0:ee.id)===e.id,isCognitiveOpen:R,onToggleCognitive:function(){j(function(e){var n=!e;return n&&G.current&&G.current.scrollTo({top:0,behavior:"smooth"}),n})},onClick:function(){return W((n=e).id),k(n),void j(!1);var n}},e.id)})}))]})),r(c,e({ref:G,sx:{flex:1,overflowY:"auto",py:1.5,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",borderTop:ie&&oe&&R?"none":"1.5px solid #EEF0F4"}},{children:i(c,e({sx:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"}},{children:[ie&&oe&&R&&r(c,e({sx:{width:"100%",pb:1,animation:"fadeIn 0.2s ease-out","& > div > button":{display:"none !important"},"& > div > div":{marginTop:"0px"}}},{children:r(m,{headerIcon:r(b,{}),reasoning:ae,gap:de,score:se,mdComponents:ce,isOpen:!0,onToggle:function(){return j(!1)}})})),i(c,e({ref:N,sx:{display:"grid",gridTemplateColumns:"1fr auto 1fr",gap:"60px",maxWidth:"1200px",width:"100%",position:"relative"}},{children:[r("svg",e({style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:10}},{children:U.map(function(n,t){var o=(n.x1+n.x2)/2,l=(n.y1+n.y2)/2;return i("g",{children:[r("line",{x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2,stroke:n.style.badgeBorder,strokeWidth:"1"}),r("foreignObject",e({x:o-125,y:l-16,width:"250",height:"32"},{children:r(c,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:r(c,e({sx:{fontSize:"11px",bgcolor:n.style.badgeBg,color:n.style.badgeText,border:"1px solid ".concat(n.style.badgeBorder),borderRadius:"12px",px:1.5,py:.25,fontWeight:500,textAlign:"center",whiteSpace:"nowrap"}},{children:n.style.label}))}))}))]},t)})})),i(c,e({sx:{border:"1px dashed #B0B0B0",borderRadius:"8px",bgcolor:"#FFFFFF",display:"flex",flexDirection:"column",position:"relative",zIndex:2,filter:"drop-shadow(0px 2px 4px #F2F2F2)",minWidth:0}},{children:[r(c,e({sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px dashed #B0B0B0",borderRadius:"8px 8px 0 0",display:"flex",minHeight:"24px",alignItems:"center"}},{children:r(p,e({sx:{fontSize:"16px",fontWeight:500,color:"#19213D"}},{children:"Conflicting Guideline 1"}))})),r(c,e({sx:{p:"12px",display:"flex",flexDirection:"column"}},{children:pe.map(function(e){var n=ge(e),t=y(n.score,n.relation,n.hasContent),i="when_to_apply"===e?he.wta:"when_not_to_apply"===e?he.wnta:he[e],o=C["when_to_apply"===e?"wta":"when_not_to_apply"===e?"wnta":e];return r(w,{ref:i,label:"when_to_apply"===e?"When to apply":"when_not_to_apply"===e?"When NOT to apply":"title"===e?"Guideline Title":"Guideline Description",content:o,highlights:n.highlightsA,styleVariant:t,isHighlighted:M===e},"left-".concat(e))})}))]})),r(c,{sx:{width:"1px"}}),i(c,e({sx:{border:"1px solid #E3E6EA",borderRadius:"8px",bgcolor:"#FFFFFF",boxShadow:"0px 1px 4px #F7F4FE",position:"relative",zIndex:2,display:"flex",flexDirection:"column",minWidth:0}},{children:[r(c,e({sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E3E6EA",borderRadius:"8px 8px 0 0",minHeight:"24px",display:"flex",alignItems:"center"}},{children:i(p,e({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",display:"flex",alignItems:"center",gap:1}},{children:[r("div",e({style:{width:"18px",height:"18px",display:"flex",alignItems:"center",justifyContent:"center"}},{children:r(x,{})})),"Conflicting Guideline 2"]}))})),r(c,e({sx:{p:"12px",display:"flex",flexDirection:"column"}},{children:pe.map(function(e){var n=ge(e),t=y(n.score,n.relation,n.hasContent),i="when_to_apply"===e?ue.wta:"when_not_to_apply"===e?ue.wnta:ue[e],o=ne["when_to_apply"===e?"wta":"when_not_to_apply"===e?"wnta":e];return r(w,{ref:i,label:"when_to_apply"===e?"When to apply":"when_not_to_apply"===e?"When NOT to apply":"title"===e?"Guideline Title":"Guideline Description",content:o,highlights:n.highlightsB,styleVariant:t,isHighlighted:M===e},"right-".concat(e))})}))]}))]}))]}))}))]}))};export{_ as default};
2
2
  //# sourceMappingURL=AgentComposerRuleComparison.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e,__spreadArray as n,__rest as t}from"tslib";import{jsxs as i,jsx as r}from"react/jsx-runtime";import o,{useState as l,useRef as a,useEffect as s,useMemo as c}from"react";import{Box as d,Typography as p,IconButton as h,Skeleton as g}from"@mui/material";import{ArrowLeft as u,ArrowRight as x}from"lucide-react";import f from"../../_svg/SparkleIcon.js";import{CognitiveDecisioningCard as m}from"@e-llm-studio/citation";import{ButtonCognitiveIcon as b}from"../../_svg/ButtonCognitiveIcon.js";import{getCognitiveDecisioningThemeStyles as v}from"../../cognitiveDecisioningThemeStyles.js";var y=function(e,n){if(!n)return null;var t=new RegExp("<".concat(e,"[^>]*>([\\s\\S]*?)<\\/").concat(e,">"),"i"),i=n.match(t);return i?i[1].replace(/\\n/g,"\n"):null},w=function(e,n,t){var i=100*e;if(!t)return{bg:"#FFFFFF",border:"#E2E8F0",badgeBg:"#F1F5F9",badgeBorder:"#CBD5E1",badgeText:"#64748B",highlightBg:"transparent",label:"Not Defined"};var r=function(e){return e.split("_").map(function(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}).join(" ")}(n);return i>=70?{bg:"#FEF2F2",border:"#FEE2E2",badgeBg:"#FEF2F2",badgeBorder:"#FECACA",badgeText:"#B91C1C",highlightBg:"#FECACA",label:r}:i>=40?{bg:"#FFFCF6",border:"#FFDD80",badgeBg:"#FEF9C3",badgeBorder:"#FEF08A",badgeText:"#A16207",highlightBg:"#FDDEB3",label:r}:{bg:"#FFFFFF",border:"#E2E8F0",badgeBg:"#F1F5F9",badgeBorder:"#CBD5E1",badgeText:"#64748B",highlightBg:"transparent",label:r}},F=o.forwardRef(function(n,t){var o=n.label,l=n.content,a=n.highlights,s=void 0===a?[]:a,c=n.styleVariant,h=n.isHighlighted,g=void 0!==h&&h,u=Array.isArray(l)?l.join("\n"):l||"",x="#B91C1C"===c.badgeText?{borderColor:"#EF4444",shadow:"rgba(239, 68, 68, 0.25)"}:"#A16207"===c.badgeText?{borderColor:"#F59E0B",shadow:"rgba(245, 158, 11, 0.25)"}:{borderColor:"#6366F1",shadow:"rgba(99, 102, 241, 0.25)"};return i(d,e({sx:{mb:1.5}},{children:[r(p,e({sx:{fontSize:"12px",color:"#19213D",mb:.5,fontWeight:500,lineHeight:"130%"}},{children:o})),r(d,e({ref:t,sx:{p:"4px 12px",borderRadius:"6px",border:g?"1.5px solid ".concat(x.borderColor):"1px solid ".concat(c.border),boxShadow:g?"0px 0px 0px 2px ".concat(x.shadow):"none",bgcolor:c.bg,fontSize:"13px",color:"#0B0E1A",lineHeight:1.4,minHeight:"24px",display:"flex",alignItems:"center",whiteSpace:"pre-line",wordBreak:"break-word"}},{children:r(d,{children:function(){if(!u)return r(p,e({sx:{color:"#94A3B8",fontSize:"12px",fontStyle:"italic"}},{children:"Not Defined"}));if(!s||0===s.length)return u;var n=s.filter(function(e){return e&&e.length>0}).map(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")});if(0===n.length)return u;var t=new RegExp("(".concat(n.join("|"),")"),"gi");return u.split(t).map(function(n,t){return s.some(function(e){return e&&e.toLowerCase()===n.toLowerCase()})?r(d,e({component:"span",sx:{bgcolor:c.highlightBg,borderRadius:"2px",px:"2px"}},{children:n}),t):n})}()})}))]}))}),_=function(n){var t=n.data,o=n.isSelected,l=n.isCognitiveOpen,a=n.onToggleCognitive,s=n.onClick,c=t.summaryText||t.description||"",h=c.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),u=h?c.replace(h[0],"").trim():c,x=!!h;return i(d,e({id:"variant-card-".concat(t.id),onClick:s,sx:{minWidth:"280px",maxWidth:"280px",p:2,m:.5,bgcolor:o?"#EFF6FF99":"#FFFFFF",borderRadius:"8px",cursor:"pointer",transition:"all 0.2s",display:"flex",flexDirection:"column",gap:1,flexShrink:0,opacity:t.isLoading?.7:1,border:o?"1.4px solid #2563EB":null,boxShadow:o?"none":"0px 2px 4px 0px #19213D14","&:hover":{borderColor:o?"#2563EB":"#CBD5E1",boxShadow:o?"none":"0px 4px 8px 0px #19213D1F"}}},{children:[r(d,e({sx:{display:"flex",alignItems:"center",gap:1.5}},{children:t.isLoading?r(g,{variant:"rounded",width:80,height:20}):i(d,e({sx:{bgcolor:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:600,px:1,py:.5,borderRadius:"100px",border:"1px solid #FFE1E1"}},{children:[void 0!==t.similarity?t.similarity:0,"% Similarity"]}))})),i(d,e({sx:{display:"flex",flexDirection:"column",gap:1}},{children:[i(d,e({sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"nowrap"}},{children:[r(p,e({title:t.title,sx:{fontWeight:500,fontSize:"14px",color:"#19213D",lineHeight:1.2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"block"}},{children:t.title})),t.scope&&r(d,e({sx:{flexShrink:0,fontSize:"10px",fontWeight:600,color:"#19213D",bgcolor:"#FFF",border:"1px solid #EDEFF2",px:.75,py:.25,borderRadius:"6px",lineHeight:1.4,whiteSpace:"nowrap"}},{children:t.scope}))]})),t.isLoading?i(d,{children:[r(g,{width:"90%"}),r(g,{width:"60%"})]}):i(d,e({title:u,sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[r(p,e({sx:{fontWeight:400,fontSize:"13px",color:"#666F8D",lineHeight:1.4,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis"}},{children:u})),x&&i(d,e({onClick:function(e){e.stopPropagation(),o||s(),a()},sx:{display:"inline-flex",alignItems:"center",alignSelf:"flex-start",gap:"4px",padding:"2px 6px",borderRadius:"4px",cursor:"pointer",transition:"all 0.2s ease",marginLeft:"-4px","&:hover":{backgroundColor:"#F1F5F9"}}},{children:[r("div",e({style:{width:"13px",height:"13px",display:"flex",alignItems:"center"}},{children:r(b,{})})),r("svg",e({width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#4B5563",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:o&&l?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}},{children:r("path",{d:"M6 9l6 6 6-6"})}))]}))]}))]}))]}))},C=function(o){var g,C,B=o.proposedRule,E=o.variants,k=void 0===E?[]:E,S=o.onSelectVariant;o.onAddAsVariant;var A=o.onSkip,D=o.onBack,L=o.targetVariantId,W=o.highlightedField,T=l(L||null),z=T[0],I=T[1],R=l(!1),j=R[0],H=R[1],O=l(null),M=O[0],V=O[1],N=a(null),U=a(null);s(function(){if(L&&I(L),V(null!=W?W:null),W){var e=setTimeout(function(){return V(null)},6e3);return function(){return clearTimeout(e)}}},[L,W]);var P=function(e){N.current&&N.current.scrollBy({left:"left"===e?-300:300,behavior:"smooth"})},Y=c(function(){return n([],k,!0).sort(function(e,n){return(n.similarity||0)-(e.similarity||0)})},[k]),$=c(function(){if(z){var e=String(z).trim();return k.find(function(n){return n.id&&String(n.id).trim()===e})||Y[0]}return Y.length>0?Y[0]:null},[z,k,Y]);s(function(){if(z&&N.current){var e=z.trim();setTimeout(function(){var n=document.getElementById("variant-card-".concat(e)),t=N.current;if(n&&t){var i=n.offsetLeft-t.offsetLeft-t.clientWidth/2+n.clientWidth/2;t.scrollTo({left:i,behavior:"smooth"})}},150)}},[z,Y]);var q=$||{title:"",scope:"",description:"",wta:"",wnta:"",variantType:"Default"},J=null==$?void 0:$.analysis,X=(null===(C=null===(g=null==J?void 0:J.rule_difference_comparison)||void 0===g?void 0:g.summary)||void 0===C?void 0:C.overall_summary)||"",G=X.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),K=!!G,Q=G?G[1]:"",Z=y("reason",Q)||"",ee=y("gap",Q)||"",ne=y("relevance_score",Q)||"",te=c(function(){return{ul:function(n){n.node;var i=t(n,["node"]);return r("ol",e({},i,{style:{paddingLeft:"1.25rem",listStyleType:"decimal",margin:0}}))},li:function(n){n.node;var i=t(n,["node"]);return r("li",e({},i,{style:{marginBottom:"4px",listStyleType:"decimal"}},{children:i.children}))},ol:function(n){n.node;var i=t(n,["node"]);return r("li",e({},i,{style:{marginBottom:"4px",listStyleType:"decimal"}},{children:i.children}))},a:function(n){var o=n.href,l=n.children,a=t(n,["href","children"]);if(!o)return r("a",e({},a,{children:l}));var s=o||"";try{s=decodeURIComponent(o)}catch(e){console.error("Error decoding href",e)}if(s.includes("variant_id=")){var c="",d="",p=s.match(/variant_id=([^?&]+)/);p&&(c=p[1]);var h=s.match(/field_name=([^&]+)/);return h&&(d=h[1]),i("button",e({type:"button",onClick:function(e){e.preventDefault(),e.stopPropagation(),I(c),V(d),setTimeout(function(){return V(null)},6e3)},style:{background:"none",border:"none",outline:"none",borderRadius:"6px",padding:"1px 4px",color:"#0F172A",cursor:"pointer",fontSize:"13px",fontWeight:500,display:"inline-flex",alignItems:"center",gap:"2px",margin:"0 1px",verticalAlign:"baseline",textDecoration:"none",boxShadow:"none",WebkitAppearance:"none",MozAppearance:"none"},title:"View Comparison"},{children:[l,r("svg",e({width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:r("path",{d:"M10.2082 8.67708H2.0415M2.0415 8.67708L4.08317 6.63542M2.0415 8.67708L4.08317 10.7188M2.0415 3.57292H10.2082M10.2082 3.57292L8.1665 1.53125M10.2082 3.57292L8.1665 5.61458",stroke:"#0F172A",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})}))]}))}return r("a",e({href:o,target:"_blank",rel:"noopener noreferrer",style:{color:"#7C3AED"}},a,{children:l}))}}},[]);s(function(){!z&&!L&&Y.length>0&&!Y[0].isLoading&&I(Y[0].id)},[Y,z,L]);var ie=a(null),re=l([]),oe=re[0],le=re[1],ae=l(!1),se=ae[0],ce=ae[1],de=l(!1),pe=de[0],he=de[1];s(function(){var e=N.current;if(e){var n=function(){ce(e.scrollLeft>0),he(e.scrollLeft+e.clientWidth<e.scrollWidth-1)};return n(),e.addEventListener("scroll",n),window.addEventListener("resize",n),function(){e.removeEventListener("scroll",n),window.removeEventListener("resize",n)}}},[Y]);var ge={title:a(null),scope:a(null),description:a(null),wta:a(null),wnta:a(null)},ue={title:a(null),scope:a(null),description:a(null),wta:a(null),wnta:a(null)};s(function(){if(M){var e="when_to_apply"===M?"wta":"when_not_to_apply"===M?"wnta":M,n=ge[e]||ue[e];n&&n.current&&setTimeout(function(){n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}},[M]);var xe=function(e){var n,t,i,r,o,l=null===(n=null==J?void 0:J.rule_difference_comparison)||void 0===n?void 0:n.fields,a="when_to_apply"===e?"wta":"when_not_to_apply"===e?"wnta":e,s=!(!B[a]&&!q[a]);if(!l||!l[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var c=l[e];if(c.mappings){var d=c.mappings[0]||{};return{score:c.score,relation:d.relation||"",highlightsA:(null===(t=d.highlights)||void 0===t?void 0:t.ruleA_spans)||[],highlightsB:(null===(i=d.highlights)||void 0===i?void 0:i.ruleB_spans)||[],hasContent:s}}return{score:c.score,relation:c.relation||"",highlightsA:(null===(r=c.highlights)||void 0===r?void 0:r.ruleA_spans)||[],highlightsB:(null===(o=c.highlights)||void 0===o?void 0:o.ruleB_spans)||[],hasContent:s}},fe=["title","scope","description","when_to_apply","when_not_to_apply"],me=function(){if(ie.current){var e=ie.current.getBoundingClientRect(),n=[];fe.forEach(function(t){var i="when_to_apply"===t?ge.wta:"when_not_to_apply"===t?ge.wnta:ge[t],r="when_to_apply"===t?ue.wta:"when_not_to_apply"===t?ue.wnta:ue[t];if(i.current&&r.current){i.current.style.height="auto",r.current.style.height="auto";var o=i.current.getBoundingClientRect(),l=r.current.getBoundingClientRect(),a=Math.max(o.height,l.height);i.current.style.height="".concat(a,"px"),r.current.style.height="".concat(a,"px");var s=i.current.getBoundingClientRect(),c=r.current.getBoundingClientRect(),d=xe(t),p=w(d.score,d.relation,d.hasContent),h=s.top+s.height/2-e.top;n.push({x1:s.right-e.left,y1:h,x2:c.left-e.left,y2:h,style:p})}}),le(n)}};return s(function(){var e=setTimeout(me,250);window.addEventListener("resize",me);var n=null;return ie.current&&(n=new ResizeObserver(function(){window.requestAnimationFrame(function(){me()})})).observe(ie.current),function(){clearTimeout(e),window.removeEventListener("resize",me),n&&n.disconnect()}},[B,q,J,j]),i(d,e({sx:{display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif',overflow:"hidden"}},{children:[i(d,e({sx:{px:2,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#FFFFFF",border:"1.5px solid #EEF0F4"}},{children:[i(d,e({sx:{display:"flex",alignItems:"center",gap:1}},{children:[r(h,e({onClick:D,size:"small"},{children:r(u,{})})),r(p,e({sx:{fontSize:"16px",fontWeight:450,color:"#0F172A"}},{children:"Learning Comparison"}))]})),r(h,e({onClick:A,size:"small"},{children:r(d,e({sx:{fontSize:24,lineHeight:.5}},{children:"×"}))}))]})),Y.length>0&&i(d,e({sx:{px:3,pb:.25}},{children:[i(d,e({sx:{display:"flex",alignItems:"center",justifyContent:"space-between",py:1}},{children:[r(p,e({sx:{fontSize:"13px",color:"#475569"}},{children:"Choose the Learning you want to compare with the rule you are creating."})),i(d,e({sx:{display:"flex",gap:.5,flexShrink:0,ml:1}},{children:[r(h,e({onClick:function(){return P("left")},size:"small",disabled:!se},{children:r(u,{size:18})})),r(h,e({onClick:function(){return P("right")},size:"small",disabled:!pe},{children:r(x,{size:18})}))]}))]})),r(d,e({ref:N,sx:{display:"flex",gap:1,overflowX:"auto",pb:.05,"&::-webkit-scrollbar":{height:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"transparent",borderRadius:"10px"},"&::-webkit-scrollbar-thumb:hover":{background:"transparent"}}},{children:Y.map(function(e){return r(_,{data:e,isSelected:(null==$?void 0:$.id)===e.id,isCognitiveOpen:j,onToggleCognitive:function(){H(function(e){var n=!e;return n&&U.current&&U.current.scrollTo({top:0,behavior:"smooth"}),n})},onClick:function(){return I((n=e).id),S(n),void H(!1);var n}},e.id)})}))]})),r(d,e({ref:U,sx:{flex:1,overflowY:"auto",py:1.5,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",borderTop:X&&K&&j?"none":"1.5px solid #EEF0F4"}},{children:i(d,e({sx:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"}},{children:[X&&K&&j&&r(d,e({sx:{width:"100%",pb:1,animation:"fadeIn 0.2s ease-out","& > div > button":{display:"none !important"},"& > div > div":{marginTop:"0px"}}},{children:r(m,{headerIcon:r(b,{}),reasoning:Z,gap:ee,score:ne,mdComponents:te,isOpen:!0,onToggle:function(){return H(!1)},styles:v()})})),i(d,e({ref:ie,sx:{display:"grid",gridTemplateColumns:"1fr auto 1fr",gap:"60px",maxWidth:"1200px",width:"100%",position:"relative"}},{children:[r("svg",e({style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:10}},{children:oe.map(function(n,t){var o=(n.x1+n.x2)/2,l=n.y1;return i("g",{children:[r("line",{x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2,stroke:n.style.badgeBorder,strokeWidth:"1"}),r("foreignObject",e({x:o-125,y:l-16,width:"250",height:"32"},{children:r(d,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:r(d,e({sx:{fontSize:"11px",bgcolor:n.style.badgeBg,color:n.style.badgeText,border:"1px solid ".concat(n.style.badgeBorder),borderRadius:"12px",px:1.5,py:.25,fontWeight:500,textAlign:"center",whiteSpace:"nowrap"}},{children:n.style.label}))}))}))]},t)})})),i(d,e({sx:{border:"1px dashed #B0B0B0",borderRadius:"8px",bgcolor:"#FFFFFF",display:"flex",flexDirection:"column",position:"relative",zIndex:2,filter:"drop-shadow(0px 2px 4px #F2F2F2)",minWidth:0}},{children:[r(d,e({sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px dashed #B0B0B0",borderRadius:"8px 8px 0 0",display:"flex",minHeight:"24px",alignItems:"center"}},{children:r(p,e({sx:{fontSize:"16px",fontWeight:500,color:"#19213D"}},{children:"Learning You’re Creating"}))})),r(d,e({sx:{p:"12px",display:"flex",flexDirection:"column"}},{children:fe.map(function(e){var n=xe(e),t=w(n.score,n.relation,n.hasContent),i="when_to_apply"===e?ge.wta:"when_not_to_apply"===e?ge.wnta:ge[e],o=B["when_to_apply"===e?"wta":"when_not_to_apply"===e?"wnta":e];return r(F,{ref:i,label:"when_to_apply"===e?"When to apply":"when_not_to_apply"===e?"When NOT to Apply":e.charAt(0).toUpperCase()+e.slice(1).replace("_"," "),content:o,highlights:n.highlightsA,styleVariant:t,isHighlighted:M===e},"left-".concat(e))})}))]})),r(d,{sx:{width:"1px"}}),i(d,e({sx:{border:"1px solid #E3E6EA",borderRadius:"8px",bgcolor:"#FFFFFF",boxShadow:"0px 1px 4px #F7F4FE",position:"relative",zIndex:2,display:"flex",flexDirection:"column",minWidth:0}},{children:[r(d,e({sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E3E6EA",borderRadius:"8px 8px 0 0",minHeight:"24px",display:"flex",alignItems:"center"}},{children:i(p,e({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",display:"flex",alignItems:"center",gap:1}},{children:[r("div",e({style:{width:"18px",height:"18px",display:"flex",alignItems:"center",justifyContent:"center"}},{children:r(f,{})})),"Existing Learning"]}))})),r(d,e({sx:{p:"12px",display:"flex",flexDirection:"column"}},{children:fe.map(function(e){var n=xe(e),t=w(n.score,n.relation,n.hasContent),i="when_to_apply"===e?ue.wta:"when_not_to_apply"===e?ue.wnta:ue[e],o=q["when_to_apply"===e?"wta":"when_not_to_apply"===e?"wnta":e];return r(F,{ref:i,label:"when_to_apply"===e?"When to apply":"when_not_to_apply"===e?"When NOT to Apply":e.charAt(0).toUpperCase()+e.slice(1).replace("_"," "),content:o,highlights:n.highlightsB,styleVariant:t,isHighlighted:M===e},"right-".concat(e))})}))]}))]}))]}))}))]}))};export{C as default};
1
+ import{__assign as e,__spreadArray as n,__rest as t}from"tslib";import{jsxs as i,jsx as r}from"react/jsx-runtime";import o,{useState as l,useRef as a,useEffect as s,useMemo as d}from"react";import{Box as c,Typography as p,IconButton as h,Skeleton as g}from"@mui/material";import{ArrowLeft as u,ArrowRight as x}from"lucide-react";import f from"../../_svg/SparkleIcon.js";import{CognitiveDecisioningCard as m}from"@e-llm-studio/citation";import{ButtonCognitiveIcon as b}from"../../_svg/ButtonCognitiveIcon.js";var v=function(e,n){if(!n)return null;var t=new RegExp("<".concat(e,"[^>]*>([\\s\\S]*?)<\\/").concat(e,">"),"i"),i=n.match(t);return i?i[1].replace(/\\n/g,"\n"):null},y=function(e,n,t){var i=100*e;if(!t)return{bg:"#FFFFFF",border:"#E2E8F0",badgeBg:"#F1F5F9",badgeBorder:"#CBD5E1",badgeText:"#64748B",highlightBg:"transparent",label:"Not Defined"};var r=function(e){return e.split("_").map(function(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}).join(" ")}(n);return i>=70?{bg:"#FEF2F2",border:"#FEE2E2",badgeBg:"#FEF2F2",badgeBorder:"#FECACA",badgeText:"#B91C1C",highlightBg:"#FECACA",label:r}:i>=40?{bg:"#FFFCF6",border:"#FFDD80",badgeBg:"#FEF9C3",badgeBorder:"#FEF08A",badgeText:"#A16207",highlightBg:"#FDDEB3",label:r}:{bg:"#FFFFFF",border:"#E2E8F0",badgeBg:"#F1F5F9",badgeBorder:"#CBD5E1",badgeText:"#64748B",highlightBg:"transparent",label:r}},w=o.forwardRef(function(n,t){var o=n.label,l=n.content,a=n.highlights,s=void 0===a?[]:a,d=n.styleVariant,h=n.isHighlighted,g=void 0!==h&&h,u=Array.isArray(l)?l.join("\n"):l||"",x="#B91C1C"===d.badgeText?{borderColor:"#EF4444",shadow:"rgba(239, 68, 68, 0.25)"}:"#A16207"===d.badgeText?{borderColor:"#F59E0B",shadow:"rgba(245, 158, 11, 0.25)"}:{borderColor:"#6366F1",shadow:"rgba(99, 102, 241, 0.25)"};return i(c,e({sx:{mb:1.5}},{children:[r(p,e({sx:{fontSize:"12px",color:"#19213D",mb:.5,fontWeight:500,lineHeight:"130%"}},{children:o})),r(c,e({ref:t,sx:{p:"4px 12px",borderRadius:"6px",border:g?"1.5px solid ".concat(x.borderColor):"1px solid ".concat(d.border),boxShadow:g?"0px 0px 0px 2px ".concat(x.shadow):"none",bgcolor:d.bg,fontSize:"13px",color:"#0B0E1A",lineHeight:1.4,minHeight:"24px",display:"flex",alignItems:"center",whiteSpace:"pre-line",wordBreak:"break-word"}},{children:r(c,{children:function(){if(!u)return r(p,e({sx:{color:"#94A3B8",fontSize:"12px",fontStyle:"italic"}},{children:"Not Defined"}));if(!s||0===s.length)return u;var n=s.filter(function(e){return e&&e.length>0}).map(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")});if(0===n.length)return u;var t=new RegExp("(".concat(n.join("|"),")"),"gi");return u.split(t).map(function(n,t){return s.some(function(e){return e&&e.toLowerCase()===n.toLowerCase()})?r(c,e({component:"span",sx:{bgcolor:d.highlightBg,borderRadius:"2px",px:"2px"}},{children:n}),t):n})}()})}))]}))}),F=function(n){var t=n.data,o=n.isSelected,l=n.isCognitiveOpen,a=n.onToggleCognitive,s=n.onClick,d=t.summaryText||t.description||"",h=d.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),u=h?d.replace(h[0],"").trim():d,x=!!h;return i(c,e({id:"variant-card-".concat(t.id),onClick:s,sx:{minWidth:"280px",maxWidth:"280px",p:2,m:.5,bgcolor:o?"#EFF6FF99":"#FFFFFF",borderRadius:"8px",cursor:"pointer",transition:"all 0.2s",display:"flex",flexDirection:"column",gap:1,flexShrink:0,opacity:t.isLoading?.7:1,border:o?"1.4px solid #2563EB":null,boxShadow:o?"none":"0px 2px 4px 0px #19213D14","&:hover":{borderColor:o?"#2563EB":"#CBD5E1",boxShadow:o?"none":"0px 4px 8px 0px #19213D1F"}}},{children:[r(c,e({sx:{display:"flex",alignItems:"center",gap:1.5}},{children:t.isLoading?r(g,{variant:"rounded",width:80,height:20}):i(c,e({sx:{bgcolor:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:600,px:1,py:.5,borderRadius:"100px",border:"1px solid #FFE1E1"}},{children:[void 0!==t.similarity?t.similarity:0,"% Similarity"]}))})),i(c,e({sx:{display:"flex",flexDirection:"column",gap:1}},{children:[i(c,e({sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"nowrap"}},{children:[r(p,e({title:t.title,sx:{fontWeight:500,fontSize:"14px",color:"#19213D",lineHeight:1.2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"block"}},{children:t.title})),t.scope&&r(c,e({sx:{flexShrink:0,fontSize:"10px",fontWeight:600,color:"#19213D",bgcolor:"#FFF",border:"1px solid #EDEFF2",px:.75,py:.25,borderRadius:"6px",lineHeight:1.4,whiteSpace:"nowrap"}},{children:t.scope}))]})),t.isLoading?i(c,{children:[r(g,{width:"90%"}),r(g,{width:"60%"})]}):i(c,e({title:u,sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[r(p,e({sx:{fontWeight:400,fontSize:"13px",color:"#666F8D",lineHeight:1.4,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis"}},{children:u})),x&&i(c,e({onClick:function(e){e.stopPropagation(),o||s(),a()},sx:{display:"inline-flex",alignItems:"center",alignSelf:"flex-start",gap:"4px",padding:"2px 6px",borderRadius:"4px",cursor:"pointer",transition:"all 0.2s ease",marginLeft:"-4px","&:hover":{backgroundColor:"#F1F5F9"}}},{children:[r("div",e({style:{width:"13px",height:"13px",display:"flex",alignItems:"center"}},{children:r(b,{})})),r("svg",e({width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#4B5563",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:o&&l?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}},{children:r("path",{d:"M6 9l6 6 6-6"})}))]}))]}))]}))]}))},_=function(o){var g,_,C=o.proposedRule,B=o.variants,E=void 0===B?[]:B,k=o.onSelectVariant;o.onAddAsVariant;var S=o.onSkip,A=o.onBack,L=o.targetVariantId,D=o.highlightedField,W=l(L||null),z=W[0],T=W[1],I=l(!1),R=I[0],j=I[1],H=l(null),O=H[0],M=H[1],V=a(null),N=a(null);s(function(){if(L&&T(L),M(null!=D?D:null),D){var e=setTimeout(function(){return M(null)},6e3);return function(){return clearTimeout(e)}}},[L,D]);var U=function(e){V.current&&V.current.scrollBy({left:"left"===e?-300:300,behavior:"smooth"})},P=d(function(){return n([],E,!0).sort(function(e,n){return(n.similarity||0)-(e.similarity||0)})},[E]),Y=d(function(){if(z){var e=String(z).trim();return E.find(function(n){return n.id&&String(n.id).trim()===e})||P[0]}return P.length>0?P[0]:null},[z,E,P]);s(function(){if(z&&V.current){var e=z.trim();setTimeout(function(){var n=document.getElementById("variant-card-".concat(e)),t=V.current;if(n&&t){var i=n.offsetLeft-t.offsetLeft-t.clientWidth/2+n.clientWidth/2;t.scrollTo({left:i,behavior:"smooth"})}},150)}},[z,P]);var $=Y||{title:"",scope:"",description:"",wta:"",wnta:"",variantType:"Default"},q=null==Y?void 0:Y.analysis,J=(null===(_=null===(g=null==q?void 0:q.rule_difference_comparison)||void 0===g?void 0:g.summary)||void 0===_?void 0:_.overall_summary)||"",X=J.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),G=!!X,K=X?X[1]:"",Q=v("reason",K)||"",Z=v("gap",K)||"",ee=v("relevance_score",K)||"",ne=d(function(){return{ul:function(n){n.node;var i=t(n,["node"]);return r("ol",e({},i,{style:{paddingLeft:"1.25rem",listStyleType:"decimal",margin:0}}))},li:function(n){n.node;var i=t(n,["node"]);return r("li",e({},i,{style:{marginBottom:"4px",listStyleType:"decimal"}},{children:i.children}))},ol:function(n){n.node;var i=t(n,["node"]);return r("li",e({},i,{style:{marginBottom:"4px",listStyleType:"decimal"}},{children:i.children}))},a:function(n){var o=n.href,l=n.children,a=t(n,["href","children"]);if(!o)return r("a",e({},a,{children:l}));var s=o||"";try{s=decodeURIComponent(o)}catch(e){console.error("Error decoding href",e)}if(s.includes("variant_id=")){var d="",c="",p=s.match(/variant_id=([^?&]+)/);p&&(d=p[1]);var h=s.match(/field_name=([^&]+)/);return h&&(c=h[1]),i("button",e({type:"button",onClick:function(e){e.preventDefault(),e.stopPropagation(),T(d),M(c),setTimeout(function(){return M(null)},6e3)},style:{background:"none",border:"none",outline:"none",borderRadius:"6px",padding:"1px 4px",color:"#0F172A",cursor:"pointer",fontSize:"13px",fontWeight:500,display:"inline-flex",alignItems:"center",gap:"2px",margin:"0 1px",verticalAlign:"baseline",textDecoration:"none",boxShadow:"none",WebkitAppearance:"none",MozAppearance:"none"},title:"View Comparison"},{children:[l,r("svg",e({width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:r("path",{d:"M10.2082 8.67708H2.0415M2.0415 8.67708L4.08317 6.63542M2.0415 8.67708L4.08317 10.7188M2.0415 3.57292H10.2082M10.2082 3.57292L8.1665 1.53125M10.2082 3.57292L8.1665 5.61458",stroke:"#0F172A",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})}))]}))}return r("a",e({href:o,target:"_blank",rel:"noopener noreferrer",style:{color:"#7C3AED"}},a,{children:l}))}}},[]);s(function(){!z&&!L&&P.length>0&&!P[0].isLoading&&T(P[0].id)},[P,z,L]);var te=a(null),ie=l([]),re=ie[0],oe=ie[1],le=l(!1),ae=le[0],se=le[1],de=l(!1),ce=de[0],pe=de[1];s(function(){var e=V.current;if(e){var n=function(){se(e.scrollLeft>0),pe(e.scrollLeft+e.clientWidth<e.scrollWidth-1)};return n(),e.addEventListener("scroll",n),window.addEventListener("resize",n),function(){e.removeEventListener("scroll",n),window.removeEventListener("resize",n)}}},[P]);var he={title:a(null),scope:a(null),description:a(null),wta:a(null),wnta:a(null)},ge={title:a(null),scope:a(null),description:a(null),wta:a(null),wnta:a(null)};s(function(){if(O){var e="when_to_apply"===O?"wta":"when_not_to_apply"===O?"wnta":O,n=he[e]||ge[e];n&&n.current&&setTimeout(function(){n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}},[O]);var ue=function(e){var n,t,i,r,o,l=null===(n=null==q?void 0:q.rule_difference_comparison)||void 0===n?void 0:n.fields,a="when_to_apply"===e?"wta":"when_not_to_apply"===e?"wnta":e,s=!(!C[a]&&!$[a]);if(!l||!l[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var d=l[e];if(d.mappings){var c=d.mappings[0]||{};return{score:d.score,relation:c.relation||"",highlightsA:(null===(t=c.highlights)||void 0===t?void 0:t.ruleA_spans)||[],highlightsB:(null===(i=c.highlights)||void 0===i?void 0:i.ruleB_spans)||[],hasContent:s}}return{score:d.score,relation:d.relation||"",highlightsA:(null===(r=d.highlights)||void 0===r?void 0:r.ruleA_spans)||[],highlightsB:(null===(o=d.highlights)||void 0===o?void 0:o.ruleB_spans)||[],hasContent:s}},xe=["title","scope","description","when_to_apply","when_not_to_apply"],fe=function(){if(te.current){var e=te.current.getBoundingClientRect(),n=[];xe.forEach(function(t){var i="when_to_apply"===t?he.wta:"when_not_to_apply"===t?he.wnta:he[t],r="when_to_apply"===t?ge.wta:"when_not_to_apply"===t?ge.wnta:ge[t];if(i.current&&r.current){i.current.style.height="auto",r.current.style.height="auto";var o=i.current.getBoundingClientRect(),l=r.current.getBoundingClientRect(),a=Math.max(o.height,l.height);i.current.style.height="".concat(a,"px"),r.current.style.height="".concat(a,"px");var s=i.current.getBoundingClientRect(),d=r.current.getBoundingClientRect(),c=ue(t),p=y(c.score,c.relation,c.hasContent),h=s.top+s.height/2-e.top;n.push({x1:s.right-e.left,y1:h,x2:d.left-e.left,y2:h,style:p})}}),oe(n)}};return s(function(){var e=setTimeout(fe,250);window.addEventListener("resize",fe);var n=null;return te.current&&(n=new ResizeObserver(function(){window.requestAnimationFrame(function(){fe()})})).observe(te.current),function(){clearTimeout(e),window.removeEventListener("resize",fe),n&&n.disconnect()}},[C,$,q,R]),i(c,e({sx:{display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif',overflow:"hidden"}},{children:[i(c,e({sx:{px:2,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#FFFFFF",border:"1.5px solid #EEF0F4"}},{children:[i(c,e({sx:{display:"flex",alignItems:"center",gap:1}},{children:[r(h,e({onClick:A,size:"small"},{children:r(u,{})})),r(p,e({sx:{fontSize:"16px",fontWeight:450,color:"#0F172A"}},{children:"Learning Comparison"}))]})),r(h,e({onClick:S,size:"small"},{children:r(c,e({sx:{fontSize:24,lineHeight:.5}},{children:"×"}))}))]})),P.length>0&&i(c,e({sx:{px:3,pb:.25}},{children:[i(c,e({sx:{display:"flex",alignItems:"center",justifyContent:"space-between",py:1}},{children:[r(p,e({sx:{fontSize:"13px",color:"#475569"}},{children:"Choose the Learning you want to compare with the rule you are creating."})),i(c,e({sx:{display:"flex",gap:.5,flexShrink:0,ml:1}},{children:[r(h,e({onClick:function(){return U("left")},size:"small",disabled:!ae},{children:r(u,{size:18})})),r(h,e({onClick:function(){return U("right")},size:"small",disabled:!ce},{children:r(x,{size:18})}))]}))]})),r(c,e({ref:V,sx:{display:"flex",gap:1,overflowX:"auto",pb:.05,"&::-webkit-scrollbar":{height:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"transparent",borderRadius:"10px"},"&::-webkit-scrollbar-thumb:hover":{background:"transparent"}}},{children:P.map(function(e){return r(F,{data:e,isSelected:(null==Y?void 0:Y.id)===e.id,isCognitiveOpen:R,onToggleCognitive:function(){j(function(e){var n=!e;return n&&N.current&&N.current.scrollTo({top:0,behavior:"smooth"}),n})},onClick:function(){return T((n=e).id),k(n),void j(!1);var n}},e.id)})}))]})),r(c,e({ref:N,sx:{flex:1,overflowY:"auto",py:1.5,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",borderTop:J&&G&&R?"none":"1.5px solid #EEF0F4"}},{children:i(c,e({sx:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"}},{children:[J&&G&&R&&r(c,e({sx:{width:"100%",pb:1,animation:"fadeIn 0.2s ease-out","& > div > button":{display:"none !important"},"& > div > div":{marginTop:"0px"}}},{children:r(m,{headerIcon:r(b,{}),reasoning:Q,gap:Z,score:ee,mdComponents:ne,isOpen:!0,onToggle:function(){return j(!1)}})})),i(c,e({ref:te,sx:{display:"grid",gridTemplateColumns:"1fr auto 1fr",gap:"60px",maxWidth:"1200px",width:"100%",position:"relative"}},{children:[r("svg",e({style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:10}},{children:re.map(function(n,t){var o=(n.x1+n.x2)/2,l=n.y1;return i("g",{children:[r("line",{x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2,stroke:n.style.badgeBorder,strokeWidth:"1"}),r("foreignObject",e({x:o-125,y:l-16,width:"250",height:"32"},{children:r(c,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:r(c,e({sx:{fontSize:"11px",bgcolor:n.style.badgeBg,color:n.style.badgeText,border:"1px solid ".concat(n.style.badgeBorder),borderRadius:"12px",px:1.5,py:.25,fontWeight:500,textAlign:"center",whiteSpace:"nowrap"}},{children:n.style.label}))}))}))]},t)})})),i(c,e({sx:{border:"1px dashed #B0B0B0",borderRadius:"8px",bgcolor:"#FFFFFF",display:"flex",flexDirection:"column",position:"relative",zIndex:2,filter:"drop-shadow(0px 2px 4px #F2F2F2)",minWidth:0}},{children:[r(c,e({sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px dashed #B0B0B0",borderRadius:"8px 8px 0 0",display:"flex",minHeight:"24px",alignItems:"center"}},{children:r(p,e({sx:{fontSize:"16px",fontWeight:500,color:"#19213D"}},{children:"Learning You’re Creating"}))})),r(c,e({sx:{p:"12px",display:"flex",flexDirection:"column"}},{children:xe.map(function(e){var n=ue(e),t=y(n.score,n.relation,n.hasContent),i="when_to_apply"===e?he.wta:"when_not_to_apply"===e?he.wnta:he[e],o=C["when_to_apply"===e?"wta":"when_not_to_apply"===e?"wnta":e];return r(w,{ref:i,label:"when_to_apply"===e?"When to apply":"when_not_to_apply"===e?"When NOT to Apply":e.charAt(0).toUpperCase()+e.slice(1).replace("_"," "),content:o,highlights:n.highlightsA,styleVariant:t,isHighlighted:O===e},"left-".concat(e))})}))]})),r(c,{sx:{width:"1px"}}),i(c,e({sx:{border:"1px solid #E3E6EA",borderRadius:"8px",bgcolor:"#FFFFFF",boxShadow:"0px 1px 4px #F7F4FE",position:"relative",zIndex:2,display:"flex",flexDirection:"column",minWidth:0}},{children:[r(c,e({sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E3E6EA",borderRadius:"8px 8px 0 0",minHeight:"24px",display:"flex",alignItems:"center"}},{children:i(p,e({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",display:"flex",alignItems:"center",gap:1}},{children:[r("div",e({style:{width:"18px",height:"18px",display:"flex",alignItems:"center",justifyContent:"center"}},{children:r(f,{})})),"Existing Learning"]}))})),r(c,e({sx:{p:"12px",display:"flex",flexDirection:"column"}},{children:xe.map(function(e){var n=ue(e),t=y(n.score,n.relation,n.hasContent),i="when_to_apply"===e?ge.wta:"when_not_to_apply"===e?ge.wnta:ge[e],o=$["when_to_apply"===e?"wta":"when_not_to_apply"===e?"wnta":e];return r(w,{ref:i,label:"when_to_apply"===e?"When to apply":"when_not_to_apply"===e?"When NOT to Apply":e.charAt(0).toUpperCase()+e.slice(1).replace("_"," "),content:o,highlights:n.highlightsB,styleVariant:t,isHighlighted:O===e},"right-".concat(e))})}))]}))]}))]}))}))]}))};export{_ as default};
2
2
  //# sourceMappingURL=RuleComparisonNew.js.map