@viswa-test/test-citation 0.0.168 → 0.0.170

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 (39) hide show
  1. package/README.md +28 -157
  2. package/dist/assests/svg/PdfViewerIcons.js +1 -1
  3. package/dist/cjs/assests/svg/PdfViewerIcons.js +1 -1
  4. package/dist/cjs/features/IngestionStatus/IngestionStatusComponent.js +1 -1
  5. package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
  6. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
  7. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.js +1 -1
  8. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/PopupDefaults.js +2 -0
  9. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/PopupDefaults.js.map +1 -0
  10. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
  11. package/dist/cjs/index.js +1 -1
  12. package/dist/features/IngestionStatus/IngestionStatusComponent.js +1 -1
  13. package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
  14. package/dist/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
  15. package/dist/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.js +1 -1
  16. package/dist/features/RequirementAI/components/UserStoryCard/Popups/PopupDefaults.js +2 -0
  17. package/dist/features/RequirementAI/components/UserStoryCard/Popups/PopupDefaults.js.map +1 -0
  18. package/dist/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
  19. package/dist/index.js +1 -1
  20. package/dist/types/src/CommonConstants/CommonConstants.d.ts +0 -1296
  21. package/dist/types/src/CommonConstants/CommonConstants.d.ts.map +1 -1
  22. package/dist/types/src/assests/svg/PdfViewerIcons.d.ts +0 -1
  23. package/dist/types/src/assests/svg/PdfViewerIcons.d.ts.map +1 -1
  24. package/dist/types/src/constants/DefaultTreeData.d.ts +1297 -0
  25. package/dist/types/src/constants/DefaultTreeData.d.ts.map +1 -0
  26. package/dist/types/src/constants/deviationData.d.ts +313 -313
  27. package/dist/types/src/constants/deviationData.d.ts.map +1 -1
  28. package/dist/types/src/features/IngestionStatus/IngestionStatusComponent.d.ts.map +1 -1
  29. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts +2 -1
  30. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts.map +1 -1
  31. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts +15 -6
  32. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts.map +1 -1
  33. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.d.ts.map +1 -1
  34. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/PopupDefaults.d.ts +29 -0
  35. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/PopupDefaults.d.ts.map +1 -0
  36. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts.map +1 -1
  37. package/dist/types/src/index.d.ts +0 -1
  38. package/dist/types/src/index.d.ts.map +1 -1
  39. package/package.json +9 -17
package/README.md CHANGED
@@ -1,41 +1,42 @@
1
1
  # 📚 e-llm-studio/citation
2
2
 
3
+
3
4
  ## Table of Contents
4
5
 
