@e-llm-studio/citation 0.0.229 → 0.0.231
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.
- package/dist/cjs/features/CognitiveCompare/CitationAnchor.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CitationRenderer.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CognitiveComparehelpers.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CognitivePopup.js +1 -1
- package/dist/cjs/features/CognitiveCompare/Guidelines/components/GuidelinePanel.js +2 -0
- package/dist/cjs/features/CognitiveCompare/Guidelines/components/GuidelinePanel.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/Guidelines/components/WebGptPanel.js +2 -0
- package/dist/cjs/features/CognitiveCompare/Guidelines/components/WebGptPanel.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/Guidelines/utils/helper.js +2 -0
- package/dist/cjs/features/CognitiveCompare/Guidelines/utils/helper.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.js +2 -0
- package/dist/cjs/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/MoreFunctionsPopup.js +1 -1
- package/dist/cjs/features/CognitiveCompare/components/RHSSectionRow.js +1 -1
- package/dist/cjs/features/CognitiveCompare/components/SectionAccordion.js +1 -1
- package/dist/cjs/features/CognitiveCompare/components/SubSectionAccordion.js +1 -1
- package/dist/cjs/features/CognitiveCompare/components/SvgConnectors.js +1 -1
- package/dist/cjs/features/CognitiveCompare/components/connectedLines.js +1 -1
- package/dist/cjs/features/CognitiveCompare/hooks/memoizedMarkdown.js +1 -1
- package/dist/cjs/features/CognitiveCompare/hooks/useCompareData.js +1 -1
- package/dist/cjs/features/CognitiveCompare/hooks/useLinesCalculator.js +1 -1
- package/dist/cjs/features/CognitiveCompare/hooks/useSideBySide.js +1 -1
- package/dist/cjs/features/CognitiveInternalgptReasoning/CognitiveNonWebSearchReasoning.module.css.js +1 -1
- package/dist/cjs/hooks/useOnDemandCitationFetch.js +1 -1
- package/dist/cjs/service/onDemandApi.js +1 -1
- package/dist/features/CognitiveCompare/CitationAnchor.js +1 -1
- package/dist/features/CognitiveCompare/CitationRenderer.js +1 -1
- package/dist/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/features/CognitiveCompare/CognitiveComparehelpers.js +1 -1
- package/dist/features/CognitiveCompare/CognitivePopup.js +1 -1
- package/dist/features/CognitiveCompare/Guidelines/components/GuidelinePanel.js +2 -0
- package/dist/features/CognitiveCompare/Guidelines/components/GuidelinePanel.js.map +1 -0
- package/dist/features/CognitiveCompare/Guidelines/components/WebGptPanel.js +2 -0
- package/dist/features/CognitiveCompare/Guidelines/components/WebGptPanel.js.map +1 -0
- package/dist/features/CognitiveCompare/Guidelines/utils/helper.js +2 -0
- package/dist/features/CognitiveCompare/Guidelines/utils/helper.js.map +1 -0
- package/dist/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.js +2 -0
- package/dist/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.js.map +1 -0
- package/dist/features/CognitiveCompare/MoreFunctionsPopup.js +1 -1
- package/dist/features/CognitiveCompare/components/RHSSectionRow.js +1 -1
- package/dist/features/CognitiveCompare/components/SectionAccordion.js +1 -1
- package/dist/features/CognitiveCompare/components/SubSectionAccordion.js +1 -1
- package/dist/features/CognitiveCompare/components/SvgConnectors.js +1 -1
- package/dist/features/CognitiveCompare/components/connectedLines.js +1 -1
- package/dist/features/CognitiveCompare/hooks/memoizedMarkdown.js +1 -1
- package/dist/features/CognitiveCompare/hooks/useCompareData.js +1 -1
- package/dist/features/CognitiveCompare/hooks/useLinesCalculator.js +1 -1
- package/dist/features/CognitiveCompare/hooks/useSideBySide.js +1 -1
- package/dist/features/CognitiveInternalgptReasoning/CognitiveNonWebSearchReasoning.module.css.js +1 -1
- package/dist/hooks/useOnDemandCitationFetch.js +1 -1
- package/dist/service/onDemandApi.js +1 -1
- package/dist/types/src/CognitiveCompareTest.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CitationAnchor.d.ts +3 -0
- package/dist/types/src/features/CognitiveCompare/CitationAnchor.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CitationRenderer.d.ts +3 -1
- package/dist/types/src/features/CognitiveCompare/CitationRenderer.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts +19 -0
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveComparehelpers.d.ts +21 -3
- package/dist/types/src/features/CognitiveCompare/CognitiveComparehelpers.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitivePopup.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CompareContext.d.ts +5 -1
- package/dist/types/src/features/CognitiveCompare/CompareContext.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/Guidelines/components/GuidelinePanel.d.ts +3 -0
- package/dist/types/src/features/CognitiveCompare/Guidelines/components/GuidelinePanel.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/Guidelines/components/WebGptPanel.d.ts +8 -0
- package/dist/types/src/features/CognitiveCompare/Guidelines/components/WebGptPanel.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/Guidelines/constants/guidelines.mockData.d.ts +2001 -0
- package/dist/types/src/features/CognitiveCompare/Guidelines/constants/guidelines.mockData.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/Guidelines/utils/helper.d.ts +11 -0
- package/dist/types/src/features/CognitiveCompare/Guidelines/utils/helper.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.d.ts +6 -0
- package/dist/types/src/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/MoreFunctionsPopup.d.ts +2 -0
- package/dist/types/src/features/CognitiveCompare/MoreFunctionsPopup.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/components/RHSSectionRow.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/components/SectionAccordion.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/components/SubSectionAccordion.d.ts +1 -0
- package/dist/types/src/features/CognitiveCompare/components/SubSectionAccordion.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/components/SvgConnectors.d.ts +2 -1
- package/dist/types/src/features/CognitiveCompare/components/SvgConnectors.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/components/connectedLines.d.ts +1 -0
- package/dist/types/src/features/CognitiveCompare/components/connectedLines.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/memoizedMarkdown.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useCompareData.d.ts +2 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useCompareData.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useCompareLayout.d.ts +1 -0
- package/dist/types/src/features/CognitiveCompare/hooks/useCompareLayout.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useLinesCalculator.d.ts +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useLinesCalculator.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useSideBySide.d.ts +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useSideBySide.d.ts.map +1 -1
- package/dist/types/src/service/onDemandApi.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/cjs/features/CognitiveInternalgptReasoning/CognitiveNonWebSearchReasoning.module.css.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const o=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;o&&e.setAttribute("nonce",o),e.appendChild(document.createTextNode(".CognitiveNonWebSearchReasoning-module_container__koQEN{display:flex;flex-direction:column;gap:var(--cr-container-gap,.5rem)}.CognitiveNonWebSearchReasoning-module_itemRow__lRmgs{align-items:flex-start;display:flex;font-size:var(--cr-item-row-font-size,.875rem);gap:.5rem}.CognitiveNonWebSearchReasoning-module_indexNumber__wP5hg{color:var(--cr-index-color,#475467);font-weight:var(--cr-index-font-weight,500)}.CognitiveNonWebSearchReasoning-module_textContent__327fx{color:var(--cr-text-content-color,#475467);flex:1;max-width:none}.CognitiveNonWebSearchReasoning-module_paraphraseButton__VS6Qe{align-items:center;background:var(--cr-paraphrase-button-bg,#0000);border:none;border-radius:var(--cr-paraphrase-button-border-radius,.375rem);cursor:pointer;display:inline-flex;gap:.25rem;justify-content:flex-start;padding:.125rem .375rem}.CognitiveNonWebSearchReasoning-module_paraphraseText__n5dty{color:var(--cr-paraphrase-color,#2563eb);font-weight:var(--cr-paraphrase-font-weight,500);text-align:start}.CognitiveNonWebSearchReasoning-module_paraphraseStar__YUnqR{color:var(--cr-paraphrase-color,#2563eb);padding-right:.25rem}.CognitiveNonWebSearchReasoning-module_chevronIcon__ZeXjw{color:var(--cr-chevron-color,#2563eb);height:1rem;transition:transform .2s;width:1rem}.CognitiveNonWebSearchReasoning-module_chevronIconRotated__WkRiP{transform:rotate(180deg)}.CognitiveNonWebSearchReasoning-module_expandedContainer__2UPr9{background-color:var(--cr-expanded-container-bg,#0000);border:solid var(--cr-expanded-container-border,#e5e7eb);border-radius:var(--cr-expanded-container-border-radius,.5rem);border-width:1px 1px 2px;margin-left:var(--cr-expanded-container-margin-left,1.5rem);margin-top:var(--cr-expanded-container-margin-top,.5rem);overflow:hidden}.CognitiveNonWebSearchReasoning-module_expandedHeader__QjKjb{align-items:center;background-color:var(--cr-header-bg,#f2f4f7);border-bottom:1px solid var(--cr-header-border,#e5e7eb);display:flex;justify-content:space-between;padding:var(--cr-header-padding,.25rem .75rem)}.CognitiveNonWebSearchReasoning-module_headerTitle__VvMwI{color:var(--cr-header-title-color,inherit);font-size:var(--cr-header-title-font-size,.875rem);font-weight:var(--cr-header-title-font-weight,400)}.CognitiveNonWebSearchReasoning-module_headerActions__j1P4u{align-items:center;display:flex;gap:.5rem}.CognitiveNonWebSearchReasoning-module_navigationContainer__G0VtG{align-items:center;background-color:var(--cr-nav-container-bg,#fff);border:1px solid var(--cr-nav-container-border,#e5e7eb);border-radius:.5rem;display:flex;padding:.25rem}.CognitiveNonWebSearchReasoning-module_navButton__aOaMv{align-items:center;background:#0000;border:none;border-radius:9999px;cursor:pointer;display:flex;justify-content:center;padding:0;transition:background-color .2s}.CognitiveNonWebSearchReasoning-module_navButton__aOaMv:hover{background-color:var(--cr-nav-button-hover-bg,#f3f4f6)}.CognitiveNonWebSearchReasoning-module_navIcon__uLme4{color:var(--cr-nav-icon-color,#6b7280);height:var(--cr-nav-icon-size,1.25rem);width:var(--cr-nav-icon-size,1.25rem)}.CognitiveNonWebSearchReasoning-module_navCounter__nj1Xc{color:var(--cr-nav-counter-color,#4b5563);font-size:var(--cr-nav-counter-font-size,.875rem);min-width:2.25rem;text-align:center}.CognitiveNonWebSearchReasoning-module_confidenceBadge__-ElB3{align-items:center;background-color:var(--cr-confidence-badge-bg,#f0fdf4);border:2px solid var(--cr-confidence-badge-border,#3ac894);border-radius:9999px;display:inline-flex;gap:.25rem;padding:.25rem .5rem}.CognitiveNonWebSearchReasoning-module_confidenceStar__4Rq0S{color:var(--cr-confidence-star-color,#059669);font-size:.75rem}.CognitiveNonWebSearchReasoning-module_confidenceScore__uLcnK{color:var(--cr-confidence-score-color,#059669);font-size:.875rem;font-weight:600}.CognitiveNonWebSearchReasoning-module_maximizeButton__Xwwu-{align-items:center;background:#0000;border:none;border-radius:.25rem;cursor:pointer;display:flex;justify-content:center;padding:.25rem;transition:background-color .2s}.CognitiveNonWebSearchReasoning-module_maximizeButton__Xwwu-:hover{background-color:var(--cr-maximize-button-hover-bg,#e5e7eb)}.CognitiveNonWebSearchReasoning-module_maximizeIcon__eFZez{color:var(--cr-maximize-icon-color,#6b7280);height:1.25rem;width:1.25rem}.CognitiveNonWebSearchReasoning-module_contentArea__hVoLL{background-color:var(--cr-content-area-bg,#0000);color:var(--cr-content-area-color,inherit);font-size:var(--cr-content-area-font-size,.875rem);max-height:var(--cr-content-area-max-height,11rem);overflow-y:auto;padding:var(--cr-content-area-padding,.5rem .75rem);scroll-behavior:smooth}.CognitiveNonWebSearchReasoning-module_contentInner__df-34{line-height:var(--cr-content-line-height,1.5rem)}.CognitiveNonWebSearchReasoning-module_footer__CNE8q{align-items:center;background-color:var(--cr-footer-bg,#f2f4f7);border-top:1px solid var(--cr-footer-border,#e5e7eb);display:flex;justify-content:flex-end}.CognitiveNonWebSearchReasoning-module_trainingTitle__CHFlh{color:var(--cr-training-title-color,inherit);font-size:var(--cr-training-title-font-size,.875rem);font-style:italic;font-weight:300}.CognitiveNonWebSearchReasoning-module_trainingTitleLink__0lu-U{align-items:center;background:none;border:none;color:var(--cr-training-link-color,inherit);cursor:pointer;display:inline-flex;font-size:var(--cr-training-link-font-size,.8rem);font-weight:600;gap:.25rem}.CognitiveNonWebSearchReasoning-module_modalDialog__eGApe{background:#0000;border:none;left:50%;margin:0;max-height:300px;max-width:none;overflow:visible;padding:0;position:fixed;top:50%;transform:translate(-50%,-50%)}.CognitiveNonWebSearchReasoning-module_modalDialog__eGApe::backdrop{background-color:#0006}.CognitiveNonWebSearchReasoning-module_modalContainer__-dZ01{background-color:var(--cr-modal-container-bg,#fff);border-radius:var(--cr-modal-container-border-radius,.75rem);box-shadow:0 25px 50px -12px #00000040;display:flex;flex-direction:column;max-height:80vh;max-width:900px;overflow:hidden;width:80vw}.CognitiveNonWebSearchReasoning-module_modalHeader__qglof{align-items:center;background-color:var(--cr-modal-header-bg,#f2f4f7);border-bottom:1px solid var(--cr-modal-header-border,#e5e7eb);display:flex;justify-content:space-between;padding:.75rem .5rem .75rem 1rem;width:100%}.CognitiveNonWebSearchReasoning-module_modalHeaderTitle__hDo1X{color:var(--cr-modal-header-title-color,inherit);font-size:var(--cr-modal-header-title-font-size,1rem);font-weight:500}.CognitiveNonWebSearchReasoning-module_modalHeaderActions__NGmip{align-items:center;display:flex;gap:.5rem}.CognitiveNonWebSearchReasoning-module_modalNavContainer__Q-OrP{align-items:center;background-color:var(--cr-modal-nav-container-bg,#f3f4f6);border:1px solid var(--cr-nav-container-border,#e5e7eb);border-radius:.5rem;display:flex;padding:.25rem}.CognitiveNonWebSearchReasoning-module_modalNavButton__6cQ24{align-items:center;background:#0000;border:none;border-radius:9999px;cursor:pointer;display:flex;justify-content:center;padding:0;transition:background-color .2s}.CognitiveNonWebSearchReasoning-module_modalNavButton__6cQ24:hover{background-color:var(--cr-modal-nav-button-hover-bg,#e5e7eb)}.CognitiveNonWebSearchReasoning-module_closeButton__S23zi{align-items:center;background:#0000;border:none;border-radius:.25rem;cursor:pointer;display:flex;justify-content:center;padding:.25rem;transition:background-color .2s}.CognitiveNonWebSearchReasoning-module_closeButton__S23zi:hover{background-color:var(--cr-close-button-hover-bg,#e5e7eb)}.CognitiveNonWebSearchReasoning-module_closeIcon__f7kaG{color:var(--cr-close-icon-color,#4b5563);height:1.25rem;width:1.25rem}.CognitiveNonWebSearchReasoning-module_modalContent__4U2Jv{background-color:var(--cr-modal-content-bg,#0000);color:var(--cr-modal-content-color,inherit);flex:1;font-size:var(--cr-modal-content-font-size,.875rem);overflow-y:scroll;padding:.75rem 1rem;scroll-behavior:smooth}.CognitiveNonWebSearchReasoning-module_modalContentInner__63tzo{line-height:var(--cr-modal-content-line-height,1.75rem)}.CognitiveNonWebSearchReasoning-module_modalFooter__hXBqn{justify-content:flex-end;padding:.5rem 1rem}.CognitiveNonWebSearchReasoning-module_modalFooterSource__MOlgt,.CognitiveNonWebSearchReasoning-module_modalFooter__hXBqn{align-items:center;background-color:var(--cr-modal-footer-bg,#f2f4f7);border-top:1px solid var(--cr-modal-footer-border,#e5e7eb);display:flex;flex-shrink:0}.CognitiveNonWebSearchReasoning-module_modalFooterSource__MOlgt{justify-content:flex-start;padding:1rem}.CognitiveNonWebSearchReasoning-module_blockLine__FwGYE{display:block}.CognitiveNonWebSearchReasoning-module_headerLine__0j5p4{display:block;font-weight:var(--cr-header-line-font-weight,400)}.CognitiveNonWebSearchReasoning-module_listItemLine__yKx2O{display:block}.CognitiveNonWebSearchReasoning-module_listCounter__esNpx{display:inline-block;font-weight:var(--cr-list-counter-font-weight,500);text-align:left;width:var(--cr-list-counter-width,1.5rem)}.CognitiveNonWebSearchReasoning-module_boldText__suAp2{font-weight:var(--cr-bold-font-weight,600)}.CognitiveNonWebSearchReasoning-module_highlight__EMAz5{background-color:var(--cr-highlight-bg,#fef08a);border-radius:.25rem;padding:0 .125rem;transition:all .2s}.CognitiveNonWebSearchReasoning-module_highlightActive__FFvuU{background-color:var(--cr-highlight-active-bg,#fde047);border:1px solid var(--cr-highlight-active-border,#eab308);box-shadow:0 1px 2px 0 #0000000d}.CognitiveNonWebSearchReasoning-module_highlightActiveVariant__-gqMp{background-color:#e0e7ff;border:1px solid #5c75f4;box-shadow:0 1px 2px 0 #0000000d;color:#6366f1;font-weight:500}.CognitiveNonWebSearchReasoning-module_highlightVariant__PYgtJ{background-color:#eef2ff;border-radius:.25rem;color:#6366f1;font-weight:500;padding:0 .125rem;transition:all .2s}.CognitiveNonWebSearchReasoning-module_highlightButton__XvkBb{border:none;cursor:pointer;display:inline;font:inherit}"));const n=document.head||document.getElementsByTagName("head")[0]||document.documentElement;n&&n.appendChild(e)}(),exports.default={container:"CognitiveNonWebSearchReasoning-module_container__koQEN",itemRow:"CognitiveNonWebSearchReasoning-module_itemRow__lRmgs",indexNumber:"CognitiveNonWebSearchReasoning-module_indexNumber__wP5hg",textContent:"CognitiveNonWebSearchReasoning-module_textContent__327fx",paraphraseButton:"CognitiveNonWebSearchReasoning-module_paraphraseButton__VS6Qe",paraphraseText:"CognitiveNonWebSearchReasoning-module_paraphraseText__n5dty",paraphraseStar:"CognitiveNonWebSearchReasoning-module_paraphraseStar__YUnqR",chevronIcon:"CognitiveNonWebSearchReasoning-module_chevronIcon__ZeXjw",chevronIconRotated:"CognitiveNonWebSearchReasoning-module_chevronIconRotated__WkRiP",expandedContainer:"CognitiveNonWebSearchReasoning-module_expandedContainer__2UPr9",expandedHeader:"CognitiveNonWebSearchReasoning-module_expandedHeader__QjKjb",headerTitle:"CognitiveNonWebSearchReasoning-module_headerTitle__VvMwI",headerActions:"CognitiveNonWebSearchReasoning-module_headerActions__j1P4u",navigationContainer:"CognitiveNonWebSearchReasoning-module_navigationContainer__G0VtG",navButton:"CognitiveNonWebSearchReasoning-module_navButton__aOaMv",navIcon:"CognitiveNonWebSearchReasoning-module_navIcon__uLme4",navCounter:"CognitiveNonWebSearchReasoning-module_navCounter__nj1Xc",confidenceBadge:"CognitiveNonWebSearchReasoning-module_confidenceBadge__-ElB3",confidenceStar:"CognitiveNonWebSearchReasoning-module_confidenceStar__4Rq0S",confidenceScore:"CognitiveNonWebSearchReasoning-module_confidenceScore__uLcnK",maximizeButton:"CognitiveNonWebSearchReasoning-module_maximizeButton__Xwwu-",maximizeIcon:"CognitiveNonWebSearchReasoning-module_maximizeIcon__eFZez",contentArea:"CognitiveNonWebSearchReasoning-module_contentArea__hVoLL",contentInner:"CognitiveNonWebSearchReasoning-module_contentInner__df-34",footer:"CognitiveNonWebSearchReasoning-module_footer__CNE8q",trainingTitle:"CognitiveNonWebSearchReasoning-module_trainingTitle__CHFlh",trainingTitleLink:"CognitiveNonWebSearchReasoning-module_trainingTitleLink__0lu-U",modalDialog:"CognitiveNonWebSearchReasoning-module_modalDialog__eGApe",modalContainer:"CognitiveNonWebSearchReasoning-module_modalContainer__-dZ01",modalHeader:"CognitiveNonWebSearchReasoning-module_modalHeader__qglof",modalHeaderTitle:"CognitiveNonWebSearchReasoning-module_modalHeaderTitle__hDo1X",modalHeaderActions:"CognitiveNonWebSearchReasoning-module_modalHeaderActions__NGmip",modalNavContainer:"CognitiveNonWebSearchReasoning-module_modalNavContainer__Q-OrP",modalNavButton:"CognitiveNonWebSearchReasoning-module_modalNavButton__6cQ24",closeButton:"CognitiveNonWebSearchReasoning-module_closeButton__S23zi",closeIcon:"CognitiveNonWebSearchReasoning-module_closeIcon__f7kaG",modalContent:"CognitiveNonWebSearchReasoning-module_modalContent__4U2Jv",modalContentInner:"CognitiveNonWebSearchReasoning-module_modalContentInner__63tzo",modalFooter:"CognitiveNonWebSearchReasoning-module_modalFooter__hXBqn",modalFooterSource:"CognitiveNonWebSearchReasoning-module_modalFooterSource__MOlgt",blockLine:"CognitiveNonWebSearchReasoning-module_blockLine__FwGYE",headerLine:"CognitiveNonWebSearchReasoning-module_headerLine__0j5p4",listItemLine:"CognitiveNonWebSearchReasoning-module_listItemLine__yKx2O",listCounter:"CognitiveNonWebSearchReasoning-module_listCounter__esNpx",boldText:"CognitiveNonWebSearchReasoning-module_boldText__suAp2",highlight:"CognitiveNonWebSearchReasoning-module_highlight__EMAz5",highlightActive:"CognitiveNonWebSearchReasoning-module_highlightActive__FFvuU",highlightActiveVariant:"CognitiveNonWebSearchReasoning-module_highlightActiveVariant__-gqMp",highlightVariant:"CognitiveNonWebSearchReasoning-module_highlightVariant__PYgtJ",highlightButton:"CognitiveNonWebSearchReasoning-module_highlightButton__XvkBb"};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const o=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;o&&e.setAttribute("nonce",o),e.appendChild(document.createTextNode(".CognitiveNonWebSearchReasoning-module_container__koQEN{display:flex;flex-direction:column;gap:var(--cr-container-gap,.5rem)}.CognitiveNonWebSearchReasoning-module_itemRow__lRmgs{align-items:flex-start;display:flex;font-size:var(--cr-item-row-font-size,.875rem);gap:.5rem}.CognitiveNonWebSearchReasoning-module_indexNumber__wP5hg{color:var(--cr-index-color,#475467);font-weight:var(--cr-index-font-weight,500)}.CognitiveNonWebSearchReasoning-module_textContent__327fx{color:var(--cr-text-content-color,#475467);flex:1;max-width:none}.CognitiveNonWebSearchReasoning-module_paraphraseButton__VS6Qe{align-items:center;background:var(--cr-paraphrase-button-bg,#0000);border:none;border-radius:var(--cr-paraphrase-button-border-radius,.375rem);cursor:pointer;display:inline-flex;gap:.25rem;justify-content:flex-start;padding:.125rem .375rem}.CognitiveNonWebSearchReasoning-module_paraphraseText__n5dty{color:var(--cr-paraphrase-color,#2563eb);font-weight:var(--cr-paraphrase-font-weight,500);text-align:start}.CognitiveNonWebSearchReasoning-module_paraphraseStar__YUnqR{color:var(--cr-paraphrase-color,#2563eb);padding-right:.25rem}.CognitiveNonWebSearchReasoning-module_chevronIcon__ZeXjw{color:var(--cr-chevron-color,#2563eb);height:1rem;transition:transform .2s;width:1rem}.CognitiveNonWebSearchReasoning-module_chevronIconRotated__WkRiP{transform:rotate(180deg)}.CognitiveNonWebSearchReasoning-module_expandedContainer__2UPr9{background-color:var(--cr-expanded-container-bg,#0000);border:solid var(--cr-expanded-container-border,#e5e7eb);border-radius:var(--cr-expanded-container-border-radius,.5rem);border-width:1px 1px 2px;container-type:inline-size;margin-left:var(--cr-expanded-container-margin-left,1.5rem);margin-top:var(--cr-expanded-container-margin-top,.5rem);overflow:hidden}.CognitiveNonWebSearchReasoning-module_expandedHeader__QjKjb{align-items:center;background-color:var(--cr-header-bg,#f2f4f7);border-bottom:1px solid var(--cr-header-border,#e5e7eb);display:flex;justify-content:space-between;padding:var(--cr-header-padding,.25rem .75rem)}.CognitiveNonWebSearchReasoning-module_headerTitle__VvMwI{color:var(--cr-header-title-color,inherit);font-size:var(--cr-header-title-font-size,.875rem);font-weight:var(--cr-header-title-font-weight,400)}.CognitiveNonWebSearchReasoning-module_headerActions__j1P4u{align-items:center;display:flex;gap:.5rem}.CognitiveNonWebSearchReasoning-module_navigationContainer__G0VtG{align-items:center;background-color:var(--cr-nav-container-bg,#fff);border:1px solid var(--cr-nav-container-border,#e5e7eb);border-radius:.5rem;display:flex;padding:.25rem}.CognitiveNonWebSearchReasoning-module_navButton__aOaMv{align-items:center;background:#0000;border:none;border-radius:9999px;cursor:pointer;display:flex;justify-content:center;padding:0;transition:background-color .2s}.CognitiveNonWebSearchReasoning-module_navButton__aOaMv:hover{background-color:var(--cr-nav-button-hover-bg,#f3f4f6)}.CognitiveNonWebSearchReasoning-module_navIcon__uLme4{color:var(--cr-nav-icon-color,#6b7280);height:var(--cr-nav-icon-size,1.25rem);width:var(--cr-nav-icon-size,1.25rem)}.CognitiveNonWebSearchReasoning-module_navCounter__nj1Xc{color:var(--cr-nav-counter-color,#4b5563);font-size:var(--cr-nav-counter-font-size,.875rem);min-width:2.25rem;text-align:center}.CognitiveNonWebSearchReasoning-module_confidenceBadge__-ElB3{align-items:center;background-color:var(--cr-confidence-badge-bg,#f0fdf4);border:2px solid var(--cr-confidence-badge-border,#3ac894);border-radius:9999px;display:inline-flex;gap:.25rem;padding:.25rem .5rem}.CognitiveNonWebSearchReasoning-module_confidenceStar__4Rq0S{color:var(--cr-confidence-star-color,#059669);font-size:.75rem}.CognitiveNonWebSearchReasoning-module_confidenceScore__uLcnK{color:var(--cr-confidence-score-color,#059669);font-size:.875rem;font-weight:600}.CognitiveNonWebSearchReasoning-module_maximizeButton__Xwwu-{align-items:center;background:#0000;border:none;border-radius:.25rem;cursor:pointer;display:flex;justify-content:center;padding:.25rem;transition:background-color .2s}.CognitiveNonWebSearchReasoning-module_maximizeButton__Xwwu-:hover{background-color:var(--cr-maximize-button-hover-bg,#e5e7eb)}.CognitiveNonWebSearchReasoning-module_maximizeIcon__eFZez{color:var(--cr-maximize-icon-color,#6b7280);height:1.25rem;width:1.25rem}.CognitiveNonWebSearchReasoning-module_contentArea__hVoLL{background-color:var(--cr-content-area-bg,#0000);color:var(--cr-content-area-color,inherit);font-size:var(--cr-content-area-font-size,.875rem);max-height:var(--cr-content-area-max-height,11rem);overflow-y:auto;padding:var(--cr-content-area-padding,.5rem .75rem);scroll-behavior:smooth}.CognitiveNonWebSearchReasoning-module_contentInner__df-34{line-height:var(--cr-content-line-height,1.5rem)}.CognitiveNonWebSearchReasoning-module_footer__CNE8q{align-items:center;background-color:var(--cr-footer-bg,#f2f4f7);border-top:1px solid var(--cr-footer-border,#e5e7eb);display:flex;justify-content:flex-end}.CognitiveNonWebSearchReasoning-module_trainingTitle__CHFlh{color:var(--cr-training-title-color,inherit);font-size:var(--cr-training-title-font-size,.875rem);font-style:italic;font-weight:300}.CognitiveNonWebSearchReasoning-module_trainingTitleLink__0lu-U{align-items:center;background:none;border:none;color:var(--cr-training-link-color,inherit);cursor:pointer;display:inline-flex;font-size:var(--cr-training-link-font-size,.8rem);font-weight:600;gap:.25rem}.CognitiveNonWebSearchReasoning-module_modalDialog__eGApe{background:#0000;border:none;left:50%;margin:0;max-height:300px;max-width:none;overflow:visible;padding:0;position:fixed;top:50%;transform:translate(-50%,-50%)}.CognitiveNonWebSearchReasoning-module_modalDialog__eGApe::backdrop{background-color:#0006}.CognitiveNonWebSearchReasoning-module_modalContainer__-dZ01{background-color:var(--cr-modal-container-bg,#fff);border-radius:var(--cr-modal-container-border-radius,.75rem);box-shadow:0 25px 50px -12px #00000040;display:flex;flex-direction:column;max-height:80vh;max-width:900px;overflow:hidden;width:80vw}.CognitiveNonWebSearchReasoning-module_modalHeader__qglof{align-items:center;background-color:var(--cr-modal-header-bg,#f2f4f7);border-bottom:1px solid var(--cr-modal-header-border,#e5e7eb);display:flex;justify-content:space-between;padding:.75rem .5rem .75rem 1rem;width:100%}.CognitiveNonWebSearchReasoning-module_modalHeaderTitle__hDo1X{color:var(--cr-modal-header-title-color,inherit);font-size:var(--cr-modal-header-title-font-size,1rem);font-weight:500}.CognitiveNonWebSearchReasoning-module_modalHeaderActions__NGmip{align-items:center;display:flex;gap:.5rem}.CognitiveNonWebSearchReasoning-module_modalNavContainer__Q-OrP{align-items:center;background-color:var(--cr-modal-nav-container-bg,#f3f4f6);border:1px solid var(--cr-nav-container-border,#e5e7eb);border-radius:.5rem;display:flex;padding:.25rem}.CognitiveNonWebSearchReasoning-module_modalNavButton__6cQ24{align-items:center;background:#0000;border:none;border-radius:9999px;cursor:pointer;display:flex;justify-content:center;padding:0;transition:background-color .2s}.CognitiveNonWebSearchReasoning-module_modalNavButton__6cQ24:hover{background-color:var(--cr-modal-nav-button-hover-bg,#e5e7eb)}.CognitiveNonWebSearchReasoning-module_closeButton__S23zi{align-items:center;background:#0000;border:none;border-radius:.25rem;cursor:pointer;display:flex;justify-content:center;padding:.25rem;transition:background-color .2s}.CognitiveNonWebSearchReasoning-module_closeButton__S23zi:hover{background-color:var(--cr-close-button-hover-bg,#e5e7eb)}.CognitiveNonWebSearchReasoning-module_closeIcon__f7kaG{color:var(--cr-close-icon-color,#4b5563);height:1.25rem;width:1.25rem}.CognitiveNonWebSearchReasoning-module_modalContent__4U2Jv{background-color:var(--cr-modal-content-bg,#0000);color:var(--cr-modal-content-color,inherit);flex:1;font-size:var(--cr-modal-content-font-size,.875rem);overflow-y:scroll;padding:.75rem 1rem;scroll-behavior:smooth}.CognitiveNonWebSearchReasoning-module_modalContentInner__63tzo{line-height:var(--cr-modal-content-line-height,1.75rem)}.CognitiveNonWebSearchReasoning-module_modalFooter__hXBqn{justify-content:flex-end;padding:.5rem 1rem}.CognitiveNonWebSearchReasoning-module_modalFooterSource__MOlgt,.CognitiveNonWebSearchReasoning-module_modalFooter__hXBqn{align-items:center;background-color:var(--cr-modal-footer-bg,#f2f4f7);border-top:1px solid var(--cr-modal-footer-border,#e5e7eb);display:flex;flex-shrink:0}.CognitiveNonWebSearchReasoning-module_modalFooterSource__MOlgt{justify-content:flex-start;padding:1rem}.CognitiveNonWebSearchReasoning-module_blockLine__FwGYE{display:block}.CognitiveNonWebSearchReasoning-module_headerLine__0j5p4{display:block;font-weight:var(--cr-header-line-font-weight,400)}.CognitiveNonWebSearchReasoning-module_listItemLine__yKx2O{display:block}.CognitiveNonWebSearchReasoning-module_listCounter__esNpx{display:inline-block;font-weight:var(--cr-list-counter-font-weight,500);text-align:left;width:var(--cr-list-counter-width,1.5rem)}.CognitiveNonWebSearchReasoning-module_boldText__suAp2{font-weight:var(--cr-bold-font-weight,600)}.CognitiveNonWebSearchReasoning-module_highlight__EMAz5{background-color:var(--cr-highlight-bg,#fef08a);border-radius:.25rem;padding:0 .125rem;transition:all .2s}.CognitiveNonWebSearchReasoning-module_highlightActive__FFvuU{background-color:var(--cr-highlight-active-bg,#fde047);border:1px solid var(--cr-highlight-active-border,#eab308);box-shadow:0 1px 2px 0 #0000000d}.CognitiveNonWebSearchReasoning-module_highlightActiveVariant__-gqMp{background-color:#e0e7ff;border:1px solid #5c75f4;box-shadow:0 1px 2px 0 #0000000d;color:#6366f1;font-weight:500}.CognitiveNonWebSearchReasoning-module_highlightVariant__PYgtJ{background-color:#eef2ff;border-radius:.25rem;color:#6366f1;font-weight:500;padding:0 .125rem;transition:all .2s}.CognitiveNonWebSearchReasoning-module_highlightButton__XvkBb{border:none;cursor:pointer;display:inline;font:inherit}@container (max-width: 520px){.CognitiveNonWebSearchReasoning-module_expandedContainer__2UPr9{margin-left:0;margin-top:0}.CognitiveNonWebSearchReasoning-module_expandedHeader__QjKjb{align-items:flex-start;display:flex;flex-wrap:wrap;gap:8px;padding:8px 12px}.CognitiveNonWebSearchReasoning-module_headerTitle__VvMwI{flex:1 1 100%;font-size:14px;line-height:1.3;min-width:0;white-space:normal}.CognitiveNonWebSearchReasoning-module_headerActions__j1P4u{align-items:center;gap:8px;justify-content:space-between;min-width:0;width:100%}.CognitiveNonWebSearchReasoning-module_modalNavContainer__Q-OrP,.CognitiveNonWebSearchReasoning-module_navigationContainer__G0VtG{flex-shrink:1;gap:2px;padding:2px}.CognitiveNonWebSearchReasoning-module_navCounter__nj1Xc{font-size:12px;min-width:auto}.CognitiveNonWebSearchReasoning-module_navIcon__uLme4{height:16px;width:16px}.CognitiveNonWebSearchReasoning-module_modalNavButton__6cQ24,.CognitiveNonWebSearchReasoning-module_navButton__aOaMv{padding:2px}.CognitiveNonWebSearchReasoning-module_confidenceBadge__-ElB3{flex-shrink:0;gap:2px;padding:2px 6px}.CognitiveNonWebSearchReasoning-module_confidenceScore__uLcnK{font-size:12px}.CognitiveNonWebSearchReasoning-module_confidenceStar__4Rq0S{font-size:10px}.CognitiveNonWebSearchReasoning-module_maximizeButton__Xwwu-{flex-shrink:0;padding:2px}.CognitiveNonWebSearchReasoning-module_maximizeIcon__eFZez{height:18px;width:18px}.CognitiveNonWebSearchReasoning-module_contentArea__hVoLL{padding:12px}}@container (max-width: 420px){.CognitiveNonWebSearchReasoning-module_expandedHeader__QjKjb{padding:8px}.CognitiveNonWebSearchReasoning-module_headerActions__j1P4u{gap:4px}.CognitiveNonWebSearchReasoning-module_modalNavContainer__Q-OrP,.CognitiveNonWebSearchReasoning-module_navigationContainer__G0VtG{transform:scale(.92);transform-origin:left center}.CognitiveNonWebSearchReasoning-module_confidenceBadge__-ElB3{padding:2px 5px}.CognitiveNonWebSearchReasoning-module_confidenceScore__uLcnK{font-size:11px}.CognitiveNonWebSearchReasoning-module_maximizeIcon__eFZez{height:16px;width:16px}.CognitiveNonWebSearchReasoning-module_contentArea__hVoLL{font-size:13px;padding:10px}}"));const n=document.head||document.getElementsByTagName("head")[0]||document.documentElement;n&&n.appendChild(e)}(),exports.default={container:"CognitiveNonWebSearchReasoning-module_container__koQEN",itemRow:"CognitiveNonWebSearchReasoning-module_itemRow__lRmgs",indexNumber:"CognitiveNonWebSearchReasoning-module_indexNumber__wP5hg",textContent:"CognitiveNonWebSearchReasoning-module_textContent__327fx",paraphraseButton:"CognitiveNonWebSearchReasoning-module_paraphraseButton__VS6Qe",paraphraseText:"CognitiveNonWebSearchReasoning-module_paraphraseText__n5dty",paraphraseStar:"CognitiveNonWebSearchReasoning-module_paraphraseStar__YUnqR",chevronIcon:"CognitiveNonWebSearchReasoning-module_chevronIcon__ZeXjw",chevronIconRotated:"CognitiveNonWebSearchReasoning-module_chevronIconRotated__WkRiP",expandedContainer:"CognitiveNonWebSearchReasoning-module_expandedContainer__2UPr9",expandedHeader:"CognitiveNonWebSearchReasoning-module_expandedHeader__QjKjb",headerTitle:"CognitiveNonWebSearchReasoning-module_headerTitle__VvMwI",headerActions:"CognitiveNonWebSearchReasoning-module_headerActions__j1P4u",navigationContainer:"CognitiveNonWebSearchReasoning-module_navigationContainer__G0VtG",navButton:"CognitiveNonWebSearchReasoning-module_navButton__aOaMv",navIcon:"CognitiveNonWebSearchReasoning-module_navIcon__uLme4",navCounter:"CognitiveNonWebSearchReasoning-module_navCounter__nj1Xc",confidenceBadge:"CognitiveNonWebSearchReasoning-module_confidenceBadge__-ElB3",confidenceStar:"CognitiveNonWebSearchReasoning-module_confidenceStar__4Rq0S",confidenceScore:"CognitiveNonWebSearchReasoning-module_confidenceScore__uLcnK",maximizeButton:"CognitiveNonWebSearchReasoning-module_maximizeButton__Xwwu-",maximizeIcon:"CognitiveNonWebSearchReasoning-module_maximizeIcon__eFZez",contentArea:"CognitiveNonWebSearchReasoning-module_contentArea__hVoLL",contentInner:"CognitiveNonWebSearchReasoning-module_contentInner__df-34",footer:"CognitiveNonWebSearchReasoning-module_footer__CNE8q",trainingTitle:"CognitiveNonWebSearchReasoning-module_trainingTitle__CHFlh",trainingTitleLink:"CognitiveNonWebSearchReasoning-module_trainingTitleLink__0lu-U",modalDialog:"CognitiveNonWebSearchReasoning-module_modalDialog__eGApe",modalContainer:"CognitiveNonWebSearchReasoning-module_modalContainer__-dZ01",modalHeader:"CognitiveNonWebSearchReasoning-module_modalHeader__qglof",modalHeaderTitle:"CognitiveNonWebSearchReasoning-module_modalHeaderTitle__hDo1X",modalHeaderActions:"CognitiveNonWebSearchReasoning-module_modalHeaderActions__NGmip",modalNavContainer:"CognitiveNonWebSearchReasoning-module_modalNavContainer__Q-OrP",modalNavButton:"CognitiveNonWebSearchReasoning-module_modalNavButton__6cQ24",closeButton:"CognitiveNonWebSearchReasoning-module_closeButton__S23zi",closeIcon:"CognitiveNonWebSearchReasoning-module_closeIcon__f7kaG",modalContent:"CognitiveNonWebSearchReasoning-module_modalContent__4U2Jv",modalContentInner:"CognitiveNonWebSearchReasoning-module_modalContentInner__63tzo",modalFooter:"CognitiveNonWebSearchReasoning-module_modalFooter__hXBqn",modalFooterSource:"CognitiveNonWebSearchReasoning-module_modalFooterSource__MOlgt",blockLine:"CognitiveNonWebSearchReasoning-module_blockLine__FwGYE",headerLine:"CognitiveNonWebSearchReasoning-module_headerLine__0j5p4",listItemLine:"CognitiveNonWebSearchReasoning-module_listItemLine__yKx2O",listCounter:"CognitiveNonWebSearchReasoning-module_listCounter__esNpx",boldText:"CognitiveNonWebSearchReasoning-module_boldText__suAp2",highlight:"CognitiveNonWebSearchReasoning-module_highlight__EMAz5",highlightActive:"CognitiveNonWebSearchReasoning-module_highlightActive__FFvuU",highlightActiveVariant:"CognitiveNonWebSearchReasoning-module_highlightActiveVariant__-gqMp",highlightVariant:"CognitiveNonWebSearchReasoning-module_highlightVariant__PYgtJ",highlightButton:"CognitiveNonWebSearchReasoning-module_highlightButton__XvkBb"};
|
|
2
2
|
//# sourceMappingURL=CognitiveNonWebSearchReasoning.module.css.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),i=require("react"),t=require("@tanstack/react-query"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),i=require("react"),t=require("@tanstack/react-query"),e=require("../service/onDemandApi.js"),o=function(n,i,t){var e;return Array.isArray(n)?Array.isArray(i)&&0!==i.length?Number.isNaN(t)?(console.warn("[findCitation] citationNumber is NaN"),null):null!==(e=n.find(function(n){var e,o=function(n){var i,t,e,o,a;if(null==n)return console.warn("[getCitationType] received null or undefined citation"),"";var l=null!==(a=null!==(o=null!==(t=null===(i=null==n?void 0:n.customMetaData)||void 0===i?void 0:i.type)&&void 0!==t?t:null===(e=null==n?void 0:n.customMetadata)||void 0===e?void 0:e.type)&&void 0!==o?o:null==n?void 0:n.type)&&void 0!==a?a:"";return l||console.warn("[getCitationType] citation has no resolvable type field",n),l}(n);return(null===(e=function(n){var i;return null==n?(console.warn("[getCitationNumber] received null or undefined citation"),""):(null==n.citation_number&&console.warn("[getCitationNumber] citation is missing citation_number field",n),null!==(i=null==n?void 0:n.citation_number)&&void 0!==i?i:"")}(n))||void 0===e?void 0:e.toString())===t.toString()&&i.some(function(n){return null==o?void 0:o.includes(n)})}))&&void 0!==e?e:null:(console.warn("[findCitation] citationTypes is empty or falsy",i),null):(console.warn("[findCitation] citations is not an array",n),null)};exports.useOnDemandCitationFetch=function(a){var l=a.msg,r=a.citationType,u=a.citationNumber,c=a.enabled,s=void 0!==c&&c,d=a.accessToken,v=a.baseUrl,_=a.orgName,f=a.citationAssistantProcessingName,m=a.citationAgentName,h=(null==l?void 0:l.requestId)||(null==l?void 0:l.id)||"",y=i.useMemo(function(){return function(n){switch(n){case"artifact_chunks":return["artifact_chunks","scanned_doc_citation","scanned_doc_citations"];case"rai_artifact_citation":return["rai_artifact_citation","rai_artifact_citations"];case"json_chunks":return["json_chunks"];case"scanned_doc_citation":return["scanned_doc_citation","scanned_doc_citations","artifact_chunks"];case"scanned_doc_citations":return["scanned_doc_citations","scanned_doc_citation","artifact_chunks"];default:return[n]}}(r)},[r]),g=function(){switch(r){case"artifact_chunks":case"scanned_doc_citations":return"scanned_doc_citation";case"rai_artifact_citation":return"rai_artifact_citation";default:return r}}(),p=(null==l?void 0:l.isEcgPayloadActive)?i.useMemo(function(){return["onDemandCitationFetch",h,g,null==l?void 0:l.customCitationId,null==l?void 0:l.ecg_agent_name]},[h,g,null==l?void 0:l.customCitationId,null==l?void 0:l.ecg_agent_name]):i.useMemo(function(){return["onDemandCitationFetch",h,g,u]},[h,g,u]),C=i.useMemo(function(){return o(null==l?void 0:l.citations,y,u)},[null==l?void 0:l.citations,y,u]),b=Boolean(s&&h&&g&&v&&_&&!Number.isNaN(u)&&!C),N=d,w=!0===(null==l?void 0:l.isStreamEnd),A=t.useQuery({queryKey:p,queryFn:function(){return n.__awaiter(void 0,void 0,void 0,function(){var i,t,o,a,r,c,s,d;return n.__generator(this,function(n){switch(n.label){case 0:return[4,e.fetchOnDemandCitation(h,g,u,null!==(t=null==l?void 0:l.content)&&void 0!==t?t:"",N,v,null!=f?f:"",_,null!=m?m:"",null!==(o=null==l?void 0:l.isEcgPayloadActive)&&void 0!==o&&o,null!==(a=null==l?void 0:l.ecg_agent_name)&&void 0!==a?a:"",null!==(r=null==l?void 0:l.customCitationId)&&void 0!==r?r:"",null!==(c=null==l?void 0:l.plan_id)&&void 0!==c?c:"",null!==(s=null==l?void 0:l.ui_chat_history)&&void 0!==s?s:void 0)];case 1:if((i=n.sent()).error||!i.responseData)throw new Error((null===(d=i.error)||void 0===d?void 0:d.errorMessage)||"Failed to fetch on-demand citation");return[2,i.responseData]}})})},enabled:b&&w&&Boolean(null==l?void 0:l.content),staleTime:1/0,cacheTime:1/0,refetchOnMount:!1,refetchOnWindowFocus:!1,retry:!1}),M=i.useMemo(function(){var n,i,t,e,a,r,c,s=null!==(t=null===(i=null===(n=A.data)||void 0===n?void 0:n.result)||void 0===i?void 0:i.citations)&&void 0!==t?t:[];return Array.isArray(s)&&0!==s.length?(null==l?void 0:l.customCitationId)?null!==(a=null!==(e=s.find(function(n){var i,t,e=null!==(t=null!==(i=null==n?void 0:n.title)&&void 0!==i?i:null==n?void 0:n.display_name)&&void 0!==t?t:"";return"string"==typeof e&&e.includes(l.customCitationId)}))&&void 0!==e?e:s[0])&&void 0!==a?a:null:null!==(c=null!==(r=o(s,y,u))&&void 0!==r?r:s[0])&&void 0!==c?c:null:null},[null==l?void 0:l.customCitationId,u,y,A.data]);return{citation:null!=C?C:M,isFetching:A.isFetching,isLoading:A.isLoading,isComplete:A.isSuccess,status:A.status,refetch:A.refetch}};
|
|
2
2
|
//# sourceMappingURL=useOnDemandCitationFetch.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("axios"),t=require("./apicache.service.js"),n=require("../types/onDemandApi.types.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=a(r),o=72e5,i=function(e){if(e&&"object"==typeof e){var r=e;return"string"==typeof r.message?r.message:"string"==typeof r.errorMessage?r.errorMessage:"string"==typeof r.error?r.error:r.error&&"object"==typeof r.error&&"string"==typeof r.error.message?r.error.message:"string"==typeof r.details?r.details:r}},c=function(r){return e.__awaiter(void 0,void 0,void 0,function(){var t;return e.__generator(this,function(e){if(s.default.isAxiosError(r)){if("ECONNABORTED"===(t=r).code)return[2,{type:n.NetworkErrorType.TIMEOUT,message:"The request took too long to complete. Please try again.",originalError:r}];if(t.message.includes("net::ERR_NETWORK_CHANGED")||t.message.includes("net::ERR_INTERNET_DISCONNECTED")||t.message.includes("net::ERR_NAME_NOT_RESOLVED"))return[2,{type:n.NetworkErrorType.INTERNET_DISCONNECTED,message:"Internet connection issue detected. Please check your network.",originalError:r}];if(t.message.includes("Network Error")||"ERR_NETWORK"===t.code||t.message.includes("net::ERR_CONNECTION_REFUSED")||t.message.includes("net::ERR_EMPTY_RESPONSE"))return[2,{type:n.NetworkErrorType.SERVER_UNREACHABLE,message:"Unable to connect to server. The service may be down or unreachable.",originalError:r}];if(t.response&&t.response.status>=500)return[2,{type:n.NetworkErrorType.SERVER_ERROR,message:"Service Unavailable. Server error (".concat(t.response.status,")."),status:t.response.status,originalError:r}];if(t.response&&t.response.status>=400&&t.response.status<500)return[2,{type:n.NetworkErrorType.SERVER_ERROR,message:i(t.response.data)||"Request failed with status code ".concat(t.response.status),status:t.response.status,originalError:r}]}return[2,{type:n.NetworkErrorType.UNKNOWN_ERROR,message:"An unexpected error occurred. Please try again later.",originalError:r}]})})},u=function(r,t){void 0===t&&(t=18e4);var n=s.default.create({baseURL:r,timeout:t});return n.interceptors.request.use(function(r){return e.__awaiter(void 0,void 0,void 0,function(){return e.__generator(this,function(e){return[2,r]})})},function(r){return e.__awaiter(void 0,void 0,void 0,function(){var t;return e.__generator(this,function(e){switch(e.label){case 0:return[4,c(r)];case 1:return t=e.sent(),[2,Promise.reject(t)]}})})}),n.interceptors.response.use(function(e){return e},function(r){return e.__awaiter(void 0,void 0,void 0,function(){var t;return e.__generator(this,function(e){switch(e.label){case 0:return[4,c(r)];case 1:return t=e.sent(),console.error("API Request Failed:",t),[2,Promise.reject(t)]}})})}),n},p=function(e,r,t){return"".concat(e,":").concat(r,":").concat(JSON.stringify(t||{}))},l=u(),_=function(r,t,a){return e.__awaiter(void 0,void 0,void 0,function(){var s,o,i,p,_,d,E;return e.__generator(this,function(g){switch(g.label){case 0:switch(g.trys.push([0,13,,15]),s=(null==a?void 0:a.baseURL)?u(a.baseURL):l,i=(o=a||{}).data,p=o.config,_=void 0,r.toLowerCase()){case"get":return[3,1];case"post":return[3,3];case"put":return[3,5];case"patch":return[3,7];case"delete":return[3,9]}return[3,11];case 1:return[4,s.get(t,p)];case 2:case 4:case 6:case 8:case 10:return _=g.sent(),[3,12];case 3:return[4,s.post(t,i,p)];case 5:return[4,s.put(t,i,p)];case 7:return[4,s.patch(t,i,p)];case 9:return d=e.__assign(e.__assign({},p),{data:i}),[4,s.delete(t,d)];case 11:throw new Error("Unsupported method: ".concat(r));case 12:return[2,{responseData:_.data,error:null}];case 13:return(E=g.sent()).type&&Object.values(n.NetworkErrorType).includes(E.type)?[2,{responseData:null,error:E}]:[4,c(E)];case 14:return[2,{responseData:null,error:g.sent()}];case 15:return[2]}})})},d=function(r,a,s){return e.__awaiter(void 0,void 0,void 0,function(){var i,c,u,l,d,E,g,f,y,h,v,R,m,N;return e.__generator(this,function(T){switch(T.label){case 0:return c=(i=s||{}).data,u=i.params,l=i.config,d=i.errorMessage,E=i.baseURL,g=i.cacheOption,f=i.shouldCache,y=null!==(N=null==g?void 0:g.ttl)&&void 0!==N?N:o,h=(null==g?void 0:g.key)||p(r,a,u),(null==g?void 0:g.forceRefresh)||(null==g?void 0:g.skipCache)?[3,2]:[4,t.apiCache.get(h)];case 1:if(v=T.sent())return[2,{responseData:v.data,error:null,cacheMeta:{isFromCache:!0,timestamp:v.timestamp,ttl:v.ttl,cacheKey:h}}];T.label=2;case 2:return R=e.__assign(e.__assign({},l),u&&{params:u}),[4,_(r,a,{data:c,config:R,baseURL:E})];case 3:return m=T.sent(),!(null==g?void 0:g.skipCache)&&null!=m.responseData&&(!f||f(m.responseData))?[4,t.apiCache.set(h,m.responseData,y)]:[3,5];case 4:T.sent(),T.label=5;case 5:return[2,{responseData:m.responseData,error:m.error?{errorMessage:m.error.type===n.NetworkErrorType.INTERNET_DISCONNECTED||m.error.type===n.NetworkErrorType.SLOW_CONNECTION||m.error.type===n.NetworkErrorType.TIMEOUT?m.error.message:m.error.type===n.NetworkErrorType.SERVER_UNREACHABLE?"Unable to connect to server. Please try again later.":d||m.error.message,errorObjData:m.error}:null,cacheMeta:{isFromCache:!1,timestamp:Date.now(),ttl:y,cacheKey:h}}]}})})};Object.defineProperty(exports,"NetworkErrorType",{enumerable:!0,get:function(){return n.NetworkErrorType}}),exports.DEFAULT_CACHE_TTL=o,exports.createApiInstance=u,exports.fetchOnDemandCitation=function(r,t,n,a,s,o,i,c,u,p,l,_,E,g){return e.__awaiter(void 0,void 0,void 0,function(){var s,f,y,h;return e.__generator(this,function(v){return s="artifact_chunks"===t||"scanned_doc_citation"===t?"artifact_chunks":t,f=p?_:"".concat(s,"_").concat(n),[2,d(y="post",h="/api/chat/chatResponse",{baseURL:o,data:{name:i||"citationsprocessing",organizationName:c,prompt:"",useAgent:{agent_name:u||"ProcessCitationsAgent",arguments:e.__assign(e.__assign({citation_type:t,is_primary_agent_request:!1},p&&{check_possible_citation_payload:!1}),{ui_request_body:e.__assign(e.__assign(e.__assign({llm_formatted_response:a,request_id:r,max_concurrent_citations:10,citation_id:f},p&&l&&{ecg_agent_name:l}),p&&E&&{plan_id:E}),p&&g&&{ui_chat_history:g})})}},config:{headers:{"Content-Type":"application/json"},withCredentials:!0},errorMessage:"Failed to fetch on-demand citation",cacheOption:{key:"".concat(y,":").concat(h,":onDemandCitation:").concat(r,":").concat(t,":").concat(p?_:n)},shouldCache:function(e){var r;return Array.isArray(null===(r=null==e?void 0:e.result)||void 0===r?void 0:r.citations)&&Boolean(e.result.citations[0])}})]})})},exports.generateCacheKey=p,exports.makeApiRequest=_,exports.makeApiRequestWithTTLCache=d;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("axios"),t=require("./apicache.service.js"),n=require("../types/onDemandApi.types.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=a(r),o=72e5,i=function(e){if(e&&"object"==typeof e){var r=e;return"string"==typeof r.message?r.message:"string"==typeof r.errorMessage?r.errorMessage:"string"==typeof r.error?r.error:r.error&&"object"==typeof r.error&&"string"==typeof r.error.message?r.error.message:"string"==typeof r.details?r.details:r}},c=function(r){return e.__awaiter(void 0,void 0,void 0,function(){var t;return e.__generator(this,function(e){if(s.default.isAxiosError(r)){if("ECONNABORTED"===(t=r).code)return[2,{type:n.NetworkErrorType.TIMEOUT,message:"The request took too long to complete. Please try again.",originalError:r}];if(t.message.includes("net::ERR_NETWORK_CHANGED")||t.message.includes("net::ERR_INTERNET_DISCONNECTED")||t.message.includes("net::ERR_NAME_NOT_RESOLVED"))return[2,{type:n.NetworkErrorType.INTERNET_DISCONNECTED,message:"Internet connection issue detected. Please check your network.",originalError:r}];if(t.message.includes("Network Error")||"ERR_NETWORK"===t.code||t.message.includes("net::ERR_CONNECTION_REFUSED")||t.message.includes("net::ERR_EMPTY_RESPONSE"))return[2,{type:n.NetworkErrorType.SERVER_UNREACHABLE,message:"Unable to connect to server. The service may be down or unreachable.",originalError:r}];if(t.response&&t.response.status>=500)return[2,{type:n.NetworkErrorType.SERVER_ERROR,message:"Service Unavailable. Server error (".concat(t.response.status,")."),status:t.response.status,originalError:r}];if(t.response&&t.response.status>=400&&t.response.status<500)return[2,{type:n.NetworkErrorType.SERVER_ERROR,message:i(t.response.data)||"Request failed with status code ".concat(t.response.status),status:t.response.status,originalError:r}]}return[2,{type:n.NetworkErrorType.UNKNOWN_ERROR,message:"An unexpected error occurred. Please try again later.",originalError:r}]})})},u=function(r,t){void 0===t&&(t=18e4);var n=s.default.create({baseURL:r,timeout:t});return n.interceptors.request.use(function(r){return e.__awaiter(void 0,void 0,void 0,function(){return e.__generator(this,function(e){return[2,r]})})},function(r){return e.__awaiter(void 0,void 0,void 0,function(){var t;return e.__generator(this,function(e){switch(e.label){case 0:return[4,c(r)];case 1:return t=e.sent(),[2,Promise.reject(t)]}})})}),n.interceptors.response.use(function(e){return e},function(r){return e.__awaiter(void 0,void 0,void 0,function(){var t;return e.__generator(this,function(e){switch(e.label){case 0:return[4,c(r)];case 1:return t=e.sent(),console.error("API Request Failed:",t),[2,Promise.reject(t)]}})})}),n},p=function(e,r,t){return"".concat(e,":").concat(r,":").concat(JSON.stringify(t||{}))},l=u(),_=function(r,t,a){return e.__awaiter(void 0,void 0,void 0,function(){var s,o,i,p,_,d,E;return e.__generator(this,function(g){switch(g.label){case 0:switch(g.trys.push([0,13,,15]),s=(null==a?void 0:a.baseURL)?u(a.baseURL):l,i=(o=a||{}).data,p=o.config,_=void 0,r.toLowerCase()){case"get":return[3,1];case"post":return[3,3];case"put":return[3,5];case"patch":return[3,7];case"delete":return[3,9]}return[3,11];case 1:return[4,s.get(t,p)];case 2:case 4:case 6:case 8:case 10:return _=g.sent(),[3,12];case 3:return[4,s.post(t,i,p)];case 5:return[4,s.put(t,i,p)];case 7:return[4,s.patch(t,i,p)];case 9:return d=e.__assign(e.__assign({},p),{data:i}),[4,s.delete(t,d)];case 11:throw new Error("Unsupported method: ".concat(r));case 12:return[2,{responseData:_.data,error:null}];case 13:return(E=g.sent()).type&&Object.values(n.NetworkErrorType).includes(E.type)?[2,{responseData:null,error:E}]:[4,c(E)];case 14:return[2,{responseData:null,error:g.sent()}];case 15:return[2]}})})},d=function(r,a,s){return e.__awaiter(void 0,void 0,void 0,function(){var i,c,u,l,d,E,g,f,y,h,v,R,m,N;return e.__generator(this,function(T){switch(T.label){case 0:return c=(i=s||{}).data,u=i.params,l=i.config,d=i.errorMessage,E=i.baseURL,g=i.cacheOption,f=i.shouldCache,y=null!==(N=null==g?void 0:g.ttl)&&void 0!==N?N:o,h=(null==g?void 0:g.key)||p(r,a,u),(null==g?void 0:g.forceRefresh)||(null==g?void 0:g.skipCache)?[3,2]:[4,t.apiCache.get(h)];case 1:if(v=T.sent())return[2,{responseData:v.data,error:null,cacheMeta:{isFromCache:!0,timestamp:v.timestamp,ttl:v.ttl,cacheKey:h}}];T.label=2;case 2:return R=e.__assign(e.__assign({},l),u&&{params:u}),[4,_(r,a,{data:c,config:R,baseURL:E})];case 3:return m=T.sent(),!(null==g?void 0:g.skipCache)&&null!=m.responseData&&(!f||f(m.responseData))?[4,t.apiCache.set(h,m.responseData,y)]:[3,5];case 4:T.sent(),T.label=5;case 5:return[2,{responseData:m.responseData,error:m.error?{errorMessage:m.error.type===n.NetworkErrorType.INTERNET_DISCONNECTED||m.error.type===n.NetworkErrorType.SLOW_CONNECTION||m.error.type===n.NetworkErrorType.TIMEOUT?m.error.message:m.error.type===n.NetworkErrorType.SERVER_UNREACHABLE?"Unable to connect to server. Please try again later.":d||m.error.message,errorObjData:m.error}:null,cacheMeta:{isFromCache:!1,timestamp:Date.now(),ttl:y,cacheKey:h}}]}})})};Object.defineProperty(exports,"NetworkErrorType",{enumerable:!0,get:function(){return n.NetworkErrorType}}),exports.DEFAULT_CACHE_TTL=o,exports.createApiInstance=u,exports.fetchOnDemandCitation=function(r,t,n,a,s,o,i,c,u,p,l,_,E,g){return e.__awaiter(void 0,void 0,void 0,function(){var s,f,y,h;return e.__generator(this,function(v){return s="artifact_chunks"===t||"scanned_doc_citation"===t?"artifact_chunks":t,f=p?_:"".concat(s,"_").concat(n),[2,d(y="post",h="/api/chat/chatResponse",{baseURL:o,data:{name:i||"citationsprocessing",organizationName:c,prompt:"",useAgent:{agent_name:u||"ProcessCitationsAgent",arguments:e.__assign(e.__assign({citation_type:t,is_primary_agent_request:!1},p&&{check_possible_citation_payload:!1}),{ui_request_body:e.__assign(e.__assign(e.__assign({llm_formatted_response:a,request_id:r,max_concurrent_citations:10,citation_id:f},p&&l&&{ecg_agent_name:l}),p&&E&&{plan_id:E}),p&&g&&{ui_chat_history:g})})}},config:{headers:{"Content-Type":"application/json"},withCredentials:!0},errorMessage:"Failed to fetch on-demand citation",cacheOption:{key:"".concat(y,":").concat(h,":onDemandCitation:").concat(r,":").concat(t,":").concat(p?_:n,":").concat(p?l:"")},shouldCache:function(e){var r;return Array.isArray(null===(r=null==e?void 0:e.result)||void 0===r?void 0:r.citations)&&Boolean(e.result.citations[0])}})]})})},exports.generateCacheKey=p,exports.makeApiRequest=_,exports.makeApiRequestWithTTLCache=d;
|
|
2
2
|
//# sourceMappingURL=onDemandApi.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as i}from"tslib";import{jsxs as l,jsx as n}from"react/jsx-runtime";import{ChevronUp as e,ChevronDown as o}from"lucide-react";import{useState as t,useMemo as d}from"react";import r from"./ResizableSplitPane.js";import a from"../PdfViewer/PdfViewer.js";import{DefaultFullScreenCloseIcon as u,DefaultFullScreenIcon as s}from"../../assests/svg/PdfViewerIcons.js";var c=function(l){var e,o,t,u,s,c,v,g=l.href,p=l.metaData,h=l.citationTitle,m=l.isFullscreen,f=function(i){try{return new URL(i,window.location.origin).searchParams.get("citationNumber")}catch(i){return null}}(g),_=f&&(null===(e=null==p?void 0:p.citations)||void 0===e?void 0:e[f])||{},x=(null===(o=null==p?void 0:p.docData)||void 0===o?void 0:o.documents)||{},b=(null===(t=null==p?void 0:p.docData)||void 0===t?void 0:t.input_index_map)||{},y=null==b?void 0:b[0],w=null==b?void 0:b[1],C=y?x[y]:null,P=w?x[w]:null,F=y?_[y]:null,S=w?_[w]:null,D=d(function(){var i,l,e,o;return F&&C?n(a,{defaultScale:"PageWidth",showFullScreenAction:!1,showHighlightsAction:!1,pdfName:null==C?void 0:C.title,pdfUrl:null==C?void 0:C.signed_url,highlightText:[null!==(i=null==F?void 0:F.highlighted_text)&&void 0!==i?i:""],highlightPages:{1:null===(l=null==F?void 0:F.custom_metadata)||void 0===l?void 0:l.pdf_start_page_number},jumpToPageValue:1,highlightCordinatePages:[],useCoordinates:!1,useRange:!0,rangeOfPages:[null===(e=null==F?void 0:F.custom_metadata)||void 0===e?void 0:e.pdf_start_page_number,null===(o=null==F?void 0:F.custom_metadata)||void 0===o?void 0:o.pdf_end_page_number]}):null},[null==C?void 0:C.title,null==C?void 0:C.signed_url,null==F?void 0:F.highlighted_text,null===(u=null==F?void 0:F.custom_metadata)||void 0===u?void 0:u.pdf_start_page_number,null===(s=null==F?void 0:F.custom_metadata)||void 0===s?void 0:s.pdf_end_page_number]),k=d(function(){var i,l,e,o;return S&&P?n(a,{defaultScale:"PageWidth",showFullScreenAction:!1,showHighlightsAction:!1,pdfName:null==P?void 0:P.title,pdfUrl:null==P?void 0:P.signed_url,jumpToPageValue:1,highlightText:[null!==(i=null==S?void 0:S.highlighted_text)&&void 0!==i?i:""],highlightPages:{1:null===(l=null==S?void 0:S.custom_metadata)||void 0===l?void 0:l.pdf_start_page_number},highlightCordinatePages:[],useCoordinates:!1,useRange:!0,rangeOfPages:[null===(e=null==S?void 0:S.custom_metadata)||void 0===e?void 0:e.pdf_start_page_number,null===(o=null==S?void 0:S.custom_metadata)||void 0===o?void 0:o.pdf_end_page_number]}):null},[null==P?void 0:P.title,null==P?void 0:P.signed_url,null==S?void 0:S.highlighted_text,null===(c=null==S?void 0:S.custom_metadata)||void 0===c?void 0:c.pdf_start_page_number,null===(v=null==S?void 0:S.custom_metadata)||void 0===v?void 0:v.pdf_end_page_number]),j=d(function(){return D||k?n(r,{leftComponent:D,rightComponent:k,isFullscreen:m}):null},[D,k,m]);return f?["contract","clause"].includes(h)?n("div",F||S?i({style:{height:"100%",display:"flex",flexDirection:"column"}},{children:j}):{children:"Missing PDF Citation. Please try again later"}):n("div",{children:"No Citation Found. Please try again later"}):null},v=function(d){var r,a,v,g=d.href,p=d.children,h=d.metaData,m=d.chevronUpComponent,f=void 0===m?null:m,_=d.chevronDownComponent,x=void 0===_?null:_,b=d.customStyle,y=void 0===b?{}:b,w=d.defaultState,C=t(void 0!==w&&w),P=C[0],F=C[1],S=t(!1),D=S[0],k=S[1],j="string"==typeof p&&(null===(r=null==p?void 0:p.split("\n"))||void 0===r?void 0:r.length)>1?p.split("\n").join(" "):p,z="string"==typeof p?p:p[0],R=null!=f?f:function(i){var l,o;return n(e,{size:null!==(l=null==i?void 0:i.fontSize)&&void 0!==l?l:16,color:null!==(o=null==i?void 0:i.color)&&void 0!==o?o:"rgb(214, 51, 132)"})}(null!==(a=null==y?void 0:y.arrow)&&void 0!==a?a:{}),T=null!=x?x:function(i){var l,e;return n(o,{size:null!==(l=null==i?void 0:i.fontSize)&&void 0!==l?l:16,color:null!==(e=null==i?void 0:i.color)&&void 0!==e?e:"rgb(214, 51, 132)"})}(null!==(v=null==y?void 0:y.arrow)&&void 0!==v?v:{});return l("span",i({style:i({display:"inline"},y.relativeWrapper||{})},{children:[n("div",i({style:i({display:"inline",marginTop:0},y.citationButtonWrapper||{})},{children:l("button",i({type:"button",onClick:function(){return F(function(i){return!i})},style:i({display:"inline-flex",alignItems:"center",gap:"3px",fontFamily:'"Inter", sans-serif',backgroundColor:"transparent",padding:0,margin:0,fontSize:"13px",borderRadius:9999,cursor:"pointer",fontWeight:700,color:"rgb(214, 51, 132)",border:"none",textDecoration:"none",wordBreak:"break-word",whiteSpace:"normal"},y.citationButton||{})},{children:[n("span",{children:j}),n("span",i({style:{display:"flex",alignItems:"center"}},{children:P?R:T}))]}))})),P&&l("div",i({style:D?{position:"fixed",inset:0,zIndex:999999,backgroundColor:"#FAFAFA",display:"flex",flexDirection:"column"}:{boxSizing:"border-box",border:"1px solid #E4E7EC",borderRadius:"8px",overflow:"hidden",marginTop:"8px",display:"flex",flexDirection:"column",width:"100%"}},{children:[n("div",i({style:{display:"flex",justifyContent:"flex-end",padding:"6px 10px",borderBottom:"1px solid #E4E7EC",backgroundColor:"#FFFFFF",flexShrink:0}},{children:n("button",i({onClick:function(){k(function(i){return!i})},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",borderRadius:"6px",color:"#475467",marginRight:"9px"}},{children:n(D?u:s,{})}))})),n("div",i({style:{flex:1,minHeight:0,height:"100%",overflow:"hidden"}},{children:n(c,{href:g,children:p,metaData:h,citationTitle:z,isFullscreen:D})}))]}))]}))};export{v as default};
|
|
1
|
+
import{__assign as i,__awaiter as n,__generator as o}from"tslib";import{jsxs as t,jsx as e,Fragment as l}from"react/jsx-runtime";import{Globe as r,ChevronUp as a,ChevronDown as d,Maximize2 as u,X as c,ExternalLink as s}from"lucide-react";import{useState as v,useEffect as p,useMemo as h,useRef as m}from"react";import g from"./ResizableSplitPane.js";import f from"../PdfViewer/PdfViewer.js";import{DefaultFullScreenCloseIcon as x,DefaultFullScreenIcon as b}from"../../assests/svg/PdfViewerIcons.js";import _ from"react-markdown";import y from"rehype-raw";import{Dialog as w,Box as C}from"@mui/material";import{SHARED_MARKDOWN_STYLES as F}from"./CognitiveCompareConfig.js";import"react-dom";import{useCompareContext as D}from"./CompareContext.js";import{processGuidelinesMarkdown as P}from"./Guidelines/utils/processGuidelinesMarkdown.js";import S from"../GptWebCitation/GptWebCitation.js";import{CitationType as T}from"../GptWebCitation/types.js";import"./MoreFunctionsPopup.js";import"./components/SubSectionAccordion.js";import"./components/LHSSectionRow.js";import"./components/RHSSectionRow.js";var k=function(i){var n,o,t;return(null===(t=null===(o=null===(n=(null==i?void 0:i.extraMetaData)||i)||void 0===n?void 0:n.aiReasoningCitation)||void 0===o?void 0:o.gpt_citation)||void 0===t?void 0:t[0])||null},j="https://dev-proposals-ai.techo.camp/utility/ca-workflow-composer-agent/get_citation",I="sai.siddhartha@techolution.com",G="672e32f7a0e8fe2e8e50bcba",N="TNV Sai Siddhartha",R="90vh",E="calc(".concat(R," - 120px)"),M=function(){var i;return"function"==typeof(null===(i=globalThis.crypto)||void 0===i?void 0:i.randomUUID)?globalThis.crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){var n=Math.floor(16*Math.random());return("x"===i?n:n%4+8).toString(16)})},A=function(i,n){var o=function(i){var n;return(null==i?void 0:i.payloadCitationId)||(null===(n=null==i?void 0:i.extraMetaData)||void 0===n?void 0:n.payloadCitationId)||""}(i)||n||M();return function(i,n){i&&"object"==typeof i&&(i.payloadCitationId=n,i.extraMetaData&&"object"==typeof i.extraMetaData&&(i.extraMetaData.payloadCitationId=n))}(i,o),o},U=function(t){var l,r=t.metaData,g=t.isFullscreen,f=void 0!==g&&g,x=D().gptWebCitationConfig,b=h(function(){return function(i){return{endpoint:(null==i?void 0:i.endpoint)||j,userEmail:(null==i?void 0:i.userEmail)||I,userId:(null==i?void 0:i.userId)||G,userName:(null==i?void 0:i.userName)||N,headers:null==i?void 0:i.headers}}(x)},[x]),_=null==r?void 0:r.webGpt,y=m(null);y.current||(y.current=M());var w=h(function(){return function(i,n,o){var t,e,l=k(i),r=(null==l?void 0:l.customMetaData)||{},a=(null==r?void 0:r.value)||{},d=(null==i?void 0:i.webSearchAnswer)||{},u=(null==i?void 0:i.extraMetaData)||i||{};return{userEmail:(null==i?void 0:i.userEmail)||(null==d?void 0:d.userEmail)||(null==n?void 0:n.userEmail)||"",userId:(null==i?void 0:i.userId)||(null==d?void 0:d.userId)||(null==n?void 0:n.userId)||"",userName:(null==i?void 0:i.userName)||(null==d?void 0:d.userName)||(null==n?void 0:n.userName)||"",citationId:A(i,o),citationUrl:(null==a?void 0:a.citationUrl)||(null==d?void 0:d.citationUrl)||"",content:(null==u?void 0:u.Reasoning)||(null==d?void 0:d.enhanced_content)||"",citationType:(null==a?void 0:a.citationType)||"web",citatioNumber:null!==(e=null!==(t=null==r?void 0:r.citation_number)&&void 0!==t?t:null==l?void 0:l.citation_number)&&void 0!==e?e:Number((null==i?void 0:i.reasoningId)||0)}}(_,b,y.current||void 0)},[_,b]),C=h(function(){return k(_)},[_]),F=(null===(l=null==C?void 0:C.customMetaData)||void 0===l?void 0:l.value)||{},P=(null==_?void 0:_.extraMetaData)||_||{},R=v(),U=R[0],W=R[1],H=v("pending"),z=H[0],V=H[1],B=v(!0),O=B[0],L=B[1];p(function(){var t=!0;return n(void 0,void 0,void 0,function(){var n,e,l,r;return o(this,function(o){switch(o.label){case 0:if(!b.endpoint||!(null==w?void 0:w.citationUrl)||!(null==w?void 0:w.content))return V("error"),[2];V("pending"),o.label=1;case 1:return o.trys.push([1,4,,5]),[4,fetch(b.endpoint,{method:"POST",headers:i({"actor-id":w.userEmail,Accept:"application/json, text/plain, */*","Content-Type":"application/json"},b.headers||{}),body:JSON.stringify(w)})];case 2:if(!(n=o.sent()).ok)throw new Error("Failed to fetch GPT web citation (".concat(n.status,")"));return[4,n.json()];case 3:return e=o.sent(),l=(null==e?void 0:e.responseData)||(null==e?void 0:e.result)||(null==e?void 0:e.data)||e,t?(W(l),V("success"),[3,5]):[2];case 4:return r=o.sent(),t?(console.error("Failed to load GPT web citation",r),V("error"),[3,5]):[2];case 5:return[2]}})}),function(){t=!1}},[w,b]);var J=h(function(){return{item:{confidence_score:Number((null==P?void 0:P.Confidence_score)||0),text:(null==F?void 0:F.paraphrase)||"Web citation reasoning",dataSource:(null==F?void 0:F.text)||(null==P?void 0:P.Reasoning)||"",paraphrase:(null==F?void 0:F.paraphrase)||""},headerTitle:"GPT Web Citation",index:Number((null==w?void 0:w.citatioNumber)||1)-1,iconsConfig:{ChevronDownIcon:d,ChevronUpIcon:a,MaximizeIcon:u,CloseIcon:c}}},[F,null==w?void 0:w.citatioNumber,P]),q=h(function(){return i(i({},J),f?{bodyHeight:E}:{})},[J,f]);return e(S,{gptCitation:q,defaultCitationUrl:(null==w?void 0:w.citationUrl)||"",citationType:T.GPT_WEB,webCitationData:U,webCitationStatus:z,showWebCitation:O,onToggleCitationView:function(){return L(function(i){return!i})},iconsConfig:{MaximizeIcon:u,ExternalLinkIcon:s},isFixedHeight:!0})},W=function(n){var o,t,r,a,d,u,c,s=n.href,v=n.metaData,p=n.citationTitle,m=n.citationType,x=n.citationReason,b=n.isFullscreen,w=D().guidelinesData,S=function(i){try{var n=new URL(i,window.location.origin);return{citationNumber:n.searchParams.get("citationNumber"),phraseToHighlight:n.searchParams.get("phrase_to_highlight")}}catch(i){return{citationNumber:null,phraseToHighlight:null}}}(s),T=S.citationNumber,k=S.phraseToHighlight,j=T&&(null===(o=null==v?void 0:v.citations)||void 0===o?void 0:o[T])||{},I=(null===(t=null==v?void 0:v.docData)||void 0===t?void 0:t.documents)||{},G=(null===(r=null==v?void 0:v.docData)||void 0===r?void 0:r.input_index_map)||{},N=Object.keys((null==v?void 0:v.citations)||{}).length>0||Object.keys((null==v?void 0:v.docData)||{}).length>0,R=null==G?void 0:G[0],E=null==G?void 0:G[1],M=R?I[R]:null,A=E?I[E]:null,W=R?j[R]:null,H=E?j[E]:null,z=h(function(){var i,n,o,t;return W&&M?e(f,{defaultScale:"PageWidth",showFullScreenAction:!1,showHighlightsAction:!1,pdfName:null==M?void 0:M.title,pdfUrl:null==M?void 0:M.signed_url,highlightText:[null!==(i=null==W?void 0:W.highlighted_text)&&void 0!==i?i:""],highlightPages:{1:null===(n=null==W?void 0:W.custom_metadata)||void 0===n?void 0:n.pdf_start_page_number},jumpToPageValue:1,highlightCordinatePages:[],useCoordinates:!1,useRange:!0,rangeOfPages:[null===(o=null==W?void 0:W.custom_metadata)||void 0===o?void 0:o.pdf_start_page_number,null===(t=null==W?void 0:W.custom_metadata)||void 0===t?void 0:t.pdf_end_page_number]}):null},[null==M?void 0:M.title,null==M?void 0:M.signed_url,null==W?void 0:W.highlighted_text,null===(a=null==W?void 0:W.custom_metadata)||void 0===a?void 0:a.pdf_start_page_number,null===(d=null==W?void 0:W.custom_metadata)||void 0===d?void 0:d.pdf_end_page_number]),V=h(function(){var i,n,o,t;return H&&A?e(f,{defaultScale:"PageWidth",showFullScreenAction:!1,showHighlightsAction:!1,pdfName:null==A?void 0:A.title,pdfUrl:null==A?void 0:A.signed_url,jumpToPageValue:1,highlightText:[null!==(i=null==H?void 0:H.highlighted_text)&&void 0!==i?i:""],highlightPages:{1:null===(n=null==H?void 0:H.custom_metadata)||void 0===n?void 0:n.pdf_start_page_number},highlightCordinatePages:[],useCoordinates:!1,useRange:!0,rangeOfPages:[null===(o=null==H?void 0:H.custom_metadata)||void 0===o?void 0:o.pdf_start_page_number,null===(t=null==H?void 0:H.custom_metadata)||void 0===t?void 0:t.pdf_end_page_number]}):null},[null==A?void 0:A.title,null==A?void 0:A.signed_url,null==H?void 0:H.highlighted_text,null===(u=null==H?void 0:H.custom_metadata)||void 0===u?void 0:u.pdf_start_page_number,null===(c=null==H?void 0:H.custom_metadata)||void 0===c?void 0:c.pdf_end_page_number]),B="dual_citation"===m,O=B&&!!(null==v?void 0:v.webGpt),L=h(function(){if(!z)return null;var n=O?e(U,{metaData:v,isFullscreen:b}):"rulebook_citation"===m?e(l,{children:e(C,i({sx:i(i({padding:"0px 20px",backgroundColor:"#FFFFFF",borderRadius:"8px"},F),{overflow:"auto"})},{children:e(_,i({rehypePlugins:[y]},{children:P({guidelinesData:w,targetHighlights:[k],labelColor:"#FEF08A"})}))}))}):V;return n?e(g,{leftComponent:z,rightComponent:n,isFullscreen:b}):z},[z,V,m,O,v,b]);return(null==v?void 0:v.webGpt)&&!N?e(U,{metaData:v,isFullscreen:b}):T?"rulebook_citation"===m?e("div",W?i({style:{height:"100%",display:"flex",flexDirection:"column"}},{children:L}):i({style:{padding:"12px",fontSize:"13px",color:"#344054",lineHeight:1.5}},{children:x||"Rulebook citation selected."})):B?W||H?e("div",i({style:{height:"100%",display:"flex",flexDirection:"column"}},{children:L})):(null==v?void 0:v.webGpt)?e(U,{metaData:v,isFullscreen:b}):e("div",{children:"Missing PDF Citation. Please try again later"}):["contract","clause"].includes(p)?e("div",W||H?i({style:{height:"100%",display:"flex",flexDirection:"column"}},{children:L}):{children:"Missing PDF Citation. Please try again later"}):e("div",{children:"No Citation Found. Please try again later"}):null},H=function(n){var o,l,u,c,s,h,m,g=n.href,f=n.children,_=n.citationType,y=n.citationReason,C=n.metaData,F=n.chevronUpComponent,D=void 0===F?null:F,P=n.chevronDownComponent,S=void 0===P?null:P,T=n.customStyle,k=void 0===T?{}:T,j=n.defaultState,I=void 0!==j&&j,G=n.onFullscreenChange,N=v(I),E=N[0],M=N[1],A=v(!1),U=A[0],H=A[1],z="string"==typeof f&&(null===(o=null==f?void 0:f.split("\n"))||void 0===o?void 0:o.length)>1?f.split("\n").join(" "):f;p(function(){if(null==G||G(U),U)return function(){null==G||G(!1)}},[U,G]);var V="string"==typeof f?f:f[0],B=null!=D?D:function(i){var n,o;return e(a,{size:null!==(n=null==i?void 0:i.fontSize)&&void 0!==n?n:16,color:null!==(o=null==i?void 0:i.color)&&void 0!==o?o:"rgb(214, 51, 132)"})}(null!==(l=null==k?void 0:k.arrow)&&void 0!==l?l:{}),O=null!=S?S:function(i){var n,o;return e(d,{size:null!==(n=null==i?void 0:i.fontSize)&&void 0!==n?n:16,color:null!==(o=null==i?void 0:i.color)&&void 0!==o?o:"rgb(214, 51, 132)"})}(null!==(u=null==k?void 0:k.arrow)&&void 0!==u?u:{}),L=t("div",i({style:{boxSizing:"border-box",border:U?"none":"1px solid #E4E7EC",borderRadius:U?0:"8px",overflow:"hidden",marginTop:U?0:"8px",display:"flex",flexDirection:"column",width:"100%",height:U?"100%":void 0,backgroundColor:"#FAFAFA"}},{children:[e("div",i({style:{display:"flex",justifyContent:"flex-end",padding:"6px 10px",borderBottom:"1px solid #E4E7EC",backgroundColor:"#FFFFFF",flexShrink:0}},{children:e("button",i({onClick:function(){H(function(i){return!i})},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",borderRadius:"6px",color:"#475467",marginRight:"9px"}},{children:e(U?x:b,{})}))})),e("div",i({style:{flex:1,minHeight:0,height:"100%",overflow:"hidden"}},{children:e(W,{href:g,children:f,metaData:C,citationTitle:V,citationType:_,citationReason:y,isFullscreen:U})}))]}));return t("span",i({style:i({display:"inline"},k.relativeWrapper||{})},{children:[e("div",i({style:i({display:"inline",marginTop:0},k.citationButtonWrapper||{})},{children:t("button",i({type:"button",onClick:function(){return M(function(i){return!i})},style:i({display:(null==C?void 0:C.webGpt)?"inline":"inline-flex",alignItems:(null==C?void 0:C.webGpt)?void 0:"center",gap:(null==C?void 0:C.webGpt)?void 0:"3px",fontFamily:'"Inter", sans-serif',backgroundColor:"transparent",padding:0,margin:0,fontSize:"13px",borderRadius:9999,cursor:"pointer",fontWeight:(null==C?void 0:C.webGpt)?600:700,color:(null==C?void 0:C.webGpt)?"#6D28D9":"rgb(214, 51, 132)",border:"none",textDecoration:"none",wordBreak:"break-word",whiteSpace:"normal"},k.citationButton||{})},{children:[(null==C?void 0:C.webGpt)&&e(r,{size:null!==(s=null===(c=k.arrow)||void 0===c?void 0:c.fontSize)&&void 0!==s?s:"1em",color:null!==(m=null===(h=k.arrow)||void 0===h?void 0:h.color)&&void 0!==m?m:"#6D28D9",style:{display:"inline-block",width:"1em",height:"1em",marginRight:"3px",verticalAlign:"-0.125em",flexShrink:0}}),e("span",{children:z}),e("span",i({style:{display:"inline-flex",alignItems:"center",marginLeft:(null==C?void 0:C.webGpt)?"3px":void 0,verticalAlign:(null==C?void 0:C.webGpt)?"-0.125em":void 0}},{children:E?B:O}))]}))})),E&&(U?e(w,i({open:U,onClose:function(){return H(!1)},maxWidth:!1,BackdropProps:{sx:{backgroundColor:"rgba(0, 0, 0, 0.6)",backdropFilter:"blur(4px)"}},PaperProps:{sx:{backgroundColor:"#FAFAFA",borderRadius:"16px",height:R,m:0,maxHeight:R,maxWidth:"95vw",overflow:"hidden",width:"95vw"}}},{children:L})):L)]}))};export{H as default};
|
|
2
2
|
//# sourceMappingURL=CitationAnchor.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as r}from"tslib";import{jsx as
|
|
1
|
+
import{__rest as n,__assign as r}from"tslib";import{jsx as t,jsxs as e}from"react/jsx-runtime";import{useMemo as i}from"react";import{Box as o,Typography as a}from"@mui/material";import l from"react-markdown";import c from"rehype-raw";import u from"./CitationAnchor.js";import{mergeRulebookCitationsIntoMatchingLinks as d}from"./Guidelines/utils/helper.js";var s=function(n){return n?"./dual-citation?citationNumber=".concat(encodeURIComponent(n)):""};function f(f){var p=f.content,m=void 0===p?"":p,v=f.title,h=void 0===v?"":v,x=f.citations,g=void 0===x?{}:x,y=f.styles,D=void 0===y?{}:y,b=f.docData,w=void 0===b?{}:b,C=f.deviationData,S=void 0===C?null:C;f.open;var F=f.onCitationFullscreenChange,E=i(function(){return JSON.stringify(g||{})},[g]),_=i(function(){return g},[E]),j=i(function(){return JSON.stringify(w||{})},[w]),A=i(function(){return w},[j]),M=i(function(){return{citations:_,docData:A}},[_,A]),N=i(function(){var n=null==S?void 0:S.web_search_answer,r=(null==n?void 0:n.extraMetaData)||{};return Object.keys(r).reduce(function(n,r){var t=function(n,r){var t;if(!n||!r)return null;var e=null==n?void 0:n.web_search_answer,i=null===(t=null==e?void 0:e.extraMetaData)||void 0===t?void 0:t[r];return e&&i?{reasoningId:r,evaluation:n,webSearchAnswer:e,extraMetaData:i}:null}(S,r);return t&&(n[r]=t),n},{})},[S]),O=i(function(){return d(m)},[m]),R=i(function(){return{a:function(e){var i,o=e.href,a=void 0===o?"":o,l=e.children,c=e.type,d=e.reason,f=n(e,["href","children","type","reason"]),p=null==f?void 0:f["data-cognitive-reasoning"],m=!0===(i=null==f?void 0:f["dual-citation"])||"true"===i,v=m&&p?N[String(p)]:null;return t(u,{href:m?s(String(p||"")):a,children:l,citationType:m?"dual_citation":c,citationReason:d,metaData:r(r({},M),v?{webGpt:v}:{}),customStyle:v?{arrow:{color:"#6D28D9"}}:{},onFullscreenChange:F})}}},[M,N,F]);return e(o,r({sx:{borderRadius:"8px",border:"1px solid #E4E7EC",bgcolor:"#FCFCFD"}},{children:[t(o,r({sx:{px:1.5,py:.75,borderBottom:"1px solid #EAECF0"}},{children:t(a,r({sx:{fontSize:"15px",fontWeight:600,color:"#344054",lineHeight:1.25}},{children:h}))})),t(o,r({sx:{px:1.5,py:1.1,display:"flex",flexDirection:"column",gap:.95}},{children:t(o,r({sx:{display:"flex",flexDirection:"column"}},{children:t(a,r({component:"div",sx:r({},D)},{children:t(l,r({components:R,rehypePlugins:[c]},{children:O}))}))}))}))]}))}export{f as default};
|
|
2
2
|
//# sourceMappingURL=CitationRenderer.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__spreadArray as n,__awaiter as i,__generator as t}from"tslib";import{jsx as o,jsxs as r}from"react/jsx-runtime";import{useState as l,useRef as u,useMemo as c,useEffect as a,useCallback as s}from"react";import{Box as d,Snackbar as v,Alert as f,Tooltip as p,Typography as g}from"@mui/material";import{ChevronDown as m}from"lucide-react";import{ButtonCognitiveIcon as h}from"../../assests/svg/ButtonCognitiveIcon.js";import S from"./OverlayComponent.js";import{safeStringify as x,extractDeviationScore as R,generateColorPalette as y,findKeyPathByNodeId as b,DEVIATION_BADGE_SEPARATOR as C,hasMeaningfulRedlineTags as w,scrollAndHighlightClause as _,scrollAndWait as B,waitForScrollIdle as E}from"./CognitiveComparehelpers.js";import{SHARED_MARKDOWN_STYLES as F,DEFAULT_FIELD_CONFIG as I,DEFAULT_COMPARISON_CONFIG as T}from"./CognitiveCompareConfig.js";export{SHARED_MARKDOWN_STYLES}from"./CognitiveCompareConfig.js";import{DEFAULT_DEVIAION_COLOR as A,EMPTY_SUMMARY_POPUP_STATE as D,DEFAULT_COMPONENT_HEADER_TEXT as O}from"./CognitiveCompareConstants.js";import P from"./CognitivePopup.js";import k from"./MoreFunctionsPopup.js";import L from"./LoaderComponent.js";import j from"./components/ThreeDotsLoader.js";import{useCognitiveTreeData as N}from"./hooks/useCompareData.js";import{useComparePopups as H}from"./hooks/useComparePopups.js";import{useSectionRefs as M}from"./hooks/useSectionRefs.js";import{useAccordionState as z}from"./hooks/useAccordionState.js";import{useDeviationNavigation as q}from"./hooks/useDeviationNavigation.js";import V from"./components/CompareHeader.js";import W from"./components/SubSectionAccordion.js";import K from"./components/LHSSectionRow.js";import J from"./components/RHSSectionRow.js";import Y from"./components/CognitiveSummaryPopup.js";import{CompareContextProvider as X}from"./CompareContext.js";import{useStyleHelpers as $}from"./hooks/useStyles.js";import{useResizeHandler as U}from"./hooks/useResizeHandler.js";import{useLinesCalculator as G}from"./hooks/useLinesCalculator.js";import{useSideBySide as Q}from"./hooks/useSideBySide.js";import Z from"./components/SvgConnectors.js";var ee=function(ee){var ne,ie,te,oe,re,le,ue,ce,ae,se,de,ve,fe,pe,ge,me,he,Se,xe,Re,ye,be,Ce,we,_e,Be,Ee,Fe,Ie,Te,Ae,De,Oe,Pe,ke,Le=ee.componentHeaderText,je=void 0===Le?O:Le,Ne=ee.treeData,He=ee.comparisonConfig,Me=ee.leftColumnTitleText,ze=ee.rightColumnTitleText,qe=ee.markdownStyles,Ve=ee.resetTrigger,We=ee.displayConfig,Ke=void 0===We?{isHeaderVisible:!0,isToggleVisible:!0,maintainRelativeOrder:!1,isLoading:!0,showDeviationBadges:!1,enableDeviationSchemaBackwardCompatibility:!1,displayEmailNotifier:!0,isStreamingEnabled:!1}:We,Je=ee.onMaintainRelativeOrderChange,Ye=ee.popupConfig,Xe=ee.deviationData,$e=void 0===Xe?{}:Xe,Ue=ee.deviationNodeIdToView,Ge=ee.resetDeviationNodeId,Qe=ee.isProposingFix,Ze=void 0!==Qe&&Qe,en=ee.proposingFixNodeId,nn=ee.isRedlineFlow,tn=ee.badgeStyleOverride,on=l(Ke.maintainRelativeOrder),rn=on[0],ln=on[1],un=null!==(ne=null==Ke?void 0:Ke.expandLevels)&&void 0!==ne?ne:0,cn=!!(null==Ke?void 0:Ke.expandAllSections),an=!!rn||!!(null==Ke?void 0:Ke.showDeviationBadges),sn=l(!1),dn=sn[0],vn=sn[1],fn=l(null),pn=fn[0],gn=fn[1],mn=l(null===(te=null!==(ie=null==Ne?void 0:Ne.newEvaluationResult)&&void 0!==ie?ie:null==Ke?void 0:Ke.enableDeviationSchemaBackwardCompatibility)||void 0===te||te)[0],hn=l(new Set),Sn=hn[0],xn=hn[1],Rn=l([]),yn=Rn[0],bn=Rn[1],Cn=l(!1),wn=Cn[0],_n=Cn[1],Bn=u(null),En=u(null),Fn=u(null),In=u(null),Tn=u(null),An=u(!1),Dn=u(null),On=u({}),Pn=u([]),kn=u(function(){}),Ln=u(null),jn=u(function(){}),Nn=c(function(){return JSON.stringify($e||{})},[JSON.stringify($e)]),Hn=c(function(){return $e||{}},[Nn]),Mn=c(function(){return(null==Ne?void 0:Ne.cognitive_decisioning)||{}},[Ne]),zn=c(function(){return e(e({},F),qe)},[qe]),qn=u(null),Vn=u(null),Wn=u(null),Kn=u(null),Jn=u(null),Yn=u(null),Xn=u(null),$n=u(null),Un=u(null),Gn=u(null),Qn=H(qn),Zn=Qn.cognitivePopup,ei=Qn.setCognitivePopup,ni=Qn.moreFunctions,ii=Qn.setMoreFunctions,ti=Qn.position,oi=Qn.setPosition,ri=Qn.activeBadgeId,li=Qn.summaryPopup,ui=Qn.setSummaryPopup,ci=Qn.closeSummaryPopup,ai=Qn.setActiveBadgeId,si=Qn.popupRef,di=Qn.handleOpenCognitiveCompare,vi=Qn.openCognitivePopupFromState,fi=Qn.closeCognitivePopup,pi=Qn.closeMoreFunctionsPopup,gi=c(function(){var e,n,i,t,o,r,l;return{fields:null!==(e=null==He?void 0:He.fields)&&void 0!==e?e:I,thresholds:{high:null!==(i=null===(n=null==He?void 0:He.thresholds)||void 0===n?void 0:n.high)&&void 0!==i?i:T.thresholds.high,medium:null!==(o=null===(t=null==He?void 0:He.thresholds)||void 0===t?void 0:t.medium)&&void 0!==o?o:T.thresholds.medium,exact:null!==(l=null===(r=null==He?void 0:He.thresholds)||void 0===r?void 0:r.exact)&&void 0!==l?l:T.thresholds.exact}}},[He]),mi=l(null),hi=mi[0];mi[1];var Si=null===(le=null===(oe=null==Ne?void 0:Ne.documents)||void 0===oe?void 0:oe[null===(re=null==Ne?void 0:Ne.input_index_map)||void 0===re?void 0:re[0]])||void 0===le?void 0:le.title,xi=null===(ae=null===(ue=null==Ne?void 0:Ne.documents)||void 0===ue?void 0:ue[null===(ce=null==Ne?void 0:Ne.input_index_map)||void 0===ce?void 0:ce[1]])||void 0===ae?void 0:ae.title,Ri=x(Me||Si||"Uploaded Contract"),yi=null===(fe=null===(ve=null===(se=null==Ne?void 0:Ne.documents)||void 0===se?void 0:se[null===(de=null==Ne?void 0:Ne.input_index_map)||void 0===de?void 0:de[0]])||void 0===ve?void 0:ve.metadata)||void 0===fe?void 0:fe.file_name,bi=x(yi),Ci=null===(he=null===(me=null===(pe=null==Ne?void 0:Ne.documents)||void 0===pe?void 0:pe[null===(ge=null==Ne?void 0:Ne.input_index_map)||void 0===ge?void 0:ge[1]])||void 0===me?void 0:me.metadata)||void 0===he?void 0:he.file_name,wi=x(Ci),_i=x(ze||xi||"Reference Template"),Bi=N(Ne,rn,Hn,gi,mn),Ei=Bi.activeProposed,Fi=Bi.existingRule,Ii=Bi.proposedSections,Ti=Bi.existingSections,Ai=Bi.visibleFields,Di=Bi.parentDeviationRecord,Oi=Bi.deviationNumberRegistry,Pi=Bi.deviationParentRegistry,ki=Bi.parseError;a(function(){ki&&gn("Failed to load comparison: ".concat(ki))},[ki]);var Li=Ii.length>0||Ti.length>0,ji=c(function(){if(!nn)return"off";var e=0,n=0,i=function(t){Array.isArray(t)&&t.forEach(function(t){var o,r=(null==t?void 0:t.content)||"";w(r)&&(e+=1,n+=String(r).length),(null===(o=null==t?void 0:t.subsections)||void 0===o?void 0:o.length)&&i(t.subsections)})};return i(Ii),i(Ti),"".concat(e,":").concat(n)},[nn,Ii,Ti]);a(function(){if(Ii.length||Ti.length)if(cn){var e={},n={},i=function(i,t){i.forEach(function(i,o){var r,l=rn?"".concat(t,"-").concat(o):String(o);e[l]=!0;var u=function(e,i){null==e||e.forEach(function(e,t){var o,r="".concat(i,"-").concat(t);n[r]=!0,(null===(o=e.subsections)||void 0===o?void 0:o.length)&&u(e.subsections,r)})};(null===(r=i.subsections)||void 0===r?void 0:r.length)&&u(i.subsections,String(o))})};i(Ii,"left"),i(Ti,"right"),St(e),Rt(n)}else if(un>0){var t={},o={},r=function(e,n,i){e.forEach(function(e,r){var l;if(i>=1){var u=rn?"".concat(n,"-").concat(r):String(r);t[u]=!0}var c=function(e,n,t){t>i||null==e||e.forEach(function(e,i){var r,l="".concat(n,"-").concat(i);o[l]=!0,(null===(r=e.subsections)||void 0===r?void 0:r.length)&&c(e.subsections,l,t+1)})};(null===(l=e.subsections)||void 0===l?void 0:l.length)&&i>=2&&c(e.subsections,String(r),2)})};r(Ii,"left",un),r(Ti,"right",un),St(t),Rt(o)}},[cn,un,Ii,Ti,rn]);var Ni=M(Ai.map(function(e){return e.key}),Math.max(Ii.length,Ti.length)),Hi=Ni.leftRefs,Mi=Ni.rightRefs,zi=Ni.sectionLeftRefs,qi=Ni.sectionRightRefs,Vi=Ni.lhsBadgeRefs,Wi=Ni.rhsBadgeRefs,Ki=Ni.sectionRightRowRefs,Ji=Ni.subSectionLeftRefs,Yi=Ni.subSectionRightRefs,Xi=Ni.sectionRowRefs,$i=Ni.getSectionRowRef,Ui=Ni.getSubSectionRef,Gi=Ni.getBadgeRef,Qi=Q({maintainRelativeOrder:rn,proposedSections:Ii,existingSections:Ti,leftContainerRef:$n,rightContainerRef:Wn,scrollContainerRef:qn,sectionLeftRefs:zi,sectionRightRefs:qi,subSectionLeftRefs:Ji,subSectionRightRefs:Yi,lhsBadgeRefs:Vi,rhsBadgeRefs:Wi,sectionRowRefs:Xi,sectionRightRowRefs:Ki,rhsTopSpacerRef:Kn,rhsBottomSpacerRef:Jn,lhsTopSpacerRef:Yn,lhsBottomSpacerRef:Xn,calculateLinesRef:kn,setConnectedSections:xn,setConnectedLines:bn,cachedConnectedPositions:Pn,closeMoreFunctionsPopup:pi,setErrorToast:gn,moreFunctions:ni,closeSummaryPopup:ci}),Zi=Qi.isSideBySide,et=Qi.isArrowVisible,nt=Qi.setIsArrowVisible,it=Qi.isResizing,tt=Qi.setIsResizing,ot=Qi.isSideBySideLoading,rt=Qi.activeSideBySideSection,lt=Qi.scrollLock,ut=Qi.sideBySideCacheRef,ct=Qi.isSideBySideRef,at=Qi.activeSideBySideRightSectionRef,st=Qi.activeSideBySideSectionRef,dt=Qi.sideBySideLineRef,vt=Qi.highlightedClauseRefs,ft=Qi.clearClauseHighlight,pt=Qi.resetSideBySide,gt=Qi.activateSideBySide,mt=z({maintainRelativeOrder:!!rn,proposedSections:Ii,existingSections:Ti,activeSideBySideSection:rt,connectedSections:Sn,resetSideBySide:pt,setConnectedSections:xn,setConnectedLines:bn,cachedConnectedPositions:Pn,svgContainerRef:Bn,isAnimatingRef:An,animationTimerRef:Dn,calculateLinesRef:kn,sectionLeftRefs:zi,sectionRightRefs:qi,subSectionLeftRefs:Ji,subSectionRightRefs:Yi}),ht=mt.expandedSections,St=mt.setExpandedSections,xt=mt.expandedSubSections,Rt=mt.setExpandedSubSections,yt=mt.handleSubSectionToggle,bt=mt.toggleSection,Ct=mt.forceExpandCrossWiredSections,wt=function(){var e,n;if(null!=rt){var i=null===(e=zi.current[rt])||void 0===e?void 0:e.current,t=null===(n=qi.current[rt])||void 0===n?void 0:n.current,o=Wn.current;if(i&&t&&o){var r=i.getBoundingClientRect(),l=t.getBoundingClientRect(),u=o.getBoundingClientRect(),c=r.top-u.top,a=l.top-u.top-c;o.scrollBy({top:a,behavior:"smooth"})}}},_t=s(function(e){null==e||e.stopPropagation(),_n(function(e){var n=!e;return n&&requestAnimationFrame(function(){wt()}),n})},[wt]);a(function(){nn&&"off"!==ji&&"0:0"!==ji&&(ut.current=null,Pn.current=[],requestAnimationFrame(function(){var e;null===(e=kn.current)||void 0===e||e.call(kn)}))},[nn,ji]);var Bt=c(function(){var e=new Map,n=new Map,i=1;if(rn)Ii.forEach(function(n){!n.title&&!n.content||n.id&&e.set(n.id,i++)}),Ti.forEach(function(t){if(t.id&&!(!t.title&&!t.content)){var o=Ii.filter(function(e){var n;return null===(n=e.refIndexes)||void 0===n?void 0:n.includes(t.selfIndex)});if(o.length>0){var r=o.map(function(n){return e.get(n.id)}).filter(Boolean);n.set(t.id,r.join(", "))}else n.set(t.id,String(i++))}});else for(var t=Math.max(Ii.length,Ti.length),o=0;o<t;o++){var r=Ii[o],l=Ti[o];r?(e.set(r.id,i),l&&n.set(l.id,String(i)),i++):l&&n.set(l.id,String(i++))}return{leftNums:e,rightNums:n}},[Ii,Ti,rn]),Et=Fi.analysis,Ft=x(null===(xe=null===(Se=null==Et?void 0:Et.rule_difference_comparison)||void 0===Se?void 0:Se.summary)||void 0===xe?void 0:xe.overall_summary),It=!!Ft.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),Tt=null!==(Re=null==Ne?void 0:Ne.base_root_id)&&void 0!==Re?Re:"-1";null==Ne||Ne[Tt];var At=mn?null!==(De=null!==(Ie=$e&&(null===(Fe=null==$e?void 0:$e[Tt])||void 0===Fe?void 0:Fe.evaluation_result))&&void 0!==Ie?Ie:null===(Ae=null===(Te=null==Ne?void 0:Ne.nodes)||void 0===Te?void 0:Te[Tt])||void 0===Ae?void 0:Ae.evaluation_result)&&void 0!==De?De:null:null!==(Ee=null!==(Ce=$e&&(null===(be=null===(ye=null==$e?void 0:$e[Tt])||void 0===ye?void 0:ye.evaluation_result)||void 0===be?void 0:be[0]))&&void 0!==Ce?Ce:null===(Be=null===(_e=null===(we=null==Ne?void 0:Ne.nodes)||void 0===we?void 0:we[Tt])||void 0===_e?void 0:_e.evaluation_result)||void 0===Be?void 0:Be[0])&&void 0!==Ee?Ee:null,Dt=R(At),Ot=y(null!==(ke=null===(Pe=null===(Oe=null==At?void 0:At.evaluation_outputs)||void 0===Oe?void 0:Oe.metadata)||void 0===Pe?void 0:Pe.label_color)&&void 0!==ke?ke:A);if(tn){var Pt=tn(Dt);Pt&&(Ot=e(e({},Ot),{badgeBg:Pt.bg,badgeText:Pt.text,badgeBorder:Pt.border}))}var kt=u(pt);a(function(){kt.current=pt},[pt]);var Lt=u(fi);a(function(){Lt.current=fi},[fi]);var jt=s(function(e,n,i,t,o,r){return qo.current(e,n,i,t,o,r)},[]),Nt=s(function(e,n,i,t,o){return Wo.current(e,n,i,t,o)},[]),Ht=s(function(){return Ko.current()},[]),Mt=s(function(e,n){return Jo.current(e,n)},[]),zt=s(function(e){return Yo.current(e)},[]),qt=s(function(e){return Xo.current(e)},[]),Vt=s(function(){return $o.current()},[]),Wt=s(function(){var e,n;ft(),null===(e=kt.current)||void 0===e||e.call(kt),_n(!1),xn(new Set),bn([]),Pn.current=[],ao([]),vo(null),ui(D),null===(n=Lt.current)||void 0===n||n.call(Lt),requestAnimationFrame(function(){var e;null===(e=kn.current)||void 0===e||e.call(kn)})},[]),Kt=u(Wt);a(function(){Kt.current=Wt},[Wt]),a(function(){Ve&&Kt.current()},[Ve]);var Jt=c(function(){return{documents:null==Ne?void 0:Ne.documents,input_index_map:null==Ne?void 0:Ne.input_index_map}},[JSON.stringify(null==Ne?void 0:Ne.documents),JSON.stringify(null==Ne?void 0:Ne.input_index_map)]),Yt=u(Ne);a(function(){Yt.current=Ne},[Ne]);var Xt=u(Mn);a(function(){Xt.current=Mn},[Mn]);var $t=s(function(n,i,t,o,r,l,u){var c,a,s,d,v,f,p,g,m,h,S=x(null==i?void 0:i.id)||x(null==t?void 0:t.id)||"",R=(S?null===(c=Xt.current)||void 0===c?void 0:c[S]:null)||(null==i?void 0:i.cognitiveData)||(null==t?void 0:t.cognitiveData)||{section_id:S,decisioning:[],gap:[],relevance_score:0},y=null!==(s=null===(a=Xi.current[o])||void 0===a?void 0:a.current)&&void 0!==s?s:null,b=function(){var n,r,l=(null==i?void 0:i.evaluationResult)||(null==t?void 0:t.evaluationResult)||null,u=function(n){var i=function(e){if(!e||"object"!=typeof e)return null;var n=null==e?void 0:e.deviation_entries;if(n&&"object"==typeof n){var i=Object.keys(n).sort(function(e,n){return Number(e)-Number(n)})[0];if(i&&n[i])return n[i]}var t=Object.keys(e).filter(function(e){return/^\d+$/.test(e)}).sort(function(e,n){return Number(e)-Number(n)});if(t.length&&e[t[0]])return e[t[0]];var o=null==e?void 0:e.deviations;if(o&&"object"==typeof o){var r=Object.keys(o).sort(function(e,n){return Number(e)-Number(n)})[0];if(r&&o[r])return o[r]}return null}(n);return i?e(e({},n),{deviation_summary:(null==n?void 0:n.deviation_summary)||(null==i?void 0:i.deviation_summary),deviation_title:(null==n?void 0:n.deviation_title)||(null==i?void 0:i.deviation_title),deviation_impact:(null==n?void 0:n.deviation_impact)||(null==i?void 0:i.deviation_impact),deviation_explanation:(null==n?void 0:n.deviation_explanation)||(null==i?void 0:i.deviation_explanation),evaluation_outputs:(null==n?void 0:n.evaluation_outputs)||(null==i?void 0:i.evaluation_outputs),cognitive_decisioning:(null==n?void 0:n.cognitive_decisioning)||(null==i?void 0:i.cognitive_decisioning)}):n};if(!("string"==typeof o&&o.includes(C)))return u(l);var c=o.split(C)[1];if(!c)return l;var a=(null==i?void 0:i.evaluationResult)||(null==t?void 0:t.evaluationResult)||{},s=(null===(n=null==a?void 0:a.deviation_entries)||void 0===n?void 0:n[c])||(null===(r=null==a?void 0:a.deviations)||void 0===r?void 0:r[c])||null;return s?e(e(e({},a),s),{deviation_summary:(null==s?void 0:s.deviation_summary)||(null==a?void 0:a.deviation_summary),deviation_title:(null==s?void 0:s.deviation_title)||(null==a?void 0:a.deviation_title),deviation_impact:(null==s?void 0:s.deviation_impact)||(null==a?void 0:a.deviation_impact),deviation_explanation:(null==s?void 0:s.deviation_explanation)||(null==a?void 0:a.deviation_explanation),evaluation_outputs:(null==s?void 0:s.evaluation_outputs)||(null==a?void 0:a.evaluation_outputs),cognitive_decisioning:(null==s?void 0:s.cognitive_decisioning)||(null==a?void 0:a.cognitive_decisioning)}):u(l)}(),w=(null!==(f=null===(v=null===(d=null==b?void 0:b.cognitive_decisioning)||void 0===d?void 0:d.decisioning_factors)||void 0===v?void 0:v.length)&&void 0!==f?f:0)>0||(null!==(m=null===(g=null===(p=null==b?void 0:b.cognitive_decisioning)||void 0===p?void 0:p.gaps_in_decision)||void 0===g?void 0:g.length)&&void 0!==m?m:0)>0;return{isLoading:null!==(h=null==Ke?void 0:Ke.isLoading)&&void 0!==h&&h&&!w,open:!0,sectionTitle:(null==i?void 0:i.title)?null==i?void 0:i.title:"No Counterpart",refSectionTitle:(null==t?void 0:t.title)?null==t?void 0:t.title:"No Counterpart",cognitiveData:R,anchorEl:n,sectionAnchorEl:y,badgeStyle:l||null,sectionIdx:o,docData:Jt,deviationData:b,isOrphan:!!r}},[Jt,null==Ke?void 0:Ke.isLoading]),Ut=s(function(e,n,i,t,o,r){var l;if(e.stopPropagation(),ni.open&&ni.sectionIdx===o)pi();else{var u=e.currentTarget,c="left";(null===(l=Wn.current)||void 0===l?void 0:l.contains(u))&&(c="right");ft(),ct.current&&pt(),xn(new Set),bn([]),Pn.current=[],fi(),li.open?Co():ci(),requestAnimationFrame(function(){var e=function(){var e,n,i,t;if("string"==typeof o&&o.includes(C)){var r=o.split(C),l="".concat(r[0]).concat(C).concat(r[1]);return"right"===c?null===(e=Wi.current[l])||void 0===e?void 0:e.current:null===(n=Vi.current[l])||void 0===n?void 0:n.current}return"right"===c?null===(i=Wi.current[o])||void 0===i?void 0:i.current:null===(t=Vi.current[o])||void 0===t?void 0:t.current}()||u;ii($t(e,n,t,o,i,r))})}},[ni.open,ni.sectionIdx,pi,ci,$t]),Gt=s(function(){var e=ni.sectionIdx;ni.isOrphan,pi(),ci(),null!==e&&(Ct(e),ft(),ct.current&&pt(),bn([]),Pn.current=[],xn(function(n){return n.has(e)?new Set:new Set([e])}),setTimeout(function(){kn.current&&kn.current()},50))},[ni.sectionIdx,ni.isOrphan,pi,ci,pt]),Qt=s(function(){var e=Tn.current;if(e){Tn.current=null;var n=Ii.findIndex(function(n){return n.id===e}),i=Ti.findIndex(function(n){return n.id===e}),t=-1===n?b(Ii,e):null,o=-1===i?b(Ti,e):null,r=-1!==n?n:t?Number(t.split("-")[0]):-1,l=-1!==i?i:o?Number(o.split("-")[0]):-1,u=function(e,n,i,t){var o,r,l,u;return-1!==e?null!==(r=null===(o=i.current[e])||void 0===o?void 0:o.current)&&void 0!==r?r:null:n&&null!==(u=null===(l=t.current[n])||void 0===l?void 0:l.current)&&void 0!==u?u:null},c=function(e,n,i){void 0===i&&(i=30);var t=0,o=function(){var r=e();r&&0!==r.getBoundingClientRect().height?(vt.current.add(r),_(r,n)):t++<i&&requestAnimationFrame(o)};requestAnimationFrame(o)};if(rn)-1!==r&&$n.current&&c(function(){return u(n,t,zi,Ji)},$n.current),-1!==l&&Wn.current&&c(function(){return u(i,o,qi,Yi)},Wn.current);else{var a=qn.current;if(!a)return;c(function(){return-1!==r?u(n,t,zi,Ji):u(i,o,qi,Yi)},a)}}},[Ii,Ti,rn,zi,qi,Ji,Yi,$n,Wn,qn]),Zt=s(function(n){if(n){ft(),pt(),xn(new Set),bn([]),Pn.current=[],ci(),fi();var i=Ii.findIndex(function(e){return e.id===n}),t=Ti.findIndex(function(e){return e.id===n}),o=-1===i?b(Ii,n):null,r=-1===t?b(Ti,n):null;if(-1!==i||o||-1!==t||r){var l=-1!==i?i:o?Number(o.split("-")[0]):-1,u=-1!==t?t:r?Number(r.split("-")[0]):-1;Tn.current=n,St(function(n){var i,t=e({},n),o=!1;-1!==l&&(t[i=rn?"left-".concat(l):String(l)]||(t[i]=!0,o=!0));-1!==u&&(t[i=rn?"right-".concat(u):String(u)]||(t[i]=!0,o=!0));return o?t:n}),Rt(function(n){var i=e({},n),t=!1,l=function(e){for(var n=e.split("-"),o=n[0],r=1;r<n.length;r++)o+="-".concat(n[r]),i[o]||(i[o]=!0,t=!0)};return o&&l(o),r&&l(r),t?i:n}),setTimeout(function(){requestAnimationFrame(function(){Tn.current===n&&eo.current()})},50)}else console.warn('scrollToAndHighlightClause: nodeId "'.concat(n,'" not found'))}},[Ii,Ti,rn,St,Rt,pt,ci,fi]),eo=u(Qt);a(function(){eo.current=Qt},[Qt]);var no=u(null);a(function(){if(hi){var e=gi.fields.find(function(e){return e.analysisKey===hi||e.key===hi});if(e){var n=Hi.current[e.key]||Mi.current[e.key];(null==n?void 0:n.current)&&setTimeout(function(){return n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[hi,gi.fields]);var io=s(function(e){var n,i,t,o,r,l,u,c,a,s=null===(n=null==Et?void 0:Et.rule_difference_comparison)||void 0===n?void 0:n.fields;if(!s||!s[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var d=s[e],v=(null==d?void 0:d.relation)||(null===(t=null===(i=null==d?void 0:d.highlights)||void 0===i?void 0:i.ruleA_spans)||void 0===t?void 0:t.length)||(null===(r=null===(o=null==d?void 0:d.highlights)||void 0===o?void 0:o.ruleB_spans)||void 0===r?void 0:r.length)||(null==d?void 0:d.mappings)&&d.mappings.length>0;if(d.mappings){var f=d.mappings[0]||{};return{score:d.score,relation:f.relation||"",highlightsA:(null===(l=f.highlights)||void 0===l?void 0:l.ruleA_spans)||[],highlightsB:(null===(u=f.highlights)||void 0===u?void 0:u.ruleB_spans)||[],hasContent:!!v}}return{score:d.score,relation:d.relation||"",highlightsA:(null===(c=d.highlights)||void 0===c?void 0:c.ruleA_spans)||[],highlightsB:(null===(a=d.highlights)||void 0===a?void 0:a.ruleB_spans)||[],hasContent:!!v}},[Et]),to=$({proposedSections:Ii,existingSections:Ti,maintainRelativeOrder:rn,cognitiveMap:Mn,deviationData:Hn,treeData:Ne,resolvedComparisonConfig:gi,badgeStyleOverride:tn}),oo=to.getSectionCompareStyle,ro=to.getSubSectionCompareStyle,lo=to.getDeviationStyleByKey,uo=G({containerRef:En,leftContainerRef:$n,rightContainerRef:Wn,svgContainerRef:Bn,pathRefs:On,leftHeaderRef:Fn,rightHeaderRef:In,proposedSections:Ii,existingSections:Ti,visibleFields:Ai,leftRefs:Hi,rightRefs:Mi,sectionLeftRefs:zi,sectionRightRefs:qi,subSectionLeftRefs:Ji,subSectionRightRefs:Yi,lhsBadgeRefs:Vi,rhsBadgeRefs:Wi,sectionRowRefs:Xi,expandedSections:ht,expandedSubSections:xt,connectedSections:Sn,isSideBySide:Zi,activeSideBySideSection:rt,maintainRelativeOrder:rn,cognitiveMap:Mn,getSectionCompareStyle:oo,getSubSectionCompareStyle:ro,getDeviationStyleByKey:lo,isArrowVisible:et,isAnimatingRef:An,isSideBySideRef:ct,sideBySideCacheRef:ut,sideBySideLineRef:dt,activeSideBySideSectionRef:st,activeSideBySideRightSectionRef:at,connectedLines:yn,setConnectedLines:bn,cachedConnectedPositions:Pn,calculateLinesRef:kn,resizeTimerRef:Ln,scrollLock:lt,scrollSyncLocked:wn,handleResizeRef:jn,activeProposed:Ei,existingRule:Fi,analysisData:Et,pendingScrollTargetRef:Un,pendingScrollCallbackRef:Gn,resolvedComparisonConfig:gi,getFieldData:io}),co=uo.lines,ao=uo.setLines,so=uo.overallConnector,vo=uo.setOverallConnector,fo=uo.svgDimensions,po=uo.handleColumnScroll;a(function(){li.anchorEl&&requestAnimationFrame(function(){requestAnimationFrame(function(){var e;null===(e=kn.current)||void 0===e||e.call(kn)})})},[li.anchorEl,wn]);var go=s(function(){ft(),_n(!1),St({}),Rt({}),pt(),xn(new Set),bn([]),Pn.current=[],ci(),fi(),pi(),requestAnimationFrame(function(){kn.current&&kn.current()})},[St,Rt,pt,ci,fi,pi]);a(function(){Zi||0!==Sn.size||_n(!1)},[Zi,Sn]);var mo=c(function(){return Object.values(ht).some(Boolean)||Object.values(xt).some(Boolean)},[ht,xt]),ho=u(null),So=u(0),xo=u(0),Ro=u(0),yo=U({timerRef:ho,ruleComponentRef:Vn,scrollContainerRef:qn,containerRef:En,maintainRelativeOrder:rn,proposedSections:Ii,existingSections:Ti,isSideBySideRef:ct,activeSideBySideSectionRef:st,activeSideBySideRightSectionRef:at,sectionRowRefs:Xi,sectionRightRowRefs:Ki,sectionLeftRefs:zi,sectionRightRefs:qi,subSectionLeftRefs:Ji,subSectionRightRefs:Yi,lhsBadgeRefs:Vi,rhsBadgeRefs:Wi,leftContainerRef:$n,rightContainerRef:Wn,calculateLinesRef:kn,handleResizeRef:jn,setIsResizing:tt,setIsArrowVisible:nt,sideBySideCacheRef:ut,cachedConnectedPositions:Pn}).handleResize;a(function(){jn.current=yo},[yo,jn]),a(function(){var e=function(e,n,i,t,o){n.current=e.getBoundingClientRect().width;var r=new ResizeObserver(function(e){null!==i.current&&cancelAnimationFrame(i.current),i.current=requestAnimationFrame(function(){var r,l,u;i.current=null;var c=e[e.length-1];if(c){var a=null!==(u=null===(l=null===(r=c.borderBoxSize)||void 0===r?void 0:r[0])||void 0===l?void 0:l.inlineSize)&&void 0!==u?u:c.contentRect.width;Math.abs(a-n.current)<1?o():(n.current=a,t())}})});return r.observe(e),r},n={current:null},i={current:null},t={current:null},o=[],r=[n,i,t];return Vn.current&&o.push(e(Vn.current,So,n,function(){return jn.current()},function(){})),qn.current&&o.push(e(qn.current,xo,i,function(){return jn.current()},function(){return kn.current()})),En.current&&o.push(e(En.current,Ro,t,function(){return jn.current()},function(){return kn.current()})),function(){o.forEach(function(e){return e.disconnect()}),r.forEach(function(e){null!==e.current&&(cancelAnimationFrame(e.current),e.current=null)})}},[]),a(function(){ct.current=Zi},[Zi]),a(function(){st.current=rt},[rt]);var bo=s(function(){var e,n=ni.sectionIdx,i=ni.isOrphan;if(ci(),null!=n){var t="left";ni.anchorEl&&(null===(e=Wn.current)||void 0===e?void 0:e.contains(ni.anchorEl))&&(t="right"),Ct(n),gt(n,i,{sourceSide:t})}},[gt,ni.isOrphan,ni.sectionIdx,ni.anchorEl,ci]),Co=s(function(){ci(),pt(),xn(new Set),bn([]),Pn.current=[]},[ci,pt]),wo=null!==ni.sectionIdx&&Sn.has(ni.sectionIdx),_o=q({proposedSections:Ii,existingSections:Ti,parentDeviationRecord:Di,expandedSections:ht,maintainRelativeOrder:!!rn,scrollContainerRef:qn,leftContainerRef:$n,rightContainerRef:Wn,lhsBadgeRefs:Vi,rhsBadgeRefs:Wi}),Bo=_o.showDeviationNavigation,Eo=_o.showOpenNodeRef,Fo=_o.adjustScrollForPopup,Io=s(function(e,n,i,t,o){var r,l="string"==typeof t?x(t).trim():x(null==t?void 0:t.deviation_summary).trim(),u=e.currentTarget;fi();var c="left";(null===(r=Wn.current)||void 0===r?void 0:r.contains(u))&&(c="right");var a=function(){var e,i,t,o;if("string"==typeof n&&n.includes(C)){var r=n.split(C),l="".concat(r[0]).concat(C).concat(r[1]);return"right"===c?null===(e=Wi.current[l])||void 0===e?void 0:e.current:null===(i=Vi.current[l])||void 0===i?void 0:i.current}return"right"===c?null===(t=Wi.current[n])||void 0===t?void 0:t.current:null===(o=Vi.current[n])||void 0===o?void 0:o.current};if(i)return pt(),xn(new Set),bn([]),Pn.current=[],void(l&&(Ct(n),requestAnimationFrame(function(){var e=a()||u;e&&(e.getBoundingClientRect().top>.8*window.innerHeight&&e.scrollIntoView({behavior:"smooth",block:"center"}));ui({open:!0,anchorEl:e,summary:t,displayImpact:o})})));Ct(n),l?setTimeout(function(){gt(n,i,{toggleIfSame:!1,sourceSide:c,onReady:function(){var e,n,i,r=a()||u;if(r){var l=r.getBoundingClientRect();if(l.top>.8*window.innerHeight||l.top<100){var c=l.top-window.innerHeight/2;rn?(null===(e=$n.current)||void 0===e||e.scrollBy({top:c,behavior:"smooth"}),null===(n=Wn.current)||void 0===n||n.scrollBy({top:c,behavior:"smooth"})):null===(i=qn.current)||void 0===i||i.scrollBy({top:c,behavior:"smooth"})}}ui({open:!0,anchorEl:r,summary:t,displayImpact:o})}})},350):setTimeout(function(){gt(n,i,{toggleIfSame:!1,sourceSide:c})},350)},[gt,fi,ui,pt,Ct]),To=c(function(){var e;if(!Ue)return null;var n=null===(e=null==Ue?void 0:Ue.id)||void 0===e?void 0:e.split(":")[0];for(var i in Di){if((Di[i]||[]).some(function(e){return e.id===n}))return i}return null},[Ue,Di]),Ao=u({id:null,triggerMs:null}),Do=u(null);a(function(){if(null==Ue?void 0:Ue.id){var o=Number(Ue.trigger),r=Ao.current;if((null==r?void 0:r.triggerMs)!==o){if(!(Ue.id.includes(":")&&/:\d+$/.test(Ue.id)))return Ao.current={id:Ue.id,triggerMs:o},void Zt(Ue.id);var l=Ue.id.split(":"),u=l[0],c=l[1],a=null!=c?c:"0";Do.current!==Ue.id&&(ci(),fi(),pt(),xn(new Set),bn([]),Pn.current=[],Do.current=Ue.id);var s=!1,d=0,v=null,f=null,p=!1,g=function(e,n){for(var i=function(e,t){if(!e)return null;if(e.id===n)return t;if(!Array.isArray(e.subsections))return null;for(var o=0;o<e.subsections.length;o++){var r=i(e.subsections[o],"".concat(t,"-").concat(o));if(r)return r}return null},t=0;t<e.length;t++){var o=i(e[t],String(t));if(o)return o}return null},m=function(){var r,l,c,h;if(!s){var S=function(){Ao.current={id:Ue.id,triggerMs:o}},x=null,R=null;for(var y in Di){var b=Di[y].find(function(e){return e.id===u});if(b){x=y,R=b;break}}if(R&&x){var w=Ii.findIndex(function(e){return e.id===x}),_=Ti.findIndex(function(e){return e.id===x}),F=-1===w&&-1!==_,I=g(Ii,R.id),T=g(Ti,R.id);if(I&&!T&&!F){var A=I.split("-"),D=Number(A[0]);if(rn){var O=null===(l=null===(r=Ii[D])||void 0===r?void 0:r.refIndexes)||void 0===l?void 0:l[0],P=Ti.findIndex(function(e){return e.selfIndex===O});-1!==P&&(D=P)}T=n([D],A.slice(1),!0).join("-")}if(I||T){var k=I?Number(I.split("-")[0]):w,L=T?Number(T.split("-")[0]):_,j=L>=0?L:T?Number(T.split("-")[0]):-1,N=Ii[k],H=Ti[j],M=N&&!N.title&&!N.content,z=H&&!H.title&&!H.content,q=F||(!I&&!!T||M&&!z);if(q){if(!(rn?!!Vo.current["right-".concat(L)]:!!Vo.current[String(L)])&&L>=0)return bt(L,"right"),void(v=setTimeout(m,200))}else if(!(rn?!!Vo.current["left-".concat(k)]:!!Vo.current[String(k)])&&k>=0)return bt(k,"left"),void(v=setTimeout(m,200));var V=I||"",W=T||"",K="".concat(R.id).concat(C).concat(a).concat(C).concat(V).concat(C).concat(W),J="".concat(R.id).concat(C).concat(a);if(!p){Ct(K),p=!0,d=0;var Y=function(){var e,n,i=null===(e=Vi.current[J])||void 0===e?void 0:e.current,t=null===(n=Wi.current[J])||void 0===n?void 0:n.current;return q||!i&&!!t?t:i};return null==f||f(),void(v=setTimeout(function(){var e,n,i,t,o,r,l;s||(e=Y,n=function(){s||(f=null,m())},t=0,o=null,r=null,l=function(){if(!s){var u=e();if(u&&0!==u.getBoundingClientRect().height){var c=u.getBoundingClientRect(),a=c.top,d=c.height,v=null!==o&&Math.abs(a-o)<.5,f=null!==r&&Math.abs(d-r)<.5;if(v&&f){if(++t>=5)return void n()}else t=0;o=a,r=d,i=requestAnimationFrame(l)}else i=requestAnimationFrame(l)}},i=requestAnimationFrame(l),f=function(){return cancelAnimationFrame(i)})},300))}var X=null===(c=Vi.current[J])||void 0===c?void 0:c.current,$=null===(h=Wi.current[J])||void 0===h?void 0:h.current;if(X||$){var U=q||!X&&!!$,G=U?$:X,Q=rn?U?Wn.current:$n.current:qn.current;if(G&&Q){var Z=G.getBoundingClientRect();if(0!==Z.height){var ee=Q.getBoundingClientRect(),ne=Z.top-ee.top+Q.scrollTop-ee.height/2+Z.height/2,ie=(null==I?void 0:I.includes("-"))||(null==T?void 0:T.includes("-")),te=function(){return i(void 0,void 0,void 0,function(){var n,i,o,r,l,u,c,d,v,f;return t(this,function(t){switch(t.label){case 0:return s?[2]:(S(),n=G instanceof Element?window.getComputedStyle(G).color:"",[X,$].forEach(function(e){e&&(e.style.transition="box-shadow 300ms ease-in-out",e.style.boxShadow="0 0 10px ".concat(n))}),setTimeout(function(){[X,$].forEach(function(e){e&&(e.style.boxShadow="")})},2e3),i=(null===(c=null===(u=R.evaluationResult)||void 0===u?void 0:u.deviations)||void 0===c?void 0:c[a])||R,o=(null===(d=R.evaluationResult)||void 0===d?void 0:d.evaluation_outputs)||R.evaluation_outputs,!!X&&!!$?(l=function(e,n){return Promise.race([e,new Promise(function(e){return setTimeout(e,n)})])},rn?[4,Promise.all([$n.current?l(E($n.current),600):Promise.resolve(),Wn.current?l(E(Wn.current),600):Promise.resolve()])]:[3,2]):(r=U?(null===(v=Wi.current[ie?J:L])||void 0===v?void 0:v.current)||$:(null===(f=Vi.current[ie?J:k])||void 0===f?void 0:f.current)||X,Fo(r,function(){ui({open:!0,anchorEl:r,displayImpact:Ue.displayImpact,summary:e(e({},i),{evaluation_outputs:o})})},{skipScroll:!0}),null==Ge||Ge(),[2]));case 1:t.sent(),t.label=2;case 2:return gt(K,!1,{toggleIfSame:!1,sourceSide:F?"right":"left",onReady:function(){var n,t,o,r;S();var l=U?(null===(n=Wi.current[J])||void 0===n?void 0:n.current)||$:(null===(t=Vi.current[J])||void 0===t?void 0:t.current)||X,u=(null===(o=Vi.current[J])||void 0===o?void 0:o.current)||X,c=(null===(r=Wi.current[J])||void 0===r?void 0:r.current)||$;u&&(u.style.scrollMarginTop="150px",u.scrollIntoView({behavior:"smooth",block:"start"})),c&&(c.style.scrollMarginTop="150px",c.scrollIntoView({behavior:"smooth",block:"start"})),ui({open:!0,anchorEl:l,displayImpact:Ue.displayImpact,summary:e({},i)}),null==Ge||Ge()}}),[2]}})})};Math.abs(Q.scrollTop-ne)<=2?te():B(Q,ne,te)}else++d<2?v=setTimeout(m,100):S()}else++d<2?v=setTimeout(m,100):S()}else++d<2?v=setTimeout(m,100):S()}else++d<2?v=setTimeout(m,100):S()}else++d<2?v=setTimeout(m,100):S()}};return v=setTimeout(m,100),function(){s=!0,v&&clearTimeout(v),null==f||f()}}}},[Ue,Di,Ii,Ti,rn,ht,gt,ui,Zt]),a(function(){var n,i,t;if(li.open){var o=li.anchorEl;if(o&&!o.isConnected){var r=function(e){for(var n,i=0,t=Object.entries(e);i<t.length;i++){var r=t[i],l=r[0];if((null===(n=r[1].current)||void 0===n?void 0:n.textContent)===o.textContent)return l}return null},l=(null===(n=o.dataset)||void 0===n?void 0:n.deviationRefId)||r(Vi.current)||r(Wi.current);if(l){var u=(null===(i=Wi.current[l])||void 0===i?void 0:i.current)||(null===(t=Vi.current[l])||void 0===t?void 0:t.current);u&&u.isConnected&&ui(function(n){return e(e({},n),{anchorEl:u})})}}}},[li.open,li.anchorEl,wn,Sn,ht]);var Oo=Zn.open,Po=Zn.sectionIdx,ko=Zn.isOrphan,Lo=Zn.badgeStyle,jo=Zn.anchorEl,No=Zn.sectionAnchorEl;a(function(){var n;if(Ke.isStreamingEnabled&&Oo&&null!=Po&&Po!==Tt){var i="string"==typeof Po?Po.split(C)[0]:null,t=function(e,n){var i;if(!e||!Array.isArray(e))return null;for(var o=0,r=e;o<r.length;o++){var l=r[o];if(l.id===n)return l;if(null===(i=l.subsections)||void 0===i?void 0:i.length){var u=t(l.subsections,n);if(u)return u}}return null},o=i&&"string"==typeof i?t(Ii,i):null,r=i&&"string"==typeof i?t(Ti,i):null,l="number"==typeof Po?Ii[Po]||null:o||i&&((null===(n=null==Ne?void 0:Ne.nodes)||void 0===n?void 0:n[i])||(null==Ne?void 0:Ne[i]))||null,u="number"==typeof Po?Ti[Po]||null:r,c=$t(jo,l,u,Po,ko,Lo);ei(function(n){return n.open?x(n.cognitiveData)===x(c.cognitiveData)&&x(n.deviationData)===x(c.deviationData)&&n.sectionTitle===c.sectionTitle&&n.refSectionTitle===c.refSectionTitle?n:e(e(e({},n),c),{open:!0,anchorEl:n.anchorEl,sectionAnchorEl:n.sectionAnchorEl}):n})}},[Oo,Po,ko,Lo,jo,No,Ii,Ti,$t]);var Ho=s(function(e){var n=e.section,i=e.keyPath,t=e.depth,r=void 0===t?0:t,l=e.columnKey,u=void 0===l?"left":l,c=e.parentNodeId,a=void 0===c?"":c,s=e.sectionOffset;return o(W,{section:n,keyPath:i,depth:r,columnKey:u,parentNodeId:a,sectionOffset:s})},[]),Mo=c(function(){return Ii.map(function(e,n){var i,t=!(null==e?void 0:e.title)&&!(null==e?void 0:e.content),r=!(null==e?void 0:e.refIndexes)||0===e.refIndexes.length;return t&&r&&rn?null:o(K,{section:e,idx:n},null!==(i=null==e?void 0:e.id)&&void 0!==i?i:"left-row-".concat(n))})},[Ii]),zo=c(function(){return Ti.map(function(e,n){var i,t=!(null==e?void 0:e.title)&&!(null==e?void 0:e.content),r=!(null==e?void 0:e.refIndexes)||0===e.refIndexes.length;return t&&r&&rn?null:o(J,{section:e,idx:n},null!==(i=null==e?void 0:e.id)&&void 0!==i?i:"right-row-".concat(n))})},[Ti]),qo=u(Ut);a(function(){qo.current=Ut},[Ut]);var Vo=u(ht);a(function(){Vo.current=ht},[ht]);var Wo=u(Io);a(function(){Wo.current=Io},[Io]);var Ko=u(Co);a(function(){Ko.current=Co},[Co]);var Jo=u(bt);a(function(){Jo.current=bt},[bt]);var Yo=u(yt);a(function(){Yo.current=yt},[yt]);var Xo=u(Ho);a(function(){Xo.current=Ho},[Ho]);var $o=u(pt);a(function(){$o.current=pt},[pt]);var Uo=c(function(){return{maintainRelativeOrder:!!rn,showDeviationBadges:an,isProposingFix:Ze,proposingFixNodeId:en,isRedlineFlow:nn,isSideBySide:Zi,activeSideBySideSection:rt,scrollSyncLocked:wn,toggleScrollSyncLocked:_t,summaryPopupAnchorEl:li.anchorEl,connectedSections:Sn,proposedSections:Ii,existingSections:Ti,deviationNumberRegistry:Oi,deviationParentRegistry:Pi,treeData:Ne,displayConfig:Ke,resolvedMarkdownStyles:zn,unifiedNumbering:Bt,expandedSections:ht,expandedSubSections:xt,setExpandedSubSections:Rt,getSectionCompareStyle:oo,getSubSectionCompareStyle:ro,getBadgeRef:Gi,getSectionRowRef:$i,getSubSectionRef:Ui,sectionLeftRefs:zi,sectionRightRefs:qi,sectionRowRefs:Xi,sectionRightRowRefs:Ki,subSectionLeftRefs:Ji,subSectionRightRefs:Yi,lhsBadgeRefs:Vi,rhsBadgeRefs:Wi,openMoreFunctionsPopup:jt,handleOpenSummaryPopup:Nt,openSummaryPopup:Nt,handleCloseSummaryPopup:Ht,toggleSection:Mt,handleSubSectionToggle:zt,renderSubSectionAccordion:qt,resetSideBySide:Vt,setConnectedSections:xn,setConnectedLines:bn,cachedConnectedPositions:Pn,showDeviationNavigation:Bo,showOpenNodeRef:Eo,deviationNodeIdToView:null==Ue?void 0:Ue.id,deviationTargetParentId:To}},[rn,an,Ze,en,nn,Zi,rt,wn,_t,li.anchorEl,Sn,Ii,Ti,Oi,Ke,zn,Bt,ht,xt,Rt,oo,ro,Gi,$i,Ui,Bo,Eo,Ue,To]);return o(X,e({value:Uo},{children:r(d,e({ref:Vn,sx:{display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif',overflow:"visible",position:"relative"}},{children:[dn&&o(d,e({sx:{position:"absolute",inset:0,bgcolor:"rgba(255, 255, 255, 0.6)",backdropFilter:"blur(10px)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px"}},{children:o(L,{})})),li.open&&o(Y,{open:li.open,anchorEl:li.anchorEl,containerEl:no.current,clipTopEl:Fn.current,scrollContainerEl:qn.current,onClose:Co,summary:li.summary,displayImpact:li.displayImpact,isScrollLocked:wn}),o(k,{open:ni.open,anchorEl:ni.anchorEl,maintainRelativeOrder:!!rn,sectionTitle:ni.sectionTitle,referenceSectionTitle:ni.refSectionTitle,onClose:pi,onOpenCognitiveCompare:di,onOpenSideBySide:bo,onConnect:Gt,isConnected:wo,isOrphan:ni.isOrphan}),Zn.open&&o(P,{open:Zn.open,popupRef:si,position:ti,popupConfig:Ye,onClose:function(){oi(null),ei(function(n){return e(e({},n),{open:!1})}),ai(null)},markdownStyles:qe,sectionTitle:bi,referenceSectionTitle:wi,cognitiveData:Zn.cognitiveData,anchorEl:Zn.anchorEl,sectionAnchorEl:Zn.sectionAnchorEl,scrollContainerEl:qn.current,badgeStyle:Zn.badgeStyle,docData:Zn.docData,deviationData:Zn.deviationData,isLoading:Zn.isLoading}),o(v,e({open:!!pn,autoHideDuration:8e3,onClose:function(){return gn(null)},anchorOrigin:{vertical:"top",horizontal:"center"}},{children:o(f,e({onClose:function(){return gn(null)},severity:"error",sx:{width:"100%",whiteSpace:"pre-line"}},{children:pn}))})),o(V,{componentHeaderText:je,displayConfig:Ke,maintainRelativeOrder:rn,onCollapseAll:go,showCollapseAll:mo,onToggleView:function(e){vn(!0),setTimeout(function(){ln(!e),null==Je||Je(!e),_n(!1),pt(),ci(),xn(new Set),bn([]),Pn.current=[],requestAnimationFrame(function(){requestAnimationFrame(function(){setTimeout(function(){vn(!1)},600)})})},50)}}),o(d,e({ref:qn,onScroll:po,sx:{flex:1,minHeight:0,pt:1.5,pb:1,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",overflowY:rn?"visible":"auto",borderTop:Ft&&It?"none":"1.5px solid #EEF0F4"}},{children:o(d,e({sx:e({display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"},rn?{flex:1}:{})},{children:r(d,e({ref:En,sx:e({display:"grid",gridTemplateColumns:"minmax(0, 1fr) 180px minmax(0, 1fr)",gap:"60px",maxWidth:"1200px",width:"100%",position:"relative",minHeight:0},rn?{flex:1,overflow:"visible"}:{})},{children:[o(Z,{svgContainerRef:Bn,svgDimensions:fo,isResizing:it,overallConnector:so,rootDeviationStyle:Ot,lines:co,isSideBySide:Zi,activeSideBySideSection:rt,isArrowVisible:et,maintainRelativeOrder:rn,proposedSections:Ii,existingSections:Ti,cognitivePopup:Zn,activeBadgeId:ri,closeCognitivePopup:fi,setActiveBadgeId:ai,openCognitivePopupFromState:vi,buildSectionPopupState:$t,connectedLines:yn,pathRefs:On}),r(d,e({sx:e({border:"1px solid #E7E7E9",borderRadius:"8px",bgcolor:"#FFFFFF",display:"flex",flexDirection:"column",position:"relative",zIndex:2,filter:"drop-shadow(0px 2px 4px #F2F2F2)"},rn?{flex:1,overflow:"visible"}:{})},{children:[o(d,e({ref:Fn,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E7E7E9",borderRadius:"8px 8px 0 0",display:"flex",alignItems:"center",minHeight:"40px",overflow:"hidden",minWidth:0}},{children:o(p,e({title:Ri,placement:"top"},{children:o(g,e({sx:{fontSize:"16px",fontWeight:500,color:"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:Ri}))}))})),r(d,e({ref:$n,onScroll:po,sx:e({p:"12px",display:"flex",flexDirection:"column"},rn?{maxHeight:"calc(100vh - 250px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,mr:"-180px",pr:"192px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[o("div",{ref:Yn,style:{width:"100%",height:"0px",flexShrink:0}}),Li&&Mo,o("div",{ref:Xn,style:{width:"100%",height:"0px",flexShrink:0}})]}))]})),o(d,e({ref:no,sx:{width:"180px",display:"flex",flexDirection:"column",alignItems:"center",pt:"15px",gap:0,zIndex:20,pointerEvents:"none"}},{children:o(d,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",mt:0}},{children:r(d,e({onClick:function(n){n.stopPropagation(),Zn.open&&ri===Tt?fi():(ai(Tt),vi($t(n.currentTarget,{title:"",content:"",evaluationResult:At,cognitiveData:{section_id:"",decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0}},null,Tt,!0,e(e({},Ot),{label:""}))))},sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",top:"-8px",borderRadius:"20px",bgcolor:Ot.badgeBg,color:Ot.badgeText,border:"1px solid ".concat(Ot.badgeBorder),fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1,pointerEvents:"auto",cursor:"pointer"}},{children:[null!=Dt?Dt:o(j,{}),o(d,e({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:o(h,{})})),o(m,{size:11,style:{transform:Zn.open&&ri===Tt?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))})),r(d,e({sx:e({border:"1px solid #E3E6EA",borderRadius:"8px",bgcolor:"#FFFFFF",boxShadow:"0px 1px 4px #F7F4FE",position:"relative",zIndex:2,display:"flex",flexDirection:"column",minWidth:0},rn?{flex:1,overflow:"visible",minHeight:0}:{})},{children:[ot&&o(S,{sections:11}),o(d,e({ref:In,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E3E6EA",borderRadius:"8px 8px 0 0",minHeight:"40px",display:"flex",alignItems:"center",overflowX:"hidden"}},{children:o(p,e({title:_i,placement:"top"},{children:o(g,e({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:_i}))}))})),r(d,e({ref:Wn,onScroll:po,sx:e({p:"12px",display:"flex",flexDirection:"column"},rn?{maxHeight:"calc(100vh - 250px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,ml:"-150px",pl:"165px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[o("div",{ref:Kn,style:{width:"100%",height:"0px",flexShrink:0}}),Li&&zo,o("div",{ref:Jn,style:{width:"100%",height:"0px",flexShrink:0}})]}))]}))]}))}))}))]}))}))};export{ee as default};
|
|
1
|
+
import{__assign as e,__spreadArray as n,__awaiter as i,__generator as t}from"tslib";import{jsx as o,jsxs as r}from"react/jsx-runtime";import{useState as l,useRef as u,useMemo as c,useEffect as a,useCallback as s}from"react";import{Box as d,Snackbar as v,Alert as f,Tooltip as p,Typography as g,Tabs as h,Tab as m}from"@mui/material";import{ChevronDown as S}from"lucide-react";import{ButtonCognitiveIcon as x}from"../../assests/svg/ButtonCognitiveIcon.js";import R from"./OverlayComponent.js";import{safeStringify as b,extractDeviationScore as y,generateColorPalette as C,findKeyPathByNodeId as w,DEVIATION_BADGE_SEPARATOR as B,hasMeaningfulRedlineTags as _,scrollAndHighlightClause as I,scrollAndWait as F,waitForScrollIdle as T}from"./CognitiveComparehelpers.js";import{SHARED_MARKDOWN_STYLES as E,DEFAULT_FIELD_CONFIG as A,DEFAULT_COMPARISON_CONFIG as D}from"./CognitiveCompareConfig.js";export{SHARED_MARKDOWN_STYLES}from"./CognitiveCompareConfig.js";import{DEFAULT_DEVIAION_COLOR as k,EMPTY_SUMMARY_POPUP_STATE as O,DEFAULT_COMPONENT_HEADER_TEXT as P}from"./CognitiveCompareConstants.js";import j from"./CognitivePopup.js";import L from"./MoreFunctionsPopup.js";import N from"./LoaderComponent.js";import M from"./components/ThreeDotsLoader.js";import{useCognitiveTreeData as H}from"./hooks/useCompareData.js";import{useComparePopups as z}from"./hooks/useComparePopups.js";import{useSectionRefs as W}from"./hooks/useSectionRefs.js";import{useAccordionState as q}from"./hooks/useAccordionState.js";import{useDeviationNavigation as G}from"./hooks/useDeviationNavigation.js";import V from"./components/CompareHeader.js";import K from"./components/SubSectionAccordion.js";import J from"./components/LHSSectionRow.js";import Y from"./components/RHSSectionRow.js";import X from"./components/CognitiveSummaryPopup.js";import{CompareContextProvider as $}from"./CompareContext.js";import{useStyleHelpers as U}from"./hooks/useStyles.js";import{useResizeHandler as Q}from"./hooks/useResizeHandler.js";import{useLinesCalculator as Z}from"./hooks/useLinesCalculator.js";import{useSideBySide as ee}from"./hooks/useSideBySide.js";import ne from"./components/SvgConnectors.js";import ie from"./Guidelines/components/GuidelinePanel.js";import te from"./Guidelines/components/WebGptPanel.js";var oe=function(oe){var re,le,ue,ce,ae,se,de,ve,fe,pe,ge,he,me,Se,xe,Re,be,ye,Ce,we,Be,_e,Ie,Fe,Te,Ee,Ae,De,ke,Oe,Pe,je,Le,Ne,Me,He=oe.componentHeaderText,ze=void 0===He?P:He,We=oe.treeData,qe=oe.comparisonConfig,Ge=oe.leftColumnTitleText,Ve=oe.rightColumnTitleText,Ke=oe.markdownStyles,Je=oe.resetTrigger,Ye=oe.displayConfig,Xe=void 0===Ye?{isHeaderVisible:!0,isToggleVisible:!0,maintainRelativeOrder:!1,isLoading:!0,showDeviationBadges:!1,enableDeviationSchemaBackwardCompatibility:!1,displayEmailNotifier:!0,isStreamingEnabled:!1}:Ye,$e=oe.onMaintainRelativeOrderChange,Ue=oe.popupConfig,Qe=oe.deviationData,Ze=void 0===Qe?{}:Qe,en=oe.deviationNodeIdToView,nn=oe.resetDeviationNodeId,tn=oe.isProposingFix,on=void 0!==tn&&tn,rn=oe.proposingFixNodeId,ln=oe.isRedlineFlow,un=oe.badgeStyleOverride,cn=oe.guidelinesData,an=oe.gptWebCitationConfig,sn=l(Xe.maintainRelativeOrder),dn=sn[0],vn=sn[1],fn=null!==(re=null==Xe?void 0:Xe.expandLevels)&&void 0!==re?re:0,pn=!!(null==Xe?void 0:Xe.expandAllSections),gn=!!dn||!!(null==Xe?void 0:Xe.showDeviationBadges),hn=l(!1),mn=hn[0],Sn=hn[1],xn=l(null),Rn=xn[0],bn=xn[1],yn=l(null===(ue=null!==(le=null==We?void 0:We.newEvaluationResult)&&void 0!==le?le:null==Xe?void 0:Xe.enableDeviationSchemaBackwardCompatibility)||void 0===ue||ue)[0],Cn=l(new Set),wn=Cn[0],Bn=Cn[1],_n=l([]),In=_n[0],Fn=_n[1],Tn=l(!1),En=Tn[0],An=Tn[1],Dn=l(0),kn=Dn[0],On=Dn[1],Pn=u(null),jn=u(null),Ln=u(null),Nn=u(null),Mn=u(null),Hn=u(!1),zn=u(null),Wn=u({}),qn=u([]),Gn=u(function(){}),Vn=u(null),Kn=u(function(){}),Jn=c(function(){return JSON.stringify(Ze||{})},[JSON.stringify(Ze)]),Yn=c(function(){return Ze||{}},[Jn]),Xn=c(function(){return(null==We?void 0:We.cognitive_decisioning)||{}},[We]),$n=c(function(){return e(e({},E),Ke)},[Ke]),Un=u(null),Qn=u(null),Zn=u(null),ei=u(null),ni=u(null),ii=u(null),ti=u(null),oi=u(null),ri=u(null),li=u(null),ui=z(Un),ci=ui.cognitivePopup,ai=ui.setCognitivePopup,si=ui.moreFunctions,di=ui.setMoreFunctions,vi=ui.position,fi=ui.setPosition,pi=ui.activeBadgeId,gi=ui.summaryPopup,hi=ui.setSummaryPopup,mi=ui.closeSummaryPopup,Si=ui.setActiveBadgeId,xi=ui.popupRef,Ri=ui.handleOpenCognitiveCompare,bi=ui.openCognitivePopupFromState,yi=ui.closeCognitivePopup,Ci=ui.closeMoreFunctionsPopup,wi=c(function(){var e,n,i,t,o,r,l;return{fields:null!==(e=null==qe?void 0:qe.fields)&&void 0!==e?e:A,thresholds:{high:null!==(i=null===(n=null==qe?void 0:qe.thresholds)||void 0===n?void 0:n.high)&&void 0!==i?i:D.thresholds.high,medium:null!==(o=null===(t=null==qe?void 0:qe.thresholds)||void 0===t?void 0:t.medium)&&void 0!==o?o:D.thresholds.medium,exact:null!==(l=null===(r=null==qe?void 0:qe.thresholds)||void 0===r?void 0:r.exact)&&void 0!==l?l:D.thresholds.exact}}},[qe]),Bi=l(null),_i=Bi[0];Bi[1];var Ii=null===(se=null===(ce=null==We?void 0:We.documents)||void 0===ce?void 0:ce[null===(ae=null==We?void 0:We.input_index_map)||void 0===ae?void 0:ae[0]])||void 0===se?void 0:se.title,Fi=null===(fe=null===(de=null==We?void 0:We.documents)||void 0===de?void 0:de[null===(ve=null==We?void 0:We.input_index_map)||void 0===ve?void 0:ve[1]])||void 0===fe?void 0:fe.title,Ti=b(Ge||Ii||"Uploaded Contract"),Ei=null===(me=null===(he=null===(pe=null==We?void 0:We.documents)||void 0===pe?void 0:pe[null===(ge=null==We?void 0:We.input_index_map)||void 0===ge?void 0:ge[0]])||void 0===he?void 0:he.metadata)||void 0===me?void 0:me.file_name,Ai=b(Ei),Di=null===(be=null===(Re=null===(Se=null==We?void 0:We.documents)||void 0===Se?void 0:Se[null===(xe=null==We?void 0:We.input_index_map)||void 0===xe?void 0:xe[1]])||void 0===Re?void 0:Re.metadata)||void 0===be?void 0:be.file_name,ki=b(Di),Oi=b(Ve||Fi||"Reference Template"),Pi=H(We,dn,Yn,wi,yn,cn),ji=Pi.isGuidelineMode,Li=Pi.activeProposed,Ni=Pi.existingRule,Mi=Pi.proposedSections,Hi=Pi.existingSections,zi=Pi.visibleFields,Wi=Pi.parentDeviationRecord,qi=Pi.deviationNumberRegistry,Gi=Pi.deviationParentRegistry,Vi=Pi.parseError;a(function(){Vi&&bn("Failed to load comparison: ".concat(Vi))},[Vi]);var Ki=Mi.length>0||Hi.length>0,Ji=c(function(){if(!ln)return"off";var e=0,n=0,i=function(t){Array.isArray(t)&&t.forEach(function(t){var o,r=(null==t?void 0:t.content)||"";_(r)&&(e+=1,n+=String(r).length),(null===(o=null==t?void 0:t.subsections)||void 0===o?void 0:o.length)&&i(t.subsections)})};return i(Mi),i(Hi),"".concat(e,":").concat(n)},[ln,Mi,Hi]);a(function(){if(Mi.length||Hi.length)if(pn){var e={},n={},i=function(i,t){i.forEach(function(i,o){var r,l=dn?"".concat(t,"-").concat(o):String(o);e[l]=!0;var u=function(e,i){null==e||e.forEach(function(e,t){var o,r="".concat(i,"-").concat(t);n[r]=!0,(null===(o=e.subsections)||void 0===o?void 0:o.length)&&u(e.subsections,r)})};(null===(r=i.subsections)||void 0===r?void 0:r.length)&&u(i.subsections,String(o))})};i(Mi,"left"),i(Hi,"right"),Tt(e),At(n)}else if(fn>0){var t={},o={},r=function(e,n,i){e.forEach(function(e,r){var l;if(i>=1){var u=dn?"".concat(n,"-").concat(r):String(r);t[u]=!0}var c=function(e,n,t){t>i||null==e||e.forEach(function(e,i){var r,l="".concat(n,"-").concat(i);o[l]=!0,(null===(r=e.subsections)||void 0===r?void 0:r.length)&&c(e.subsections,l,t+1)})};(null===(l=e.subsections)||void 0===l?void 0:l.length)&&i>=2&&c(e.subsections,String(r),2)})};r(Mi,"left",fn),r(Hi,"right",fn),Tt(t),At(o)}},[pn,fn,Mi,Hi,dn]);var Yi=W(zi.map(function(e){return e.key}),Math.max(Mi.length,Hi.length)),Xi=Yi.leftRefs,$i=Yi.rightRefs,Ui=Yi.sectionLeftRefs,Qi=Yi.sectionRightRefs,Zi=Yi.lhsBadgeRefs,et=Yi.rhsBadgeRefs,nt=Yi.sectionRightRowRefs,it=Yi.subSectionLeftRefs,tt=Yi.subSectionRightRefs,ot=Yi.sectionRowRefs,rt=Yi.getSectionRowRef,lt=Yi.getSubSectionRef,ut=Yi.getBadgeRef,ct=ee({isGuidelineMode:ji,maintainRelativeOrder:dn,proposedSections:Mi,existingSections:Hi,leftContainerRef:oi,rightContainerRef:Zn,scrollContainerRef:Un,sectionLeftRefs:Ui,sectionRightRefs:Qi,subSectionLeftRefs:it,subSectionRightRefs:tt,lhsBadgeRefs:Zi,rhsBadgeRefs:et,sectionRowRefs:ot,sectionRightRowRefs:nt,rhsTopSpacerRef:ei,rhsBottomSpacerRef:ni,lhsTopSpacerRef:ii,lhsBottomSpacerRef:ti,calculateLinesRef:Gn,setConnectedSections:Bn,setConnectedLines:Fn,cachedConnectedPositions:qn,closeMoreFunctionsPopup:Ci,setErrorToast:bn,moreFunctions:si,closeSummaryPopup:mi}),at=ct.isSideBySide,st=ct.isArrowVisible,dt=ct.setIsArrowVisible,vt=ct.isResizing,ft=ct.setIsResizing,pt=ct.isSideBySideLoading,gt=ct.activeSideBySideSection,ht=ct.scrollLock,mt=ct.sideBySideCacheRef,St=ct.isSideBySideRef,xt=ct.activeSideBySideRightSectionRef,Rt=ct.activeSideBySideSectionRef,bt=ct.sideBySideLineRef,yt=ct.highlightedClauseRefs,Ct=ct.clearClauseHighlight,wt=ct.resetSideBySide,Bt=ct.activateSideBySide,_t=u(Bt);a(function(){_t.current=Bt},[Bt]);var It=q({maintainRelativeOrder:!!dn,proposedSections:Mi,existingSections:Hi,activeSideBySideSection:gt,connectedSections:wn,resetSideBySide:wt,setConnectedSections:Bn,setConnectedLines:Fn,cachedConnectedPositions:qn,svgContainerRef:Pn,isAnimatingRef:Hn,animationTimerRef:zn,calculateLinesRef:Gn,sectionLeftRefs:Ui,sectionRightRefs:Qi,subSectionLeftRefs:it,subSectionRightRefs:tt}),Ft=It.expandedSections,Tt=It.setExpandedSections,Et=It.expandedSubSections,At=It.setExpandedSubSections,Dt=It.handleSubSectionToggle,kt=It.toggleSection,Ot=It.forceExpandCrossWiredSections,Pt=function(){var e,n;if(null!=gt){var i=null===(e=Ui.current[gt])||void 0===e?void 0:e.current,t=null===(n=Qi.current[gt])||void 0===n?void 0:n.current,o=Zn.current;if(i&&t&&o){var r=i.getBoundingClientRect(),l=t.getBoundingClientRect(),u=o.getBoundingClientRect(),c=r.top-u.top,a=l.top-u.top-c;o.scrollBy({top:a,behavior:"smooth"})}}},jt=s(function(e){null==e||e.stopPropagation(),An(function(e){var n=!e;return n&&requestAnimationFrame(function(){Pt()}),n})},[Pt]);a(function(){ln&&"off"!==Ji&&"0:0"!==Ji&&(mt.current=null,qn.current=[],requestAnimationFrame(function(){var e;null===(e=Gn.current)||void 0===e||e.call(Gn)}))},[ln,Ji]);var Lt=c(function(){var e=new Map,n=new Map,i=1;if(dn)Mi.forEach(function(n){!n.title&&!n.content||n.id&&e.set(n.id,i++)}),Hi.forEach(function(t){if(t.id&&!(!t.title&&!t.content)){var o=Mi.filter(function(e){var n;return null===(n=e.refIndexes)||void 0===n?void 0:n.includes(t.selfIndex)});if(o.length>0){var r=o.map(function(n){return e.get(n.id)}).filter(Boolean);n.set(t.id,r.join(", "))}else n.set(t.id,String(i++))}});else for(var t=Math.max(Mi.length,Hi.length),o=0;o<t;o++){var r=Mi[o],l=Hi[o];r?(e.set(r.id,i),l&&n.set(l.id,String(i)),i++):l&&n.set(l.id,String(i++))}return{leftNums:e,rightNums:n}},[Mi,Hi,dn]),Nt=Ni.analysis,Mt=b(null===(Ce=null===(ye=null==Nt?void 0:Nt.rule_difference_comparison)||void 0===ye?void 0:ye.summary)||void 0===Ce?void 0:Ce.overall_summary),Ht=!!Mt.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),zt=null!==(we=null==We?void 0:We.base_root_id)&&void 0!==we?we:"-1";null==We||We[zt];var Wt=yn?null!==(je=null!==(ke=Ze&&(null===(De=null==Ze?void 0:Ze[zt])||void 0===De?void 0:De.evaluation_result))&&void 0!==ke?ke:null===(Pe=null===(Oe=null==We?void 0:We.nodes)||void 0===Oe?void 0:Oe[zt])||void 0===Pe?void 0:Pe.evaluation_result)&&void 0!==je?je:null:null!==(Ae=null!==(Ie=Ze&&(null===(_e=null===(Be=null==Ze?void 0:Ze[zt])||void 0===Be?void 0:Be.evaluation_result)||void 0===_e?void 0:_e[0]))&&void 0!==Ie?Ie:null===(Ee=null===(Te=null===(Fe=null==We?void 0:We.nodes)||void 0===Fe?void 0:Fe[zt])||void 0===Te?void 0:Te.evaluation_result)||void 0===Ee?void 0:Ee[0])&&void 0!==Ae?Ae:null,qt=y(Wt),Gt=C(null!==(Me=null===(Ne=null===(Le=null==Wt?void 0:Wt.evaluation_outputs)||void 0===Le?void 0:Le.metadata)||void 0===Ne?void 0:Ne.label_color)&&void 0!==Me?Me:k);if(un){var Vt=un(qt);Vt&&(Gt=e(e({},Gt),{badgeBg:Vt.bg,badgeText:Vt.text,badgeBorder:Vt.border}))}var Kt=u(wt);a(function(){Kt.current=wt},[wt]);var Jt=u(yi);a(function(){Jt.current=yi},[yi]);var Yt=s(function(e,n,i,t,o,r){return nr.current(e,n,i,t,o,r)},[]),Xt=s(function(e,n,i,t,o){return tr.current(e,n,i,t,o)},[]),$t=s(function(){return or.current()},[]),Ut=s(function(e,n){return rr.current(e,n)},[]),Qt=s(function(e){return lr.current(e)},[]),Zt=s(function(e){return ur.current(e)},[]),eo=s(function(){return cr.current()},[]),no=s(function(){var e,n;Ct(),null===(e=Kt.current)||void 0===e||e.call(Kt),An(!1),Bn(new Set),Fn([]),qn.current=[],bo([]),Co(null),hi(O),null===(n=Jt.current)||void 0===n||n.call(Jt),requestAnimationFrame(function(){var e;null===(e=Gn.current)||void 0===e||e.call(Gn)})},[]),io=u(no);a(function(){io.current=no},[no]),a(function(){Je&&io.current()},[Je]);var to=c(function(){return{documents:null==We?void 0:We.documents,input_index_map:null==We?void 0:We.input_index_map}},[JSON.stringify(null==We?void 0:We.documents),JSON.stringify(null==We?void 0:We.input_index_map)]),oo=u(We);a(function(){oo.current=We},[We]);var ro=u(Xn);a(function(){ro.current=Xn},[Xn]);var lo=s(function(n,i,t,o,r,l,u){var c,a,s,d,v,f,p,g,h,m,S=b(null==i?void 0:i.id)||b(null==t?void 0:t.id)||"",x=(S?null===(c=ro.current)||void 0===c?void 0:c[S]:null)||(null==i?void 0:i.cognitiveData)||(null==t?void 0:t.cognitiveData)||{section_id:S,decisioning:[],gap:[],relevance_score:0},R=null!==(s=null===(a=ot.current[o])||void 0===a?void 0:a.current)&&void 0!==s?s:null,y=function(){var n,r,l=(null==i?void 0:i.evaluationResult)||(null==t?void 0:t.evaluationResult)||null,u=function(n){var i=function(e){if(!e||"object"!=typeof e)return null;var n=null==e?void 0:e.deviation_entries;if(n&&"object"==typeof n){var i=Object.keys(n).sort(function(e,n){return Number(e)-Number(n)})[0];if(i&&n[i])return n[i]}var t=Object.keys(e).filter(function(e){return/^\d+$/.test(e)}).sort(function(e,n){return Number(e)-Number(n)});if(t.length&&e[t[0]])return e[t[0]];var o=null==e?void 0:e.deviations;if(o&&"object"==typeof o){var r=Object.keys(o).sort(function(e,n){return Number(e)-Number(n)})[0];if(r&&o[r])return o[r]}return null}(n);return i?e(e({},n),{deviation_summary:(null==n?void 0:n.deviation_summary)||(null==i?void 0:i.deviation_summary),deviation_title:(null==n?void 0:n.deviation_title)||(null==i?void 0:i.deviation_title),deviation_impact:(null==n?void 0:n.deviation_impact)||(null==i?void 0:i.deviation_impact),deviation_explanation:(null==n?void 0:n.deviation_explanation)||(null==i?void 0:i.deviation_explanation),evaluation_outputs:(null==n?void 0:n.evaluation_outputs)||(null==i?void 0:i.evaluation_outputs),cognitive_decisioning:(null==n?void 0:n.cognitive_decisioning)||(null==i?void 0:i.cognitive_decisioning)}):n};if(!("string"==typeof o&&o.includes(B)))return u(l);var c=o.split(B)[1];if(!c)return l;var a=(null==i?void 0:i.evaluationResult)||(null==t?void 0:t.evaluationResult)||{},s=(null===(n=null==a?void 0:a.deviation_entries)||void 0===n?void 0:n[c])||(null===(r=null==a?void 0:a.deviations)||void 0===r?void 0:r[c])||null;return s?e(e(e({},a),s),{deviation_summary:(null==s?void 0:s.deviation_summary)||(null==a?void 0:a.deviation_summary),deviation_title:(null==s?void 0:s.deviation_title)||(null==a?void 0:a.deviation_title),deviation_impact:(null==s?void 0:s.deviation_impact)||(null==a?void 0:a.deviation_impact),deviation_explanation:(null==s?void 0:s.deviation_explanation)||(null==a?void 0:a.deviation_explanation),evaluation_outputs:(null==s?void 0:s.evaluation_outputs)||(null==a?void 0:a.evaluation_outputs),cognitive_decisioning:(null==s?void 0:s.cognitive_decisioning)||(null==a?void 0:a.cognitive_decisioning)}):u(l)}(),C=(null!==(f=null===(v=null===(d=null==y?void 0:y.cognitive_decisioning)||void 0===d?void 0:d.decisioning_factors)||void 0===v?void 0:v.length)&&void 0!==f?f:0)>0||(null!==(h=null===(g=null===(p=null==y?void 0:y.cognitive_decisioning)||void 0===p?void 0:p.gaps_in_decision)||void 0===g?void 0:g.length)&&void 0!==h?h:0)>0,w=null!==(m=null==Xe?void 0:Xe.isLoading)&&void 0!==m&&m,_=!0;if(ji){var I=null==y?void 0:y.deviation_highlights;if(I&&"object"==typeof I)_=Object.values(I).some(function(e){return Array.isArray(e)&&e.length>0});else _=!1}return{isLoading:w&&!C,open:!0,sectionTitle:(null==i?void 0:i.title)?null==i?void 0:i.title:"No Counterpart",refSectionTitle:(null==t?void 0:t.title)?null==t?void 0:t.title:"No Counterpart",cognitiveData:x,anchorEl:n,sectionAnchorEl:R,badgeStyle:l||null,sectionIdx:o,docData:to,deviationData:y,isOrphan:!!r,hasGuidelineMatches:_}},[to,null==Xe?void 0:Xe.isLoading,ji]),uo=s(function(e,n,i,t,o,r){var l;if(e.stopPropagation(),si.open&&si.sectionIdx===o)Ci();else{var u=e.currentTarget,c="left";(null===(l=Zn.current)||void 0===l?void 0:l.contains(u))&&(c="right");Ct(),St.current&&wt(),Bn(new Set),Fn([]),qn.current=[],yi(),gi.open?jo():mi(),requestAnimationFrame(function(){var e=function(){var e,n,i,t;if("string"==typeof o&&o.includes(B)){var r=o.split(B),l="".concat(r[0]).concat(B).concat(r[1]);return"right"===c?null===(e=et.current[l])||void 0===e?void 0:e.current:null===(n=Zi.current[l])||void 0===n?void 0:n.current}return"right"===c?null===(i=et.current[o])||void 0===i?void 0:i.current:null===(t=Zi.current[o])||void 0===t?void 0:t.current}()||u;di(lo(e,n,t,o,i,r))})}},[si.open,si.sectionIdx,Ci,mi,lo]),co=s(function(){var e=si.sectionIdx;si.isOrphan,Ci(),mi(),null!==e&&(Ot(e),Ct(),St.current&&wt(),Fn([]),qn.current=[],ji&&null!==e&&On(ko(e)),Bn(function(n){return n.has(e)?new Set:new Set([e])}),setTimeout(function(){Gn.current&&Gn.current()},50))},[si.sectionIdx,si.isOrphan,Ci,mi,wt]),ao=s(function(){var e=Mn.current;if(e){Mn.current=null;var n=Mi.findIndex(function(n){return n.id===e}),i=Hi.findIndex(function(n){return n.id===e}),t=-1===n?w(Mi,e):null,o=-1===i?w(Hi,e):null,r=-1!==n?n:t?Number(t.split("-")[0]):-1,l=-1!==i?i:o?Number(o.split("-")[0]):-1,u=function(e,n,i,t){var o,r,l,u;return-1!==e?null!==(r=null===(o=i.current[e])||void 0===o?void 0:o.current)&&void 0!==r?r:null:n&&null!==(u=null===(l=t.current[n])||void 0===l?void 0:l.current)&&void 0!==u?u:null},c=function(e,n,i){void 0===i&&(i=30);var t=0,o=function(){var r=e();r&&0!==r.getBoundingClientRect().height?(yt.current.add(r),I(r,n)):t++<i&&requestAnimationFrame(o)};requestAnimationFrame(o)};if(dn)-1!==r&&oi.current&&c(function(){return u(n,t,Ui,it)},oi.current),-1!==l&&Zn.current&&c(function(){return u(i,o,Qi,tt)},Zn.current);else{var a=Un.current;if(!a)return;c(function(){return-1!==r?u(n,t,Ui,it):u(i,o,Qi,tt)},a)}}},[Mi,Hi,dn,Ui,Qi,it,tt,oi,Zn,Un]),so=s(function(n){if(n){Ct(),wt(),Bn(new Set),Fn([]),qn.current=[],mi(),yi();var i=Mi.findIndex(function(e){return e.id===n}),t=Hi.findIndex(function(e){return e.id===n}),o=-1===i?w(Mi,n):null,r=-1===t?w(Hi,n):null;if(-1!==i||o||-1!==t||r){var l=-1!==i?i:o?Number(o.split("-")[0]):-1,u=-1!==t?t:r?Number(r.split("-")[0]):-1;Mn.current=n,Tt(function(n){var i,t=e({},n),o=!1;-1!==l&&(t[i=dn?"left-".concat(l):String(l)]||(t[i]=!0,o=!0));-1!==u&&(t[i=dn?"right-".concat(u):String(u)]||(t[i]=!0,o=!0));return o?t:n}),At(function(n){var i=e({},n),t=!1,l=function(e){for(var n=e.split("-"),o=n[0],r=1;r<n.length;r++)o+="-".concat(n[r]),i[o]||(i[o]=!0,t=!0)};return o&&l(o),r&&l(r),t?i:n}),setTimeout(function(){requestAnimationFrame(function(){Mn.current===n&&vo.current()})},50)}else console.warn('scrollToAndHighlightClause: nodeId "'.concat(n,'" not found'))}},[Mi,Hi,dn,Tt,At,wt,mi,yi]),vo=u(ao);a(function(){vo.current=ao},[ao]);var fo=u(null);a(function(){if(_i){var e=wi.fields.find(function(e){return e.analysisKey===_i||e.key===_i});if(e){var n=Xi.current[e.key]||$i.current[e.key];(null==n?void 0:n.current)&&setTimeout(function(){return n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[_i,wi.fields]);var po=s(function(e){var n,i,t,o,r,l,u,c,a,s=null===(n=null==Nt?void 0:Nt.rule_difference_comparison)||void 0===n?void 0:n.fields;if(!s||!s[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var d=s[e],v=(null==d?void 0:d.relation)||(null===(t=null===(i=null==d?void 0:d.highlights)||void 0===i?void 0:i.ruleA_spans)||void 0===t?void 0:t.length)||(null===(r=null===(o=null==d?void 0:d.highlights)||void 0===o?void 0:o.ruleB_spans)||void 0===r?void 0:r.length)||(null==d?void 0:d.mappings)&&d.mappings.length>0;if(d.mappings){var f=d.mappings[0]||{};return{score:d.score,relation:f.relation||"",highlightsA:(null===(l=f.highlights)||void 0===l?void 0:l.ruleA_spans)||[],highlightsB:(null===(u=f.highlights)||void 0===u?void 0:u.ruleB_spans)||[],hasContent:!!v}}return{score:d.score,relation:d.relation||"",highlightsA:(null===(c=d.highlights)||void 0===c?void 0:c.ruleA_spans)||[],highlightsB:(null===(a=d.highlights)||void 0===a?void 0:a.ruleB_spans)||[],hasContent:!!v}},[Nt]),go=U({proposedSections:Mi,existingSections:Hi,maintainRelativeOrder:dn,cognitiveMap:Xn,deviationData:Yn,treeData:We,resolvedComparisonConfig:wi,badgeStyleOverride:un}),ho=go.getSectionCompareStyle,mo=go.getSubSectionCompareStyle,So=go.getDeviationStyleByKey,xo=Z({containerRef:jn,leftContainerRef:oi,rightContainerRef:Zn,svgContainerRef:Pn,pathRefs:Wn,leftHeaderRef:Ln,rightHeaderRef:Nn,proposedSections:Mi,existingSections:Hi,visibleFields:zi,leftRefs:Xi,rightRefs:$i,sectionLeftRefs:Ui,sectionRightRefs:Qi,subSectionLeftRefs:it,subSectionRightRefs:tt,lhsBadgeRefs:Zi,rhsBadgeRefs:et,sectionRowRefs:ot,expandedSections:Ft,expandedSubSections:Et,connectedSections:wn,isSideBySide:at,activeSideBySideSection:gt,maintainRelativeOrder:dn,isGuidelineMode:ji,cognitiveMap:Xn,getSectionCompareStyle:ho,getSubSectionCompareStyle:mo,getDeviationStyleByKey:So,isArrowVisible:st,isAnimatingRef:Hn,isSideBySideRef:St,sideBySideCacheRef:mt,sideBySideLineRef:bt,activeSideBySideSectionRef:Rt,activeSideBySideRightSectionRef:xt,connectedLines:In,setConnectedLines:Fn,cachedConnectedPositions:qn,calculateLinesRef:Gn,resizeTimerRef:Vn,scrollLock:ht,scrollSyncLocked:En,handleResizeRef:Kn,activeProposed:Li,existingRule:Ni,analysisData:Nt,pendingScrollTargetRef:ri,pendingScrollCallbackRef:li,resolvedComparisonConfig:wi,getFieldData:po}),Ro=xo.lines,bo=xo.setLines,yo=xo.overallConnector,Co=xo.setOverallConnector,wo=xo.svgDimensions,Bo=xo.handleColumnScroll;a(function(){gi.anchorEl&&requestAnimationFrame(function(){requestAnimationFrame(function(){var e;null===(e=Gn.current)||void 0===e||e.call(Gn)})})},[gi.anchorEl,En]);var _o=s(function(){Ct(),An(!1),Tt({}),At({}),wt(),Bn(new Set),Fn([]),qn.current=[],mi(),yi(),Ci(),requestAnimationFrame(function(){Gn.current&&Gn.current()})},[Tt,At,wt,mi,yi,Ci]);a(function(){at||0!==wn.size||An(!1)},[at,wn]);var Io=c(function(){return Object.values(Ft).some(Boolean)||Object.values(Et).some(Boolean)},[Ft,Et]),Fo=u(null),To=u(0),Eo=u(0),Ao=u(0),Do=Q({timerRef:Fo,ruleComponentRef:Qn,scrollContainerRef:Un,containerRef:jn,maintainRelativeOrder:dn,proposedSections:Mi,existingSections:Hi,isSideBySideRef:St,activeSideBySideSectionRef:Rt,activeSideBySideRightSectionRef:xt,sectionRowRefs:ot,sectionRightRowRefs:nt,sectionLeftRefs:Ui,sectionRightRefs:Qi,subSectionLeftRefs:it,subSectionRightRefs:tt,lhsBadgeRefs:Zi,rhsBadgeRefs:et,leftContainerRef:oi,rightContainerRef:Zn,calculateLinesRef:Gn,handleResizeRef:Kn,setIsResizing:ft,setIsArrowVisible:dt,sideBySideCacheRef:mt,cachedConnectedPositions:qn}).handleResize;a(function(){Kn.current=Do},[Do,Kn]),a(function(){var e=function(e,n,i,t,o){n.current=e.getBoundingClientRect().width;var r=new ResizeObserver(function(e){null!==i.current&&cancelAnimationFrame(i.current),i.current=requestAnimationFrame(function(){var r,l,u;i.current=null;var c=e[e.length-1];if(c){var a=null!==(u=null===(l=null===(r=c.borderBoxSize)||void 0===r?void 0:r[0])||void 0===l?void 0:l.inlineSize)&&void 0!==u?u:c.contentRect.width;Math.abs(a-n.current)<1?o():(n.current=a,t())}})});return r.observe(e),r},n={current:null},i={current:null},t={current:null},o=[],r=[n,i,t];return Qn.current&&o.push(e(Qn.current,To,n,function(){return Kn.current()},function(){})),Un.current&&o.push(e(Un.current,Eo,i,function(){return Kn.current()},function(){return Gn.current()})),jn.current&&o.push(e(jn.current,Ao,t,function(){return Kn.current()},function(){return Gn.current()})),function(){o.forEach(function(e){return e.disconnect()}),r.forEach(function(e){null!==e.current&&(cancelAnimationFrame(e.current),e.current=null)})}},[]),a(function(){St.current=at},[at]),a(function(){Rt.current=gt},[gt]);var ko=s(function(e){var n,i,t,o,r,l="",u="0";if("number"==typeof e)l=(null===(n=Mi[e])||void 0===n?void 0:n.nodeId)||(null===(i=Mi[e])||void 0===i?void 0:i.id)||"";else{var c=String(e).split(B);l=c[0],u=c[1]||"0"}var a=null===(t=null==Yn?void 0:Yn[l])||void 0===t?void 0:t.evaluation_result,s=Array.isArray(a)?a[parseInt(u,10)]:null==a?void 0:a[u];return!1===(null===(r=null===(o=null==s?void 0:s.evaluation_outputs)||void 0===o?void 0:o.guideline_flag)||void 0===r?void 0:r.rulebook_used)?1:0},[Mi,Yn]),Oo=s(function(e){var n,i,t=document.querySelectorAll('[id^="guideline-target-"], [data-web-gpt-active="true"]'),o=oi.current,r=Zn.current,l="string"==typeof e&&e.includes(B),u=e;if(l){var c=e.split(B);c.length>=2&&(u="".concat(c[0]).concat(B).concat(c[1]))}var a=(null===(n=Zi.current[u])||void 0===n?void 0:n.current)||(null===(i=Zi.current[e])||void 0===i?void 0:i.current);if(t.length>0&&a&&o&&r){var s=t[0];ii.current&&(ii.current.style.height="0px"),ei.current&&(ei.current.style.height="0px"),ti.current&&(ti.current.style.height="0px"),ni.current&&(ni.current.style.height="0px"),requestAnimationFrame(function(){var e=a.getBoundingClientRect(),n=s.getBoundingClientRect(),i=o.getBoundingClientRect(),t=r.getBoundingClientRect(),l=o.scrollTop+(e.top-i.top)+e.height/2,u=r.scrollTop+(n.top-t.top)+n.height/2,c=l-i.height/2,d=Math.max(0,c),v=o.scrollHeight-o.clientHeight,f=d>v?d-v:0,p=i.top+l-d,g=t.top+u-p,h=0;g<0&&(h=Math.abs(g),g=0);var m=r.scrollHeight-r.clientHeight+h,S=g>m?g-m:0;ti.current&&(ti.current.style.height="".concat(f,"px")),ei.current&&(ei.current.style.height="".concat(h,"px")),ni.current&&(ni.current.style.height="".concat(S,"px")),requestAnimationFrame(function(){o.scrollTo({top:d,behavior:"smooth"}),r.scrollTo({top:g,behavior:"smooth"}),Gn.current&&setTimeout(function(){return Gn.current()},50)})})}},[B]),Po=s(function(){var e,n=si.sectionIdx,i=si.isOrphan;if(mi(),null!=n){var t="left";si.anchorEl&&(null===(e=Zn.current)||void 0===e?void 0:e.contains(si.anchorEl))&&(t="right"),Ot(n),ji&&(On(ko(n)),Bn(new Set([n]))),Bt(n,i,{sourceSide:t,onReady:function(){ji&&setTimeout(function(){return Oo(String(n))},150)}})}},[Bt,si.isOrphan,si.sectionIdx,si.anchorEl,mi,Ot,ji,Oo,ko]),jo=s(function(){mi(),wt(),Bn(new Set),Fn([]),qn.current=[]},[mi,wt]),Lo=null!==si.sectionIdx&&wn.has(si.sectionIdx),No=G({proposedSections:Mi,existingSections:Hi,parentDeviationRecord:Wi,expandedSections:Ft,maintainRelativeOrder:!!dn,scrollContainerRef:Un,leftContainerRef:oi,rightContainerRef:Zn,lhsBadgeRefs:Zi,rhsBadgeRefs:et}),Mo=No.showDeviationNavigation,Ho=No.showOpenNodeRef,zo=No.adjustScrollForPopup,Wo=s(function(e,n,i,t,o){var r,l="string"==typeof t?b(t).trim():b(null==t?void 0:t.deviation_summary).trim(),u=e.currentTarget;yi();var c="left";(null===(r=Zn.current)||void 0===r?void 0:r.contains(u))&&(c="right");var a=function(){var e,i,t,o;if("string"==typeof n&&n.includes(B)){var r=n.split(B),l="".concat(r[0]).concat(B).concat(r[1]);return"right"===c?null===(e=et.current[l])||void 0===e?void 0:e.current:null===(i=Zi.current[l])||void 0===i?void 0:i.current}return"right"===c?null===(t=et.current[n])||void 0===t?void 0:t.current:null===(o=Zi.current[n])||void 0===o?void 0:o.current};if(i&&!ji)return wt(),Bn(new Set),Fn([]),qn.current=[],void(l&&(Ot(n),requestAnimationFrame(function(){var e=a()||u;e&&(e.getBoundingClientRect().top>.8*window.innerHeight&&e.scrollIntoView({behavior:"smooth",block:"center"}));hi({open:!0,anchorEl:e,summary:t,displayImpact:o})})));Ot(n),ji&&(On(ko(n)),Bn(new Set([n]))),l?setTimeout(function(){Bt(n,i,{toggleIfSame:!1,sourceSide:c,onReady:function(){var e,i,r,l=a()||u;if(ji)setTimeout(function(){return Oo(n)},150);else if(l){var c=l.getBoundingClientRect();if(c.top>.8*window.innerHeight||c.top<100){var s=c.top-window.innerHeight/2;dn?(null===(e=oi.current)||void 0===e||e.scrollBy({top:s,behavior:"smooth"}),null===(i=Zn.current)||void 0===i||i.scrollBy({top:s,behavior:"smooth"})):null===(r=Un.current)||void 0===r||r.scrollBy({top:s,behavior:"smooth"})}}hi({open:!0,anchorEl:l,summary:t,displayImpact:o})}})},350):setTimeout(function(){Bt(n,i,{toggleIfSame:!1,sourceSide:c}),ji&&setTimeout(function(){return Oo(n)},150)},350)},[Bt,yi,hi,wt,Ot,ji,dn,Oo,Yn]),qo=c(function(){var e;if(!en)return null;var n=null===(e=null==en?void 0:en.id)||void 0===e?void 0:e.split(":")[0];for(var i in Wi){if((Wi[i]||[]).some(function(e){return e.id===n}))return i}return null},[en,Wi]),Go=u({id:null,triggerMs:null}),Vo=u(null);a(function(){if(null==en?void 0:en.id){var o=Number(en.trigger),r=Go.current;if((null==r?void 0:r.id)!==en.id||(null==r?void 0:r.triggerMs)!==o){if(en.id.includes(":")&&/:\d+$/.test(en.id)){var l=en.id.split(":"),u=l[0],c=l[1],a=null!=c?c:"0",s="".concat(en.id,":").concat(o);Vo.current!==s&&(mi(),yi(),wt(),Bn(new Set),Fn([]),qn.current=[],Vo.current=s);var d=!1,v=0,f=null,p=null,g=!1,h=function(e,n){for(var i=function(e,t){if(!e)return null;if(n.includes(e.id)||n.includes(e.nodeId)||n.includes(e.contentId))return t;if(!Array.isArray(e.subsections))return null;for(var o=0;o<e.subsections.length;o++){var r=i(e.subsections[o],"".concat(t,"-").concat(o));if(r)return r}return null},t=0;t<e.length;t++){var o=i(e[t],String(t));if(o)return o}return null},m=function(){var r,l,c;if(!d){var s=function(){Go.current={id:en.id,triggerMs:o}},S=null,x=null;for(var R in Wi){var b=Wi[R].find(function(e){var n;return e.id===u||e.nodeId===u||e.contentId===u||(null===(n=e.evaluationResult)||void 0===n?void 0:n.nodeId)===u});if(b){S=R,x=b;break}}if(x&&S){var y=Array.from(new Set([u,x.id,x.nodeId,x.contentId,null===(r=x.evaluationResult)||void 0===r?void 0:r.nodeId].filter(Boolean))),C=Mi.findIndex(function(e){return e.id===S}),w=Hi.findIndex(function(e){return e.id===S}),_=-1===C&&-1!==w,I=h(Mi,y),E=h(Hi,y);if(I&&!E&&!_){var A=I.split("-"),D=Number(A[0]);if(dn){var k=null===(c=null===(l=Mi[D])||void 0===l?void 0:l.refIndexes)||void 0===c?void 0:c[0],O=Hi.findIndex(function(e){return e.selfIndex===k});-1!==O&&(D=O)}E=n([D],A.slice(1),!0).join("-")}if(I||E){var P=I?Number(I.split("-")[0]):C,j=E?Number(E.split("-")[0]):w,L=j>=0?j:E?Number(E.split("-")[0]):-1,N=Mi[P],M=Hi[L],H=N&&!N.title&&!N.content,z=M&&!M.title&&!M.content,W=_||(!I&&!!E||H&&!z);if(W){if(!(dn?!!ir.current["right-".concat(j)]:!!ir.current[String(j)])&&j>=0)return kt(j,"right"),void(f=setTimeout(m,200))}else if(!(dn?!!ir.current["left-".concat(P)]:!!ir.current[String(P)])&&P>=0)return kt(P,"left"),void(f=setTimeout(m,200));var q=I||"",G=E||"",V=y.map(function(e){return"".concat(e).concat(B).concat(a)}),K=V[0],J=function(){for(var e,n,i=0,t=V;i<t.length;i++){var o=t[i],r=(null===(e=Zi.current[o])||void 0===e?void 0:e.current)||null,l=(null===(n=et.current[o])||void 0===n?void 0:n.current)||null;if(r||l)return{refId:o,left:r,right:l}}return{refId:K,left:null,right:null}},Y=function(e){return"".concat(e).concat(B).concat(q).concat(B).concat(G)};if(!g){Ot(Y(K)),g=!0,v=0;var X=function(){var e=J(),n=e.left,i=e.right;return W||!n&&!!i?i:n};return null==p||p(),void(f=setTimeout(function(){var e,n,i,t,o,r,l,u;d||(e=X,n=function(){d||(p=null,m())},t=0,o=null,r=null,l=performance.now(),u=function(){if(!d)if(performance.now()-l>3e3)n();else{var c=e();if(c&&0!==c.getBoundingClientRect().height){var a=c.getBoundingClientRect(),s=a.top,v=a.height,f=null!==o&&Math.abs(s-o)<.5,p=null!==r&&Math.abs(v-r)<.5;if(f&&p){if(++t>=5)return void n()}else t=0;o=s,r=v,i=requestAnimationFrame(u)}else i=requestAnimationFrame(u)}},i=requestAnimationFrame(u),p=function(){return cancelAnimationFrame(i)})},300))}var $=J(),U=$.refId,Q=$.left,Z=$.right,ee=Y(U);if(Q||Z){var ne=W||!Q&&!!Z,ie=ne?Z:Q,te=dn?ne?Zn.current:oi.current:Un.current;if(ie&&te){var oe=ie.getBoundingClientRect();if(0!==oe.height){var re=te.getBoundingClientRect(),le=oe.top-re.top+te.scrollTop-re.height/2+oe.height/2,ue=(null==I?void 0:I.includes("-"))||(null==E?void 0:E.includes("-")),ce=function(){return i(void 0,void 0,void 0,function(){var n,i,o,r,l,u,c,v,f,p;return t(this,function(t){switch(t.label){case 0:return d?[2]:(s(),n=ie instanceof Element?window.getComputedStyle(ie).color:"",[Q,Z].forEach(function(e){e&&(e.style.transition="box-shadow 300ms ease-in-out",e.style.boxShadow="0 0 10px ".concat(n))}),setTimeout(function(){[Q,Z].forEach(function(e){e&&(e.style.boxShadow="")})},2e3),i=(null===(c=null===(u=x.evaluationResult)||void 0===u?void 0:u.deviations)||void 0===c?void 0:c[a])||x,o=(null===(v=x.evaluationResult)||void 0===v?void 0:v.evaluation_outputs)||x.evaluation_outputs,!!Q&&!!Z||ji?(l=function(e,n){return Promise.race([e,new Promise(function(e){return setTimeout(e,n)})])},dn?[4,Promise.all([oi.current?l(T(oi.current),600):Promise.resolve(),Zn.current?l(T(Zn.current),600):Promise.resolve()])]:[3,2]):(r=ne?(null===(f=et.current[ue?U:j])||void 0===f?void 0:f.current)||Z:(null===(p=Zi.current[ue?U:P])||void 0===p?void 0:p.current)||Q,zo(r,function(){hi({open:!0,anchorEl:r,displayImpact:en.displayImpact,summary:e(e({},i),{evaluation_outputs:o})})},{skipScroll:!0}),null==nn||nn(),[2]));case 1:t.sent(),t.label=2;case 2:return ji&&(On(ko(ee)),Bn(new Set([ee]))),_t.current(ee,!1,{toggleIfSame:!1,sourceSide:_?"right":"left",onReady:function(){var n,t,o,r;s();var l=ne?(null===(n=et.current[U])||void 0===n?void 0:n.current)||Z:(null===(t=Zi.current[U])||void 0===t?void 0:t.current)||Q;if(ji)setTimeout(function(){return Oo(ee)},150);else{var u=(null===(o=Zi.current[U])||void 0===o?void 0:o.current)||Q,c=(null===(r=et.current[U])||void 0===r?void 0:r.current)||Z;u&&(u.style.scrollMarginTop="150px",u.scrollIntoView({behavior:"smooth",block:"start"})),c&&(c.style.scrollMarginTop="150px",c.scrollIntoView({behavior:"smooth",block:"start"}))}hi({open:!0,anchorEl:l,displayImpact:en.displayImpact,summary:e({},i)}),null==nn||nn()}}),[2]}})})};Math.abs(te.scrollTop-le)<=2?ce():F(te,le,ce)}else++v<30&&(f=setTimeout(m,100))}else++v<30&&(f=setTimeout(m,100))}else++v<30&&(f=setTimeout(m,100))}else++v<30&&(f=setTimeout(m,100))}else++v<30&&(f=setTimeout(m,100))}};return f=setTimeout(m,100),function(){d=!0,f&&clearTimeout(f),null==p||p()}}Go.current={id:en.id,triggerMs:o},so(en.id);var S=Mi.findIndex(function(e){return e.id===en.id}),x=Hi.findIndex(function(e){return e.id===en.id});-1===S&&-1===x||setTimeout(function(){var e=-1!==S?S:x,n=-1===S;ji&&On(ko(e)),Bn(new Set([e])),_t.current(e,n,{sourceSide:n?"right":"left",onReady:function(){ji&&setTimeout(function(){return Oo(String(e))},150)}})},400)}}},[null==en?void 0:en.id,null==en?void 0:en.trigger,null==en?void 0:en.displayImpact,Wi,Mi,Hi,dn,hi,so,ji,ko,Oo]),a(function(){var n,i,t;if(gi.open){var o=gi.anchorEl;if(o&&!o.isConnected){var r=function(e){for(var n,i=0,t=Object.entries(e);i<t.length;i++){var r=t[i],l=r[0];if((null===(n=r[1].current)||void 0===n?void 0:n.textContent)===o.textContent)return l}return null},l=(null===(n=o.dataset)||void 0===n?void 0:n.deviationRefId)||r(Zi.current)||r(et.current);if(l){var u=(null===(i=et.current[l])||void 0===i?void 0:i.current)||(null===(t=Zi.current[l])||void 0===t?void 0:t.current);u&&u.isConnected&&hi(function(n){return e(e({},n),{anchorEl:u})})}}}},[gi.open,gi.anchorEl,En,wn,Ft]);var Ko=ci.open,Jo=ci.sectionIdx,Yo=ci.isOrphan,Xo=ci.badgeStyle,$o=ci.anchorEl,Uo=ci.sectionAnchorEl;a(function(){var n;if(Xe.isStreamingEnabled&&Ko&&null!=Jo&&Jo!==zt){var i="string"==typeof Jo?Jo.split(B)[0]:null,t=function(e,n){var i;if(!e||!Array.isArray(e))return null;for(var o=0,r=e;o<r.length;o++){var l=r[o];if(l.id===n)return l;if(null===(i=l.subsections)||void 0===i?void 0:i.length){var u=t(l.subsections,n);if(u)return u}}return null},o=i&&"string"==typeof i?t(Mi,i):null,r=i&&"string"==typeof i?t(Hi,i):null,l="number"==typeof Jo?Mi[Jo]||null:o||i&&((null===(n=null==We?void 0:We.nodes)||void 0===n?void 0:n[i])||(null==We?void 0:We[i]))||null,u="number"==typeof Jo?Hi[Jo]||null:r,c=lo($o,l,u,Jo,Yo,Xo);ai(function(n){return n.open?b(n.cognitiveData)===b(c.cognitiveData)&&b(n.deviationData)===b(c.deviationData)&&n.sectionTitle===c.sectionTitle&&n.refSectionTitle===c.refSectionTitle?n:e(e(e({},n),c),{open:!0,anchorEl:n.anchorEl,sectionAnchorEl:n.sectionAnchorEl}):n})}},[Ko,Jo,Yo,Xo,$o,Uo,Mi,Hi,lo]);var Qo=s(function(e){var n=e.section,i=e.keyPath,t=e.depth,r=void 0===t?0:t,l=e.columnKey,u=void 0===l?"left":l,c=e.parentNodeId,a=void 0===c?"":c,s=e.sectionOffset,d=e.rhsOrphanVisualIndexes;return o(K,{section:n,keyPath:i,depth:r,columnKey:u,parentNodeId:a,sectionOffset:s,rhsOrphanVisualIndexes:d})},[]),Zo=c(function(){return Mi.map(function(e,n){var i,t=!(null==e?void 0:e.title)&&!(null==e?void 0:e.content),r=!(null==e?void 0:e.refIndexes)||0===e.refIndexes.length;return t&&r&&dn?null:o(J,{section:e,idx:n},null!==(i=null==e?void 0:e.id)&&void 0!==i?i:"left-row-".concat(n))})},[Mi]),er=c(function(){return Hi.map(function(e,n){var i,t=!(null==e?void 0:e.title)&&!(null==e?void 0:e.content),r=!(null==e?void 0:e.refIndexes)||0===e.refIndexes.length;return t&&r&&dn?null:o(Y,{section:e,idx:n},null!==(i=null==e?void 0:e.id)&&void 0!==i?i:"right-row-".concat(n))})},[Hi]),nr=u(uo);a(function(){nr.current=uo},[uo]);var ir=u(Ft);a(function(){ir.current=Ft},[Ft]);var tr=u(Wo);a(function(){tr.current=Wo},[Wo]);var or=u(jo);a(function(){or.current=jo},[jo]);var rr=u(kt);a(function(){rr.current=kt},[kt]);var lr=u(Dt);a(function(){lr.current=Dt},[Dt]);var ur=u(Qo);a(function(){ur.current=Qo},[Qo]);var cr=u(wt);a(function(){cr.current=wt},[wt]);var ar=c(function(){return{isGuidelineMode:ji,maintainRelativeOrder:!!dn,showDeviationBadges:gn,isProposingFix:on,proposingFixNodeId:rn,isRedlineFlow:ln,isSideBySide:at,activeSideBySideSection:gt,scrollSyncLocked:En,toggleScrollSyncLocked:jt,summaryPopupAnchorEl:gi.anchorEl,connectedSections:wn,proposedSections:Mi,existingSections:Hi,deviationNumberRegistry:qi,deviationParentRegistry:Gi,treeData:We,displayConfig:Xe,resolvedMarkdownStyles:$n,unifiedNumbering:Lt,expandedSections:Ft,expandedSubSections:Et,setExpandedSubSections:At,getSectionCompareStyle:ho,getSubSectionCompareStyle:mo,getBadgeRef:ut,getSectionRowRef:rt,getSubSectionRef:lt,sectionLeftRefs:Ui,sectionRightRefs:Qi,sectionRowRefs:ot,sectionRightRowRefs:nt,subSectionLeftRefs:it,subSectionRightRefs:tt,lhsBadgeRefs:Zi,rhsBadgeRefs:et,openMoreFunctionsPopup:Yt,handleOpenSummaryPopup:Xt,openSummaryPopup:Xt,handleCloseSummaryPopup:$t,toggleSection:Ut,handleSubSectionToggle:Qt,renderSubSectionAccordion:Zt,resetSideBySide:eo,setConnectedSections:Bn,setConnectedLines:Fn,cachedConnectedPositions:qn,showDeviationNavigation:Mo,showOpenNodeRef:Ho,deviationNodeIdToView:null==en?void 0:en.id,deviationTargetParentId:qo,guidelinesData:cn,gptWebCitationConfig:an}},[ji,dn,gn,on,rn,ln,at,gt,En,jt,gi.anchorEl,wn,Mi,Hi,qi,Xe,$n,Lt,Ft,Et,At,ho,mo,ut,rt,lt,Mo,Ho,en,qo,cn,an]),sr=b(ci.sectionTitle||Ai||Ti),dr=b(ji?ki||Oi||ci.refSectionTitle:ci.refSectionTitle||ki||Oi);return o($,e({value:ar},{children:r(d,e({ref:Qn,sx:{display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif',overflow:"visible",position:"relative"}},{children:[mn&&o(d,e({sx:{position:"absolute",inset:0,bgcolor:"rgba(255, 255, 255, 0.6)",backdropFilter:"blur(10px)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px"}},{children:o(N,{})})),gi.open&&o(X,{open:gi.open,anchorEl:gi.anchorEl,containerEl:fo.current,clipTopEl:Ln.current,scrollContainerEl:Un.current,onClose:jo,summary:gi.summary,displayImpact:gi.displayImpact,isScrollLocked:En}),o(L,{open:si.open,anchorEl:si.anchorEl,maintainRelativeOrder:!!dn,sectionTitle:si.sectionTitle,referenceSectionTitle:si.refSectionTitle,onClose:Ci,onOpenCognitiveCompare:Ri,onOpenSideBySide:Po,onConnect:co,isConnected:Lo,isOrphan:!ji&&!!si.isOrphan,isGuidelineMode:ji,hasGuidelineMatches:si.hasGuidelineMatches}),ci.open&&o(j,{open:ci.open,popupRef:xi,position:vi,popupConfig:Ue,onClose:function(){fi(null),ai(function(n){return e(e({},n),{open:!1})}),Si(null)},markdownStyles:Ke,sectionTitle:sr,referenceSectionTitle:dr,cognitiveData:ci.cognitiveData,anchorEl:ci.anchorEl,sectionAnchorEl:ci.sectionAnchorEl,scrollContainerEl:Un.current,badgeStyle:ci.badgeStyle,docData:ci.docData,deviationData:ci.deviationData,isLoading:ci.isLoading}),o(v,e({open:!!Rn,autoHideDuration:8e3,onClose:function(){return bn(null)},anchorOrigin:{vertical:"top",horizontal:"center"}},{children:o(f,e({onClose:function(){return bn(null)},severity:"error",sx:{width:"100%",whiteSpace:"pre-line"}},{children:Rn}))})),o(V,{componentHeaderText:ze,displayConfig:Xe,maintainRelativeOrder:dn,onCollapseAll:_o,showCollapseAll:Io,onToggleView:function(e){Sn(!0),setTimeout(function(){vn(!e),null==$e||$e(!e),An(!1),wt(),mi(),Bn(new Set),Fn([]),qn.current=[],requestAnimationFrame(function(){requestAnimationFrame(function(){setTimeout(function(){Sn(!1)},600)})})},50)}}),o(d,e({ref:Un,onScroll:Bo,sx:{flex:1,minHeight:0,pt:1.5,pb:1,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",overflowY:dn?"visible":"auto",borderTop:Mt&&Ht?"none":"1.5px solid #EEF0F4"}},{children:o(d,e({sx:e({display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"},dn?{flex:1}:{})},{children:r(d,e({ref:jn,sx:e({display:"grid",gridTemplateColumns:"minmax(0, 1fr) 180px minmax(0, 1fr)",gap:"100px",maxWidth:"1200px",width:"100%",position:"relative",minHeight:0},dn?{flex:1,overflow:"visible"}:{})},{children:[o(ne,{svgContainerRef:Pn,svgDimensions:wo,isResizing:vt,overallConnector:yo,rootDeviationStyle:Gt,lines:Ro,isSideBySide:at,activeSideBySideSection:gt,isArrowVisible:st,maintainRelativeOrder:dn,proposedSections:Mi,existingSections:Hi,cognitivePopup:ci,activeBadgeId:pi,closeCognitivePopup:yi,setActiveBadgeId:Si,openCognitivePopupFromState:bi,buildSectionPopupState:lo,connectedLines:In,isGuidelineMode:ji,pathRefs:Wn}),r(d,e({sx:e({border:"1px solid #E7E7E9",borderRadius:"8px",bgcolor:"#FFFFFF",display:"flex",flexDirection:"column",position:"relative",zIndex:2,filter:"drop-shadow(0px 2px 4px #F2F2F2)"},dn?{flex:1,overflow:"visible"}:{})},{children:[o(d,e({ref:Ln,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E7E7E9",borderRadius:"8px 8px 0 0",display:"flex",alignItems:"center",minHeight:"40px",overflow:"hidden",minWidth:0}},{children:o(p,e({title:Ti,placement:"top"},{children:o(g,e({sx:{fontSize:"16px",fontWeight:500,color:"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:Ti}))}))})),r(d,e({ref:oi,onScroll:Bo,sx:e({p:"12px",display:"flex",flexDirection:"column"},dn?{maxHeight:"calc(100vh - 250px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,mr:"-180px",pr:"192px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[o("div",{ref:ii,style:{width:"100%",height:"0px",flexShrink:0}}),Ki&&Zo,o("div",{ref:ti,style:{width:"100%",height:"0px",flexShrink:0}})]}))]})),o(d,e({ref:fo,sx:{width:"180px",display:"flex",flexDirection:"column",alignItems:"center",pt:"15px",gap:0,zIndex:20,pointerEvents:"none"}},{children:o(d,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",mt:0}},{children:r(d,e({onClick:function(n){n.stopPropagation(),ci.open&&pi===zt?yi():(Si(zt),bi(lo(n.currentTarget,{title:"",content:"",evaluationResult:Wt,cognitiveData:{section_id:"",decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0}},null,zt,!0,e(e({},Gt),{label:""}))))},sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",top:"-8px",borderRadius:"20px",bgcolor:Gt.badgeBg,color:Gt.badgeText,border:"1px solid ".concat(Gt.badgeBorder),fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1,pointerEvents:"auto",cursor:"pointer"}},{children:[null!=qt?qt:o(M,{}),o(d,e({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:o(x,{})})),o(S,{size:11,style:{transform:ci.open&&pi===zt?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))})),r(d,e({sx:e({border:"1px solid #E3E6EA",borderRadius:"8px",bgcolor:"#FFFFFF",boxShadow:"0px 1px 4px #F7F4FE",position:"relative",zIndex:2,display:"flex",flexDirection:"column",minWidth:0},dn?{flex:1,overflow:"visible",minHeight:0}:{})},{children:[pt&&o(R,{sections:11}),o(d,e({ref:Nn,sx:e({p:"8px",bgcolor:ji?"#F1F3F5":"#F7F8FA",borderBottom:"1px solid #D7DCE2",borderRadius:"8px 8px 0 0",display:"flex",alignItems:"center"},dn?e({maxHeight:"calc(100vh - 250px)",overflowY:"auto",overflowX:"hidden",minHeight:0},ji?{"&::-webkit-scrollbar":{width:"6px",display:"block"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"#CBD5E1",borderRadius:"10px"},"&::-webkit-scrollbar-thumb:hover":{background:"#94A3B8"},scrollbarWidth:"thin",scrollbarColor:"#CBD5E1 transparent"}:{"&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}):{})},{children:ji?r(h,e({value:kn,onChange:function(e,n){return On(n)},variant:"fullWidth",TabIndicatorProps:{sx:{display:"none"}},sx:{width:"100%",minHeight:"36px","& .MuiTab-root":{minHeight:"36px",px:1,py:0,borderRadius:"8px",fontSize:"14px",lineHeight:1,fontWeight:500,textTransform:"none",color:"#374151",minWidth:0,transition:"background-color 160ms ease, box-shadow 160ms ease"},"& .Mui-selected":{color:"#374151",bgcolor:"#FFFFFF"}}},{children:[o(m,{label:o(p,e({title:Oi,placement:"top"},{children:o(d,e({component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block",width:"100%"}},{children:"Redline Guidelines"}))}))}),o(m,{label:o(p,e({title:"Web & GPT Sources",placement:"top"},{children:o(d,e({component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block",width:"100%"}},{children:"Web & GPT Sources"}))}))})]})):o(p,e({title:Oi,placement:"top"},{children:o(g,e({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:Oi}))}))})),r(d,e({ref:Zn,onScroll:Bo,sx:e({p:ji?"0px":"12px",display:"flex",flexDirection:"column"},dn?e(e({maxHeight:"calc(100vh - 250px)"},!ji&&{flex:1}),{overflowY:"auto",overflowX:"hidden",minHeight:0,ml:"-150px",pl:"165px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}):{})},{children:[o("div",{ref:ei,style:{width:"100%",height:"0px",flexShrink:0}}),ji?0===kn?o(ie,{guidelinesData:cn,deviationData:Ze,connectedSections:wn,proposedSections:Mi}):o(te,{deviationData:Ze,connectedSections:wn,proposedSections:Mi}):Ki&&er,o("div",{ref:ni,style:{width:"100%",height:"0px",flexShrink:0}})]}))]}))]}))}))}))]}))}))};export{oe as default};
|
|
2
2
|
//# sourceMappingURL=CognitiveCompare.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{DEFAULT_DEVIAION_COLOR as t}from"./CognitiveCompareConstants.js";var n=function(t){return null==t?"":"string"==typeof t?t:Array.isArray(t)?t.map(n).join("\n\n"):"object"==typeof t?JSON.stringify(t):String(t)},e=function(t){return null!=t&&("string"==typeof t?t.trim().length>0:!Array.isArray(t)||t.length>0&&t.some(function(t){return e(t)}))},o=function(t,e,o){var r,i=o[e],u=null===(r=null==t?void 0:t.comparison_inputs)||void 0===r?void 0:r[i];return{title:n((null==u?void 0:u.title)||""),content:n((null==u?void 0:u.content)||""),change_history:n((null==u?void 0:u.change_history)||""),attributes:(null==u?void 0:u.additional_attributes)||null,subsections:(null==u?void 0:u.subsections)||[]}},r=function(t){if(!t.mapping_rationale)return{cognitiveData:{decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0,citations:[]},score:0,relation:"N/A"};var n=t.mapping_rationale,e=parseInt(n.decision_strength||"0");return{cognitiveData:{decisioning:n.decisioning_factors||[],gap:n.gaps_in_decision||[],relevance_score:e,citations:n.citations},score:0,relation:"N/A"}};function i(t){var n=function(t,n){var e=function(t){var n=function(t){return 4===t.length?"#"+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]:t}(t).replace("#",""),e=parseInt(n,16);return{r:e>>16&255,g:e>>8&255,b:255&e}}(t),o=e.r,r=e.g,i=e.b;return function(t,n,e){return"#"+[t,n,e].map(function(t){return t.toString(16).padStart(2,"0")}).join("").toUpperCase()}(Math.round(o+(255-o)*n),Math.round(r+(255-r)*n),Math.round(i+(255-i)*n))};return{bg:n(t,.8),border:n(t,.5),badgeBg:n(t,.8),badgeBorder:n(t,.5),badgeText:t.toUpperCase(),highlightBg:n(t,.8)}}function u(t,n){var e;return function(){for(var o=[],r=0;r<arguments.length;r++)o[r]=arguments[r];var i=this;clearTimeout(e),e=setTimeout(function(){return t.apply(i,o)},n)}}var l=function(t,n){var e,o,r,i,u,l;if(t.content!==n.content)return!1;if(t.overlayContent!==n.overlayContent)return!1;if(t.sxStyles!==n.sxStyles)return!1;if(t.maintainRelativeOrder!==n.maintainRelativeOrder)return!1;if(t.highlightBg!==n.highlightBg)return!1;if(t.suppressHighlightBg!==n.suppressHighlightBg)return!1;if(t.collisionKey!==n.collisionKey)return!1;var a=t.highlights||[],s=n.highlights||[];if(a.length!==s.length)return!1;for(var c=0;c<a.length;c++)if(a[c]!==s[c])return!1;var v=t.deviationBadges||[],d=n.deviationBadges||[];if(v.length!==d.length)return!1;for(c=0;c<v.length;c++){if(v[c].id!==d[c].id)return!1;if(v[c].actionId!==d[c].actionId)return!1;if(v[c].label!==d[c].label)return!1;if(v[c].score!==d[c].score)return!1;if(v[c].isOrphan!==d[c].isOrphan)return!1;if(v[c].isConnected!==d[c].isConnected)return!1;if(v[c].showScrollLockToggle!==d[c].showScrollLockToggle)return!1;if(v[c].scrollSyncLocked!==d[c].scrollSyncLocked)return!1;if((null===(e=v[c].style)||void 0===e?void 0:e.badgeBg)!==(null===(o=d[c].style)||void 0===o?void 0:o.badgeBg))return!1;if((null===(r=v[c].style)||void 0===r?void 0:r.badgeBorder)!==(null===(i=d[c].style)||void 0===i?void 0:i.badgeBorder))return!1;if((null===(u=v[c].style)||void 0===u?void 0:u.badgeText)!==(null===(l=d[c].style)||void 0===l?void 0:l.badgeText))return!1}return!0},a="::",s=function(t){if(!t)return!0;var n=t.trim().toLowerCase();return n.includes("no equivalent")||"n/a"===n||"na"===n||"none"===n},c=function(t){var n;if("string"!=typeof t||!t)return!1;for(var e=/<(updated|deleted|changed|change)\b[^>]*>([\s\S]*?)<\/\1>/gi,o=null;null!==(o=e.exec(t));){if((null!==(n=o[2])&&void 0!==n?n:"").replace(/<[^>]*>/g,"").trim().length>0)return!0}return!1},v=function(t){return"string"==typeof t&&t?t.replace(/<\/?(updated|deleted|changed|change)\b[^>]*>/gi,""):""},d=function(t,n){var e,o,r,i,u,l,a;if(!t)return n;var s=null!==(l=null!==(i=null!==(o=null===(e=t.evaluation_output)||void 0===e?void 0:e.output_score)&&void 0!==o?o:null===(r=t.evaluation_outputs)||void 0===r?void 0:r.output_score)&&void 0!==i?i:null===(u=t.evaluation_outputs)||void 0===u?void 0:u.output_value)&&void 0!==l?l:t.output_score;return null!==(a=null!=s?s:n)&&void 0!==a?a:""},f=function(t,n,e,o,r){void 0===r&&(r=14);var i=t+.5*(e-t),u=o-n;if(Math.abs(u)<3)return"M ".concat(t," ").concat(n," H ").concat(e);var l=u>0?1:-1,a=Math.min(r,Math.abs(u)/2,Math.abs(i-t)/2,Math.abs(e-i)/2);return["M ".concat(t," ").concat(n),"H ".concat(i-a),"Q ".concat(i," ").concat(n," ").concat(i," ").concat(n+l*a),"V ".concat(o-l*a),"Q ".concat(i," ").concat(o," ").concat(i+a," ").concat(o),"H ".concat(e)].join(" ")},g=function(t,n,e,o,r){void 0===e&&(e=300);var i=t.style.scrollBehavior;t.style.scrollBehavior="auto";var u=t.scrollTop,l=n-u,a=null,s=function(c){null===a&&(a=c);var v,d=c-a;d<e?(t.scrollTop=(v=d,v/=e,l*(--v*v*v+1)+u),r&&r(),requestAnimationFrame(s)):(t.scrollTop=n,t.style.scrollBehavior=i,r&&r(),o&&o())};requestAnimationFrame(s)},p=["#B91C1C","#A16207","#1D4ED8","#000000"],h=function(t){var n=p.findIndex(function(n){return n.toLowerCase()===t.toLowerCase()});return-1===n?p.length:n},b=function(n){for(var e,o,r,i,u,l,a,s,c,v,d,f,g,p=[],b=0,m=Object.keys((null==n?void 0:n.deviations)||{}).sort(function(t,n){return Number(t)-Number(n)});b<m.length;b++){var y=m[b];(C=null===(i=null===(r=null===(o=null===(e=null==n?void 0:n.deviations)||void 0===e?void 0:e[y])||void 0===o?void 0:o.evaluation_outputs)||void 0===r?void 0:r.metadata)||void 0===i?void 0:i.label_color)&&p.push(C)}for(var _=0,T=Object.keys((null==n?void 0:n.deviation_entries)||{}).sort(function(t,n){return Number(t)-Number(n)});_<T.length;_++){y=T[_];(C=null===(s=null===(a=null===(l=null===(u=null==n?void 0:n.deviation_entries)||void 0===u?void 0:u[y])||void 0===l?void 0:l.evaluation_outputs)||void 0===a?void 0:a.metadata)||void 0===s?void 0:s.label_color)&&p.push(C)}for(var B=0,x=Object.keys(n||{}).filter(function(t){return/^\d+$/.test(t)}).sort(function(t,n){return Number(t)-Number(n)});B<x.length;B++){var C;y=x[B];(C=null===(d=null===(v=null===(c=null==n?void 0:n[y])||void 0===c?void 0:c.evaluation_outputs)||void 0===v?void 0:v.metadata)||void 0===d?void 0:d.label_color)&&p.push(C)}return 0===p.length?(null===(g=null===(f=null==n?void 0:n.evaluation_outputs)||void 0===f?void 0:f.metadata)||void 0===g?void 0:g.label_color)?n.evaluation_outputs.metadata.label_color:t:p.sort(function(t,n){return h(t)-h(n)})[0]},m=function(t){for(var n,e,o,r,i,u,l,a,s,c=0,v=Object.keys((null==t?void 0:t.deviations)||{}).sort(function(t,n){return Number(t)-Number(n)});c<v.length;c++){var d=v[c];if(b=null===(o=null===(e=null===(n=null==t?void 0:t.deviations)||void 0===n?void 0:n[d])||void 0===e?void 0:e.evaluation_outputs)||void 0===o?void 0:o.output_value)return b}for(var f=0,g=Object.keys((null==t?void 0:t.deviation_entries)||{}).sort(function(t,n){return Number(t)-Number(n)});f<g.length;f++){d=g[f];if(b=null===(u=null===(i=null===(r=null==t?void 0:t.deviation_entries)||void 0===r?void 0:r[d])||void 0===i?void 0:i.evaluation_outputs)||void 0===u?void 0:u.output_value)return b}for(var p=0,h=Object.keys(t||{}).filter(function(t){return/^\d+$/.test(t)}).sort(function(t,n){return Number(t)-Number(n)});p<h.length;p++){var b;d=h[p];if(b=null===(a=null===(l=null==t?void 0:t[d])||void 0===l?void 0:l.evaluation_outputs)||void 0===a?void 0:a.output_value)return b}return(null===(s=null==t?void 0:t.evaluation_outputs)||void 0===s?void 0:s.output_value)?t.evaluation_outputs.output_value:null},y=function(t,n){var e=function(t){var n=t.replace("#","");return[parseInt(n.substring(0,2),16),parseInt(n.substring(2,4),16),parseInt(n.substring(4,6),16)]},o=function(t){var n=Math.round(t).toString(16);return 1===n.length?"0"+n:n};try{var r=e(t),i=e(n),u=(r[0]+i[0])/2*.95,l=(r[1]+i[1])/2*.95,a=(r[2]+i[2])/2*.95;return"#".concat(o(u)).concat(o(l)).concat(o(a))}catch(t){return"#FDE68A"}},_=function(t,n,e){if(!t)return null;if(t.id===e)return n;if(!Array.isArray(t.subsections))return null;for(var o=0;o<t.subsections.length;o++){var r=_(t.subsections[o],"".concat(n,"-").concat(o),e);if(r)return r}return null},T=function(t,n){for(var e=0;e<t.length;e++){var o=_(t[e],String(e),n);if(o)return o}return null},B=new WeakMap,x=function(t){if(t){var n=B.get(t);null!=n&&(clearTimeout(n),B.delete(t)),t.style.transition="box-shadow 300ms ease-out, outline 300ms ease-out",requestAnimationFrame(function(){t.style.outline="",t.style.boxShadow=""}),window.setTimeout(function(){t.style.transition="",t.style.borderRadius=""},300)}},C=function(t){if(t){var n=B.get(t);null!=n&&clearTimeout(n),t.style.transition="box-shadow 300ms ease-in-out, outline 300ms ease-in-out",t.style.outline="2px solid #ff9494",t.style.borderRadius="6px",t.style.boxShadow="0 0 12px 2px rgba(244, 113, 113, 0.33)";var e=window.setTimeout(function(){x(t)},3e3);B.set(t,e)}},w=function(t,n){var e=n.getBoundingClientRect(),o=t.getBoundingClientRect(),r=n.scrollTop+o.top-e.top-e.height/2+o.height/2;n.scrollTo({top:r,behavior:"smooth"});var i=function(){return C(t)};if("onscrollend"in n)n.addEventListener("scrollend",i,{once:!0});else{var u=n.scrollTop,l=function(){n.scrollTop===u?i():(u=n.scrollTop,requestAnimationFrame(l))};requestAnimationFrame(l)}},A=function(t,n,e){if(Math.abs(t.scrollTop-n)<=2)e();else{var o,r=!1,i=function(){r||(r=!0,clearTimeout(o),t.removeEventListener("scrollend",u),e())},u=function(){return i()};t.addEventListener("scrollend",u),t.scrollTo({top:n,behavior:"smooth"}),o=setTimeout(i,800)}},N=function(t,n){return void 0===n&&(n=100),new Promise(function(e){var o,r=!1,i=function(){r||(r=!0,t.removeEventListener("scroll",u),e())},u=function(){clearTimeout(o),o=setTimeout(i,n)};t.addEventListener("scroll",u),o=setTimeout(i,n)})};export{a as DEVIATION_BADGE_SEPARATOR,l as areMarkdownPropsEqual,u as debounce,d as extractDeviationScore,T as findKeyPathByNodeId,i as generateColorPalette,f as getBentArrowPath,b as getFirstDeviationColor,m as getFirstDeviationOutputValue,r as getRationale,o as getSideData,c as hasMeaningfulRedlineTags,e as hasValue,C as highlightClause,s as isMissingStr,y as mixHexColors,_ as recursivelyFindSubSectionIdxById,x as resetClauseHighlight,n as safeStringify,w as scrollAndHighlightClause,A as scrollAndWait,g as smoothScrollTo,v as stripRedlineTags,N as waitForScrollIdle};
|
|
1
|
+
import{DEFAULT_DEVIAION_COLOR as n}from"./CognitiveCompareConstants.js";var t=function(n){return null==n?"":"string"==typeof n?n:Array.isArray(n)?n.map(t).join("\n\n"):"object"==typeof n?JSON.stringify(n):String(n)},e=function(n){return null!=n&&("string"==typeof n?n.trim().length>0:!Array.isArray(n)||n.length>0&&n.some(function(n){return e(n)}))},o=function(n){for(var t=n+1,e="";t>0;){t-=1;e=String.fromCharCode(97+t%26)+e,t=Math.floor(t/26)}return e},r=function(n){var t=n.section,e=n.proposedSections,r=n.leftNums,i=n.fallbackNumber,u=n.firstOnly,l=void 0!==u&&u;if(!(null==t?void 0:t.id))return i;var a=(e||[]).map(function(n){var e=Array.isArray(null==n?void 0:n.refIndexes)?n.refIndexes:[],i=e.findIndex(function(n){return n===t.selfIndex});if(-1===i)return null;var u=(null==n?void 0:n.id)?r.get(n.id):void 0;return null==u?null:e.length>1?"".concat(u).concat(o(i)):String(u)}).filter(Boolean);return 0===a.length?i:l?a[0]:a.join(", ")},i=function(n,t){return null!=(null==n?void 0:n.selfIndex)&&1===(t||[]).filter(function(t){return Array.isArray(null==t?void 0:t.refIndexes)&&t.refIndexes.includes(n.selfIndex)}).length},u=function(n,t,e,o){var r;void 0===o&&(o={});var i=e[t],u=null===(r=null==n?void 0:n.comparison_inputs)||void 0===r?void 0:r[i];return u?(Array.isArray(u)?u:[u]).map(function(n,t){if(n&&"string"==typeof n&&n.trim()){var e=o[n];return e&&"object"==typeof e&&e?{contentId:n,data:e,attributes:e.additional_attributes||{}}:null}return n&&"object"==typeof n?{contentId:n.content_id||n.id||"".concat(i,"-direct-").concat(t),data:n,attributes:n.additional_attributes||{}}:null}).filter(Boolean):[]},l=function(n,e,o,r){var i,l,a;void 0===r&&(r={});var s=u(n,e,o,r),c=(null===(i=s[0])||void 0===i?void 0:i.data)||{},d=(null===(l=s[0])||void 0===l?void 0:l.attributes)||null;return{title:t((null==c?void 0:c.title)||""),content:t((null==c?void 0:c.content)||""),change_history:t((null==c?void 0:c.change_history)||""),attributes:d,subsections:(null==c?void 0:c.subsections)||[],contentId:null===(a=s[0])||void 0===a?void 0:a.contentId,allItems:s}},a=function(n){if(!n.mapping_rationale)return{cognitiveData:{decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0,citations:[]},score:0,relation:"N/A"};var t=n.mapping_rationale,e=parseInt(t.decision_strength||"0");return{cognitiveData:{decisioning:t.decisioning_factors||[],gap:t.gaps_in_decision||[],relevance_score:e,citations:t.citations},score:0,relation:"N/A"}};function s(n){var t=function(n,t){var e=function(n){var t=function(n){return 4===n.length?"#"+n[1]+n[1]+n[2]+n[2]+n[3]+n[3]:n}(n).replace("#",""),e=parseInt(t,16);return{r:e>>16&255,g:e>>8&255,b:255&e}}(n),o=e.r,r=e.g,i=e.b;return function(n,t,e){return"#"+[n,t,e].map(function(n){return n.toString(16).padStart(2,"0")}).join("").toUpperCase()}(Math.round(o+(255-o)*t),Math.round(r+(255-r)*t),Math.round(i+(255-i)*t))};return{bg:t(n,.8),border:t(n,.5),badgeBg:t(n,.8),badgeBorder:t(n,.5),badgeText:n.toUpperCase(),highlightBg:t(n,.8)}}function c(n,t){var e;return function(){for(var o=[],r=0;r<arguments.length;r++)o[r]=arguments[r];var i=this;clearTimeout(e),e=setTimeout(function(){return n.apply(i,o)},t)}}var d=function(n,t){var e,o,r,i,u,l;if(n.content!==t.content)return!1;if(n.overlayContent!==t.overlayContent)return!1;if(n.sxStyles!==t.sxStyles)return!1;if(n.maintainRelativeOrder!==t.maintainRelativeOrder)return!1;if(n.highlightBg!==t.highlightBg)return!1;if(n.suppressHighlightBg!==t.suppressHighlightBg)return!1;if(n.collisionKey!==t.collisionKey)return!1;var a=n.highlights||[],s=t.highlights||[];if(a.length!==s.length)return!1;for(var c=0;c<a.length;c++)if(a[c]!==s[c])return!1;var d=n.deviationBadges||[],v=t.deviationBadges||[];if(d.length!==v.length)return!1;for(c=0;c<d.length;c++){if(d[c].id!==v[c].id)return!1;if(d[c].actionId!==v[c].actionId)return!1;if(d[c].label!==v[c].label)return!1;if(d[c].score!==v[c].score)return!1;if(d[c].isOrphan!==v[c].isOrphan)return!1;if(d[c].isConnected!==v[c].isConnected)return!1;if(d[c].showScrollLockToggle!==v[c].showScrollLockToggle)return!1;if(d[c].scrollSyncLocked!==v[c].scrollSyncLocked)return!1;if((null===(e=d[c].style)||void 0===e?void 0:e.badgeBg)!==(null===(o=v[c].style)||void 0===o?void 0:o.badgeBg))return!1;if((null===(r=d[c].style)||void 0===r?void 0:r.badgeBorder)!==(null===(i=v[c].style)||void 0===i?void 0:i.badgeBorder))return!1;if((null===(u=d[c].style)||void 0===u?void 0:u.badgeText)!==(null===(l=v[c].style)||void 0===l?void 0:l.badgeText))return!1}return!0},v="::",f=function(n){if(!n)return!0;var t=n.trim().toLowerCase();return t.includes("no equivalent")||"n/a"===t||"na"===t||"none"===t},g=function(n){var t;if("string"!=typeof n||!n)return!1;for(var e=/<(updated|deleted|changed|change)\b[^>]*>([\s\S]*?)<\/\1>/gi,o=null;null!==(o=e.exec(n));){if((null!==(t=o[2])&&void 0!==t?t:"").replace(/<[^>]*>/g,"").trim().length>0)return!0}return!1},h=function(n){return"string"==typeof n&&n?n.replace(/<\/?(updated|deleted|changed|change)\b[^>]*>/gi,""):""},p=function(n,e,o){var r=new Map;if(!e)return r;var i=function(n){var e=g(n)?h(n):t(n||"");return t(e).replace(/\\n/g,"\n")};return(n||[]).forEach(function(n){var t=new Map,u=function(n){var r;if(n){var l=i(n.content);((null===(r=n.evaluationResults)||void 0===r?void 0:r.length)?n.evaluationResults:n.evaluationResult?[n.evaluationResult]:[]).forEach(function(r){var u=(null==r?void 0:r.nodeId)||n.nodeId||n.id;Object.entries((null==r?void 0:r.deviations)||{}).forEach(function(n){var r=n[0],a=n[1][e],s=i(a);if(s&&!f(a)&&l.includes(s)){var c="".concat(u).concat("::").concat(r),d=o[c];null!=d&&t.set(c,d)}})}),(n.subsections||[]).forEach(u)}};if(u(n),0!==t.size){var l=Math.min.apply(Math,Array.from(t.values()));t.forEach(function(n,t){r.set(t,n-l+1)})}}),r},b=function(n,t){var e,o,r,i,u,l,a;if(!n)return t;var s=null!==(l=null!==(i=null!==(o=null===(e=n.evaluation_output)||void 0===e?void 0:e.output_score)&&void 0!==o?o:null===(r=n.evaluation_outputs)||void 0===r?void 0:r.output_score)&&void 0!==i?i:null===(u=n.evaluation_outputs)||void 0===u?void 0:u.output_value)&&void 0!==l?l:n.output_score;return null!==(a=null!=s?s:t)&&void 0!==a?a:""},m=function(n,t,e,o,r){void 0===r&&(r=14);var i=n+.5*(e-n),u=o-t;if(Math.abs(u)<3)return"M ".concat(n," ").concat(t," H ").concat(e);var l=u>0?1:-1,a=Math.min(r,Math.abs(u)/2,Math.abs(i-n)/2,Math.abs(e-i)/2);return["M ".concat(n," ").concat(t),"H ".concat(i-a),"Q ".concat(i," ").concat(t," ").concat(i," ").concat(t+l*a),"V ".concat(o-l*a),"Q ".concat(i," ").concat(o," ").concat(i+a," ").concat(o),"H ".concat(e)].join(" ")},y=function(n,t,e,o,r){void 0===e&&(e=300);var i=n.style.scrollBehavior;n.style.scrollBehavior="auto";var u=n.scrollTop,l=t-u,a=null,s=function(c){null===a&&(a=c);var d,v=c-a;v<e?(n.scrollTop=(d=v,d/=e,l*(--d*d*d+1)+u),r&&r(),requestAnimationFrame(s)):(n.scrollTop=t,n.style.scrollBehavior=i,r&&r(),o&&o())};requestAnimationFrame(s)},_=["#B91C1C","#A16207","#1D4ED8","#000000"],T=function(n){var t=_.findIndex(function(t){return t.toLowerCase()===n.toLowerCase()});return-1===t?_.length:t},I=function(t){for(var e,o,r,i,u,l,a,s,c,d,v,f,g,h=[],p=0,b=Object.keys((null==t?void 0:t.deviations)||{}).sort(function(n,t){return Number(n)-Number(t)});p<b.length;p++){var m=b[p];(A=null===(i=null===(r=null===(o=null===(e=null==t?void 0:t.deviations)||void 0===e?void 0:e[m])||void 0===o?void 0:o.evaluation_outputs)||void 0===r?void 0:r.metadata)||void 0===i?void 0:i.label_color)&&h.push(A)}for(var y=0,_=Object.keys((null==t?void 0:t.deviation_entries)||{}).sort(function(n,t){return Number(n)-Number(t)});y<_.length;y++){m=_[y];(A=null===(s=null===(a=null===(l=null===(u=null==t?void 0:t.deviation_entries)||void 0===u?void 0:u[m])||void 0===l?void 0:l.evaluation_outputs)||void 0===a?void 0:a.metadata)||void 0===s?void 0:s.label_color)&&h.push(A)}for(var I=0,x=Object.keys(t||{}).filter(function(n){return/^\d+$/.test(n)}).sort(function(n,t){return Number(n)-Number(t)});I<x.length;I++){var A;m=x[I];(A=null===(v=null===(d=null===(c=null==t?void 0:t[m])||void 0===c?void 0:c.evaluation_outputs)||void 0===d?void 0:d.metadata)||void 0===v?void 0:v.label_color)&&h.push(A)}return 0===h.length?(null===(g=null===(f=null==t?void 0:t.evaluation_outputs)||void 0===f?void 0:f.metadata)||void 0===g?void 0:g.label_color)?t.evaluation_outputs.metadata.label_color:n:h.sort(function(n,t){return T(n)-T(t)})[0]},x=function(n){for(var t,e,o,r,i,u,l,a,s,c=0,d=Object.keys((null==n?void 0:n.deviations)||{}).sort(function(n,t){return Number(n)-Number(t)});c<d.length;c++){var v=d[c];if(b=null===(o=null===(e=null===(t=null==n?void 0:n.deviations)||void 0===t?void 0:t[v])||void 0===e?void 0:e.evaluation_outputs)||void 0===o?void 0:o.output_value)return b}for(var f=0,g=Object.keys((null==n?void 0:n.deviation_entries)||{}).sort(function(n,t){return Number(n)-Number(t)});f<g.length;f++){v=g[f];if(b=null===(u=null===(i=null===(r=null==n?void 0:n.deviation_entries)||void 0===r?void 0:r[v])||void 0===i?void 0:i.evaluation_outputs)||void 0===u?void 0:u.output_value)return b}for(var h=0,p=Object.keys(n||{}).filter(function(n){return/^\d+$/.test(n)}).sort(function(n,t){return Number(n)-Number(t)});h<p.length;h++){var b;v=p[h];if(b=null===(a=null===(l=null==n?void 0:n[v])||void 0===l?void 0:l.evaluation_outputs)||void 0===a?void 0:a.output_value)return b}return(null===(s=null==n?void 0:n.evaluation_outputs)||void 0===s?void 0:s.output_value)?n.evaluation_outputs.output_value:null},A=function(n,t){var e=function(n){var t=n.replace("#","");return[parseInt(t.substring(0,2),16),parseInt(t.substring(2,4),16),parseInt(t.substring(4,6),16)]},o=function(n){var t=Math.round(n).toString(16);return 1===t.length?"0"+t:t};try{var r=e(n),i=e(t),u=(r[0]+i[0])/2*.95,l=(r[1]+i[1])/2*.95,a=(r[2]+i[2])/2*.95;return"#".concat(o(u)).concat(o(l)).concat(o(a))}catch(n){return"#FDE68A"}},B=function(n,t,e){if(!n)return null;if(n.id===e||n.nodeId===e||n.contentId===e)return t;if(!Array.isArray(n.subsections))return null;for(var o=0;o<n.subsections.length;o++){var r=B(n.subsections[o],"".concat(t,"-").concat(o),e);if(r)return r}return null},M=function(n,t){for(var e=0;e<n.length;e++){var o=B(n[e],String(e),t);if(o)return o}return null},C=new WeakMap,S=function(n){if(n){var t=C.get(n);null!=t&&(clearTimeout(t),C.delete(n)),n.style.transition="box-shadow 300ms ease-out, outline 300ms ease-out",requestAnimationFrame(function(){n.style.outline="",n.style.boxShadow=""}),window.setTimeout(function(){n.style.transition="",n.style.borderRadius=""},300)}},w=function(n){if(n){var t=C.get(n);null!=t&&clearTimeout(t),n.style.transition="box-shadow 300ms ease-in-out, outline 300ms ease-in-out",n.style.outline="2px solid #ff9494",n.style.borderRadius="6px",n.style.boxShadow="0 0 12px 2px rgba(244, 113, 113, 0.33)";var e=window.setTimeout(function(){S(n)},3e3);C.set(n,e)}},N=function(n,t){var e=t.getBoundingClientRect(),o=n.getBoundingClientRect(),r=t.scrollTop+o.top-e.top-e.height/2+o.height/2;t.scrollTo({top:r,behavior:"smooth"});var i=function(){return w(n)};if("onscrollend"in t)t.addEventListener("scrollend",i,{once:!0});else{var u=t.scrollTop,l=function(){t.scrollTop===u?i():(u=t.scrollTop,requestAnimationFrame(l))};requestAnimationFrame(l)}},j=function(n,t,e){if(Math.abs(n.scrollTop-t)<=2)e();else{var o,r=!1,i=function(){r||(r=!0,clearTimeout(o),n.removeEventListener("scrollend",u),e())},u=function(){return i()};n.addEventListener("scrollend",u),n.scrollTo({top:t,behavior:"smooth"}),o=setTimeout(i,800)}},O=function(n,t){return void 0===t&&(t=100),new Promise(function(e){var o,r=!1,i=function(){r||(r=!0,n.removeEventListener("scroll",u),e())},u=function(){clearTimeout(o),o=setTimeout(i,t)};n.addEventListener("scroll",u),o=setTimeout(i,t)})};export{v as DEVIATION_BADGE_SEPARATOR,d as areMarkdownPropsEqual,c as debounce,b as extractDeviationScore,M as findKeyPathByNodeId,s as generateColorPalette,o as getAlphabeticSuffix,m as getBentArrowPath,I as getFirstDeviationColor,x as getFirstDeviationOutputValue,p as getLhsDeviationDisplayIndexes,a as getRationale,r as getRhsMappedSectionNumber,l as getSideData,g as hasMeaningfulRedlineTags,i as hasSingleMappedLhsSection,e as hasValue,w as highlightClause,f as isMissingStr,A as mixHexColors,B as recursivelyFindSubSectionIdxById,S as resetClauseHighlight,u as resolveComparisonInputItems,t as safeStringify,N as scrollAndHighlightClause,j as scrollAndWait,y as smoothScrollTo,h as stripRedlineTags,O as waitForScrollIdle};
|
|
2
2
|
//# sourceMappingURL=CognitiveComparehelpers.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as o}from"tslib";import{jsxs as i,Fragment as n,jsx as
|
|
1
|
+
import{__assign as o}from"tslib";import{jsxs as i,Fragment as n,jsx as e}from"react/jsx-runtime";import{useMemo as t,useState as r,useCallback as a,useEffect as l}from"react";import{Box as c,Typography as s,IconButton as d,Tooltip as p}from"@mui/material";import{X as v}from"lucide-react";import x from"react-dom";import h from"../../assests/svg/SparkleIcon.js";import{SHARED_MARKDOWN_STYLES as u,DEFAULT_POPUP_CONFIG as g}from"./CognitiveCompareConfig.js";import b from"./CitationRenderer.js";var f=10,m=function(m){var y,w,F,k,C,S,D,_,E,R,z,W,I,T,j,A,B,L,H,M,O=m.open,G=m.onClose,N=m.sectionTitle,P=m.referenceSectionTitle,Y=m.cognitiveData,q=m.relevanceScore,J=m.anchorEl,K=m.badgeStyle,Q=m.popupRef,U=m.position,V=m.markdownStyles,X=m.docData,Z=m.popupConfig,$=m.deviationData,oo=void 0===$?null:$,io=m.isLoading,no=o(o({},u),V),eo=t(function(){var i,n;return o(o(o({},g),Z),{tabs:{deviation:o(o({},g.tabs.deviation),null===(i=null==Z?void 0:Z.tabs)||void 0===i?void 0:i.deviation),association:o(o({},g.tabs.association),null===(n=null==Z?void 0:Z.tabs)||void 0===n?void 0:n.association)},sectionTitles:o(o({},g.sectionTitles),null==Z?void 0:Z.sectionTitles)})},[Z]),to=null==Y?void 0:Y.isMissingRationale,ro=r(to?eo.tabs.deviation.key:eo.tabs.association.key),ao=ro[0],lo=ro[1],co=r(!1),so=co[0],po=co[1],vo=a(function(o){po(o)},[]);l(function(){O?lo(to?eo.tabs.deviation.key:eo.tabs.association.key):po(!1)},[O,to,eo.tabs.deviation.key,eo.tabs.association.key]);var xo=t(function(){if(!K)return{border:eo.accentColor,shadow:"".concat(eo.accentColor,"2E")};var o=K.badgeText;return"#9F1239"===o||"#B42318"===o?{border:"#E11D48",shadow:"rgba(225,29,72,0.15)"}:"#1D4ED8"===o?{border:"#3B82F6",shadow:"rgba(59,130,246,0.15)"}:"#A16207"===o?{border:"#F59E0B",shadow:"rgba(245,158,11,0.15)"}:{border:eo.accentColor,shadow:"".concat(eo.accentColor,"2E")}},[K,eo.accentColor]);l(function(){if(O&&!so){var o=function(o){var i;(null===(i=Q.current)||void 0===i?void 0:i.contains(o.target))||(null==J?void 0:J.contains(o.target))||G()};return document.addEventListener("mousedown",o),function(){return document.removeEventListener("mousedown",o)}}},[O,G,J,Q,so]);var ho=to?[]:[eo.tabs.deviation,eo.tabs.association];if(1===ho.length&&ho[0].key===eo.tabs.deviation.key)return null;if(!O||!Y)return null;var uo=null!==(F=null!==(w=ao===eo.tabs.deviation.key?null===(y=null==oo?void 0:oo.cognitive_decisioning)||void 0===y?void 0:y.decision_strength:Y.relevance_score)&&void 0!==w?w:q)&&void 0!==F?F:0,go=Y.decisioning,bo=Array.isArray(go)?go:"string"==typeof go&&go.trim()?[go]:[],fo=Y.gap,mo=Array.isArray(fo)?fo:"string"==typeof fo&&fo.trim()?[fo]:[],yo=U?U.left-150:-9999,wo=(null!==(k=null==U?void 0:U.arrowLeft)&&void 0!==k?k:60)+150,Fo=i(c,o({ref:Q,sx:{position:"fixed",top:null!==(C=null==U?void 0:U.top)&&void 0!==C?C:-9999,left:yo,zIndex:9999,width:"".concat(1050,"px"),maxWidth:"min(".concat(1050,"px, calc(100vw - ").concat(yo>0?yo:0,"px - ").concat(12,"px))"),bgcolor:"#FFFFFF",borderRadius:"14px",border:"1.5px solid ".concat(xo.border),boxShadow:"0px 8px 32px ".concat(xo.shadow,", 0px 0px 0px 3px ").concat(xo.shadow),overflow:"visible",display:"flex",flexDirection:"column",maxHeight:(null==U?void 0:U.maxHeight)?"min(60vh, ".concat(U.maxHeight,"px)"):"60vh",visibility:!so&&U?"visible":"hidden",pointerEvents:so?"none":"auto"}},{children:[U&&(U.openAbove?i(n,{children:[e(c,{sx:{position:"absolute",bottom:-11,left:wo-f,width:0,height:0,borderLeft:"".concat(f,"px solid transparent"),borderRight:"".concat(f,"px solid transparent"),borderTop:"".concat(11,"px solid ").concat(xo.border),zIndex:1}}),e(c,{sx:{position:"absolute",bottom:-9,left:wo-f+1,width:0,height:0,borderLeft:"".concat(9,"px solid transparent"),borderRight:"".concat(9,"px solid transparent"),borderTop:"".concat(f,"px solid #FFFFFF"),zIndex:2}})]}):i(n,{children:[e(c,{sx:{position:"absolute",top:-11,left:wo-f,width:0,height:0,borderLeft:"".concat(f,"px solid transparent"),borderRight:"".concat(f,"px solid transparent"),borderBottom:"".concat(11,"px solid ").concat(xo.border),zIndex:1}}),e(c,{sx:{position:"absolute",top:-9,left:wo-f+1,width:0,height:0,borderLeft:"".concat(9,"px solid transparent"),borderRight:"".concat(9,"px solid transparent"),borderBottom:"".concat(f,"px solid #FFFFFF"),zIndex:2}})]})),i(c,o({sx:{px:2.5,pt:2,pb:1.5,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:2,flexShrink:0}},{children:[i(c,o({sx:{flex:1,minWidth:0}},{children:[("no counterpart"!==N||"no counterpart"!==P)&&i(s,o({sx:{fontSize:"16px",fontWeight:600,color:"#101828",lineHeight:1.3,display:"flex",alignItems:"center",gap:1,flexWrap:"nowrap",overflow:"hidden",width:"100%"}},{children:[e(c,o({component:"span",title:N,sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:"0 1 auto",maxWidth:"calc(50% - 16px)",minWidth:0}},{children:N})),e(c,o({component:"span",sx:{color:"#667085",fontWeight:400,flexShrink:0,mx:.5}},{children:"↔"})),e(c,o({component:"span",title:P||"Reference Section",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,minWidth:0}},{children:P||"Reference Section"}))]})),e(c,o({sx:{mt:.75,display:"inline-flex",alignItems:"center",gap:.75}},{children:e(s,o({sx:{fontSize:"no counterpart"!==N||"no counterpart"!==P?"13px":"16px",fontWeight:400,color:"#5928ED",lineHeight:1}},{children:null===(S=Object.values(eo.tabs).find(function(o){return o.key===ao}))||void 0===S?void 0:S.subtitle}))}))]})),i(c,o({sx:{display:"flex",alignItems:"center",gap:1.5,flexShrink:0}},{children:[i(c,o({sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:.5,borderRadius:"20px",bgcolor:"#FFFFFF",border:"1px solid #5928ED",fontSize:"12px",fontWeight:600,color:"#5928ED"}},{children:[e(h,{}),eo.decisionStrengthLabel," ",uo,"%"]})),e(d,o({onClick:G,size:"small",sx:{color:"#667085",width:24,height:24,"&:hover":{bgcolor:"transparent",color:"#101828"}}},{children:e(v,{size:22})}))]}))]})),e(c,o({sx:{display:"flex",borderBottom:"1px solid #E4E7EC",px:2.5,flexShrink:0}},{children:ho.map(function(i){var n=ao===i.key,t=i.key===eo.tabs.deviation.key,r=ho.length>1&&t&&io,a=e(c,o({onClick:function(){r||lo(i.key)},sx:{pb:"10px",pt:"4px",mr:3,px:2,cursor:r?"not-allowed":"pointer",opacity:r?.5:1,fontSize:"14px",fontWeight:n?600:400,color:n?eo.accentColor:"#667085",backgroundColor:n?"".concat(eo.accentColor,"14"):"transparent",borderBottom:n?"2px solid ".concat(eo.accentColor):"2px solid transparent",transition:"all 0.15s",userSelect:"none"}},{children:i.label}),i.key);return r?e(p,o({title:"Fetching deviation data",arrow:!0,placement:"top"},{children:e("span",{children:a})}),i.key):a})})),e(c,o({sx:{flex:1,minHeight:0,overflowY:"auto",px:2.5,py:2,display:"flex",flexDirection:"column",gap:1.5,"&::-webkit-scrollbar":{width:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"".concat(xo.border,"55"),borderRadius:"10px"},"&::-webkit-scrollbar-thumb:hover":{background:xo.border},scrollbarWidth:"thin",scrollbarColor:"".concat(xo.border,"55 transparent")}},{children:ao===eo.tabs.deviation.key?oo?i(n,{children:[(null===(_=(null===(D=null==oo?void 0:oo.cognitive_decisioning)||void 0===D?void 0:D.decisioning_factors)||[])||void 0===_?void 0:_.length)>0&&e(b,{title:"Decision Making Factors",content:null===(R=null===(E=null==oo?void 0:oo.cognitive_decisioning)||void 0===E?void 0:E.decisioning_factors)||void 0===R?void 0:R.join("\n\n"),citations:null===(z=null==oo?void 0:oo.cognitive_decisioning)||void 0===z?void 0:z.citations,styles:no,docData:X,deviationData:oo,open:O,onCitationFullscreenChange:vo}),(null===(I=(null===(W=null==oo?void 0:oo.cognitive_decisioning)||void 0===W?void 0:W.gaps_in_decision)||[])||void 0===I?void 0:I.length)>0&&e(b,{title:"Gaps in Decision",content:null===(j=null===(T=null==oo?void 0:oo.cognitive_decisioning)||void 0===T?void 0:T.gaps_in_decision)||void 0===j?void 0:j.join("\n\n"),citations:null===(A=null==oo?void 0:oo.cognitive_decisioning)||void 0===A?void 0:A.citations,styles:no,docData:X,deviationData:oo,open:O,onCitationFullscreenChange:vo}),0===(null===(L=(null===(B=null==oo?void 0:oo.cognitive_decisioning)||void 0===B?void 0:B.decisioning_factors)||[])||void 0===L?void 0:L.length)&&0===(null===(M=(null===(H=null==oo?void 0:oo.cognitive_decisioning)||void 0===H?void 0:H.gaps_in_decision)||[])||void 0===M?void 0:M.length)&&e(c,o({sx:{p:2,bgcolor:"#F8FAFC",borderRadius:"8px",border:"1px solid #E2E8F0"}},{children:e(s,o({sx:{fontSize:"13px",color:"#64748B"}},{children:"No cognitive decisioning data available for this section."}))}))]}):e(b,{title:"Deviation Analysis",content:"Deviation analysis content will appear here. This tab shows\n structural and semantic deviations identified between the two\n sections being compared.",citations:{},styles:no,docData:X,open:O,onCitationFullscreenChange:vo}):i(n,{children:[bo.length>0&&e(b,{title:eo.sectionTitles.decisioningFactors,content:bo.join("\n\n"),citations:Y.citations,styles:no,open:O,docData:X,onCitationFullscreenChange:vo}),mo.length>0&&e(b,{title:eo.sectionTitles.gaps,content:mo.join("\n\n"),citations:Y.citations,styles:no,open:O,docData:X,onCitationFullscreenChange:vo}),0===bo.length&&0===mo.length&&e(c,o({sx:{p:2,bgcolor:"#F8FAFC",borderRadius:"8px",border:"1px solid #E2E8F0"}},{children:e(s,o({sx:{fontSize:"13px",color:"#64748B"}},{children:eo.emptyStateMessage}))}))]})}))]}));return x.createPortal(Fo,document.body)};export{m as default};
|
|
2
2
|
//# sourceMappingURL=CognitivePopup.js.map
|