5
6
  1. [Project Overview](#project-overview)
6
7
  2. [Installation](#installation)
7
8
  3. [Available Components](#available-citations)
8
9
  - [Citation Components](#citation-components)
9
- - [BookCitation](#bookcitation) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/BookCitation/README.MD)
10
- - [ChatCitation](#chatcitation) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/ChatCitation/ChatCitationReadme.md)
11
- - [CitationRenderer](#citationrenderer) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/CitationRenderer/CitationRendererReadme.md)
12
- - [EmailCitation](#emailcitation) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/EmailCitation/EmailCitation.md)
13
- - [CognitiveDecisioningCard](#cognitivedecisioningcard) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/CognitiveDecisioning/CognitiveDecisioningReadme.md)
14
- - [CognitiveCompare](#cognitivecompare) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/new-compare-ui/citation/src/features/CognitiveCompare/README.md)
15
- - [CognitiveInternalGPTReasoning](#cognitiveinternalgptreasoning) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/CognitiveInternalgptReasoning/README.md)
16
- - [CodeCitation](#codecitation) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/CodeCitation/README.md)
17
- - [ChatDrawer](#chatdrawer) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/ChatDrawer/ChatDrawerReadme.md)
18
- - [CitationsViewer](#citationsviewer) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/CitationViewer/CitationViewerReadme.md)
19
- - [PdfEditorCitation](#pdfeditorcitation) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/PdfEditorCitation/README.md)
20
- - [RequirementAICitation](#requirementaicitation) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/RequirementAiCitations/RequirementAiCitationsReadme.md)
21
- - [VideoCitationContent](#videocitationcontent) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/RequirementAiCitations/RequirementAiCitationsReadme.md)
22
- - [MarkdownWithImageCitation](#markdownwithimagecitation) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/MarkdownWithImageCitation/README.md)
23
- - [ScannedDocCitation](#scanneddoccitation) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/ScannedDocCitation/README.md)
10
+ - [BookCitation](#bookcitation) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/BookCitation/README.MD)
11
+ - [ChatCitation](#chatcitation) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/ChatCitation/ChatCitationReadme.md)
12
+ - [CitationRenderer](#citationrenderer) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/CitationRenderer/CitationRendererReadme.md)
13
+ - [EmailCitation](#emailcitation) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/EmailCitation/EmailCitation.md)
14
+ - [CognitiveDecisioningCard](#cognitivedecisioningcard) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/CognitiveDecisioning/CognitiveDecisioningReadme.md)
15
+ - [CognitiveInternalGPTReasoning](#cognitiveinternalgptreasoning) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/CognitiveInternalgptReasoning/README.md)
16
+ - [CodeCitation](#codecitation) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/CodeCitation/README.md)
17
+ - [ChatDrawer](#chatdrawer) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/ChatDrawer/ChatDrawerReadme.md)
18
+ - [CitationsViewer](#citationsviewer) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/CitationViewer/CitationViewerReadme.md)
19
+ - [PdfEditorCitation](#pdfeditorcitation) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/PdfEditorCitation/README.md)
20
+ - [RequirementAICitation](#requirementaicitation) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/RequirementAiCitations/RequirementAiCitationsReadme.md)
21
+ - [VideoCitationContent](#videocitationcontent) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/RequirementAiCitations/RequirementAiCitationsReadme.md)
22
+ - [MarkdownWithImageCitation](#markdownwithimagecitation) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/MarkdownWithImageCitation/README.md)
23
+ - [ScannedDocCitation](#scanneddoccitation) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/ScannedDocCitation/README.md)
24
24
  - [Other Components](#other-components)
25
- - [Bookemon](#bookemon) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/Bookemon/BookemonReadme.md)
26
- - [DatagestMon](#datagestmon) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/DatagestMon/README.md)
27
- - [DataSelector](#dataselector)[<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/DataSelector/DataSelectorReadme.md)
28
- - [PaginatedTable](#paginatedtable) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/PaginatedTable/PaginatedTableReadme.md)
29
- - [PdfViewer](#pdfviewer) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/PdfViewer/PdfViewerReadme.md)
30
- - [ProjectAccordion](#projectaccordion) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/ProjectAccordion/README.md)
31
- - [UploadData](#uploaddata) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/UploadData/README.md)
32
- - [ReviewPanel](#reviewpanel) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/ReviewPanel/README.md)
33
- - [TableCitationContent](#tablecitationcontent) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/TableCitation/README.md)
34
- - [SplitterCitationsComponent](#splittercitationscomponent) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/SplitterCitations/README.md)
25
+ - [Bookemon](#bookemon) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/Bookemon/BookemonReadme.md)
26
+ - [DatagestMon](#datagestmon) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/DatagestMon/README.md)
27
+ - [DataSelector](#dataselector)[<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/DataSelector/DataSelectorReadme.md)
28
+ - [PaginatedTable](#paginatedtable) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/PaginatedTable/PaginatedTableReadme.md)
29
+ - [PdfViewer](#pdfviewer) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/PdfViewer/PdfViewerReadme.md)
30
+ - [ProjectAccordion](#projectaccordion) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/ProjectAccordion/README.md)
31
+ - [UploadData](#uploaddata) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/UploadData/README.md)
32
+ - [ReviewPanel](#reviewpanel) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/ReviewPanel/README.md)
33
+ - [TableCitationContent](#tablecitationcontent) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/TableCitation/README.md)
34
+ - [SplitterCitationsComponent](#splittercitationscomponent) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/SplitterCitations/README.md)
35
35
  4. [Common Use Cases](#common-use-cases)
36
36
  5. [Development & Contribution](#development--contribution)
37
37
  6. [License](#license)
38
38
 
39
+
39
40
  ## Project Overview
40
41
 
41
42
  The @e-llm-studio/citation library is a comprehensive React component library designed to render various types of citations and related UI elements within the e-LLM Studio ecosystem. It provides a robust set of reusable, production-ready components that enable developers to display citations, reasoning chains, code snippets, PDFs, and other content types with rich interactive features and highly customizable styling.
@@ -135,8 +136,8 @@ pnpm add @e-llm-studio/citation
135
136
 
136
137
  ---
137
138
 
138
- # Citation Components
139
139
 
140
+ # Citation Components
140
141
  ## BookCitation
141
142
 
142
143
  ### Overview
@@ -189,136 +190,7 @@ import BookCitation from '@e-llm-studio/citation/BookCitation'
189
190
  | `useDropdown` | `boolean` | Optional flag to render the citation as a dropdown (default: `true`) |
190
191
 
191
192
  ---
192
- ---
193
-
194
- ### CognitiveCompare (Main Component)
195
-
196
- A side-by-side document comparison component with cognitive analysis, deviation badges, citation-linked PDF previews, and two layout modes (Standard and Relative Order). For full documentation see the [dedicated README](https://github.com/Techolution/e-llm-studio-lib/blob/new-compare-ui/citation/src/features/CognitiveCompare/README.md).
197
-
198
- ### Props
199
-
200
- | Prop | Type | Default | Description |
201
- | --------------------- | ----------------------------------- | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
202
- | `treeData` | `Record<string, any> \| null` | — | **Required.** Backend tree structure powering both columns. |
203
- | `displayConfig` | [`IDisplayConfig`](#idisplayconfig) | — | **Required.** Controls header/toggle visibility and initial layout mode. |
204
- | `componentHeaderText` | `string` | `"Contract Comparison"` | Text shown in the top header bar. |
205
- | `deviationData` | `Record<string, any>` | `{}` | Per-node deviation analysis results keyed by node ID. Populates the Deviation Analysis tab in the cognitive popup and drives inline text highlights within section content. |
206
-
207
- ---
208
-
209
- #### IDisplayConfig
210
-
211
- | Property | Type | Default | Description |
212
- | ----------------------- | --------- | ------- | ---------------------------------------------------------------------- |
213
- | `isHeaderVisible` | `boolean` | `true` | Show or hide the top header bar. |
214
- | `isToggleVisible` | `boolean` | `true` | Show or hide the Standard / Relative Order toggle switch. |
215
- | `maintainRelativeOrder` | `boolean` | `false` | Initial layout mode — `true` for Relative Order, `false` for Standard. |
216
-
217
- ---
218
-
219
- ### treeData Shape
220
-
221
- `treeData` is the primary data contract. It must be a flat object where every key is a node ID, plus four reserved keys.
222
-
223
- ```ts
224
- {
225
- // Top-level metadata keys
226
- base_root_id: string, // ID of the root node (looked up inside nodes)
227
- input_index_map: { // Maps side index to document UUID
228
- "0": string, // left side UUID
229
- "1": string, // right side UUID
230
- },
231
- documents: { // Document metadata keyed by UUID
232
- [uuid: string]: {
233
- title: string,
234
- signed_url: string, // PDF URL used by CitationAnchor / PdfViewer
235
- }
236
- },
237
-
238
- // All node data lives under the `nodes` key
239
- nodes: {
240
- // Root node (identified by base_root_id)
241
- [rootId: string]: {
242
- display_node?: boolean,
243
- comparison_inputs: {
244
- [uuid: string]: { title: string } // column titles
245
- },
246
- decision_scope_description?: string,
247
- next?: Record<string, string>, // child node IDs
248
- },
249
-
250
- // Section nodes
251
- [nodeId: string]: {
252
- display_node?: boolean, // set false to hide the node
253
- evaluation_result?: DeviationDataEntry, // deviation result attached directly to node
254
- comparison_inputs: {
255
- [uuid: string]: {
256
- title: string,
257
- content: string,
258
- additional_attributes?: {
259
- display_index?: number, // used in Relative Order mode for sorting
260
- display_title?: boolean, // set false to suppress rendering the title
261
- display_content?: boolean, // set false to suppress rendering the content
262
- }
263
- }
264
- },
265
- next?: Record<string, string>, // child node IDs (for subsections)
266
- mapping_rationale?: {
267
- decision_strength?: string, // numeric string, e.g. "72"
268
- decisioning_factors?: string[],
269
- gaps_in_decision?: string[],
270
- citations?: Record<string, Record<string, CitationEntry>>
271
- }
272
- }
273
- }
274
- }
275
- ```
276
-
277
- > All node data (root and section nodes) lives under the `nodes` key. The top-level `base_root_id`, `input_index_map`, and `documents` keys remain directly on `treeData`.
278
-
279
- #### deviationData Shape
280
-
281
- ```ts
282
- // deviationData[nodeId]
283
- {
284
- evaluation_outputs?: {
285
- output_value?: string, // badge label text
286
- metadata?: { label_color?: string } // hex — drives badge/highlight colors
287
- },
288
- cognitive_decisioning?: {
289
- decisioning_factors?: string[],
290
- gaps_in_decision?: string[],
291
- citations?: Record<string, any>,
292
- decision_strength?: string | null,
293
- },
294
- deviations?: Record<string, any>, // { devKey: { [docUuid]: highlightText } }
295
- }
296
- ```
297
-
298
- #### Usage
299
-
300
- ```tsx
301
- import CognitiveCompare from "@e-llm-studio/citation/CognitiveCompare";
302
-
303
- <CognitiveCompare
304
- treeData={myTreeData}
305
- displayConfig={{
306
- isHeaderVisible: true,
307
- isToggleVisible: true,
308
- maintainRelativeOrder: false,
309
- }}
310
- deviationData={myDeviationData}
311
- />;
312
- ```
313
-
314
- #### Key Behaviours
315
193
 
316
- - Badge and highlight colors are generated dynamically from `evaluation_outputs.metadata.label_color` via `generateColorPalette()`. The static `relationStyles` map has been removed.
317
- - Clicking a badge in **Standard mode** opens `CognitivePopup` directly. In **Relative Order mode** it opens `MoreFunctionsPopup` offering Connect, Side by Side, and Cognitive Decisioning actions.
318
- - The **Deviation Analysis** tab is shown first in the popup and displays `cognitive_decisioning.decisioning_factors` and `gaps_in_decision` with inline citation anchors that open split PDF viewers.
319
- - `deviations` entries drive inline `<mark>` highlights inside section content, colored using the same `label_color`-derived palette.
320
-
321
- ---
322
194
 
323
195
  ## ChatCitation
324
196
 
@@ -1103,7 +975,6 @@ This visual captures a clean product collaboration workspace prepared for planni
1103
975
  ```
1104
976
 
1105
977
  **With CitationRenderer (Expandable Pill):**
1106
-
1107
978
  ```tsx
1108
979
  import { CitationRenderer } from '@e-llm-studio/citation/CitationRenderer'
1109
980
  import { MarkdownWithImageCitation } from '@e-llm-studio/citation/MarkdownWithImageCitation'
@@ -2441,4 +2312,4 @@ npm install @e-llm-studio/citation@latest
2441
2312
 
2442
2313
  This library is released under the MIT License. See the LICENSE file for more details.
2443
2314
 
2444
- The license information is also available in the `citation/package.json` file under the 'license' field.
2315
+ The license information is also available in the `citation/package.json` file under the 'license' field.
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsx as n,jsxs as i}from"react/jsx-runtime";var t=function(){return n("svg",e({xmlns:"http://www.w3.org/2000/svg",style:{width:"12px",height:"15px"},viewBox:"0 0 14 17",fill:"none"},{children:n("path",{d:"M8.25 0.952148V4.05005C8.25 4.47009 8.25 4.68011 8.33175 4.84055C8.40365 4.98167 8.51839 5.0964 8.65951 5.16831C8.81994 5.25005 9.02996 5.25005 9.45 5.25005H12.5479M9.75 9H3.75M9.75 12H3.75M5.25 6H3.75M8.25 0.75H4.35C3.08988 0.75 2.45982 0.75 1.97852 0.995235C1.55516 1.21095 1.21095 1.55516 0.995235 1.97852C0.75 2.45982 0.75 3.08988 0.75 4.35V12.15C0.75 13.4101 0.75 14.0402 0.995235 14.5215C1.21095 14.9448 1.55516 15.289 1.97852 15.5048C2.45982 15.75 3.08988 15.75 4.35 15.75H9.15C10.4101 15.75 11.0402 15.75 11.5215 15.5048C11.9448 15.289 12.289 14.9448 12.5048 14.5215C12.75 14.0402 12.75 13.4101 12.75 12.15V5.25L8.25 0.75Z",stroke:"#0019FF",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))},o=function(){return n("svg",e({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:n("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})}))},r=function(){return i("svg",e({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),n("polyline",{points:"7 10 12 15 17 10"}),n("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}))},h=function(){return i("svg",e({width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}))},s=function(){return n("svg",e({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:n("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"})}))};export{h as DefaultCloseIcon,r as DefaultDownloadIcon,s as DefaultFullScreenCloseIcon,o as DefaultFullScreenIcon,t as DefaultPdfIcon};
1
+ import{__assign as e}from"tslib";import{jsx as n,jsxs as i}from"react/jsx-runtime";var t=function(){return n("svg",e({xmlns:"http://www.w3.org/2000/svg",style:{width:"12px",height:"15px"},viewBox:"0 0 14 17",fill:"none"},{children:n("path",{d:"M8.25 0.952148V4.05005C8.25 4.47009 8.25 4.68011 8.33175 4.84055C8.40365 4.98167 8.51839 5.0964 8.65951 5.16831C8.81994 5.25005 9.02996 5.25005 9.45 5.25005H12.5479M9.75 9H3.75M9.75 12H3.75M5.25 6H3.75M8.25 0.75H4.35C3.08988 0.75 2.45982 0.75 1.97852 0.995235C1.55516 1.21095 1.21095 1.55516 0.995235 1.97852C0.75 2.45982 0.75 3.08988 0.75 4.35V12.15C0.75 13.4101 0.75 14.0402 0.995235 14.5215C1.21095 14.9448 1.55516 15.289 1.97852 15.5048C2.45982 15.75 3.08988 15.75 4.35 15.75H9.15C10.4101 15.75 11.0402 15.75 11.5215 15.5048C11.9448 15.289 12.289 14.9448 12.5048 14.5215C12.75 14.0402 12.75 13.4101 12.75 12.15V5.25L8.25 0.75Z",stroke:"#0019FF",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))},o=function(){return n("svg",e({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:n("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})}))},r=function(){return i("svg",e({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),n("polyline",{points:"7 10 12 15 17 10"}),n("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}))},h=function(){return i("svg",e({width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}))};export{h as DefaultCloseIcon,r as DefaultDownloadIcon,o as DefaultFullScreenIcon,t as DefaultPdfIcon};
2
2
  //# sourceMappingURL=PdfViewerIcons.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime");exports.DefaultCloseIcon=function(){return n.jsxs("svg",e.__assign({width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}))},exports.DefaultDownloadIcon=function(){return n.jsxs("svg",e.__assign({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),n.jsx("polyline",{points:"7 10 12 15 17 10"}),n.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}))},exports.DefaultFullScreenCloseIcon=function(){return n.jsx("svg",e.__assign({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:n.jsx("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"})}))},exports.DefaultFullScreenIcon=function(){return n.jsx("svg",e.__assign({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:n.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})}))},exports.DefaultPdfIcon=function(){return n.jsx("svg",e.__assign({xmlns:"http://www.w3.org/2000/svg",style:{width:"12px",height:"15px"},viewBox:"0 0 14 17",fill:"none"},{children:n.jsx("path",{d:"M8.25 0.952148V4.05005C8.25 4.47009 8.25 4.68011 8.33175 4.84055C8.40365 4.98167 8.51839 5.0964 8.65951 5.16831C8.81994 5.25005 9.02996 5.25005 9.45 5.25005H12.5479M9.75 9H3.75M9.75 12H3.75M5.25 6H3.75M8.25 0.75H4.35C3.08988 0.75 2.45982 0.75 1.97852 0.995235C1.55516 1.21095 1.21095 1.55516 0.995235 1.97852C0.75 2.45982 0.75 3.08988 0.75 4.35V12.15C0.75 13.4101 0.75 14.0402 0.995235 14.5215C1.21095 14.9448 1.55516 15.289 1.97852 15.5048C2.45982 15.75 3.08988 15.75 4.35 15.75H9.15C10.4101 15.75 11.0402 15.75 11.5215 15.5048C11.9448 15.289 12.289 14.9448 12.5048 14.5215C12.75 14.0402 12.75 13.4101 12.75 12.15V5.25L8.25 0.75Z",stroke:"#0019FF",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime");exports.DefaultCloseIcon=function(){return n.jsxs("svg",e.__assign({width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}))},exports.DefaultDownloadIcon=function(){return n.jsxs("svg",e.__assign({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),n.jsx("polyline",{points:"7 10 12 15 17 10"}),n.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}))},exports.DefaultFullScreenIcon=function(){return n.jsx("svg",e.__assign({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:n.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})}))},exports.DefaultPdfIcon=function(){return n.jsx("svg",e.__assign({xmlns:"http://www.w3.org/2000/svg",style:{width:"12px",height:"15px"},viewBox:"0 0 14 17",fill:"none"},{children:n.jsx("path",{d:"M8.25 0.952148V4.05005C8.25 4.47009 8.25 4.68011 8.33175 4.84055C8.40365 4.98167 8.51839 5.0964 8.65951 5.16831C8.81994 5.25005 9.02996 5.25005 9.45 5.25005H12.5479M9.75 9H3.75M9.75 12H3.75M5.25 6H3.75M8.25 0.75H4.35C3.08988 0.75 2.45982 0.75 1.97852 0.995235C1.55516 1.21095 1.21095 1.55516 0.995235 1.97852C0.75 2.45982 0.75 3.08988 0.75 4.35V12.15C0.75 13.4101 0.75 14.0402 0.995235 14.5215C1.21095 14.9448 1.55516 15.289 1.97852 15.5048C2.45982 15.75 3.08988 15.75 4.35 15.75H9.15C10.4101 15.75 11.0402 15.75 11.5215 15.5048C11.9448 15.289 12.289 14.9448 12.5048 14.5215C12.75 14.0402 12.75 13.4101 12.75 12.15V5.25L8.25 0.75Z",stroke:"#0019FF",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))};
2
2
  //# sourceMappingURL=PdfViewerIcons.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),n=require("./ingestion.module.css.js"),t=require("./useIngestionStatus.js"),r={ingested:{label:"Ingested",className:n.default.ingested},failed:{label:"Ingestion Failed",className:n.default.failed},in_progress:{label:"Ingesting...",className:n.default.inProgress},pending:{label:"Pending",className:n.default.pending}};var a=function(t){var a=t.status,l=t.label,i=t.percentage,o=t.customConfig;if(o)return s.jsx("span",e.__assign({className:n.default.chip,style:{border:"1px solid ".concat(o.borderColor),background:o.background,color:o.color}},{children:null!=l?l:o.label}));if("custom"===a)return null;var u=r[a];if(!u)return null;var c="in_progress"===a&&void 0!==i;return s.jsx("span",e.__assign({className:"".concat(n.default.chip," ").concat(u.className)},{children:c?s.jsxs(s.Fragment,{children:[null!=l?l:"Ingesting",s.jsx("span",{className:n.default.dot}),"".concat(i,"%")]}):null!=l?l:u.label}))},l=new Set(["DONE","COMPLETED","FAILED"]);exports.IngestionStatusChip=a,exports.IngestionStatusComponent=function(e){var n,r,i,o,u=e.ingestionId,c=e.status,d=e.wsBaseUrl,g=e.showPercentage,p=void 0===g||g,f=e.statusMap,v=e.customStatusConfigs,m=!!c&&l.has(c.toUpperCase()),b=t.useIngestionWebSocket(!m&&u?u:null,d).data,x=m?c:null!==(r=null!==(n=null==b?void 0:b.ingestionStatus)&&void 0!==n?n:c)&&void 0!==r?r:"",C=x?function(e,s){if(!e)return"custom";if(s){if(void 0!==s[e])return s[e];var n=e.toUpperCase();if(void 0!==s[n])return s[n]}return"custom"}(x,f):"pending",I=v?null!==(o=null!==(i=v[C])&&void 0!==i?i:v[x])&&void 0!==o?o:v[x.toUpperCase()]:void 0,j=!m&&void 0!==(null==b?void 0:b.currentProgress)&&p?b.currentProgress:void 0;return s.jsx(a,{status:C,percentage:j,customConfig:I})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),n=require("./ingestion.module.css.js"),t=require("./useIngestionStatus.js"),r={ingested:{label:"Ingested",className:n.default.ingested},failed:{label:"Ingestion Failed",className:n.default.failed},in_progress:{label:"Ingesting...",className:n.default.inProgress},pending:{label:"Pending",className:n.default.pending}};var a=function(t){var a=t.status,i=t.label,l=t.percentage,o=t.customConfig;if(o)return s.jsx("span",e.__assign({className:n.default.chip,style:{border:"1px solid ".concat(o.borderColor),background:o.background,color:o.color}},{children:null!=i?i:o.label}));if("custom"===a)return null;var u=r[a];if(!u)return null;var c="in_progress"===a&&void 0!==l;return s.jsx("span",e.__assign({className:"".concat(n.default.chip," ").concat(u.className)},{children:c?s.jsxs(s.Fragment,{children:[null!=i?i:"Ingesting",s.jsx("span",{className:n.default.dot}),"".concat(l,"%")]}):null!=i?i:u.label}))},i=new Set(["DONE","COMPLETED","FAILED"]);exports.IngestionStatusChip=a,exports.IngestionStatusComponent=function(e){var n,r,l,o,u=e.ingestionId,c=e.status,d=e.wsBaseUrl,g=e.showPercentage,p=void 0===g||g,f=e.statusMap,v=e.customStatusConfigs,m=!!c&&i.has(c.toUpperCase()),b=t.useIngestionWebSocket(!m&&u?u:null,d).data,x=m?c:null!==(r=null!==(n=null==b?void 0:b.ingestionStatus)&&void 0!==n?n:c)&&void 0!==r?r:"",C=x?function(e,s){if(!e)return"custom";if(s){if(void 0!==s[e])return s[e];var n=e.toUpperCase();if(void 0!==s[n])return s[n]}return"custom"}(x,f):"pending",I=v?null!==(o=null!==(l=v[C])&&void 0!==l?l:v[x])&&void 0!==o?o:v[x.toUpperCase()]:void 0,h=function(){if(!m&&p)return void 0!==(null==b?void 0:b.currentProgress)?Math.max(5,b.currentProgress):"in_progress"===C?5:void 0}();return s.jsx(a,{status:C,percentage:h,customConfig:I})};
2
2
  //# sourceMappingURL=IngestionStatusComponent.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),s=require("react"),n=require("react-markdown"),c=require("rehype-raw");require("./CitationComponent.css.js");var a=require("lucide-react"),t=require("../icons/cognitiveBrain.svg.js"),r=require("../icons/aiMagic.svg.js"),_=require("./CitationAnchor.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=d(s),o=d(n),x=d(c),m=function(s){var n=s.text,c=s.item;return i.jsx(o.default,e.__assign({rehypePlugins:[x.default],components:{ol:function(s){var n=s.children;return i.jsx("ol",e.__assign({className:"md-ol"},{children:n}))},ul:function(s){var n=s.children;return i.jsx("ul",e.__assign({className:"md-ul"},{children:n}))},li:function(s){var n=s.children;return i.jsx("li",e.__assign({className:"md-li"},{children:n}))},a:function(e){e.node;var s=e.href,n=e.children;return i.jsx(_.default,{href:s,children:n,metaData:{citations:c.citations,docData:c.docData}})}}},{children:n.replace(/<br\s*\/?>/gi,"\n")}))};exports.default=function(n){var c=n.item,_=n.title,d=void 0===_?"Cognitive Decisioning AI":_,o=n.relevanceScore,x=void 0===o?0:o,h=n.showRelevanceScore,v=void 0===h||h,g=n.reason,j=void 0===g?"No reasoning provided.":g,u=n.impact,N=void 0===u?"No Impact provided.":u,p=n.explaination,f=void 0===p?"No explaination provided.":p,y=n.gap,b=void 0===y?"None":y,C=n.onClose,q=void 0===C?function(){}:C,H=n.onAccept,B=n.onReject,M=n.showResolveBtns,L=void 0!==M&&M,R=n.sections,k=n.leftIcon,w=n.scoreIcon,D=n.className,I=s.useMemo(function(){var e=Number(x);return Number.isNaN(e)?0:Math.max(0,Math.min(100,Math.round(e)))},[x]),T=s.useMemo(function(){return function(e){if(!e)return!0;var i=e.trim().toLowerCase();return"none"===i||"no gap"===i||"no gaps"===i||"n/a"===i}(b)?"1. No gaps identified.":b},[b]);return i.jsx("div",e.__assign({className:"cite-acc ".concat(D||"")},{children:R&&R.length>0?R.map(function(s){return!1===s.show?null:i.jsxs("div",e.__assign({className:"cite-acc__explain-body ".concat(s.bodyClassName||"")},{children:[i.jsxs("div",e.__assign({className:"cite-acc__innerHeader"},{children:[i.jsx("div",e.__assign({className:"cite-acc__innerHeaderLeft"},{children:i.jsx("div",{children:i.jsx("div",e.__assign({className:"cite-acc__innerTitle"},{children:s.title}))})})),i.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),q&&q()}},{children:i.jsx(a.ChevronUp,{})}))]})),i.jsx("div",e.__assign({className:"cite-acc__innerBody text-sm text-gray-600"},{children:"string"==typeof s.content?i.jsx(m,{text:s.content,item:s.item||c||{}}):s.content}))]}),s.id||s.title)}):i.jsxs(i.Fragment,{children:[i.jsxs("div",e.__assign({className:"cite-acc__explain-body"},{children:[i.jsxs("div",e.__assign({className:"cite-acc__innerHeader"},{children:[i.jsx("div",e.__assign({className:"cite-acc__innerHeaderLeft"},{children:i.jsx("div",{children:i.jsx("div",e.__assign({className:"cite-acc__innerTitle"},{children:"Impact"}))})})),i.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),q&&q()}},{children:i.jsx(a.ChevronUp,{})}))]})),i.jsx("div",e.__assign({className:"cite-acc__innerBody text-sm text-gray-600"},{children:i.jsx(m,{text:N||"",item:c||{}})}))]})),i.jsxs("div",e.__assign({className:"cite-acc__explain-body"},{children:[i.jsx("div",e.__assign({className:"cite-acc__innerHeader"},{children:i.jsx("div",e.__assign({className:"cite-acc__innerHeaderLeft"},{children:i.jsx("div",{children:i.jsx("div",e.__assign({className:"cite-acc__innerTitle"},{children:"Explaination"}))})}))})),i.jsx("div",e.__assign({className:"cite-acc__innerBody text-sm text-gray-600"},{children:i.jsx(m,{text:f||"",item:{}})}))]})),L&&i.jsxs("div",e.__assign({className:"cite-acc__btn-container"},{children:[i.jsx("button",e.__assign({className:"btn-reject",onClick:B},{children:"Reject"})),i.jsx("button",e.__assign({className:"btn-accept",onClick:H},{children:"Accept"}))]})),i.jsxs("div",e.__assign({className:"cite-acc__header"},{children:[i.jsxs("div",e.__assign({className:"cite-acc__headerLeft"},{children:[i.jsx("span",e.__assign({className:"cite-acc__titleIcon"},{children:k?"function"==typeof k?l.default.createElement(k):k:i.jsx(t.ReactComponent,{})})),i.jsx("div",e.__assign({className:"cite-acc__title"},{children:d}))]})),i.jsx("div",e.__assign({className:"cite-acc__headerRight"},{children:v&&i.jsxs("span",e.__assign({className:"cite-acc__scoreBadge"},{children:[w?"function"==typeof w?l.default.createElement(w):w:i.jsx(r.ReactComponent,{}),i.jsxs("span",e.__assign({className:"cite-acc__scoreText"},{children:[I,"%"]}))]}))}))]})),i.jsxs("div",e.__assign({className:"cite-acc__explain-body"},{children:[i.jsx("div",e.__assign({className:"cite-acc__innerHeader"},{children:i.jsx("div",e.__assign({className:"cite-acc__innerHeaderLeft"},{children:i.jsx("div",{children:i.jsx("div",e.__assign({className:"cite-acc__innerTitle"},{children:"Decision Making Factors"}))})}))})),i.jsx("div",e.__assign({className:"cite-acc__innerBody text-sm text-gray-600"},{children:i.jsx(m,{text:j||"",item:c||{}})}))]})),i.jsxs("div",e.__assign({className:"cite-acc__explain-body cite-acc__explain-body_border"},{children:[i.jsx("div",e.__assign({className:"cite-acc__innerHeader"},{children:i.jsx("div",e.__assign({className:"cite-acc__innerHeaderLeft"},{children:i.jsx("div",{children:i.jsx("div",e.__assign({className:"cite-acc__innerTitle"},{children:"Gaps in Decision"}))})}))})),i.jsx("div",e.__assign({className:"cite-acc__innerBody text-sm text-gray-600"},{children:i.jsx(m,{text:T||"",item:c||{}})}))]}))]})}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),s=require("react"),n=require("../Popups/PopupDefaults.js"),a=require("react-markdown"),c=require("rehype-raw");require("./CitationComponent.css.js");var t=require("lucide-react"),r=require("../icons/cognitiveBrain.svg.js"),d=require("../icons/aiMagic.svg.js"),l=require("./CitationAnchor.js");function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=_(s),x=_(a),u=_(c),m=function(s){var n=s.text,a=s.item;return i.jsx(x.default,e.__assign({rehypePlugins:[u.default],components:{ol:function(s){var n=s.children;return i.jsx("ol",e.__assign({className:"md-ol"},{children:n}))},ul:function(s){var n=s.children;return i.jsx("ul",e.__assign({className:"md-ul"},{children:n}))},li:function(s){var n=s.children;return i.jsx("li",e.__assign({className:"md-li"},{children:n}))},a:function(e){e.node;var s=e.href,n=e.children;return i.jsx(l.default,{href:s,children:n,metaData:{citations:a.citations,docData:a.docData}})}}},{children:n.replace(/<br\s*\/?>/gi,"\n")}))};exports.default=function(a){var c=a.item,l=a.title,_=void 0===l?"Cognitive Decisioning AI":l,x=a.relevanceScore,u=void 0===x?0:x,g=a.showRelevanceScore,v=void 0===g||g,h=a.reason,j=void 0===h?"No reasoning provided.":h,p=a.impact,N=void 0===p?"No Impact provided.":p,f=a.explaination,y=void 0===f?"No explaination provided.":f,b=a.gap,C=void 0===b?"None":b,H=a.onClose,q=void 0===H?function(){}:H,B=a.onAccept,D=a.onReject,M=a.showResolveBtns,A=void 0!==M&&M,L=a.sections,R=a.leftIcon,k=a.scoreIcon,w=a.className,I=a.customStyles,P=void 0===I?{}:I,T=s.useMemo(function(){var e=Number(u);return Number.isNaN(e)?0:Math.max(0,Math.min(100,Math.round(e)))},[u]),E=s.useMemo(function(){return function(e){if(!e)return!0;var i=e.trim().toLowerCase();return"none"===i||"no gap"===i||"no gaps"===i||"n/a"===i}(C)?"1. No gaps identified.":C},[C]);return i.jsx("div",e.__assign({className:"cite-acc ".concat(w||""),style:e.__assign(e.__assign({},n.default.CitationAccordionDefaults.container),null==P?void 0:P.container)},{children:L&&L.length>0?L.map(function(s){return!1===s.show?null:i.jsxs("div",e.__assign({className:"cite-acc__explain-body ".concat(s.bodyClassName||"")},{children:[i.jsxs("div",e.__assign({className:"cite-acc__innerHeader",style:e.__assign(e.__assign({},n.default.CitationAccordionDefaults.innerHeader),null==P?void 0:P.innerHeader)},{children:[i.jsx("div",e.__assign({className:"cite-acc__innerHeaderLeft"},{children:i.jsx("div",{children:i.jsx("div",e.__assign({className:"cite-acc__innerTitle"},{children:s.title}))})})),i.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),q&&q()}},{children:i.jsx(t.ChevronUp,{})}))]})),i.jsx("div",e.__assign({className:"cite-acc__innerBody text-sm text-gray-600",style:e.__assign(e.__assign({},n.default.CitationAccordionDefaults.innerBody),null==P?void 0:P.innerBody)},{children:"string"==typeof s.content?i.jsx(m,{text:s.content,item:s.item||c||{}}):s.content}))]}),s.id||s.title)}):i.jsxs(i.Fragment,{children:[i.jsxs("div",e.__assign({className:"cite-acc__explain-body"},{children:[i.jsxs("div",e.__assign({className:"cite-acc__innerHeader"},{children:[i.jsx("div",e.__assign({className:"cite-acc__innerHeaderLeft"},{children:i.jsx("div",{children:i.jsx("div",e.__assign({className:"cite-acc__innerTitle"},{children:"Impact"}))})})),i.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),q&&q()}},{children:i.jsx(t.ChevronUp,{})}))]})),i.jsx("div",e.__assign({className:"cite-acc__innerBody text-sm text-gray-600"},{children:i.jsx(m,{text:N||"",item:c||{}})}))]})),i.jsxs("div",e.__assign({className:"cite-acc__explain-body"},{children:[i.jsx("div",e.__assign({className:"cite-acc__innerHeader"},{children:i.jsx("div",e.__assign({className:"cite-acc__innerHeaderLeft"},{children:i.jsx("div",{children:i.jsx("div",e.__assign({className:"cite-acc__innerTitle"},{children:"Explaination"}))})}))})),i.jsx("div",e.__assign({className:"cite-acc__innerBody text-sm text-gray-600"},{children:i.jsx(m,{text:y||"",item:{}})}))]})),A&&i.jsxs("div",e.__assign({className:"cite-acc__btn-container"},{children:[i.jsx("button",e.__assign({className:"btn-reject",onClick:D},{children:"Reject"})),i.jsx("button",e.__assign({className:"btn-accept",onClick:B},{children:"Accept"}))]})),i.jsxs("div",e.__assign({className:"cite-acc__header"},{children:[i.jsxs("div",e.__assign({className:"cite-acc__headerLeft"},{children:[i.jsx("span",e.__assign({className:"cite-acc__titleIcon"},{children:R?"function"==typeof R?o.default.createElement(R):R:i.jsx(r.ReactComponent,{})})),i.jsx("div",e.__assign({className:"cite-acc__title"},{children:_}))]})),i.jsx("div",e.__assign({className:"cite-acc__headerRight"},{children:v&&i.jsxs("span",e.__assign({className:"cite-acc__scoreBadge"},{children:[k?"function"==typeof k?o.default.createElement(k):k:i.jsx(d.ReactComponent,{}),i.jsxs("span",e.__assign({className:"cite-acc__scoreText"},{children:[T,"%"]}))]}))}))]})),i.jsxs("div",e.__assign({className:"cite-acc__explain-body"},{children:[i.jsx("div",e.__assign({className:"cite-acc__innerHeader"},{children:i.jsx("div",e.__assign({className:"cite-acc__innerHeaderLeft"},{children:i.jsx("div",{children:i.jsx("div",e.__assign({className:"cite-acc__innerTitle"},{children:"Decision Making Factors"}))})}))})),i.jsx("div",e.__assign({className:"cite-acc__innerBody text-sm text-gray-600"},{children:i.jsx(m,{text:j||"",item:c||{}})}))]})),i.jsxs("div",e.__assign({className:"cite-acc__explain-body cite-acc__explain-body_border"},{children:[i.jsx("div",e.__assign({className:"cite-acc__innerHeader"},{children:i.jsx("div",e.__assign({className:"cite-acc__innerHeaderLeft"},{children:i.jsx("div",{children:i.jsx("div",e.__assign({className:"cite-acc__innerTitle"},{children:"Gaps in Decision"}))})}))})),i.jsx("div",e.__assign({className:"cite-acc__innerBody text-sm text-gray-600"},{children:i.jsx(m,{text:E||"",item:c||{}})}))]}))]})}))};
2
2
  //# sourceMappingURL=CognitiveComponent.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("lucide-react"),o=require("react"),t=require("./ToneToggle.js"),s=[{color:"#1D9E75",angle:-90,arcD:"M1 13 A10 10 0 0 1 1 13"},{color:"#BA7517",angle:0,arcD:"M1 13 A10 10 0 0 1 11 3"},{color:"#E24B4A",angle:90,arcD:"M1 13 A10 10 0 0 1 21 13"}],r=function(i){var o=i.toneIndex,t=i.configs,r=void 0===t?s:t,a=r[Math.min(o,r.length-1)]||r[1]||r[0],l=a.color,d=a.angle,c=a.arcD,g=(d-90)*Math.PI/180,p=11+9*Math.cos(g),x=13+9*Math.sin(g);return n.jsxs("svg",e.__assign({width:"22",height:"14",viewBox:"0 0 22 14",fill:"none"},{children:[n.jsx("path",{d:"M1 13 A10 10 0 0 1 21 13",stroke:"#e5e5e5",strokeWidth:"2.5",strokeLinecap:"round"}),n.jsx("path",{d:c,stroke:l,strokeWidth:"2.5",strokeLinecap:"round"}),n.jsx("line",{x1:"11",y1:"13",x2:p,y2:x,stroke:l,strokeWidth:"2",strokeLinecap:"round"})]}))},a=function(i){var o=i.type,t=i.customStyles,s=void 0===t?{}:t,r=e.__assign(e.__assign({},{High:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #FECACA",background:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:"500"},Medium:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #F2E5A1",background:"#FFFBEB",color:"#B45309",fontSize:"11px",fontWeight:"500"},Low:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #8098F9",background:"#DBEAFE",color:"#444CE7",fontSize:"11px",fontWeight:"500"}}),s),a=r[o]||r.Medium;return n.jsx("div",e.__assign({style:a},{children:o}))},l=["Lenient","Balanced","Aggressive"],d={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"};exports.default=function(c){var g,p,x,u,f=c.onClose,_=c.aiReason,h=c.onAccept,y=c.onReject,m=c.onIterate,v=c.initialTone,j=c.onRegenerate,b=c.labels,C=void 0===b?{}:b,k=c.toneLevelsConfig,I=void 0===k?l:k,B=c.toneColorsConfig,S=void 0===B?d:B,A=c.dialConfigs,z=void 0===A?s:A,E=c.customStyles,T=void 0===E?{}:E,R=c.severityChipStyles,w=void 0===R?{}:R,D=c.customIcons,W=void 0===D?{}:D,M=I.findIndex(function(e){return e===v});-1===M&&(M=1);var F=o.useState(!0),L=F[0],H=F[1],q=o.useState(!1),P=q[0],O=q[1],X=o.useState(M),G=X[0],J=X[1],K=o.useState(M)[0],N=I[G],Q=S[N]||"#BA7517",U=G!==K;return n.jsxs("div",e.__assign({onClick:function(e){return e.stopPropagation()},style:e.__assign({width:"350px",background:"#fff",border:"1px solid #ddd",borderRadius:"8px",padding:"16px",maxHeight:"400px",overflow:"auto"},T.root)},{children:[n.jsxs("div",e.__assign({style:e.__assign({display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},T.header)},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:6}},{children:[n.jsx("span",{children:W.summaryIcon||n.jsx(i.Info,{size:16,color:"#E24B4A"})}),n.jsx("span",e.__assign({style:{fontSize:11,fontWeight:500,letterSpacing:"0.08em",color:"#E24B4A",textTransform:"uppercase"}},{children:C.summaryHeader||"Summary"}))]})),n.jsx("button",e.__assign({onClick:f,style:{background:"none",border:"none",cursor:"pointer",fontSize:16,color:"#888",lineHeight:1,padding:0}},{children:"✕"}))]})),n.jsx("p",e.__assign({style:e.__assign({fontSize:15,fontWeight:500,margin:"0 0 8px",color:"#111"},T.bodyText)},{children:null===(g=null==_?void 0:_.deviation_details)||void 0===g?void 0:g.deviation_title})),n.jsx("p",e.__assign({style:e.__assign({fontSize:13,color:"#666",lineHeight:1.6,margin:"0 0 14px"},T.bodyText)},{children:null===(p=null==_?void 0:_.deviation_details)||void 0===p?void 0:p.deviation_summary})),n.jsxs("div",e.__assign({style:e.__assign({marginBottom:14,borderTop:"0.5px solid #eee",paddingTop:12},T.impactContainer)},{children:[n.jsxs("div",e.__assign({style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},{children:[n.jsxs("button",e.__assign({onClick:function(){return H(!L)},style:{display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",padding:0,width:"100%"}},{children:[n.jsx("span",e.__assign({style:{fontSize:11,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.08em",color:"#E24B4A"}},{children:C.impactHeader||"Impact"})),n.jsx("span",e.__assign({style:{fontSize:12,color:"#E24B4A",transition:"transform 0.2s",display:"flex",alignItems:"center",transform:L?"rotate(180deg)":"rotate(0deg)"}},{children:n.jsx(i.ChevronDown,{size:16,color:"#E24B4A"})}))]})),n.jsx(a,{type:(null==_?void 0:_.severity)||"Medium",customStyles:w})]})),L&&n.jsx("p",e.__assign({style:{fontSize:13,color:"#666",lineHeight:1.6,margin:"8px 0 0"}},{children:null!==(u=null===(x=null==_?void 0:_.deviation_details)||void 0===x?void 0:x.deviation_impact)&&void 0!==u?u:C.fallbackImpact||"This change reduces compliance obligations and lowers contractual risk thresholds."}))]})),n.jsxs("div",e.__assign({style:e.__assign({display:"flex",gap:8,marginBottom:18},T.actionContainer)},{children:[n.jsxs("button",e.__assign({style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,fontSize:12,fontWeight:500,padding:"7px 4px",borderRadius:8,border:"0.5px solid #ccc",background:"#fff",color:"#64748B",cursor:"pointer"},onClick:m},{children:[W.iterateIcon||n.jsx(i.PenLine,{size:16,color:"#64748B"}),C.btnIterate||"Iterate"]}),"Iterate"),n.jsxs("button",e.__assign({style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,fontSize:12,fontWeight:500,padding:"7px 4px",borderRadius:8,border:"0.5px solid #ccc",background:"#fff",color:"#10B981",cursor:"pointer"},onClick:h},{children:[W.acceptIcon||n.jsx(i.CheckCircle,{size:16,color:"#10B981"}),C.btnAccept||"Approve"]}),"Accept"),n.jsxs("button",e.__assign({style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,fontSize:12,fontWeight:500,padding:"7px 4px",borderRadius:8,border:"0.5px solid #ccc",background:"#fff",color:"#DC2626",cursor:"pointer"},onClick:y},{children:[W.rejectIcon||n.jsx(i.XCircle,{size:16,color:"#DC2626"}),C.btnReject||"Reject"]}),"reject")]})),n.jsxs("div",e.__assign({style:e.__assign({borderTop:"0.5px solid #eee",paddingTop:14},T.toneContainer)},{children:[n.jsxs("button",e.__assign({onClick:function(){return O(!P)},style:{display:"flex",alignItems:"center",width:"100%",background:"none",border:"none",cursor:"pointer",padding:0,marginBottom:4}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:8}},{children:[n.jsx(r,{toneIndex:G,configs:z}),n.jsx("span",e.__assign({style:{fontSize:13,fontWeight:500,color:"#111"}},{children:C.toneHeader||"Redline Tone"}))]})),n.jsx("span",e.__assign({style:{transition:"transform 0.2s",display:"flex",alignItems:"center",transform:P?"rotate(180deg)":"rotate(0deg)"}},{children:n.jsx(i.ChevronDown,{size:16,color:"#111"})}))]})),P&&n.jsxs(n.Fragment,{children:[n.jsx("p",e.__assign({style:{fontSize:12,color:"#888",margin:"0 0 12px"}},{children:C.toneDescription||"Controls how assertively AI is redlining"})),n.jsx(t.ToneToggle,{isDirty:U,onToneChange:function(e){J(e)},toneColor:Q,toneIndex:G,onClickRegenerate:function(){return null==j?void 0:j(N)},toneLabels:I})]})]}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("lucide-react"),o=require("react"),s=require("./ToneToggle.js"),t=[{color:"#1D9E75",angle:-90,arcD:"M1 13 A10 10 0 0 1 1 13"},{color:"#BA7517",angle:0,arcD:"M1 13 A10 10 0 0 1 11 3"},{color:"#E24B4A",angle:90,arcD:"M1 13 A10 10 0 0 1 21 13"}],l=function(n){var o=n.toneIndex,s=n.configs,l=void 0===s?t:s,a=l[Math.min(o,l.length-1)]||l[1]||l[0],r=a.color,d=a.angle,c=a.arcD,g=(d-90)*Math.PI/180,u=11+9*Math.cos(g),_=13+9*Math.sin(g);return i.jsxs("svg",e.__assign({width:"22",height:"14",viewBox:"0 0 22 14",fill:"none"},{children:[i.jsx("path",{d:"M1 13 A10 10 0 0 1 21 13",stroke:"#e5e5e5",strokeWidth:"2.5",strokeLinecap:"round"}),i.jsx("path",{d:c,stroke:r,strokeWidth:"2.5",strokeLinecap:"round"}),i.jsx("line",{x1:"11",y1:"13",x2:u,y2:_,stroke:r,strokeWidth:"2",strokeLinecap:"round"})]}))},a=function(n){var o=n.type,s=n.customStyles,t=void 0===s?{}:s,l=e.__assign(e.__assign({},{High:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #FECACA",background:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:"500"},Medium:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #F2E5A1",background:"#FFFBEB",color:"#B45309",fontSize:"11px",fontWeight:"500"},Low:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #8098F9",background:"#DBEAFE",color:"#444CE7",fontSize:"11px",fontWeight:"500"}}),t),a=l[o]||l.Medium;return i.jsx("div",e.__assign({style:a},{children:o}))},r=["Lenient","Balanced","Aggressive"],d={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},c={width:"350px",background:"#fff",border:"1px solid #ddd",borderRadius:"8px",padding:"16px",maxHeight:"400px",overflow:"auto"},g={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},u={fontSize:11,fontWeight:500,letterSpacing:"0.08em",color:"#E24B4A",textTransform:"uppercase"},_={fontSize:15,fontWeight:500,margin:"0 0 8px",color:"#111"},v={fontSize:13,color:"#666",lineHeight:1.6,margin:"0 0 14px"},p={marginBottom:14,borderTop:"0.5px solid #eee",paddingTop:12},x={display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",padding:0,width:"100%"},m={fontSize:11,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.08em",color:"#E24B4A"},y={display:"flex",gap:8,marginBottom:18},f={flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,fontSize:12,fontWeight:500,padding:"7px 4px",borderRadius:8,border:"0.5px solid #ccc",background:"#fff",cursor:"pointer"},h={background:"none",border:"none",cursor:"pointer",fontSize:16,color:"#888",lineHeight:1,padding:0},S={borderTop:"0.5px solid #eee",paddingTop:14},j={display:"flex",alignItems:"center",width:"100%",background:"none",border:"none",cursor:"pointer",padding:0,marginBottom:4};exports.default=function(b){var C,B,k,D,I,A,z,T,E,w,M,R,F,W,L,H,q,P,O,X=b.onClose,G=b.aiReason,J=b.onAccept,K=b.onReject,N=b.onIterate,Q=b.initialTone,U=b.onRegenerate,V=b.labels,Y=void 0===V?{}:V,Z=b.toneLevelsConfig,$=void 0===Z?r:Z,ee=b.toneColorsConfig,ie=void 0===ee?d:ee,ne=b.dialConfigs,oe=void 0===ne?t:ne,se=b.customStyles,te=void 0===se?{}:se,le=b.severityChipStyles,ae=void 0===le?{}:le,re=b.customIcons,de=void 0===re?{}:re,ce=$.findIndex(function(e){return e===Q});-1===ce&&(ce=1);var ge=o.useState(!0),ue=ge[0],_e=ge[1],ve=o.useState(!1),pe=ve[0],xe=ve[1],me=o.useState(ce),ye=me[0],fe=me[1],he=o.useState(ce)[0],Se=$[ye],je=ie[Se]||"#BA7517",be=ye!==he;return i.jsxs("div",e.__assign({onClick:function(e){return e.stopPropagation()},style:e.__assign(e.__assign({},c),null===(C=null==te?void 0:te.DeviationSummaryStyles)||void 0===C?void 0:C.root)},{children:[i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},g),null===(B=null==te?void 0:te.DeviationSummaryStyles)||void 0===B?void 0:B.header)},{children:[i.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:6}},{children:[i.jsx("span",{children:de.summaryIcon||i.jsx(n.Info,{size:16,color:"#E24B4A"})}),i.jsx("span",e.__assign({style:e.__assign(e.__assign({},u),null===(k=null==te?void 0:te.DeviationSummaryStyles)||void 0===k?void 0:k.title)},{children:Y.summaryHeader||"Summary"}))]})),i.jsx("button",e.__assign({onClick:X,style:e.__assign(e.__assign({},h),null===(D=null==te?void 0:te.DeviationSummaryStyles)||void 0===D?void 0:D.closeBtn)},{children:"✕"}))]})),i.jsx("p",e.__assign({style:e.__assign(e.__assign({},_),null===(I=null==te?void 0:te.DeviationSummaryStyles)||void 0===I?void 0:I.bodyText)},{children:null===(A=null==G?void 0:G.deviation_details)||void 0===A?void 0:A.deviation_title})),i.jsx("p",e.__assign({style:e.__assign(e.__assign({},v),null===(z=null==te?void 0:te.DeviationSummaryStyles)||void 0===z?void 0:z.summary)},{children:null===(T=null==G?void 0:G.deviation_details)||void 0===T?void 0:T.deviation_summary})),i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},p),null===(E=null==te?void 0:te.DeviationSummaryStyles)||void 0===E?void 0:E.impactContainer)},{children:[i.jsxs("div",e.__assign({style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},{children:[i.jsxs("button",e.__assign({onClick:function(){return _e(!ue)},style:e.__assign(e.__assign({},x),null===(w=null==te?void 0:te.DeviationSummaryStyles)||void 0===w?void 0:w.impactToggle)},{children:[i.jsx("span",e.__assign({style:e.__assign(e.__assign({},m),null===(M=null==te?void 0:te.DeviationSummaryStyles)||void 0===M?void 0:M.impactToggleLabel)},{children:Y.impactHeader||"Impact"})),i.jsx("span",e.__assign({style:{fontSize:12,color:"#E24B4A",transition:"transform 0.2s",display:"flex",alignItems:"center",transform:ue?"rotate(180deg)":"rotate(0deg)"}},{children:i.jsx(n.ChevronDown,{size:16,color:"#E24B4A"})}))]})),i.jsx(a,{type:(null==G?void 0:G.severity)||"Medium",customStyles:ae})]})),ue&&i.jsx("p",e.__assign({style:{fontSize:13,color:"#666",lineHeight:1.6,margin:"8px 0 0"}},{children:null!==(F=null===(R=null==G?void 0:G.deviation_details)||void 0===R?void 0:R.deviation_impact)&&void 0!==F?F:Y.fallbackImpact||"This change reduces compliance obligations and lowers contractual risk thresholds."}))]})),i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},y),null===(W=null==te?void 0:te.DeviationSummaryStyles)||void 0===W?void 0:W.actionContainer)},{children:[i.jsxs("button",e.__assign({style:e.__assign(e.__assign(e.__assign({},f),null===(L=null==te?void 0:te.DeviationSummaryStyles)||void 0===L?void 0:L.actionBtn),{color:"#64748B"}),onClick:N},{children:[de.iterateIcon||i.jsx(n.PenLine,{size:16,color:"#64748B"}),Y.btnIterate||"Iterate"]}),"Iterate"),i.jsxs("button",e.__assign({style:e.__assign(e.__assign(e.__assign({},f),null===(H=null==te?void 0:te.DeviationSummaryStyles)||void 0===H?void 0:H.actionBtn),{color:"#10B981"}),onClick:J},{children:[de.acceptIcon||i.jsx(n.CheckCircle,{size:16,color:"#10B981"}),Y.btnAccept||"Approve"]}),"Accept"),i.jsxs("button",e.__assign({style:e.__assign(e.__assign(e.__assign({},f),null===(q=null==te?void 0:te.DeviationSummaryStyles)||void 0===q?void 0:q.actionBtn),{color:"#DC2626"}),onClick:K},{children:[de.rejectIcon||i.jsx(n.XCircle,{size:16,color:"#DC2626"}),Y.btnReject||"Reject"]}),"reject")]})),i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},S),null===(P=null==te?void 0:te.DeviationSummaryStyles)||void 0===P?void 0:P.toneContainer)},{children:[i.jsxs("button",e.__assign({onClick:function(){return xe(!pe)},style:e.__assign(e.__assign({},j),null===(O=null==te?void 0:te.DeviationSummaryStyles)||void 0===O?void 0:O.toneToggleBtn)},{children:[i.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:8}},{children:[i.jsx(l,{toneIndex:ye,configs:oe}),i.jsx("span",e.__assign({style:{fontSize:13,fontWeight:500,color:"#111"}},{children:Y.toneHeader||"Redline Tone"}))]})),i.jsx("span",e.__assign({style:{transition:"transform 0.2s",display:"flex",alignItems:"center",transform:pe?"rotate(180deg)":"rotate(0deg)"}},{children:i.jsx(n.ChevronDown,{size:16,color:"#111"})}))]})),pe&&i.jsxs(i.Fragment,{children:[i.jsx("p",e.__assign({style:{fontSize:12,color:"#888",margin:"0 0 12px"}},{children:Y.toneDescription||"Controls how assertively AI is redlining"})),i.jsx(s.ToneToggle,{isDirty:be,onToneChange:function(e){fe(e)},toneColor:je,toneIndex:ye,onClickRegenerate:function(){return null==U?void 0:U(Se)},toneLabels:$})]})]}))]}))};
2
2
  //# sourceMappingURL=DeviationSummary.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),t=require("../icons/History.svg.js"),o=require("../icons/message-chat-square.svg.js"),s=require("./ToneToggle.js"),a=[{id:"chat",icon:n.jsx(o.ReactComponent,{}),label:"Chat",description:"Type on what basis you want to iterate"},{id:"risk",icon:n.jsx(o.ReactComponent,{}),label:"Shift the risk",description:"Adjust how aggressive or lenient the language is"},{id:"history",icon:n.jsx(t.ReactComponent,{}),label:"Historical Recommendations",description:"Pull from past recommended clauses"}],r=[{id:"1",filename:"Mutual_DA2.pdf",excerpt:'"...shall protect Confidential Information using at least the same degree of care as it uses to protect its own confidential information, but no less than reasonable c..."',tab:"Balanced"},{id:"2",filename:"Tech NDA.pdf",excerpt:'"...protect confidential information using reasonable care and appropriate safeguards..."',tab:"Balanced"},{id:"3",filename:"Corp NDA.pdf",excerpt:'"...shall use best efforts to protect any disclosed confidential materials from unauthorised access or disclosure..."',tab:"Aggressive"},{id:"4",filename:"Vendor Agreement.pdf",excerpt:'"...may use disclosed information solely for the stated purpose with no special handling required..."',tab:"Lenient"}],l=["Lenient","Balanced","Aggressive"],d={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},c=["Grounded","Innovative"];function g(i){var t=i.chatTitle,o=i.chatBody,s=i.mergedStyles,a=void 0===s?h:s;return n.jsx("div",e.__assign({style:a.body},{children:n.jsxs("div",e.__assign({style:a.chatBanner},{children:[n.jsx("p",e.__assign({style:a.chatBannerTitle},{children:t})),n.jsx("p",e.__assign({style:a.chatBannerBody},{children:o}))]}))}))}function f(t){var o=t.initialTone,a=t.onRiskRegenerate,r=t.riskMode,g=t.toneLevelsConfig,f=void 0===g?l:g,p=t.toneColorsConfig,u=void 0===p?d:p,x=t.riskModesConfig,y=void 0===x?c:x,m=t.mergedStyles,b=void 0===m?h:m,_=f.findIndex(function(e){return e===o});-1===_&&(_=1);var v=i.useState(r||y[0]||"Grounded"),C=v[0],j=v[1],k=i.useState(_),B=k[0],S=k[1],T=i.useState(_)[0],A=f[B],R=u[A]||"#BA7517",w=B!==T||r!==C;return n.jsxs("div",e.__assign({style:b.body},{children:[n.jsx("div",e.__assign({style:{display:"flex",gap:8,marginBottom:16}},{children:y.map(function(i){return n.jsxs("button",e.__assign({onClick:function(){return j(i)},style:{flex:1,display:"flex",alignItems:"center",gap:8,padding:"10px 12px",borderRadius:10,border:"1px solid ".concat(C===i?"#7c5cbf":"#e0ddd8"),background:"#fff",cursor:"pointer",fontSize:13,fontWeight:500,color:"#1a1a1a"}},{children:[n.jsx("span",e.__assign({style:{width:16,height:16,borderRadius:"50%",border:"2px solid ".concat(C===i?"#7c5cbf":"#ccc"),display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},{children:C===i&&n.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:"#7c5cbf"}})})),i.charAt(0).toUpperCase()+i.slice(1)]}),i)})})),n.jsx(s.ToneToggle,{onToneChange:function(e){return S(e)},toneColor:R,isDirty:w,toneIndex:B,onClickRegenerate:function(){return null==a?void 0:a({tone:A,mode:C})}})]}))}function p(t){var o=t.onApply,s=t.historicalClausesData,a=void 0===s?r:s,d=t.toneLevelsConfig,c=void 0===d?l:d,g=t.mergedStyles,f=void 0===g?h:g,p=c.length>1?c[1]:c[0]||"Balanced",u=i.useState(p),x=u[0],y=u[1],m=a.filter(function(e){return e.tab===x});return n.jsxs("div",e.__assign({style:f.body},{children:[n.jsx("div",e.__assign({style:f.segmentedControl},{children:c.map(function(i){return n.jsx("button",e.__assign({onClick:function(){return y(i)},style:e.__assign(e.__assign({},f.segmentedBtn),x===i?f.segmentedBtnActive:{})},{children:i.charAt(0).toUpperCase()+i.slice(1)}),i)})})),n.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:10,marginTop:12}},{children:[m.map(function(i){return n.jsxs("button",e.__assign({onClick:function(){return null==o?void 0:o({type:"history",value:i.excerpt})},style:f.clauseCard},{children:[n.jsx("p",e.__assign({style:f.clauseFilename},{children:i.filename})),n.jsx("p",e.__assign({style:f.clauseExcerpt},{children:i.excerpt}))]}),i.id)}),0===m.length&&n.jsx("p",e.__assign({style:{fontSize:12,color:"#aaa",textAlign:"center",padding:"12px 0"}},{children:"No clauses for this tone"}))]}))]}))}function u(e){var i=e.type,t=e.onRiskRegenerate,o=e.initialTone,s=e.riskMode,a=e.onApply,r=e.chatTitle,l=e.chatBody,d=e.historicalClausesData,c=e.toneLevelsConfig,u=e.toneColorsConfig,x=e.riskModesConfig,y=e.mergedStyles,m=void 0===y?h:y;return"chat"===i?n.jsx(g,{chatTitle:r,chatBody:l,mergedStyles:m}):"risk"===i?n.jsx(f,{onRiskRegenerate:t,initialTone:o,riskMode:s,toneLevelsConfig:c,toneColorsConfig:u,riskModesConfig:x,mergedStyles:m}):"history"===i?n.jsx(p,{onApply:a,historicalClausesData:d,toneLevelsConfig:c,mergedStyles:m}):null}var h={card:{background:"#fff",border:"0.5px solid #e8e7e3",borderRadius:14,width:300,maxHeight:"350px",overflow:"auto",fontFamily:"system-ui, sans-serif"},header:{display:"flex",alignItems:"center",gap:8,padding:"14px 16px",borderBottom:"0.5px solid #e8e7e3"},backBtn:{background:"none",border:"none",cursor:"pointer",fontSize:20,color:"#888",padding:0,lineHeight:1},headerTitle:{fontSize:14,fontWeight:500,color:"#1a1a1a"},row:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 16px",cursor:"pointer",border:"none",textAlign:"left",gap:10,boxSizing:"border-box",backgroundColor:"transparent"},rowLeft:{display:"flex",alignItems:"flex-start",gap:10,flex:1},icon:{fontSize:16,color:"#666",marginTop:1,flexShrink:0},label:{margin:0,fontSize:14,fontWeight:500,color:"#1a1a1a"},desc:{margin:"2px 0 0",fontSize:12,color:"#888",lineHeight:1.4},chevron:{fontSize:18,color:"#aaa",flexShrink:0,display:"inline-block",transition:"transform 0.2s"},body:{padding:"0 16px 14px 16px"},chatBanner:{background:"#eef4fd",border:"1px solid #c5d8f7",borderRadius:10,padding:"12px 14px",marginBottom:10},chatBannerTitle:{margin:"0 0 6px",fontSize:14,fontWeight:600,color:"#3a5a8a"},chatBannerBody:{margin:0,fontSize:13,color:"#4a6080",lineHeight:1.5},applyBtn:{display:"flex",padding:"7px 10.5px",justifyContent:"center",alignItems:"center",gap:"7px",marginTop:8,fontSize:13,borderRadius:6,border:"1px solid #2563EB",background:"#2563EB",color:"#fff"},rangeLabel:{fontSize:12,color:"#888"},segmentedControl:{border:"1px solid #F2F4F7",display:"flex",background:"#F9FAFB",borderRadius:4,padding:6,gap:8},segmentedBtn:{flex:1,padding:"7px 0",fontSize:13,fontWeight:500,color:"#888",background:"transparent",border:"none",borderRadius:8,cursor:"pointer",transition:"background 0.15s, color 0.15s"},segmentedBtnActive:{background:"#dce8fa",color:"#2a4a7a",fontWeight:700},clauseCard:{background:"#fff",border:"1px solid #dde5f0",borderRadius:12,padding:"12px 14px",textAlign:"left",cursor:"pointer",width:"100%"},clauseFilename:{margin:"0 0 6px",fontSize:13,fontWeight:600,color:"#2a4a7a"},clauseExcerpt:{margin:0,fontSize:13,color:"#4a5a70",fontStyle:"italic",lineHeight:1.5}};exports.default=function(t){var o=t.onBack,s=t.onChatClick,g=t.onRiskRegenerate,f=t.initialTone,p=t.riskMode,x=t.onApply,y=t.onTabToggle,m=t.menuItemsConfig,b=void 0===m?a:m,_=t.historicalClausesConfig,v=void 0===_?r:_,C=t.chatTitle,j=void 0===C?"Chat mode active":C,k=t.chatBody,B=void 0===k?"You are now chatting about this redline, continue the conversation in the left panel to refine or update it":k,S=t.headerTitle,T=void 0===S?"How would you like to iterate?":S,A=t.customStyles,R=void 0===A?{}:A,w=t.toneLevelsConfig,z=void 0===w?l:w,L=t.toneColorsConfig,M=void 0===L?d:L,I=t.riskModesConfig,D=void 0===I?c:I,F=i.useState(null),H=F[0],q=F[1],W=e.__assign(e.__assign({},h),R);return n.jsxs("div",e.__assign({style:W.card},{children:[n.jsxs("div",e.__assign({style:W.header},{children:[n.jsx("button",e.__assign({onClick:o,style:W.backBtn,"aria-label":"Go back"},{children:"‹"})),n.jsx("span",e.__assign({style:W.headerTitle},{children:T}))]})),b.map(function(i,t){var o=H===i.id;return n.jsxs("div",e.__assign({style:{borderBottom:t<b.length-1?"0.5px solid #e8e7e3":"none"}},{children:[n.jsxs("button",e.__assign({onClick:function(){return e=i.id,q(function(n){return n===e?null:("chat"===e&&(null==s||s()),y&&y(e),e)});var e},style:W.row},{children:[n.jsx("div",e.__assign({style:W.rowLeft},{children:n.jsxs("div",{children:[n.jsx("p",e.__assign({style:W.label},{children:i.label})),n.jsx("p",e.__assign({style:W.desc},{children:i.description}))]})})),n.jsx("span",e.__assign({style:e.__assign(e.__assign({},W.chevron),{transform:o?"rotate(90deg)":"rotate(0deg)"})},{children:"›"}))]})),n.jsx("div",e.__assign({style:{maxHeight:o?400:0,overflow:"hidden",transition:"max-height 0.25s ease"}},{children:n.jsx(u,{type:i.id,onRiskRegenerate:g,initialTone:f,riskMode:p,onApply:x,chatTitle:j,chatBody:B,historicalClausesData:v,toneLevelsConfig:z,toneColorsConfig:M,riskModesConfig:D,mergedStyles:W})}))]}),i.id)})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),t=require("./PopupDefaults.js"),o=require("../icons/History.svg.js"),s=require("../icons/message-chat-square.svg.js"),a=require("./ToneToggle.js"),r=[{id:"chat",icon:n.jsx(s.ReactComponent,{}),label:"Chat",description:"Type on what basis you want to iterate"},{id:"risk",icon:n.jsx(s.ReactComponent,{}),label:"Shift the risk",description:"Adjust how aggressive or lenient the language is"},{id:"history",icon:n.jsx(o.ReactComponent,{}),label:"Historical Recommendations",description:"Pull from past recommended clauses"}],l=[{id:"1",filename:"Mutual_DA2.pdf",excerpt:'"...shall protect Confidential Information using at least the same degree of care as it uses to protect its own confidential information, but no less than reasonable c..."',tab:"Balanced"},{id:"2",filename:"Tech NDA.pdf",excerpt:'"...protect confidential information using reasonable care and appropriate safeguards..."',tab:"Balanced"},{id:"3",filename:"Corp NDA.pdf",excerpt:'"...shall use best efforts to protect any disclosed confidential materials from unauthorised access or disclosure..."',tab:"Aggressive"},{id:"4",filename:"Vendor Agreement.pdf",excerpt:'"...may use disclosed information solely for the stated purpose with no special handling required..."',tab:"Lenient"}],d=["Lenient","Balanced","Aggressive"],c={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},g=["Grounded","Innovative"];function f(i){var t=i.chatTitle,o=i.chatBody,s=i.mergedStyles,a=void 0===s?x:s;return n.jsx("div",e.__assign({style:a.body},{children:n.jsxs("div",e.__assign({style:a.chatBanner},{children:[n.jsx("p",e.__assign({style:a.chatBannerTitle},{children:t})),n.jsx("p",e.__assign({style:a.chatBannerBody},{children:o}))]}))}))}function p(t){var o=t.initialTone,s=t.onRiskRegenerate,r=t.riskMode,l=t.toneLevelsConfig,f=void 0===l?d:l,p=t.toneColorsConfig,u=void 0===p?c:p,h=t.riskModesConfig,y=void 0===h?g:h,m=t.mergedStyles,b=void 0===m?x:m,_=f.findIndex(function(e){return e===o});-1===_&&(_=1);var v=i.useState(r||y[0]||"Grounded"),C=v[0],j=v[1],k=i.useState(_),B=k[0],S=k[1],T=i.useState(_)[0],A=f[B],R=u[A]||"#BA7517",w=B!==T||r!==C;return n.jsxs("div",e.__assign({style:b.body},{children:[n.jsx("div",e.__assign({style:{display:"flex",gap:8,marginBottom:16}},{children:y.map(function(i){return n.jsxs("button",e.__assign({onClick:function(){return j(i)},style:{flex:1,display:"flex",alignItems:"center",gap:8,padding:"10px 12px",borderRadius:10,border:"1px solid ".concat(C===i?"#7c5cbf":"#e0ddd8"),background:"#fff",cursor:"pointer",fontSize:13,fontWeight:500,color:"#1a1a1a"}},{children:[n.jsx("span",e.__assign({style:{width:16,height:16,borderRadius:"50%",border:"2px solid ".concat(C===i?"#7c5cbf":"#ccc"),display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},{children:C===i&&n.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:"#7c5cbf"}})})),i.charAt(0).toUpperCase()+i.slice(1)]}),i)})})),n.jsx(a.ToneToggle,{onToneChange:function(e){return S(e)},toneColor:R,isDirty:w,toneIndex:B,onClickRegenerate:function(){return null==s?void 0:s({tone:A,mode:C})}})]}))}function u(t){var o=t.onApply,s=t.historicalClausesData,a=void 0===s?l:s,r=t.toneLevelsConfig,c=void 0===r?d:r,g=t.mergedStyles,f=void 0===g?x:g,p=c.length>1?c[1]:c[0]||"Balanced",u=i.useState(p),h=u[0],y=u[1],m=a.filter(function(e){return e.tab===h});return n.jsxs("div",e.__assign({style:f.body},{children:[n.jsx("div",e.__assign({style:f.segmentedControl},{children:c.map(function(i){return n.jsx("button",e.__assign({onClick:function(){return y(i)},style:e.__assign(e.__assign({},f.segmentedBtn),h===i?f.segmentedBtnActive:{})},{children:i.charAt(0).toUpperCase()+i.slice(1)}),i)})})),n.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:10,marginTop:12}},{children:[m.map(function(i){return n.jsxs("button",e.__assign({onClick:function(){return null==o?void 0:o({type:"history",value:i.excerpt})},style:f.clauseCard},{children:[n.jsx("p",e.__assign({style:f.clauseFilename},{children:i.filename})),n.jsx("p",e.__assign({style:f.clauseExcerpt},{children:i.excerpt}))]}),i.id)}),0===m.length&&n.jsx("p",e.__assign({style:{fontSize:12,color:"#aaa",textAlign:"center",padding:"12px 0"}},{children:"No clauses for this tone"}))]}))]}))}function h(e){var i=e.type,t=e.onRiskRegenerate,o=e.initialTone,s=e.riskMode,a=e.onApply,r=e.chatTitle,l=e.chatBody,d=e.historicalClausesData,c=e.toneLevelsConfig,g=e.toneColorsConfig,h=e.riskModesConfig,y=e.mergedStyles,m=void 0===y?x:y;return"chat"===i?n.jsx(f,{chatTitle:r,chatBody:l,mergedStyles:m}):"risk"===i?n.jsx(p,{onRiskRegenerate:t,initialTone:o,riskMode:s,toneLevelsConfig:c,toneColorsConfig:g,riskModesConfig:h,mergedStyles:m}):"history"===i?n.jsx(u,{onApply:a,historicalClausesData:d,toneLevelsConfig:c,mergedStyles:m}):null}var x={card:{background:"#fff",border:"0.5px solid #e8e7e3",borderRadius:14,width:300,maxHeight:"350px",overflow:"auto",fontFamily:"system-ui, sans-serif"},header:{display:"flex",alignItems:"center",gap:8,padding:"14px 16px",borderBottom:"0.5px solid #e8e7e3"},backBtn:{background:"none",border:"none",cursor:"pointer",fontSize:20,color:"#888",padding:0,lineHeight:1},headerTitle:{fontSize:14,fontWeight:500,color:"#1a1a1a"},row:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 16px",cursor:"pointer",border:"none",textAlign:"left",gap:10,boxSizing:"border-box",backgroundColor:"transparent"},rowLeft:{display:"flex",alignItems:"flex-start",gap:10,flex:1},icon:{fontSize:16,color:"#666",marginTop:1,flexShrink:0},label:{margin:0,fontSize:14,fontWeight:500,color:"#1a1a1a"},desc:{margin:"2px 0 0",fontSize:12,color:"#888",lineHeight:1.4},chevron:{fontSize:18,color:"#aaa",flexShrink:0,display:"inline-block",transition:"transform 0.2s"},body:{padding:"0 16px 14px 16px"},chatBanner:{background:"#eef4fd",border:"1px solid #c5d8f7",borderRadius:10,padding:"12px 14px",marginBottom:10},chatBannerTitle:{margin:"0 0 6px",fontSize:14,fontWeight:600,color:"#3a5a8a"},chatBannerBody:{margin:0,fontSize:13,color:"#4a6080",lineHeight:1.5},applyBtn:{display:"flex",padding:"7px 10.5px",justifyContent:"center",alignItems:"center",gap:"7px",marginTop:8,fontSize:13,borderRadius:6,border:"1px solid #2563EB",background:"#2563EB",color:"#fff"},rangeLabel:{fontSize:12,color:"#888"},segmentedControl:{border:"1px solid #F2F4F7",display:"flex",background:"#F9FAFB",borderRadius:4,padding:6,gap:8},segmentedBtn:{flex:1,padding:"7px 0",fontSize:13,fontWeight:500,color:"#888",background:"transparent",border:"none",borderRadius:8,cursor:"pointer",transition:"background 0.15s, color 0.15s"},segmentedBtnActive:{background:"#dce8fa",color:"#2a4a7a",fontWeight:700},clauseCard:{background:"#fff",border:"1px solid #dde5f0",borderRadius:12,padding:"12px 14px",textAlign:"left",cursor:"pointer",width:"100%"},clauseFilename:{margin:"0 0 6px",fontSize:13,fontWeight:600,color:"#2a4a7a"},clauseExcerpt:{margin:0,fontSize:13,color:"#4a5a70",fontStyle:"italic",lineHeight:1.5}};exports.default=function(o){var s=o.onBack,a=o.onChatClick,f=o.onRiskRegenerate,p=o.initialTone,u=o.riskMode,y=o.onApply,m=o.onTabToggle,b=o.menuItemsConfig,_=void 0===b?r:b,v=o.historicalClausesConfig,C=void 0===v?l:v,j=o.chatTitle,k=void 0===j?"Chat mode active":j,B=o.chatBody,S=void 0===B?"You are now chatting about this redline, continue the conversation in the left panel to refine or update it":B,T=o.headerTitle,A=void 0===T?"How would you like to iterate?":T,R=o.customStyles,w=void 0===R?{}:R,z=o.toneLevelsConfig,L=void 0===z?d:z,M=o.toneColorsConfig,D=void 0===M?c:M,I=o.riskModesConfig,q=void 0===I?g:I,F=i.useState(null),H=F[0],W=F[1],E=e.__assign(e.__assign(e.__assign({},t.default.IterateMenuDefaults.styles),x),w);return n.jsxs("div",e.__assign({style:E.card},{children:[n.jsxs("div",e.__assign({style:E.header},{children:[n.jsx("button",e.__assign({onClick:s,style:E.backBtn,"aria-label":"Go back"},{children:"‹"})),n.jsx("span",e.__assign({style:E.headerTitle},{children:A}))]})),_.map(function(i,t){var o=H===i.id;return n.jsxs("div",e.__assign({style:{borderBottom:t<_.length-1?"0.5px solid #e8e7e3":"none"}},{children:[n.jsxs("button",e.__assign({onClick:function(){return e=i.id,W(function(n){return n===e?null:("chat"===e&&(null==a||a()),m&&m(e),e)});var e},style:E.row},{children:[n.jsx("div",e.__assign({style:E.rowLeft},{children:n.jsxs("div",{children:[n.jsx("p",e.__assign({style:E.label},{children:i.label})),n.jsx("p",e.__assign({style:E.desc},{children:i.description}))]})})),n.jsx("span",e.__assign({style:e.__assign(e.__assign({},E.chevron),{transform:o?"rotate(90deg)":"rotate(0deg)"})},{children:"›"}))]})),n.jsx("div",e.__assign({style:{maxHeight:o?400:0,overflow:"hidden",transition:"max-height 0.25s ease"}},{children:n.jsx(h,{type:i.id,onRiskRegenerate:f,initialTone:p,riskMode:u,onApply:y,chatTitle:k,chatBody:S,historicalClausesData:C,toneLevelsConfig:L,toneColorsConfig:D,riskModesConfig:q,mergedStyles:E})}))]}),i.id)})]}))};
2
2
  //# sourceMappingURL=IterateComponent.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e={root:{width:"350px",background:"#fff",border:"1px solid #ddd",borderRadius:"8px",padding:"16px",maxHeight:"400px",overflow:"auto"},header:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},title:{fontSize:11,fontWeight:500,letterSpacing:"0.08em",color:"#E24B4A",textTransform:"uppercase"},bodyText:{fontSize:15,fontWeight:500,margin:"0 0 8px",color:"#111"},summary:{fontSize:13,color:"#666",lineHeight:1.6,margin:"0 0 14px"},impactContainer:{marginBottom:14,borderTop:"0.5px solid #eee",paddingTop:12},actionContainer:{display:"flex",gap:8,marginBottom:18},toneContainer:{borderTop:"0.5px solid #eee",paddingTop:14}},o={styles:{card:{background:"#fff",border:"0.5px solid #e8e7e3",borderRadius:14,width:300,maxHeight:"350px",overflow:"auto",fontFamily:"system-ui, sans-serif"},header:{display:"flex",alignItems:"center",gap:8,padding:"14px 16px",borderBottom:"0.5px solid #e8e7e3"},backBtn:{background:"none",border:"none",cursor:"pointer",fontSize:20,color:"#888",padding:0,lineHeight:1},headerTitle:{fontSize:14,fontWeight:500,color:"#1a1a1a"},row:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 16px",cursor:"pointer",border:"none",textAlign:"left",gap:10,boxSizing:"border-box",backgroundColor:"transparent"},rowLeft:{display:"flex",alignItems:"flex-start",gap:10,flex:1},label:{margin:0,fontSize:14,fontWeight:500,color:"#1a1a1a"},desc:{margin:"2px 0 0",fontSize:12,color:"#888",lineHeight:1.4},chevron:{fontSize:18,color:"#aaa",flexShrink:0,display:"inline-block",transition:"transform 0.2s"},body:{padding:"0 16px 14px 16px"},chatBanner:{background:"#eef4fd",border:"1px solid #c5d8f7",borderRadius:10,padding:"12px 14px",marginBottom:10},chatBannerTitle:{margin:"0 0 6px",fontSize:14,fontWeight:600,color:"#3a5a8a"},chatBannerBody:{margin:0,fontSize:13,color:"#4a6080",lineHeight:1.5},segmentedControl:{border:"1px solid #F2F4F7",display:"flex",background:"#F9FAFB",borderRadius:4,padding:6,gap:8},segmentedBtn:{flex:1,padding:"7px 0",fontSize:13,fontWeight:500,color:"#888",background:"transparent",border:"none",borderRadius:8,cursor:"pointer",transition:"background 0.15s, color 0.15s"},segmentedBtnActive:{background:"#dce8fa",color:"#2a4a7a",fontWeight:700},clauseCard:{background:"#fff",border:"1px solid #dde5f0",borderRadius:12,padding:"12px 14px",textAlign:"left",cursor:"pointer",width:"100%"},clauseFilename:{margin:"0 0 6px",fontSize:13,fontWeight:600,color:"#2a4a7a"},clauseExcerpt:{margin:0,fontSize:13,color:"#4a5a70",fontStyle:"italic",lineHeight:1.5}}},n={root:{animation:"slideIn 0.32s cubic-bezier(0.22,1,0.36,1) both",width:350,background:"#fff",borderRadius:18,boxShadow:"0 8px 48px rgba(0,0,0,0.18), 0 1.5px 6px rgba(0,0,0,0.07)",overflow:"hidden",fontFamily:"'DM Sans', 'Segoe UI', sans-serif"},header:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 16px",borderBottom:"1.5px solid #e2e8f0"},closeBtn:{background:"none",border:"none",cursor:"pointer",padding:4,borderRadius:6,display:"flex",alignItems:"center"},body:{padding:"14px 16px",display:"flex",flexDirection:"column",gap:13,overflow:"auto"},meta:{},divider:{height:1,background:"#f1f5f9"},impactText:{margin:"10px 0 0",fontSize:13,lineHeight:1.65,color:"#334155"},secondSection:{marginTop:12,background:"#f8fafc",border:"1.5px solid #e2e8f0",borderRadius:12,padding:"14px 16px",fontSize:13,lineHeight:1.7,color:"#64748b",fontStyle:"italic"},actionsContainer:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingTop:2}},t={container:{background:"#fff"},header:{display:"flex",alignItems:"center",justifyContent:"space-between"},innerHeader:{padding:"8px 12px"},innerBody:{padding:"8px 12px",color:"#4b5563"}},a={DeviationSummaryDefaults:e,IterateMenuDefaults:o,RedlineCardDefaults:n,CitationAccordionDefaults:t};exports.CitationAccordionDefaults=t,exports.DeviationSummaryDefaults=e,exports.IterateMenuDefaults=o,exports.RedlineCardDefaults=n,exports.default=a;
2
+ //# sourceMappingURL=PopupDefaults.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PopupDefaults.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("lucide-react"),i=require("react");function s(e){var t=new Date(e);return isNaN(t.getTime())?e:new Date(e).toLocaleString("en-US",{month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0}).replace(" AM","AM").replace(" PM","PM")}var o=function(){return t.jsxs("svg",e.__assign({width:"22",height:"22",viewBox:"0 0 22 22",fill:"none"},{children:[t.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"#22c55e",strokeWidth:"2",fill:"#f0fdf4"}),t.jsx("path",{d:"M6.5 11.5l3 3 6-6",stroke:"#22c55e",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}))},r=function(){return t.jsxs("svg",e.__assign({width:"22",height:"22",viewBox:"0 0 22 22",fill:"none"},{children:[t.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"#ef4444",strokeWidth:"2",fill:"#fff1f2"}),t.jsx("path",{d:"M7.5 7.5l7 7M14.5 7.5l-7 7",stroke:"#ef4444",strokeWidth:"2",strokeLinecap:"round"})]}))},a=function(){return t.jsx("svg",e.__assign({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},{children:t.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#94a3b8",strokeWidth:"1.8",strokeLinecap:"round"})}))},d=function(){return t.jsxs("svg",e.__assign({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),t.jsx("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),t.jsx("path",{d:"M11 8.5l1.5 1.5 2.5-2.5",stroke:"#22c55e",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}))},c=function(){return t.jsxs("svg",e.__assign({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),t.jsx("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),t.jsx("path",{d:"M11.5 8l3 3m0-3l-3 3",stroke:"#ef4444",strokeWidth:"1.4",strokeLinecap:"round"})]}))},l=function(n){var i=n.open;return t.jsx("svg",e.__assign({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",style:{transform:i?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.25s ease"}},{children:t.jsx("path",{d:"M4.5 11.25L9 6.75l4.5 4.5",stroke:"#64748b",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}))},g=function(n){var i=n.color,s=void 0===i?"#3b82f6":i;return t.jsxs("svg",e.__assign({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("path",{d:"M1.5 8A6.5 6.5 0 1 0 4 3.2",stroke:s,strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("path",{d:"M1.5 3.5v4h4",stroke:s,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M8 5v3.5l2 1.5",stroke:s,strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}))},h=function(){return t.jsxs("svg",e.__assign({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("path",{d:"M13.5 8a5.5 5.5 0 1 0-1.6 3.9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("path",{d:"M13.5 13v-4.5H9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}))},x=function(){return t.jsxs("svg",e.__assign({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("path",{d:"M2 8h12M10 4l4 4-4 4",stroke:"#64748b",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M4 5l-2 3 2 3",stroke:"#64748b",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}))};function u(n){var i=n.title,s=n.open,o=n.onToggle,r=n.children;return t.jsxs("div",e.__assign({style:{maxHeight:"170px",overflow:"auto"}},{children:[t.jsxs("div",e.__assign({onClick:o,style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",userSelect:"none",padding:"2px 0"}},{children:[t.jsx("span",e.__assign({style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"}},{children:i})),t.jsx(l,{open:s})]})),t.jsx("div",e.__assign({style:{maxHeight:s?300:0,opacity:s?1:0,overflow:"hidden",transition:"max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.25s"}},{children:r}))]}))}function f(n){var i=n.icon,s=n.label,o=n.onClick,r=n.customStyle,a=void 0===r?{}:r,d=e.__assign({display:"flex",alignItems:"center",gap:7,padding:"8px 16px",background:"#f8fafc",border:"1.5px solid #e2e8f0",borderRadius:10,cursor:"pointer",fontSize:"12px",fontWeight:600,color:"#475569",fontFamily:"inherit",transition:"background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s",whiteSpace:"nowrap"},a);return t.jsxs("button",e.__assign({onClick:o,style:d,onMouseEnter:function(e){e.currentTarget.style.background="#f1f5f9",e.currentTarget.style.transform="translateY(-1px)",e.currentTarget.style.boxShadow="0 2px 8px rgba(0,0,0,0.07)"},onMouseLeave:function(e){e.currentTarget.style.background="#f8fafc",e.currentTarget.style.transform="",e.currentTarget.style.boxShadow=""}},{children:[i,s]}))}exports.RedlineCard=function(l){var p,k=l.status,j=l.onClose,_=l.impactText,b=l.secondText,v=l.actionTakenByName,y=l.actionTakenAtTime,m=void 0===y?"NA":y,B=l.onHistory,w=l.onIterate,L=l.onReinstate,S=l.onRevert,M=l.impactTitle,C=void 0===M?"Impact":M,W=l.customConfigs,T=void 0===W?{}:W,I=l.customStyles,R=void 0===I?{}:I,z=i.useState(!0),D=z[0],H=z[1],A=i.useState(!0),U=A[0],F=A[1],q=i.useState(!1),E=q[0],N=q[1],O={headerBg:"#f0fdf4",headerBorder:"#dcfce7",titleColor:"#166534",label:"Redline Approved",metaLabel:"Approved By",UserIcon:t.jsx(d,{}),StatusIcon:t.jsx(o,{}),secondTitle:"Original text",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!0,actions:[{icon:t.jsx(g,{}),label:"History",onClick:B},{icon:t.jsx(n.Undo2,{size:17}),label:"Revert",onClick:S},{icon:t.jsx(x,{}),label:"Iterate",onClick:w}]},P={headerBg:"#fff1f2",headerBorder:"#fecdd3",titleColor:"#991b1b",label:"Redline Rejected",metaLabel:"Rejected By",UserIcon:t.jsx(c,{}),StatusIcon:t.jsx(r,{}),secondTitle:"Rejected Recommendation",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!1,actions:[{icon:t.jsx(g,{color:"#3b82f6"}),label:"History",onClick:B},{icon:t.jsx(h,{}),label:"Reinstate",onClick:L},{icon:t.jsx(x,{}),label:"Iterate",onClick:w}]},Y={headerBg:"#E2E8F0",headerBorder:"none",titleColor:"#1E293B",label:"Redline Reverted",metaLabel:"Reverted By",UserIcon:t.jsx(d,{}),StatusIcon:t.jsx(n.Undo2,{size:17}),secondTitle:"Reverted redline",secondBg:"#F9FAFB",secondBorder:"#D0D5DD",impactBox:!1,actions:[{icon:t.jsx(g,{}),label:"History",onClick:B},{icon:t.jsx(x,{}),label:"Iterate",onClick:w}]};p="accepted"===k?O:"rejected"===k?P:Y;var G=e.__assign(e.__assign({},p),T[k]||{});return t.jsxs("div",e.__assign({style:e.__assign({animation:E?"slideOut 0.26s cubic-bezier(0.4,0,1,1) forwards":"slideIn 0.32s cubic-bezier(0.22,1,0.36,1) both",width:350,background:"#fff",borderRadius:18,boxShadow:"0 8px 48px rgba(0,0,0,0.18), 0 1.5px 6px rgba(0,0,0,0.07)",overflow:"hidden",fontFamily:"'DM Sans', 'Segoe UI', sans-serif"},R.root)},{children:[t.jsxs("div",e.__assign({style:e.__assign({display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 16px",background:G.headerBg,borderBottom:"1.5px solid ".concat(G.headerBorder)},R.header)},{children:[t.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:10}},{children:[G.StatusIcon,t.jsx("span",e.__assign({style:{fontSize:15,fontWeight:700,color:G.titleColor,letterSpacing:"-0.01em"}},{children:G.label}))]})),t.jsx("button",e.__assign({onClick:function(){N(!0),j()},style:{background:"none",border:"none",cursor:"pointer",padding:4,borderRadius:6,display:"flex",alignItems:"center"}},{children:t.jsx(a,{})}))]})),t.jsxs("div",e.__assign({style:e.__assign({padding:"14px 16px",display:"flex",flexDirection:"column",gap:13,overflow:"auto"},R.body)},{children:[t.jsxs("div",e.__assign({style:R.meta},{children:[t.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:6,marginBottom:5}},{children:[G.UserIcon,t.jsx("span",e.__assign({style:{fontSize:12.5,color:"#94a3b8",fontWeight:500}},{children:G.metaLabel}))]})),t.jsxs("div",e.__assign({style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"}},{children:[v,", ",s(m)]}))]})),t.jsx("div",{style:e.__assign({height:1,background:"#f1f5f9"},R.divider)}),t.jsx(u,e.__assign({title:C,open:D,onToggle:function(){return H(function(e){return!e})}},{children:t.jsx("p",e.__assign({style:e.__assign({margin:"10px 0 0",fontSize:13,lineHeight:1.65,color:"#334155"},R.impactText)},{children:_||""}))})),t.jsx("div",{style:e.__assign({height:1,background:"#f1f5f9"},R.divider)}),t.jsx(u,e.__assign({title:G.secondTitle,open:U,onToggle:function(){return F(function(e){return!e})}},{children:t.jsx("div",e.__assign({style:e.__assign({marginTop:12,background:G.secondBg,border:"1.5px solid ".concat(G.secondBorder),borderRadius:12,padding:"14px 16px",fontSize:13,lineHeight:1.7,color:"#64748b",fontStyle:"italic"},R.secondSection)},{children:b||""}))})),t.jsx("div",e.__assign({style:e.__assign({display:"flex",justifyContent:"space-between",alignItems:"center",paddingTop:2},R.actionsContainer)},{children:G.actions.map(function(e){return t.jsx(f,{icon:e.icon,label:e.label,onClick:e.onClick,customStyle:e.style},e.label)})}))]}))]}))},exports.formatDate=s;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("lucide-react"),s=require("react"),i=require("./PopupDefaults.js");function o(e){var t=new Date(e);return isNaN(t.getTime())?e:new Date(e).toLocaleString("en-US",{month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0}).replace(" AM","AM").replace(" PM","PM")}var r=function(){return t.jsxs("svg",e.__assign({width:"22",height:"22",viewBox:"0 0 22 22",fill:"none"},{children:[t.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"#22c55e",strokeWidth:"2",fill:"#f0fdf4"}),t.jsx("path",{d:"M6.5 11.5l3 3 6-6",stroke:"#22c55e",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}))},a=function(){return t.jsxs("svg",e.__assign({width:"22",height:"22",viewBox:"0 0 22 22",fill:"none"},{children:[t.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"#ef4444",strokeWidth:"2",fill:"#fff1f2"}),t.jsx("path",{d:"M7.5 7.5l7 7M14.5 7.5l-7 7",stroke:"#ef4444",strokeWidth:"2",strokeLinecap:"round"})]}))},d=function(){return t.jsx("svg",e.__assign({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},{children:t.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#94a3b8",strokeWidth:"1.8",strokeLinecap:"round"})}))},l=function(){return t.jsxs("svg",e.__assign({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),t.jsx("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),t.jsx("path",{d:"M11 8.5l1.5 1.5 2.5-2.5",stroke:"#22c55e",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}))},c=function(){return t.jsxs("svg",e.__assign({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),t.jsx("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),t.jsx("path",{d:"M11.5 8l3 3m0-3l-3 3",stroke:"#ef4444",strokeWidth:"1.4",strokeLinecap:"round"})]}))},u=function(n){var s=n.open;return t.jsx("svg",e.__assign({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",style:{transform:s?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.25s ease"}},{children:t.jsx("path",{d:"M4.5 11.25L9 6.75l4.5 4.5",stroke:"#64748b",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}))},g=function(n){var s=n.color,i=void 0===s?"#3b82f6":s;return t.jsxs("svg",e.__assign({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("path",{d:"M1.5 8A6.5 6.5 0 1 0 4 3.2",stroke:i,strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("path",{d:"M1.5 3.5v4h4",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M8 5v3.5l2 1.5",stroke:i,strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}))},f=function(){return t.jsxs("svg",e.__assign({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("path",{d:"M13.5 8a5.5 5.5 0 1 0-1.6 3.9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("path",{d:"M13.5 13v-4.5H9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}))},h=function(){return t.jsxs("svg",e.__assign({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("path",{d:"M2 8h12M10 4l4 4-4 4",stroke:"#64748b",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M4 5l-2 3 2 3",stroke:"#64748b",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}))};function x(n){var s=n.title,i=n.open,o=n.onToggle,r=n.children;return t.jsxs("div",e.__assign({style:{maxHeight:"170px",overflow:"auto"}},{children:[t.jsxs("div",e.__assign({onClick:o,style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",userSelect:"none",padding:"2px 0"}},{children:[t.jsx("span",e.__assign({style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"}},{children:s})),t.jsx(u,{open:i})]})),t.jsx("div",e.__assign({style:{maxHeight:i?300:0,opacity:i?1:0,overflow:"hidden",transition:"max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.25s"}},{children:r}))]}))}function _(n){var s=n.icon,i=n.label,o=n.onClick,r=n.customStyle,a=void 0===r?{}:r,d=e.__assign({display:"flex",alignItems:"center",gap:7,padding:"8px 16px",background:"#f8fafc",border:"1.5px solid #e2e8f0",borderRadius:10,cursor:"pointer",fontSize:"12px",fontWeight:600,color:"#475569",fontFamily:"inherit",transition:"background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s",whiteSpace:"nowrap"},a);return t.jsxs("button",e.__assign({onClick:o,style:d,onMouseEnter:function(e){e.currentTarget.style.background="#f1f5f9",e.currentTarget.style.transform="translateY(-1px)",e.currentTarget.style.boxShadow="0 2px 8px rgba(0,0,0,0.07)"},onMouseLeave:function(e){e.currentTarget.style.background="#f8fafc",e.currentTarget.style.transform="",e.currentTarget.style.boxShadow=""}},{children:[s,i]}))}exports.RedlineCard=function(u){var p,k=u.status,j=u.onClose,b=u.impactText,v=u.secondText,y=u.actionTakenByName,m=u.actionTakenAtTime,B=void 0===m?"NA":m,C=u.onHistory,L=u.onIterate,w=u.onReinstate,R=u.onRevert,S=u.impactTitle,M=void 0===S?"Impact":S,W=u.customConfigs,T=void 0===W?{}:W,I=u.customStyles,D=void 0===I?{}:I,z=s.useState(!0),A=z[0],H=z[1],U=s.useState(!0),q=U[0],F=U[1],E=s.useState(!1),N=E[0],P=E[1],O={headerBg:"#f0fdf4",headerBorder:"#dcfce7",titleColor:"#166534",label:"Redline Approved",metaLabel:"Approved By",UserIcon:t.jsx(l,{}),StatusIcon:t.jsx(r,{}),secondTitle:"Original text",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!0,actions:[{icon:t.jsx(g,{}),label:"History",onClick:C},{icon:t.jsx(n.Undo2,{size:17}),label:"Revert",onClick:R},{icon:t.jsx(h,{}),label:"Iterate",onClick:L}]},Y={headerBg:"#fff1f2",headerBorder:"#fecdd3",titleColor:"#991b1b",label:"Redline Rejected",metaLabel:"Rejected By",UserIcon:t.jsx(c,{}),StatusIcon:t.jsx(a,{}),secondTitle:"Rejected Recommendation",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!1,actions:[{icon:t.jsx(g,{color:"#3b82f6"}),label:"History",onClick:C},{icon:t.jsx(f,{}),label:"Reinstate",onClick:w},{icon:t.jsx(h,{}),label:"Iterate",onClick:L}]},G={headerBg:"#E2E8F0",headerBorder:"none",titleColor:"#1E293B",label:"Redline Reverted",metaLabel:"Reverted By",UserIcon:t.jsx(l,{}),StatusIcon:t.jsx(n.Undo2,{size:17}),secondTitle:"Reverted redline",secondBg:"#F9FAFB",secondBorder:"#D0D5DD",impactBox:!1,actions:[{icon:t.jsx(g,{}),label:"History",onClick:C},{icon:t.jsx(h,{}),label:"Iterate",onClick:L}]};p="accepted"===k?O:"rejected"===k?Y:G;var J=e.__assign(e.__assign({},p),T[k]||{});return t.jsxs("div",e.__assign({style:e.__assign(e.__assign(e.__assign({},i.default.RedlineCardDefaults.root),{animation:N?"slideOut 0.26s cubic-bezier(0.4,0,1,1) forwards":i.default.RedlineCardDefaults.root.animation||"slideIn 0.32s cubic-bezier(0.22,1,0.36,1) both"}),D.root)},{children:[t.jsxs("div",e.__assign({style:e.__assign(e.__assign(e.__assign({},i.default.RedlineCardDefaults.header),{background:J.headerBg,borderBottom:"1.5px solid ".concat(J.headerBorder)}),D.header)},{children:[t.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:10}},{children:[J.StatusIcon,t.jsx("span",e.__assign({style:{fontSize:15,fontWeight:700,color:J.titleColor,letterSpacing:"-0.01em"}},{children:J.label}))]})),t.jsx("button",e.__assign({onClick:function(){P(!0),j()},style:{background:"none",border:"none",cursor:"pointer",padding:4,borderRadius:6,display:"flex",alignItems:"center"}},{children:t.jsx(d,{})}))]})),t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.body),D.body)},{children:[t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.meta),D.meta)},{children:[t.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:6,marginBottom:5}},{children:[J.UserIcon,t.jsx("span",e.__assign({style:{fontSize:12.5,color:"#94a3b8",fontWeight:500}},{children:J.metaLabel}))]})),t.jsxs("div",e.__assign({style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"}},{children:[y,", ",o(B)]}))]})),t.jsx("div",{style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.divider),D.divider)}),t.jsx(x,e.__assign({title:M,open:A,onToggle:function(){return H(function(e){return!e})}},{children:t.jsx("p",e.__assign({style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.impactText),D.impactText)},{children:b||""}))})),t.jsx("div",{style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.divider),D.divider)}),t.jsx(x,e.__assign({title:J.secondTitle,open:q,onToggle:function(){return F(function(e){return!e})}},{children:t.jsx("div",e.__assign({style:e.__assign(e.__assign(e.__assign({},i.default.RedlineCardDefaults.secondSection),{background:J.secondBg,border:"1.5px solid ".concat(J.secondBorder)}),D.secondSection)},{children:v||""}))})),t.jsx("div",e.__assign({style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.actionsContainer),D.actionsContainer)},{children:J.actions.map(function(e){return t.jsx(_,{icon:e.icon,label:e.label,onClick:e.onClick,customStyle:e.style},e.label)})}))]}))]}))},exports.formatDate=o;
2
2
  //# sourceMappingURL=RedlineStatusCard.js.map
package/dist/cjs/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./features/CodeCitation/CodeCitation.js"),t=require("./features/ProjectAccordion/ProjectAccordion.js"),i=require("./features/BookCitation/BookCitation.js"),o=require("./features/Bookemon/Bookemon.js"),n=require("./features/PdfEditorCitation/PdfEditorCitation.js"),r=require("./features/CitationRenderer/CitationRenderer.js"),a=require("./features/CitationRenderer/MarkdownRenderer.js"),s=require("./features/CodeCitation/_components/CodeEditor.js"),C=require("./features/PaginatedTable/PaginatedTable.js"),u=require("./features/CognitiveInternalgptReasoning/CognitiveInternalgptReasoningComponent.js"),d=require("./features/ChatCitation/ChatCitationRenderer.js"),f=require("./features/CognitiveDecisioning/CognitiveDecisioningWrapper.js"),p=require("./features/PdfViewer/PdfViewer.js"),l=require("./features/CognitiveDecisioning/FaqCitation/FaqCitation.js"),g=require("./features/RequirementAiCitations/ImageCitation/ImageCitationContent.js"),x=require("./features/RequirementAiCitations/VideoCitation/VideoCitationContent.js"),q=require("./features/RequirementAiCitations/FileCitation/FileCitationContent.js"),j=require("./features/RequirementAiCitations/WebCitation/WebCitationWithImageContent.js"),m=require("./features/MarkdownWithImageCitation/MarkdownWithImageCitation.js"),c=require("./features/RequirementAiCitations/AiReasoning/AiReasoningCitation.js"),I=require("./features/TableCitation/TableCitationContent.js"),R=require("./features/CitationViewer/CitationsViewer.js"),S=require("./features/ExcelCitation/ExcelCitations.js"),T=require("./features/ScannedDocCitation/ScannedDocCitation.js"),E=require("./features/ChatDrawer/ChatDrawer.js"),D=require("./features/ChatDrawer/constants/ChatDrawer.js"),A=require("./features/SplitterCitations/SplitterCitationsComponent.js"),P=require("./features/CognitiveCompare/CognitiveCompare.js"),v=require("./features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js"),w=require("./features/TextualGuidelines/TextualGuideLinesComponent.js"),h=require("./features/IngestionStatus/IngestionStatusComponent.js");exports.CodeCitation=e.default,exports.ProjectAccordian=t.default,exports.BookCitation=i.default,exports.Bookemon=o.default,exports.PdfCitation=n.PdfEditorCitation,exports.CitationRenderer=r.default,exports.MarkdownRenderer=a.default,Object.defineProperty(exports,"DiagnosticSeverity",{enumerable:!0,get:function(){return s.DiagnosticSeverity}}),exports.PaginatedTable=C.default,exports.InternalgptReasoningComponent=u.default,exports.NonWebReasoningComponent=u.default,exports.ChatCitation=d.default,exports.CognitiveDecisioningCard=f.default,exports.PdfViewer=p.default,exports.FaqCitation=l.default,exports.ImageCitationContent=g.default,exports.VideoCitationContent=x.default,exports.FileCitationContent=q.default,exports.WebCitationWithImageContent=j.default,exports.MarkdownWithImageCitation=m.default,exports.AiReasoningCitation=c.default,exports.TableCitationContent=I.default,exports.CitationsViewer=R.default,exports.ExcelCitation=S.default,exports.ScannedDocCitation=T.default,exports.ChatDrawer=E.default,exports.FILE_INGESTION_STATUS=D.FILE_INGESTION_STATUS,exports.SUMMARY_EXPAND_HEIGHT_NUDGE=D.SUMMARY_EXPAND_HEIGHT_NUDGE,exports.TRUNCATE_THRESHOLD=D.TRUNCATE_THRESHOLD,exports.SplitterCitationsComponent=A.default,exports.CognitiveCompare=P.default,exports.CognitiveInternalgptCoreComponent=v.default,exports.TextualGuideLinesComponent=w.default,exports.IngestionStatusChip=h.IngestionStatusChip,exports.IngestionStatusComponent=h.IngestionStatusComponent;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./features/CodeCitation/CodeCitation.js"),t=require("./features/ProjectAccordion/ProjectAccordion.js"),i=require("./features/BookCitation/BookCitation.js"),o=require("./features/Bookemon/Bookemon.js"),n=require("./features/PdfEditorCitation/PdfEditorCitation.js"),r=require("./features/CitationRenderer/CitationRenderer.js"),a=require("./features/CitationRenderer/MarkdownRenderer.js"),s=require("./features/CodeCitation/_components/CodeEditor.js"),u=require("./features/PaginatedTable/PaginatedTable.js"),C=require("./features/CognitiveInternalgptReasoning/CognitiveInternalgptReasoningComponent.js"),d=require("./features/ChatCitation/ChatCitationRenderer.js"),f=require("./features/CognitiveDecisioning/CognitiveDecisioningWrapper.js"),p=require("./features/PdfViewer/PdfViewer.js"),l=require("./features/CognitiveDecisioning/FaqCitation/FaqCitation.js"),g=require("./features/RequirementAiCitations/ImageCitation/ImageCitationContent.js"),x=require("./features/RequirementAiCitations/VideoCitation/VideoCitationContent.js"),q=require("./features/RequirementAiCitations/FileCitation/FileCitationContent.js"),j=require("./features/RequirementAiCitations/WebCitation/WebCitationWithImageContent.js"),c=require("./features/MarkdownWithImageCitation/MarkdownWithImageCitation.js"),m=require("./features/RequirementAiCitations/AiReasoning/AiReasoningCitation.js"),I=require("./features/TableCitation/TableCitationContent.js"),R=require("./features/CitationViewer/CitationsViewer.js"),S=require("./features/ExcelCitation/ExcelCitations.js"),T=require("./features/ScannedDocCitation/ScannedDocCitation.js"),E=require("./features/ChatDrawer/ChatDrawer.js"),D=require("./features/ChatDrawer/constants/ChatDrawer.js"),A=require("./features/SplitterCitations/SplitterCitationsComponent.js"),P=require("./features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js"),w=require("./features/TextualGuidelines/TextualGuideLinesComponent.js"),h=require("./features/IngestionStatus/IngestionStatusComponent.js");exports.CodeCitation=e.default,exports.ProjectAccordian=t.default,exports.BookCitation=i.default,exports.Bookemon=o.default,exports.PdfCitation=n.PdfEditorCitation,exports.CitationRenderer=r.default,exports.MarkdownRenderer=a.default,Object.defineProperty(exports,"DiagnosticSeverity",{enumerable:!0,get:function(){return s.DiagnosticSeverity}}),exports.PaginatedTable=u.default,exports.InternalgptReasoningComponent=C.default,exports.NonWebReasoningComponent=C.default,exports.ChatCitation=d.default,exports.CognitiveDecisioningCard=f.default,exports.PdfViewer=p.default,exports.FaqCitation=l.default,exports.ImageCitationContent=g.default,exports.VideoCitationContent=x.default,exports.FileCitationContent=q.default,exports.WebCitationWithImageContent=j.default,exports.MarkdownWithImageCitation=c.default,exports.AiReasoningCitation=m.default,exports.TableCitationContent=I.default,exports.CitationsViewer=R.default,exports.ExcelCitation=S.default,exports.ScannedDocCitation=T.default,exports.ChatDrawer=E.default,exports.FILE_INGESTION_STATUS=D.FILE_INGESTION_STATUS,exports.SUMMARY_EXPAND_HEIGHT_NUDGE=D.SUMMARY_EXPAND_HEIGHT_NUDGE,exports.TRUNCATE_THRESHOLD=D.TRUNCATE_THRESHOLD,exports.SplitterCitationsComponent=A.default,exports.CognitiveInternalgptCoreComponent=P.default,exports.TextualGuideLinesComponent=w.default,exports.IngestionStatusChip=h.IngestionStatusChip,exports.IngestionStatusComponent=h.IngestionStatusComponent;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsx as n,jsxs as s,Fragment as r}from"react/jsx-runtime";import t from"./ingestion.module.css.js";import{useIngestionWebSocket as o}from"./useIngestionStatus.js";var a={ingested:{label:"Ingested",className:t.ingested},failed:{label:"Ingestion Failed",className:t.failed},in_progress:{label:"Ingesting...",className:t.inProgress},pending:{label:"Pending",className:t.pending}};var i=function(o){var i=o.status,l=o.label,u=o.percentage,c=o.customConfig;if(c)return n("span",e({className:t.chip,style:{border:"1px solid ".concat(c.borderColor),background:c.background,color:c.color}},{children:null!=l?l:c.label}));if("custom"===i)return null;var d=a[i];if(!d)return null;var g="in_progress"===i&&void 0!==u;return n("span",e({className:"".concat(t.chip," ").concat(d.className)},{children:g?s(r,{children:[null!=l?l:"Ingesting",n("span",{className:t.dot}),"".concat(u,"%")]}):null!=l?l:d.label}))},l=new Set(["DONE","COMPLETED","FAILED"]),u=function(e){var s,r,t,a,u=e.ingestionId,c=e.status,d=e.wsBaseUrl,g=e.showPercentage,p=void 0===g||g,m=e.statusMap,v=e.customStatusConfigs,f=!!c&&l.has(c.toUpperCase()),b=o(!f&&u?u:null,d).data,N=f?c:null!==(r=null!==(s=null==b?void 0:b.ingestionStatus)&&void 0!==s?s:c)&&void 0!==r?r:"",C=N?function(e,n){if(!e)return"custom";if(n){if(void 0!==n[e])return n[e];var s=e.toUpperCase();if(void 0!==n[s])return n[s]}return"custom"}(N,m):"pending",h=v?null!==(a=null!==(t=v[C])&&void 0!==t?t:v[N])&&void 0!==a?a:v[N.toUpperCase()]:void 0,I=!f&&void 0!==(null==b?void 0:b.currentProgress)&&p?b.currentProgress:void 0;return n(i,{status:C,percentage:I,customConfig:h})};export{i as IngestionStatusChip,u as IngestionStatusComponent};
1
+ import{__assign as e}from"tslib";import{jsx as n,jsxs as s,Fragment as r}from"react/jsx-runtime";import t from"./ingestion.module.css.js";import{useIngestionWebSocket as o}from"./useIngestionStatus.js";var a={ingested:{label:"Ingested",className:t.ingested},failed:{label:"Ingestion Failed",className:t.failed},in_progress:{label:"Ingesting...",className:t.inProgress},pending:{label:"Pending",className:t.pending}};var i=function(o){var i=o.status,l=o.label,u=o.percentage,c=o.customConfig;if(c)return n("span",e({className:t.chip,style:{border:"1px solid ".concat(c.borderColor),background:c.background,color:c.color}},{children:null!=l?l:c.label}));if("custom"===i)return null;var d=a[i];if(!d)return null;var g="in_progress"===i&&void 0!==u;return n("span",e({className:"".concat(t.chip," ").concat(d.className)},{children:g?s(r,{children:[null!=l?l:"Ingesting",n("span",{className:t.dot}),"".concat(u,"%")]}):null!=l?l:d.label}))},l=new Set(["DONE","COMPLETED","FAILED"]),u=function(e){var s,r,t,a,u=e.ingestionId,c=e.status,d=e.wsBaseUrl,g=e.showPercentage,p=void 0===g||g,m=e.statusMap,f=e.customStatusConfigs,v=!!c&&l.has(c.toUpperCase()),b=o(!v&&u?u:null,d).data,N=v?c:null!==(r=null!==(s=null==b?void 0:b.ingestionStatus)&&void 0!==s?s:c)&&void 0!==r?r:"",h=N?function(e,n){if(!e)return"custom";if(n){if(void 0!==n[e])return n[e];var s=e.toUpperCase();if(void 0!==n[s])return n[s]}return"custom"}(N,m):"pending",C=f?null!==(a=null!==(t=f[h])&&void 0!==t?t:f[N])&&void 0!==a?a:f[N.toUpperCase()]:void 0,I=function(){if(!v&&p)return void 0!==(null==b?void 0:b.currentProgress)?Math.max(5,b.currentProgress):"in_progress"===h?5:void 0}();return n(i,{status:h,percentage:I,customConfig:C})};export{i as IngestionStatusChip,u as IngestionStatusComponent};
2
2
  //# sourceMappingURL=IngestionStatusComponent.js.map