@e-llm-studio/citation 0.0.131 → 0.0.133
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/assests/svg/ButtonCognitiveIcon.js +2 -0
- package/dist/assests/svg/ButtonCognitiveIcon.js.map +1 -0
- package/dist/cjs/assests/svg/ButtonCognitiveIcon.js +2 -0
- package/dist/cjs/assests/svg/ButtonCognitiveIcon.js.map +1 -0
- package/dist/cjs/features/Bookemon/BookCopyrightsCard/BookCopyrightsCard.js +1 -1
- package/dist/cjs/features/Bookemon/BookDetailsCard/BookDetailsCard.js +1 -1
- package/dist/cjs/features/Bookemon/BookElementsCard/BookElementsCard.js +1 -1
- package/dist/cjs/features/Bookemon/BookOverviewCard/BookOverviewCard.js +1 -1
- package/dist/cjs/features/Bookemon/BookPeopleAwardsCard/BookPeopleAwardsCard.js +1 -1
- package/dist/cjs/features/Bookemon/Bookemon.js +1 -1
- package/dist/cjs/features/Bookemon/BookemonContent.js +1 -1
- package/dist/cjs/features/Bookemon/utils/highlight.js +1 -1
- package/dist/cjs/features/ChatCitation/ChatCitationRenderer.js +1 -1
- package/dist/cjs/features/ChatCitation/components/wrappers/Modal.js +1 -1
- package/dist/cjs/features/CognitiveDecisioning/CognitiveDecisioningWrapper.js +1 -1
- package/dist/cjs/features/CognitiveDecisioning/CognitiveDecisioningWrapper.module.css.js +1 -1
- package/dist/features/Bookemon/BookCopyrightsCard/BookCopyrightsCard.js +1 -1
- package/dist/features/Bookemon/BookDetailsCard/BookDetailsCard.js +1 -1
- package/dist/features/Bookemon/BookElementsCard/BookElementsCard.js +1 -1
- package/dist/features/Bookemon/BookOverviewCard/BookOverviewCard.js +1 -1
- package/dist/features/Bookemon/BookPeopleAwardsCard/BookPeopleAwardsCard.js +1 -1
- package/dist/features/Bookemon/Bookemon.js +1 -1
- package/dist/features/Bookemon/BookemonContent.js +1 -1
- package/dist/features/Bookemon/utils/highlight.js +1 -1
- package/dist/features/ChatCitation/ChatCitationRenderer.js +1 -1
- package/dist/features/ChatCitation/components/wrappers/Modal.js +1 -1
- package/dist/features/CognitiveDecisioning/CognitiveDecisioningWrapper.js +1 -1
- package/dist/features/CognitiveDecisioning/CognitiveDecisioningWrapper.module.css.js +1 -1
- package/dist/types/src/BookemonTest.d.ts.map +1 -1
- package/dist/types/src/assests/svg/ButtonCognitiveIcon.d.ts +2 -0
- package/dist/types/src/assests/svg/ButtonCognitiveIcon.d.ts.map +1 -0
- package/dist/types/src/features/Bookemon/BookCopyrightsCard/BookCopyrightsCard.d.ts.map +1 -1
- package/dist/types/src/features/Bookemon/BookDetailsCard/BookDetailsCard.d.ts.map +1 -1
- package/dist/types/src/features/Bookemon/BookElementsCard/BookElementsCard.d.ts +6 -1
- package/dist/types/src/features/Bookemon/BookElementsCard/BookElementsCard.d.ts.map +1 -1
- package/dist/types/src/features/Bookemon/BookOverviewCard/BookOverviewCard.d.ts.map +1 -1
- package/dist/types/src/features/Bookemon/BookPeopleAwardsCard/BookPeopleAwardsCard.d.ts.map +1 -1
- package/dist/types/src/features/Bookemon/Bookemon.d.ts +1 -1
- package/dist/types/src/features/Bookemon/Bookemon.d.ts.map +1 -1
- package/dist/types/src/features/Bookemon/BookemonContent.d.ts +1 -1
- package/dist/types/src/features/Bookemon/BookemonContent.d.ts.map +1 -1
- package/dist/types/src/features/Bookemon/types/citation.types.d.ts +5 -0
- package/dist/types/src/features/Bookemon/types/citation.types.d.ts.map +1 -1
- package/dist/types/src/features/Bookemon/utils/highlight.d.ts +1 -0
- package/dist/types/src/features/Bookemon/utils/highlight.d.ts.map +1 -1
- package/dist/types/src/features/ChatCitation/ChatCitationRenderer.d.ts +1 -0
- package/dist/types/src/features/ChatCitation/ChatCitationRenderer.d.ts.map +1 -1
- package/dist/types/src/features/ChatCitation/components/wrappers/Modal.d.ts +2 -1
- package/dist/types/src/features/ChatCitation/components/wrappers/Modal.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveDecisioning/CognitiveDecisioningWrapper.d.ts.map +1 -1
- package/package.json +14 -79
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as C}from"tslib";import{jsxs as i,jsx as l}from"react/jsx-runtime";var e=function(){return i("svg",C({width:"13",height:"20",viewBox:"0 0 13 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[i("g",C({"clip-path":"url(#clip0_7146_59770)"},{children:[l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.870143 7.4728C1.05898 7.12852 1.27464 6.8046 1.51383 6.50373L1.18293 7.96614C0.979942 8.80183 0.898342 9.61402 1.17775 10.2711C1.21942 10.3691 1.26815 10.4612 1.32333 10.5469C1.31329 10.7241 1.31151 10.9023 1.31813 11.0806C1.35384 12.0427 1.63248 12.9774 2.12537 13.7883C2.61826 14.5994 3.30759 15.2574 4.12238 15.6948C4.23255 15.7549 4.32499 15.8457 4.38965 15.9572C4.45431 16.0686 4.48873 16.1966 4.48918 16.3274V19.2231C4.48918 19.3163 4.47174 19.4086 4.43785 19.4947C4.40397 19.5808 4.3543 19.6591 4.29169 19.7249C4.22908 19.7908 4.15475 19.8432 4.07294 19.8788C3.99114 19.9145 3.90346 19.9328 3.81492 19.9328C3.72637 19.9328 3.63869 19.9145 3.55689 19.8788C3.47508 19.8432 3.40075 19.7908 3.33814 19.7249C3.27553 19.6591 3.22587 19.5808 3.19198 19.4947C3.1581 19.4086 3.14066 19.3163 3.14066 19.2231V16.7453C1.68401 15.8205 0.630139 14.3313 0.205569 12.5974C-0.219001 10.8635 0.0196202 9.02345 0.870143 7.4728ZM2.90096 5.19659C2.88899 5.25028 2.87501 5.30914 2.85914 5.37342L2.35372 7.6047C2.74036 7.06579 3.22081 6.60571 3.77188 6.25032C3.86004 6.19348 3.94964 6.13953 4.04056 6.08854L4.37488 4.7326C4.4043 4.6181 4.42962 4.50778 4.45073 4.40202C3.89913 4.59451 3.3785 4.86265 2.90096 5.19659ZM5.56585 4.12493C5.53444 4.42314 5.47335 4.72393 5.39987 5.0116L5.25401 5.6033C5.6147 5.51175 5.98526 5.46115 6.35938 5.45343C7.27383 5.43458 8.17653 5.67261 8.97455 6.14302C9.77256 6.61343 10.437 7.29923 10.8996 8.1298C11.3621 8.96038 11.606 9.90572 11.6062 10.8685V15.3246C11.6062 15.4318 11.5657 15.5346 11.4937 15.6104C11.4216 15.6863 11.324 15.7288 11.2221 15.7288H9.10545C8.92662 15.7288 8.75512 15.8037 8.62867 15.9367C8.50223 16.0699 8.43119 16.2504 8.43119 16.4386V19.2231C8.43119 19.4114 8.50223 19.5919 8.62867 19.7249C8.75512 19.8581 8.92662 19.9328 9.10545 19.9328C9.28428 19.9328 9.45578 19.8581 9.58223 19.7249C9.70867 19.5919 9.77971 19.4114 9.77971 19.2231V17.1483H11.2221C11.4496 17.1483 11.6749 17.1012 11.8851 17.0096C12.0953 16.9179 12.2863 16.7836 12.4472 16.6142C12.6081 16.4448 12.7357 16.2438 12.8228 16.0225C12.9099 15.8013 12.9547 15.5641 12.9547 15.3246V10.8696C12.9545 9.65475 12.6467 8.46189 12.0631 7.4138C11.4794 6.36573 10.641 5.50029 9.63407 4.90657C8.38865 4.18261 6.95913 3.91301 5.56585 4.12493ZM3.70049 8.44134C3.42465 8.78904 3.20515 9.1864 3.05432 9.61774C2.98799 9.80743 2.93585 10.0011 2.89791 10.1971C3.31428 10.1882 3.71718 10.1018 4.57574 9.3851L5.00851 9.00583C5.17133 8.85685 5.2371 8.62777 5.20005 8.40752L5.17831 8.31379C5.07205 8.04339 4.74203 7.96266 4.50119 8.1089C4.25222 8.26007 3.98261 8.37306 3.70049 8.44134ZM6.15774 7.88766C6.02755 7.55613 5.82305 7.3186 5.58321 7.1627C6.10638 7.00991 6.65842 6.97659 7.20161 7.07001C8.06073 7.21777 8.84495 7.67345 9.42154 8.35994C9.80992 8.82213 9.70204 9.48646 9.30287 9.86461C8.12912 10.9809 6.18401 12.4277 4.25076 12.9671C3.75882 13.1034 3.21941 12.8535 3.03925 12.3198C2.92908 11.9929 2.86081 11.6548 2.8344 11.314C3.15405 11.3123 3.55309 11.2871 4.0591 11.0503C4.53459 10.8279 5.0516 10.4444 5.70426 9.84718C6.24535 9.35195 6.37813 8.59572 6.18673 7.97158L6.1743 7.92908L6.15774 7.88766Z",fill:"#344054"}),l("path",{d:"M2.78566 10.2017C2.21589 10.2017 1.79754 9.83133 2.19656 8.2028L2.85082 5.3137C2.96495 4.85111 2.98338 4.66616 2.85082 4.66616C2.36416 4.7953 2.60848 4.71503 2.19651 4.89983L1.91211 4.39986C3.29881 3.15966 3.32335 2.83187 4.00636 2.83187C4.57614 2.83187 4.6714 3.55367 4.38607 4.66428L3.63745 7.70142C3.50444 8.23827 3.56196 8.42321 3.69406 8.42321C3.98316 8.35428 4.2596 8.24005 4.5145 8.08528C4.75852 7.93711 5.09207 8.01872 5.19962 8.29281C5.27637 8.54288 5.21676 8.82053 5.02834 8.99293C3.76206 10.1516 3.31404 10.2017 2.78566 10.2017ZM4.0972 0.00281947C4.22705 -0.00766091 4.35753 0.0111517 4.47993 0.0580007C4.60232 0.10485 4.71381 0.178656 4.80694 0.274487C4.90007 0.370319 4.97269 0.485969 5.01996 0.61371C5.06723 0.74145 5.08806 0.878339 5.08105 1.01523V1.01265C5.06571 1.36127 4.9234 1.69028 4.68365 1.93134C4.44391 2.17242 4.12517 2.30702 3.79362 2.3072L3.76707 2.30677C3.63546 2.32186 3.50354 2.30544 3.3788 2.25874C3.25407 2.21205 3.14097 2.13628 3.04797 2.0371C2.95497 1.93792 2.88447 1.8179 2.84174 1.68601C2.79934 1.55514 2.78536 1.41595 2.80082 1.27867C2.81343 0.928866 2.95678 0.598439 3.1997 0.359319C3.44286 0.119957 3.76606 -0.00849914 4.09883 0.00195941L4.0972 0.00281947Z",fill:"#344054"})]})),l("defs",{children:l("clipPath",C({id:"clip0_7146_59770"},{children:l("rect",{width:"13",height:"20",fill:"white"})}))})]}))};export{e as ButtonCognitiveIcon};
|
|
2
|
+
//# sourceMappingURL=ButtonCognitiveIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonCognitiveIcon.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var C=require("tslib"),e=require("react/jsx-runtime");exports.ButtonCognitiveIcon=function(){return e.jsxs("svg",C.__assign({width:"13",height:"20",viewBox:"0 0 13 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[e.jsxs("g",C.__assign({"clip-path":"url(#clip0_7146_59770)"},{children:[e.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.870143 7.4728C1.05898 7.12852 1.27464 6.8046 1.51383 6.50373L1.18293 7.96614C0.979942 8.80183 0.898342 9.61402 1.17775 10.2711C1.21942 10.3691 1.26815 10.4612 1.32333 10.5469C1.31329 10.7241 1.31151 10.9023 1.31813 11.0806C1.35384 12.0427 1.63248 12.9774 2.12537 13.7883C2.61826 14.5994 3.30759 15.2574 4.12238 15.6948C4.23255 15.7549 4.32499 15.8457 4.38965 15.9572C4.45431 16.0686 4.48873 16.1966 4.48918 16.3274V19.2231C4.48918 19.3163 4.47174 19.4086 4.43785 19.4947C4.40397 19.5808 4.3543 19.6591 4.29169 19.7249C4.22908 19.7908 4.15475 19.8432 4.07294 19.8788C3.99114 19.9145 3.90346 19.9328 3.81492 19.9328C3.72637 19.9328 3.63869 19.9145 3.55689 19.8788C3.47508 19.8432 3.40075 19.7908 3.33814 19.7249C3.27553 19.6591 3.22587 19.5808 3.19198 19.4947C3.1581 19.4086 3.14066 19.3163 3.14066 19.2231V16.7453C1.68401 15.8205 0.630139 14.3313 0.205569 12.5974C-0.219001 10.8635 0.0196202 9.02345 0.870143 7.4728ZM2.90096 5.19659C2.88899 5.25028 2.87501 5.30914 2.85914 5.37342L2.35372 7.6047C2.74036 7.06579 3.22081 6.60571 3.77188 6.25032C3.86004 6.19348 3.94964 6.13953 4.04056 6.08854L4.37488 4.7326C4.4043 4.6181 4.42962 4.50778 4.45073 4.40202C3.89913 4.59451 3.3785 4.86265 2.90096 5.19659ZM5.56585 4.12493C5.53444 4.42314 5.47335 4.72393 5.39987 5.0116L5.25401 5.6033C5.6147 5.51175 5.98526 5.46115 6.35938 5.45343C7.27383 5.43458 8.17653 5.67261 8.97455 6.14302C9.77256 6.61343 10.437 7.29923 10.8996 8.1298C11.3621 8.96038 11.606 9.90572 11.6062 10.8685V15.3246C11.6062 15.4318 11.5657 15.5346 11.4937 15.6104C11.4216 15.6863 11.324 15.7288 11.2221 15.7288H9.10545C8.92662 15.7288 8.75512 15.8037 8.62867 15.9367C8.50223 16.0699 8.43119 16.2504 8.43119 16.4386V19.2231C8.43119 19.4114 8.50223 19.5919 8.62867 19.7249C8.75512 19.8581 8.92662 19.9328 9.10545 19.9328C9.28428 19.9328 9.45578 19.8581 9.58223 19.7249C9.70867 19.5919 9.77971 19.4114 9.77971 19.2231V17.1483H11.2221C11.4496 17.1483 11.6749 17.1012 11.8851 17.0096C12.0953 16.9179 12.2863 16.7836 12.4472 16.6142C12.6081 16.4448 12.7357 16.2438 12.8228 16.0225C12.9099 15.8013 12.9547 15.5641 12.9547 15.3246V10.8696C12.9545 9.65475 12.6467 8.46189 12.0631 7.4138C11.4794 6.36573 10.641 5.50029 9.63407 4.90657C8.38865 4.18261 6.95913 3.91301 5.56585 4.12493ZM3.70049 8.44134C3.42465 8.78904 3.20515 9.1864 3.05432 9.61774C2.98799 9.80743 2.93585 10.0011 2.89791 10.1971C3.31428 10.1882 3.71718 10.1018 4.57574 9.3851L5.00851 9.00583C5.17133 8.85685 5.2371 8.62777 5.20005 8.40752L5.17831 8.31379C5.07205 8.04339 4.74203 7.96266 4.50119 8.1089C4.25222 8.26007 3.98261 8.37306 3.70049 8.44134ZM6.15774 7.88766C6.02755 7.55613 5.82305 7.3186 5.58321 7.1627C6.10638 7.00991 6.65842 6.97659 7.20161 7.07001C8.06073 7.21777 8.84495 7.67345 9.42154 8.35994C9.80992 8.82213 9.70204 9.48646 9.30287 9.86461C8.12912 10.9809 6.18401 12.4277 4.25076 12.9671C3.75882 13.1034 3.21941 12.8535 3.03925 12.3198C2.92908 11.9929 2.86081 11.6548 2.8344 11.314C3.15405 11.3123 3.55309 11.2871 4.0591 11.0503C4.53459 10.8279 5.0516 10.4444 5.70426 9.84718C6.24535 9.35195 6.37813 8.59572 6.18673 7.97158L6.1743 7.92908L6.15774 7.88766Z",fill:"#344054"}),e.jsx("path",{d:"M2.78566 10.2017C2.21589 10.2017 1.79754 9.83133 2.19656 8.2028L2.85082 5.3137C2.96495 4.85111 2.98338 4.66616 2.85082 4.66616C2.36416 4.7953 2.60848 4.71503 2.19651 4.89983L1.91211 4.39986C3.29881 3.15966 3.32335 2.83187 4.00636 2.83187C4.57614 2.83187 4.6714 3.55367 4.38607 4.66428L3.63745 7.70142C3.50444 8.23827 3.56196 8.42321 3.69406 8.42321C3.98316 8.35428 4.2596 8.24005 4.5145 8.08528C4.75852 7.93711 5.09207 8.01872 5.19962 8.29281C5.27637 8.54288 5.21676 8.82053 5.02834 8.99293C3.76206 10.1516 3.31404 10.2017 2.78566 10.2017ZM4.0972 0.00281947C4.22705 -0.00766091 4.35753 0.0111517 4.47993 0.0580007C4.60232 0.10485 4.71381 0.178656 4.80694 0.274487C4.90007 0.370319 4.97269 0.485969 5.01996 0.61371C5.06723 0.74145 5.08806 0.878339 5.08105 1.01523V1.01265C5.06571 1.36127 4.9234 1.69028 4.68365 1.93134C4.44391 2.17242 4.12517 2.30702 3.79362 2.3072L3.76707 2.30677C3.63546 2.32186 3.50354 2.30544 3.3788 2.25874C3.25407 2.21205 3.14097 2.13628 3.04797 2.0371C2.95497 1.93792 2.88447 1.8179 2.84174 1.68601C2.79934 1.55514 2.78536 1.41595 2.80082 1.27867C2.81343 0.928866 2.95678 0.598439 3.1997 0.359319C3.44286 0.119957 3.76606 -0.00849914 4.09883 0.00195941L4.0972 0.00281947Z",fill:"#344054"})]})),e.jsx("defs",{children:e.jsx("clipPath",C.__assign({id:"clip0_7146_59770"},{children:e.jsx("rect",{width:"13",height:"20",fill:"white"})}))})]}))};
|
|
2
|
+
//# sourceMappingURL=ButtonCognitiveIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonCognitiveIcon.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),e=require("react/jsx-runtime"),t=require("react"),n=require("../utils/highlight.js"),l=require("../../../utils/sanitizeHtml.js"),r={sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},textBlock:{fontSize:"14px",fontWeight:400,color:"#64748B",marginBottom:"24px"}};exports.default=function(s){var o,h,u,d,a,g,c,v,p=s.data,x=s.highlightTerms,y=s.onHighlightMatch,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),e=require("react/jsx-runtime"),t=require("react"),n=require("../utils/highlight.js"),l=require("../../../utils/sanitizeHtml.js"),r={sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},textBlock:{fontSize:"14px",fontWeight:400,color:"#64748B",marginBottom:"24px"}};exports.default=function(s){var o,h,u,d,a,g,c,v,p=s.data,x=s.highlightTerms,y=s.onHighlightMatch,_=p.copyright,m=p.salesRights,j=t.useRef(null);return t.useEffect(function(){var e,t,n,l,r,s,o,h;if(x&&0!==x.length){var u=i.__spreadArray([String(null!==(t=null===(e=p.copyright)||void 0===e?void 0:e.year)&&void 0!==t?t:""),null!==(l=null===(n=p.copyright)||void 0===n?void 0:n.owner)&&void 0!==l?l:"",null!==(s=null===(r=p.salesRights)||void 0===r?void 0:r.description)&&void 0!==s?s:""],null!==(h=null===(o=p.salesRights)||void 0===o?void 0:o.territory)&&void 0!==h?h:[],!0).some(function(i){return!!i&&x.some(function(e){return i.toLowerCase().includes(e.toLowerCase())})});null==y||y(u)}},[x,p]),e.jsxs("div",i.__assign({ref:j},{children:[e.jsx("p",i.__assign({style:r.sectionTitle},{children:"Copyrights"})),e.jsxs("div",i.__assign({style:r.textBlock},{children:[e.jsxs("p",{children:["Copyright Year:"," ",x&&x.length>0?e.jsx("span",{dangerouslySetInnerHTML:{__html:l.sanitizeHtml(n.highlightTermsFunc(String(null!==(o=_.year)&&void 0!==o?o:"NA"),x))}}):null!==(h=_.year)&&void 0!==h?h:"NA"]}),e.jsxs("p",{children:["Copyright Owner:"," ",x&&x.length>0?e.jsx("span",{dangerouslySetInnerHTML:{__html:l.sanitizeHtml(n.highlightTermsFunc(null!==(u=_.owner)&&void 0!==u?u:"NA",x))}}):null!==(d=_.owner)&&void 0!==d?d:"NA"]})]})),e.jsx("p",i.__assign({style:r.sectionTitle},{children:"Sales Rights"})),e.jsxs("div",i.__assign({style:r.textBlock},{children:[e.jsx("p",{children:x&&x.length>0?e.jsx("span",{dangerouslySetInnerHTML:{__html:l.sanitizeHtml(n.highlightTermsFunc(null!==(a=m.description)&&void 0!==a?a:"",x))}}):null!==(g=m.description)&&void 0!==g?g:""}),e.jsxs("p",{children:["Sales Territory:"," ",x&&x.length>0?e.jsx("span",{dangerouslySetInnerHTML:{__html:l.sanitizeHtml(n.highlightTermsFunc(null!==(c=m.territory.join(", "))&&void 0!==c?c:"NA",x))}}):null!==(v=m.territory.join(", "))&&void 0!==v?v:"NA"]})]}))]}))};
|
|
2
2
|
//# sourceMappingURL=BookCopyrightsCard.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),i=require("react"),n=require("../utils/highlight.js"),s=require("../../../utils/sanitizeHtml.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),i=require("react"),n=require("../utils/highlight.js"),s=require("../../../utils/sanitizeHtml.js"),l={container:{width:"100%"},sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},detailsContainer:{marginBottom:"24px",fontSize:"14px",fontWeight:400,color:"#64748B",display:"flex",flexDirection:"column",gap:"4px",paddingLeft:"12px"},detailsContainerItem:{margin:"4px 0"},boldText:{fontWeight:"bold"},categoriesContainer:{marginBottom:"24px"},categoriesList:{display:"flex",flexWrap:"wrap",gap:"12px",marginBottom:"8px",paddingLeft:"12px"},category:{backgroundColor:"#ECEEF1",padding:"8px 12px",fontWeight:400,fontSize:"12px",borderRadius:"4px",color:"#64748B",maxWidth:"100%",wordBreak:"break-word"},button:{color:"#5928ED",fontSize:"14px",fontWeight:600,background:"none",border:"none",cursor:"pointer",padding:0,textDecoration:"none",paddingLeft:"12px"},reviewsList:{paddingLeft:"12px"},reviewCard:{border:"1px solid #CBD5E1",borderRadius:"6px",padding:"16px",marginBottom:"12px",backgroundColor:"#F8FAFC"},reviewText:{fontSize:"14px",fontStyle:"italic",fontWeight:400,color:"#475569",marginBottom:"8px"},reviewSource:{fontSize:"10px",color:"#475569",fontWeight:600}};exports.default=function(r){var o,a,g,c,d,u,h,p,x,m,_,b,f,v=r.data,y=r.highlightTerms,j=r.onHighlightMatch,T=i.useState(!1),C=T[0],w=T[1],N=i.useState(!1),k=N[0],S=N[1],H=i.useRef(null),I=i.useMemo(function(){return C?v.subjectCategories||[]:(v.subjectCategories||[]).slice(0,10)},[C,v.subjectCategories]);return i.useEffect(function(){var e,t;if(null==y?void 0:y.length){var i=y.map(function(e){return e.toLowerCase()}),n=function(e){return e&&i.some(function(t){return e.toLowerCase().includes(t)})},s=[v.isbn,v.isbn10,v.imprint,v.publisher,v.publishingDate,v.age].some(n),l=(null!==(e=v.subjectCategories)&&void 0!==e?e:[]).some(n),r=(null!==(t=v.reviews)&&void 0!==t?t:[]).some(function(e){return n(e.replace(/<[^>]+>/g,""))}),o=s||l||r;null==j||j(o),o&&(l&&!C&&w(!0),r&&!k&&S(!0))}},[y,v]),t.jsxs("div",e.__assign({ref:H,style:l.container,className:"book-details-container"},{children:[t.jsx("p",e.__assign({style:l.sectionTitle,className:"book-details-section-title"},{children:"Product Details"})),t.jsxs("div",e.__assign({style:l.detailsContainer,className:"book-details-details-container"},{children:[t.jsxs("p",e.__assign({style:l.detailsContainerItem},{children:[t.jsx("span",e.__assign({style:l.boldText},{children:"ISBN:"}))," ",y&&y.length>0?t.jsx("span",{dangerouslySetInnerHTML:{__html:s.sanitizeHtml(n.highlightTermsFunc(null!==(o=v.isbn)&&void 0!==o?o:"NA",y))}}):null!==(a=v.isbn)&&void 0!==a?a:"NA"]})),t.jsxs("p",e.__assign({style:l.detailsContainerItem},{children:[t.jsx("span",e.__assign({style:l.boldText},{children:"ISBN 10:"}))," ",y&&y.length>0?t.jsx("span",{dangerouslySetInnerHTML:{__html:s.sanitizeHtml(n.highlightTermsFunc(null!==(g=v.isbn10)&&void 0!==g?g:"NA",y))}}):null!==(c=v.isbn10)&&void 0!==c?c:"NA"]})),t.jsxs("p",e.__assign({style:l.detailsContainerItem},{children:[t.jsx("span",e.__assign({style:l.boldText},{children:"Imprint:"}))," ",y&&y.length>0?t.jsx("span",{dangerouslySetInnerHTML:{__html:s.sanitizeHtml(n.highlightTermsFunc(null!==(d=v.imprint)&&void 0!==d?d:"NA",y))}}):null!==(u=v.imprint)&&void 0!==u?u:"NA"]})),t.jsxs("p",e.__assign({style:l.detailsContainerItem},{children:[t.jsx("span",e.__assign({style:l.boldText},{children:"Publisher:"}))," ",y&&y.length>0?t.jsx("span",{dangerouslySetInnerHTML:{__html:s.sanitizeHtml(n.highlightTermsFunc(null!==(h=v.publisher)&&void 0!==h?h:"NA",y))}}):null!==(p=v.publisher)&&void 0!==p?p:"NA"]})),t.jsxs("p",e.__assign({style:l.detailsContainerItem},{children:[t.jsx("span",e.__assign({style:l.boldText},{children:"Publishing Date:"}))," ",y&&y.length>0?t.jsx("span",{dangerouslySetInnerHTML:{__html:s.sanitizeHtml(n.highlightTermsFunc(null!==(x=v.publishingDate)&&void 0!==x?x:"NA",y))}}):null!==(m=v.publishingDate)&&void 0!==m?m:"NA"]})),t.jsxs("p",e.__assign({style:l.detailsContainerItem},{children:[t.jsx("span",e.__assign({style:l.boldText},{children:"Age:"}))," ",y&&y.length>0?t.jsx("span",{dangerouslySetInnerHTML:{__html:s.sanitizeHtml(n.highlightTermsFunc(null!==(_=v.age)&&void 0!==_?_:"NA",y))}}):null!==(b=v.age)&&void 0!==b?b:"NA"]}))]})),t.jsxs("div",e.__assign({style:l.categoriesContainer},{children:[t.jsx("p",e.__assign({style:l.sectionTitle,className:"book-details-section-title"},{children:"Subject Categories"})),t.jsxs("div",e.__assign({style:l.categoriesList,className:"book-details-categories-list"},{children:[I.map(function(i,r){return t.jsx("span",e.__assign({style:l.category,className:"book-details-category"},{children:y&&y.length>0?t.jsx("span",{dangerouslySetInnerHTML:{__html:s.sanitizeHtml(n.highlightTermsFunc(i,y))}}):i}),r)}),v.subjectCategories&&v.subjectCategories.length>10&&t.jsx("button",e.__assign({style:l.button,onClick:function(){return w(!C)},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:C?"View less":"View more"}))]}))]})),t.jsxs("div",e.__assign({style:l.reviewsContainer},{children:[t.jsx("p",e.__assign({style:l.sectionTitle,className:"book-details-section-title"},{children:"Book Marketing Collateral"})),t.jsxs("div",e.__assign({style:l.reviewsList,className:"book-details-reviews-list"},{children:[v.reviews&&v.reviews.length>0?(f=v.reviews.filter(function(e){return e.replace(/<[^>]+>/g,"").trim().replace(/&[#A-Za-z0-9]+;/g,"").trim().length>0}),(k?f:f.slice(0,3)).map(function(i,r){return t.jsx("div",e.__assign({style:l.reviewCard,className:"book-details-review-card"},{children:t.jsx("div",{style:l.reviewText,dangerouslySetInnerHTML:{__html:y&&y.length>0?s.sanitizeHtml(n.highlightTermsFunc(i,y)):i}})}),r)})):t.jsx("p",e.__assign({style:l.reviewText},{children:"No Book Marketing Collateral available for this book."})),v.reviews&&v.reviews.length>3&&t.jsx("button",e.__assign({style:l.button,onClick:function(){return S(function(e){return!e})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:k?"View less":"View more"}))]}))]}))]}))};
|
|
2
2
|
//# sourceMappingURL=BookDetailsCard.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("@mui/material/Pagination"),s=require("@mui/material/Skeleton"),a=require("react"),i=require("react-markdown"),r=require("../utils/highlight.js"),o=require("../../../utils/sanitizeHtml.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=l(n),u=l(s),d=l(i),g={sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},quotesPadding:{paddingLeft:"12px"},quoteCard:{border:"1px solid #CBD5E1",borderRadius:"8px",padding:"16px",backgroundColor:"#F8FAFC",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",marginBottom:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},quoteText:{fontStyle:"italic",color:"#475569",fontSize:"14px",fontWeight:400,marginBottom:"12px"},quoteMeta:{color:"#475569",fontSize:"12px",fontWeight:400},quoteAuthor:{fontSize:"10px",fontWeight:600,color:"#475569",marginTop:"8px",marginBottom:"18px"},button:{color:"#5928ED",fontSize:"14px",fontWeight:600,background:"none",border:"none",cursor:"pointer",padding:0,textDecoration:"none",paddingLeft:"12px"},geoLocationsContainer:{marginTop:"24px",marginBottom:"24px"},geoText:{fontSize:"14px",fontWeight:500,cursor:"pointer",color:"#532BED"},geoDivider:{margin:"0 8px",color:"#475abb",backgroundColor:"#475abb",width:"1px",height:"18px",display:"inline-block"},geoLocationFlex:{display:"inline-flex",alignItems:"center",gap:"8px",marginBottom:"8px"},charactersContainer:{marginTop:"16px"},charactersGrid:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"16px",marginBottom:"16px",paddingLeft:"12px"},characterCard:{border:"1px solid #E5E7EB",borderRadius:"8px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",display:"flex",alignItems:"flex-start",gap:"12px",padding:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},avatar:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"9999px",fontSize:"14px",fontWeight:600,flexShrink:0},charName:{fontStyle:"normal",fontWeight:600,color:"#101827",fontSize:"16px"},charDesc:{fontStyle:"normal",fontWeight:400,fontSize:"14px",color:"#6B7280"},retryButton:{backgroundColor:"#5928EC",color:"#fff",padding:"6px 10px",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"12px",fontWeight:"500"}};exports.default=function(n){n.data;var s=n.updateQuotesToHighLight,i=n.handleFetchManuscriptElements,l=n.BookIsbn,x=n.title,p=n.highlightTerms,h=n.onHighlightMatch,f=a.useRef(!0);a.useEffect(function(){return function(){f.current=!1}},[]);var _=a.useState([]),m=_[0],y=_[1],v=a.useState(1),b=v[0],j=v[1],k=a.useState(!1),S=k[0],T=k[1],C=a.useState(!0),w=C[0],q=C[1],L=a.useState(0),N=L[0],B=L[1],M=a.useState([]),D=M[0],F=M[1],E=a.useState(1),H=E[0],z=E[1],I=a.useState(!1),P=I[0],W=I[1],R=a.useState(!0),A=R[0],G=R[1],K=a.useState(0),Y=K[0],O=K[1],Q=a.useState([]),J=Q[0],U=Q[1],V=a.useState(1),X=V[0],Z=V[1],$=a.useState(!1),ee=$[0],te=$[1],ne=a.useState(!0),se=ne[0],ae=ne[1],ie=a.useState(0),re=ie[0],oe=ie[1],le=a.useState({list:"",index:-1,page:1}),ce=le[0],ue=le[1],de=a.useRef(!1);a.useEffect(function(){var t,n,s;p&&0!==p.length&&(de.current||e.__spreadArray(e.__spreadArray(e.__spreadArray([],null!==(t=null==m?void 0:m.map(function(e){return e.text}))&&void 0!==t?t:[],!0),null!==(n=null==J?void 0:J.map(function(e){return e.name}))&&void 0!==n?n:[],!0),null!==(s=null==D?void 0:D.flatMap(function(e){return[e.name,e.description]}))&&void 0!==s?s:[],!0).some(function(e){return!!e&&p.some(function(t){return e.toLowerCase().includes(t.toLowerCase())})})&&(null==h||h(!0),de.current=!0))},[p]),a.useEffect(function(){de.current=!1},[p]);var ge=function(t){var n=t.endpoint,s=t.page,a=t.isbn,r=t.setData,o=t.setLoading,l=t.setHasMore,c=t.setTotalPage,u=t.title;return e.__awaiter(void 0,void 0,void 0,function(){var t,d,g,x;return e.__generator(this,function(e){switch(e.label){case 0:o(!0),e.label=1;case 1:return e.trys.push([1,,3,4]),[4,i({endpoint:n,page:s,pageSize:10,isbn:a,title:u})];case 2:return t=e.sent(),f.current?(r((null==t?void 0:t.data)||[]),c((null===(d=null==t?void 0:t.pagination)||void 0===d?void 0:d.totalPages)||0),l(!(null===(g=null==t?void 0:t.pagination)||void 0===g?void 0:g.hasNext)&&!(null===(x=null==t?void 0:t.pagination)||void 0===x?void 0:x.hasPrevious)),[3,4]):[2];case 3:return f.current&&o(!1),[7];case 4:return[2]}})})};return a.useEffect(function(){ge({endpoint:"notable-quotes",page:b,isbn:l,setData:y,setLoading:T,setHasMore:q,setTotalPage:B,title:x})},[b]),a.useEffect(function(){ge({endpoint:"notable-characters",page:H,isbn:l,setData:F,setLoading:W,setHasMore:G,setTotalPage:O,title:x})},[H]),a.useEffect(function(){ge({endpoint:"geo-locations",page:X,isbn:l,setData:U,setLoading:te,setHasMore:ae,setTotalPage:oe,title:x})},[X]),t.jsxs("div",e.__assign({className:"book-elements-container"},{children:[t.jsxs("div",e.__assign({style:{marginBottom:"24px"}},{children:[t.jsx("p",e.__assign({style:g.sectionTitle,className:"book-elements-section-title"},{children:"Notable Quotes"})),t.jsxs("div",e.__assign({style:g.quotesPadding},{children:[S?t.jsx("div",e.__assign({style:{display:"flex",flexDirection:"column",rowGap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(n){return t.jsxs("div",e.__assign({className:"book-elements-quote-card",style:g.quoteCard},{children:[t.jsx(u.default,{variant:"text",width:"60%",height:28}),t.jsx(u.default,{variant:"text",width:"40%",height:20}),t.jsx(u.default,{variant:"text",width:"25%",height:20}),t.jsx(u.default,{variant:"text",width:"30%",height:20})]}),n)})})):0===m.length?t.jsxs("p",e.__assign({style:{color:"#6B7280",fontStyle:"italic"}},{children:["No notable quotes found. ",t.jsx("button",e.__assign({style:g.retryButton,onClick:function(){return ge({endpoint:"notable-quotes",page:b,isbn:l,setData:y,setLoading:T,setHasMore:q,setTotalPage:B,title:x})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:m.map(function(n,a){var i="notable"===ce.list&&ce.page===b&&ce.index===a;return t.jsxs("div",e.__assign({className:"book-elements-quote-card",style:e.__assign(e.__assign({},g.quoteCard),{borderColor:i?"rgb(83, 43, 237)":"#CBD5E1"}),onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,i;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),ue({list:"notable",page:b,index:a}),(null===(i=null==n?void 0:n.chunkIds)||void 0===i?void 0:i.length)>0?[4,s(n.text,"Notable Quotes",n.chunkIds,0)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[3,4];case 3:return t=e.sent(),console.error("Failed to highlight quote:",t),[3,4];case 4:return[2]}})})}},{children:[p&&p.length>0?t.jsx("p",{style:g.quoteText,className:"book-elements-quote-text",dangerouslySetInnerHTML:{__html:o.sanitizeHtml(r.highlightTermsFunc(null==n?void 0:n.text,p))}}):t.jsx("p",e.__assign({style:g.quoteText,className:"book-elements-quote-text"},{children:null==n?void 0:n.text})),t.jsxs("p",e.__assign({style:g.quoteMeta,className:"book-elements-quote-meta"},{children:[n.chapter," ",t.jsx("br",{})," ",n.page]})),t.jsxs("p",e.__assign({style:g.quoteAuthor},{children:["— ",null==n?void 0:n.author]}))]}),a)})}),t.jsx("div",e.__assign({className:"book-elements-pagination",style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!w&&t.jsx(c.default,{disabled:S,count:N,page:b,onChange:function(e,t){return j(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),t.jsxs("div",e.__assign({style:g.geoLocationsContainer},{children:[t.jsx("p",e.__assign({style:g.sectionTitle,className:"book-elements-section-title"},{children:"Key Geo Locations"})),t.jsxs("div",e.__assign({className:"book-elements-geo-wrapper",style:e.__assign(e.__assign({},g.quotesPadding),{marginBottom:"8px"})},{children:[ee?t.jsx("div",e.__assign({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(e){return t.jsx(u.default,{variant:"rectangular",width:100,height:20,style:{borderRadius:"8px"}},e)})})):0===J.length?t.jsxs("p",e.__assign({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key geo locations found. ",t.jsx("button",e.__assign({style:g.retryButton,onClick:function(){return ge({endpoint:"geo-locations",page:X,isbn:l,setData:U,setLoading:te,setHasMore:ae,setTotalPage:oe,title:x})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:J.map(function(n,a){var i="geo_location"===ce.list&&ce.page===X&&ce.index===a;return t.jsxs("span",e.__assign({style:g.geoLocationFlex},{children:[t.jsx("span",e.__assign({className:"book-elements-geo-text",style:e.__assign(e.__assign({},g.geoText),{fontWeight:i?"700":"",textDecoration:i?"underline":""}),onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,i;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),ue({list:"geo_location",page:X,index:a}),(null===(i=null==n?void 0:n.chunkIds)||void 0===i?void 0:i.length)>0?[4,s(n.name,"Key Geo Locations",n.chunkIds,0)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[3,4];case 3:return t=e.sent(),console.error("Failed to highlight location:",t),[3,4];case 4:return[2]}})})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:p&&p.length>0?t.jsx("span",{dangerouslySetInnerHTML:{__html:o.sanitizeHtml(r.highlightTermsFunc(null==n?void 0:n.name,p))}}):null==n?void 0:n.name})),a<J.length-1&&t.jsx("span",{style:g.geoDivider})]}),a)})}),t.jsx("div",e.__assign({className:"book-elements-pagination",style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!se&&t.jsx(c.default,{disabled:ee,count:re,page:X,onChange:function(e,t){return Z(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),t.jsxs("div",e.__assign({style:g.charactersContainer},{children:[t.jsx("p",e.__assign({style:g.sectionTitle,className:"book-elements-section-title"},{children:"Key Characters"})),P?t.jsx("div",e.__assign({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(n){return t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},g.characterCard),{flexBasis:"40%"})},{children:[t.jsx(u.default,{variant:"circular",style:e.__assign(e.__assign({},g.avatar),{flexShrink:0})}),t.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",flex:1}},{children:[t.jsx(u.default,{variant:"text",style:{flex:"1",flexShrink:0}}),t.jsx(u.default,{variant:"text",style:{flex:"1"}}),t.jsx(u.default,{variant:"text",style:{flex:"1"}}),t.jsx(u.default,{variant:"text",style:{flex:"1"}})]}))]}),n)})})):0===D.length?t.jsxs("p",e.__assign({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key characters found. ",t.jsx("button",e.__assign({style:g.retryButton,onClick:function(){return ge({endpoint:"notable-characters",page:H,isbn:l,setData:F,setLoading:W,setHasMore:G,setTotalPage:O,title:x})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:t.jsx("div",e.__assign({className:"book-elements-characters-grid",style:g.charactersGrid},{children:D.map(function(n,a){var i=e.__assign(e.__assign({},g.avatar),{backgroundColor:n.bg,color:n.color}),l="key_character"===ce.list&&ce.page===H&&ce.index===a;return t.jsxs("div",e.__assign({onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},className:"book-elements-character-card",style:e.__assign(e.__assign({},g.characterCard),{borderColor:l?"rgb(83, 43, 237)":"#E5E7EB"}),onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,i;return e.__generator(this,function(e){switch(e.label){case 0:ue({list:"key_character",page:H,index:a}),e.label=1;case 1:return e.trys.push([1,4,,5]),(null===(i=null==n?void 0:n.chunkIds)||void 0===i?void 0:i.length)>0?[4,s(n.name,"Key Characters",n.chunkIds,0)]:[3,3];case 2:e.sent(),e.label=3;case 3:return[3,5];case 4:return t=e.sent(),console.error("Failed to highlight character:",t),[3,5];case 5:return[2]}})})}},{children:[t.jsx("div",e.__assign({style:i},{children:n.initials})),t.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column"}},{children:[t.jsx("p",e.__assign({className:"book-elements-char-name",style:e.__assign(e.__assign({},g.charName),{margin:0})},{children:p&&p.length>0?t.jsx("span",{dangerouslySetInnerHTML:{__html:o.sanitizeHtml(r.highlightTermsFunc(n.name,p))}}):n.name})),t.jsx("p",e.__assign({className:"book-elements-char-desc",style:e.__assign(e.__assign({},g.charDesc),{margin:0,marginTop:"4px"})},{children:p&&p.length>0?t.jsx("span",{dangerouslySetInnerHTML:{__html:o.sanitizeHtml(r.highlightTermsFunc(null==n?void 0:n.description,p))}}):t.jsx(d.default,e.__assign({components:{p:function(n){n.node;var s=e.__rest(n,["node"]);return t.jsx("p",e.__assign({style:{marginTop:"0"}},s))}}},{children:null==n?void 0:n.description}))}))]}))]}),a)})}))}),t.jsx("div",e.__assign({className:"book-elements-pagination",style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!A&&t.jsx(c.default,{count:Y,disabled:P,page:H,onChange:function(e,t){return z(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("@mui/material/Pagination"),a=require("@mui/material/Skeleton"),s=require("react"),i=require("react-markdown"),o=require("rehype-raw"),r=require("remark-breaks"),l=require("../utils/highlight.js"),c=require("../../../utils/sanitizeHtml.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=u(n),g=u(a),x=u(i),h=u(o),p=u(r),f={sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},quotesPadding:{paddingLeft:"12px"},quoteCard:{border:"1px solid #CBD5E1",borderRadius:"8px",padding:"16px",backgroundColor:"#F8FAFC",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",marginBottom:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},quoteText:{fontStyle:"italic",color:"#475569",fontSize:"14px",fontWeight:400,marginBottom:"12px"},quoteMeta:{color:"#475569",fontSize:"12px",fontWeight:400},quoteAuthor:{fontSize:"10px",fontWeight:600,color:"#475569",marginTop:"8px",marginBottom:"18px"},button:{color:"#5928ED",fontSize:"14px",fontWeight:600,background:"none",border:"none",cursor:"pointer",padding:0,textDecoration:"none",paddingLeft:"12px"},geoLocationsContainer:{marginTop:"24px",marginBottom:"24px"},geoText:{fontSize:"14px",fontWeight:500,cursor:"pointer",color:"#532BED"},geoDivider:{margin:"0 8px",color:"#475abb",backgroundColor:"#475abb",width:"1px",height:"18px",display:"inline-block"},geoLocationFlex:{display:"inline-flex",alignItems:"center",gap:"8px",marginBottom:"8px"},charactersContainer:{marginTop:"16px"},charactersGrid:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"16px",marginBottom:"16px",paddingLeft:"12px"},characterCard:{border:"1px solid #E5E7EB",borderRadius:"8px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",display:"flex",alignItems:"flex-start",gap:"12px",padding:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},avatar:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"9999px",fontSize:"14px",fontWeight:600,flexShrink:0},charName:{fontStyle:"normal",fontWeight:600,color:"#101827",fontSize:"16px"},charDesc:{fontStyle:"normal",fontWeight:400,fontSize:"14px",color:"#6B7280"},retryButton:{backgroundColor:"#5928EC",color:"#fff",padding:"6px 10px",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"12px",fontWeight:"500"}};exports.default=function(n){var a,i,o;n.data;var r=n.updateQuotesToHighLight,u=n.handleFetchManuscriptElements,_=n.BookIsbn,m=n.title,y=n.highlightTerms,v=n.onHighlightMatch,b=n.defaultPages,j=s.useRef(!0);s.useEffect(function(){return function(){j.current=!1}},[]);var k=s.useState([]),S=k[0],T=k[1],C=s.useState(null!==(a=null==b?void 0:b.quotes)&&void 0!==a?a:1),q=C[0],w=C[1],L=s.useState(!1),N=L[0],E=L[1],B=s.useState(!0),F=B[0],D=B[1],M=s.useState(0),H=M[0],P=M[1],W=s.useState([]),z=W[0],I=W[1],R=s.useState(null!==(i=null==b?void 0:b.characters)&&void 0!==i?i:1),A=R[0],G=R[1],K=s.useState(!1),Y=K[0],O=K[1],Q=s.useState(!0),V=Q[0],J=Q[1],U=s.useState(0),X=U[0],Z=U[1],$=s.useState([]),ee=$[0],te=$[1],ne=s.useState(null!==(o=null==b?void 0:b.locations)&&void 0!==o?o:1),ae=ne[0],se=ne[1],ie=s.useState(!1),oe=ie[0],re=ie[1],le=s.useState(!0),ce=le[0],ue=le[1],de=s.useState(0),ge=de[0],xe=de[1],he=s.useState({list:"",index:-1,page:1}),pe=he[0],fe=he[1],_e=s.useRef(!1),me=s.useRef(null);s.useEffect(function(){if(null==y?void 0:y.length){var e=y.map(function(e){return e.toLowerCase()}),t=function(t){return t&&e.some(function(e){return t.toLowerCase().includes(e)})},n=!1;S.forEach(function(e,a){!n&&t(e.text)&&(fe({list:"notable",index:a,page:q}),null==v||v(!0),n=!0)}),ee.forEach(function(e,a){!n&&t(e.name)&&(fe({list:"geo_location",index:a,page:ae}),null==v||v(!0),n=!0)}),z.forEach(function(e,a){n||!t(e.name)&&!t(e.description)||(fe({list:"key_character",index:a,page:A}),null==v||v(!0),n=!0)})}},[y,S,ee,z,q,ae,A]),s.useEffect(function(){-1!==pe.index&&(N||oe||Y||requestAnimationFrame(function(){requestAnimationFrame(function(){var e,t=null===(e=me.current)||void 0===e?void 0:e.querySelector('[data-selected="true"]');null==t||t.scrollIntoView({behavior:"smooth",block:"center"})})}))},[pe,N,oe,Y]),s.useEffect(function(){b&&(b.quotes&&w(b.quotes),b.locations&&se(b.locations),b.characters&&G(b.characters))},[b]),s.useEffect(function(){_e.current=!1},[y]);var ye=function(t){var n=t.endpoint,a=t.page,s=t.isbn,i=t.setData,o=t.setLoading,r=t.setHasMore,l=t.setTotalPage,c=t.title;return e.__awaiter(void 0,void 0,void 0,function(){var t,d,g,x;return e.__generator(this,function(e){switch(e.label){case 0:o(!0),e.label=1;case 1:return e.trys.push([1,,3,4]),[4,u({endpoint:n,page:a,pageSize:10,isbn:s,title:c})];case 2:return t=e.sent(),j.current?(i((null==t?void 0:t.data)||[]),l((null===(d=null==t?void 0:t.pagination)||void 0===d?void 0:d.totalPages)||0),r(!(null===(g=null==t?void 0:t.pagination)||void 0===g?void 0:g.hasNext)&&!(null===(x=null==t?void 0:t.pagination)||void 0===x?void 0:x.hasPrevious)),[3,4]):[2];case 3:return j.current&&o(!1),[7];case 4:return[2]}})})};return s.useEffect(function(){ye({endpoint:"notable-quotes",page:q,isbn:_,setData:T,setLoading:E,setHasMore:D,setTotalPage:P,title:m})},[q]),s.useEffect(function(){ye({endpoint:"notable-characters",page:A,isbn:_,setData:I,setLoading:O,setHasMore:J,setTotalPage:Z,title:m})},[A]),s.useEffect(function(){ye({endpoint:"geo-locations",page:ae,isbn:_,setData:te,setLoading:re,setHasMore:ue,setTotalPage:xe,title:m})},[ae]),t.jsxs("div",e.__assign({ref:me,className:"book-elements-container"},{children:[t.jsxs("div",e.__assign({style:{marginBottom:"24px"}},{children:[t.jsx("p",e.__assign({style:f.sectionTitle,className:"book-elements-section-title"},{children:"Notable Quotes"})),t.jsxs("div",e.__assign({style:f.quotesPadding},{children:[N?t.jsx("div",e.__assign({style:{display:"flex",flexDirection:"column",rowGap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(n){return t.jsxs("div",e.__assign({className:"book-elements-quote-card",style:f.quoteCard},{children:[t.jsx(g.default,{variant:"text",width:"60%",height:28}),t.jsx(g.default,{variant:"text",width:"40%",height:20}),t.jsx(g.default,{variant:"text",width:"25%",height:20}),t.jsx(g.default,{variant:"text",width:"30%",height:20})]}),n)})})):0===S.length?t.jsxs("p",e.__assign({style:{color:"#6B7280",fontStyle:"italic"}},{children:["No notable quotes found. ",t.jsx("button",e.__assign({style:f.retryButton,onClick:function(){return ye({endpoint:"notable-quotes",page:q,isbn:_,setData:T,setLoading:E,setHasMore:D,setTotalPage:P,title:m})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:S.map(function(n,a){var s="notable"===pe.list&&pe.page===q&&pe.index===a;return t.jsxs("div",e.__assign({className:"book-elements-quote-card",style:e.__assign(e.__assign({},f.quoteCard),{borderColor:s?"rgb(83, 43, 237)":"#CBD5E1"}),onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,s;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),fe({list:"notable",page:q,index:a}),(null===(s=null==n?void 0:n.chunkIds)||void 0===s?void 0:s.length)>0?[4,r(n.text,"Notable Quotes",n.chunkIds,0)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[3,4];case 3:return t=e.sent(),console.error("Failed to highlight quote:",t),[3,4];case 4:return[2]}})})},"data-selected":"notable"===pe.list&&pe.page===q&&pe.index===a?"true":void 0},{children:[y&&y.length>0?t.jsx("p",{style:f.quoteText,className:"book-elements-quote-text",dangerouslySetInnerHTML:{__html:c.sanitizeHtml(l.highlightTermsFunc(null==n?void 0:n.text,y))}}):t.jsx("p",e.__assign({style:f.quoteText,className:"book-elements-quote-text"},{children:null==n?void 0:n.text})),t.jsxs("p",e.__assign({style:f.quoteMeta,className:"book-elements-quote-meta"},{children:[l.processTextWithHighlight(n.chapter,y)," ",t.jsx("br",{})," ",l.processTextWithHighlight(n.page,y)]})),t.jsxs("p",e.__assign({style:f.quoteAuthor},{children:["— ",l.processTextWithHighlight(null==n?void 0:n.author,y)]}))]}),a)})}),t.jsx("div",e.__assign({className:"book-elements-pagination",style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!F&&t.jsx(d.default,{disabled:N,count:H,page:q,onChange:function(e,t){return w(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),t.jsxs("div",e.__assign({style:f.geoLocationsContainer},{children:[t.jsx("p",e.__assign({style:f.sectionTitle,className:"book-elements-section-title"},{children:"Key Geo Locations"})),t.jsxs("div",e.__assign({className:"book-elements-geo-wrapper",style:e.__assign(e.__assign({},f.quotesPadding),{marginBottom:"8px"})},{children:[oe?t.jsx("div",e.__assign({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(e){return t.jsx(g.default,{variant:"rectangular",width:100,height:20,style:{borderRadius:"8px"}},e)})})):0===ee.length?t.jsxs("p",e.__assign({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key geo locations found. ",t.jsx("button",e.__assign({style:f.retryButton,onClick:function(){return ye({endpoint:"geo-locations",page:ae,isbn:_,setData:te,setLoading:re,setHasMore:ue,setTotalPage:xe,title:m})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:ee.map(function(n,a){var s="geo_location"===pe.list&&pe.page===ae&&pe.index===a;return t.jsxs("span",e.__assign({"data-selected":"geo_location"===pe.list&&pe.page===ae&&pe.index===a?"true":void 0,style:f.geoLocationFlex},{children:[t.jsx("span",e.__assign({className:"book-elements-geo-text",style:e.__assign(e.__assign({},f.geoText),{fontWeight:s?"700":"",textDecoration:s?"underline":""}),onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,s;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),fe({list:"geo_location",page:ae,index:a}),(null===(s=null==n?void 0:n.chunkIds)||void 0===s?void 0:s.length)>0?[4,r(n.name,"Key Geo Locations",n.chunkIds,0)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[3,4];case 3:return t=e.sent(),console.error("Failed to highlight location:",t),[3,4];case 4:return[2]}})})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:y&&y.length>0?t.jsx("span",{dangerouslySetInnerHTML:{__html:c.sanitizeHtml(l.highlightTermsFunc(null==n?void 0:n.name,y))}}):null==n?void 0:n.name})),a<ee.length-1&&t.jsx("span",{style:f.geoDivider})]}),a)})}),t.jsx("div",e.__assign({className:"book-elements-pagination",style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!ce&&t.jsx(d.default,{disabled:oe,count:ge,page:ae,onChange:function(e,t){return se(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),t.jsxs("div",e.__assign({style:f.charactersContainer},{children:[t.jsx("p",e.__assign({style:f.sectionTitle,className:"book-elements-section-title"},{children:"Key Characters"})),Y?t.jsx("div",e.__assign({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(n){return t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},f.characterCard),{flexBasis:"40%"})},{children:[t.jsx(g.default,{variant:"circular",style:e.__assign(e.__assign({},f.avatar),{flexShrink:0})}),t.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",flex:1}},{children:[t.jsx(g.default,{variant:"text",style:{flex:"1",flexShrink:0}}),t.jsx(g.default,{variant:"text",style:{flex:"1"}}),t.jsx(g.default,{variant:"text",style:{flex:"1"}}),t.jsx(g.default,{variant:"text",style:{flex:"1"}})]}))]}),n)})})):0===z.length?t.jsxs("p",e.__assign({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key characters found. ",t.jsx("button",e.__assign({style:f.retryButton,onClick:function(){return ye({endpoint:"notable-characters",page:A,isbn:_,setData:I,setLoading:O,setHasMore:J,setTotalPage:Z,title:m})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:t.jsx("div",e.__assign({className:"book-elements-characters-grid",style:f.charactersGrid},{children:z.map(function(n,a){var s=e.__assign(e.__assign({},f.avatar),{backgroundColor:n.bg,color:n.color}),i="key_character"===pe.list&&pe.page===A&&pe.index===a;return t.jsxs("div",e.__assign({onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},className:"book-elements-character-card",style:e.__assign(e.__assign({},f.characterCard),{borderColor:i?"rgb(83, 43, 237)":"#E5E7EB"}),onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,s;return e.__generator(this,function(e){switch(e.label){case 0:fe({list:"key_character",page:A,index:a}),e.label=1;case 1:return e.trys.push([1,4,,5]),(null===(s=null==n?void 0:n.chunkIds)||void 0===s?void 0:s.length)>0?[4,r(n.name,"Key Characters",n.chunkIds,0)]:[3,3];case 2:e.sent(),e.label=3;case 3:return[3,5];case 4:return t=e.sent(),console.error("Failed to highlight character:",t),[3,5];case 5:return[2]}})})},"data-selected":"key_character"===pe.list&&pe.page===A&&pe.index===a?"true":void 0},{children:[t.jsx("div",e.__assign({style:s},{children:n.initials})),t.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column"}},{children:[t.jsx("p",e.__assign({className:"book-elements-char-name",style:e.__assign(e.__assign({},f.charName),{margin:0})},{children:y&&y.length>0?t.jsx("span",{dangerouslySetInnerHTML:{__html:c.sanitizeHtml(l.highlightTermsFunc(n.name,y))}}):n.name})),t.jsx("p",e.__assign({className:"book-elements-char-desc",style:e.__assign(e.__assign({},f.charDesc),{margin:0,marginTop:"4px"})},{children:t.jsx(x.default,e.__assign({remarkPlugins:[p.default],rehypePlugins:[h.default],components:{p:function(n){n.node;var a=e.__rest(n,["node"]);return t.jsx("p",e.__assign({style:{marginTop:0}},a))}}},{children:l.processTextWithHighlight(null==n?void 0:n.description,y)}))}))]}))]}),a)})}))}),t.jsx("div",e.__assign({className:"book-elements-pagination",style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!V&&t.jsx(d.default,{count:X,disabled:Y,page:A,onChange:function(e,t){return G(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]}))};
|
|
2
2
|
//# sourceMappingURL=BookElementsCard.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),i=require("react-markdown"),l=require("remark-breaks"),s=require("../utils/highlight.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),i=require("react-markdown"),l=require("remark-breaks"),o=require("rehype-raw"),s=require("../utils/highlight.js"),r=require("../../../utils/sanitizeHtml.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=a(i),c=a(l),d=a(o),g={card:{border:"2px solid #E5E7EB",backgroundColor:"#FFFFFF",borderRadius:"12px",padding:"24px"},title:{fontSize:"16px",fontWeight:"bold",marginBottom:"24px"},grid:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:"24px",marginBottom:"24px"},gridItem:{backgroundColor:"#F8FAFC",border:"1px solid #DFE5EC",borderRadius:"8px",padding:"12px 8px",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"12px"},gridItemHeight:{height:"50px"},label:{fontSize:"14px",fontWeight:400,color:"#64748B",margin:0},value:{fontWeight:"bold",fontSize:"14px",color:"#434C55",margin:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"120px"},section:{marginBottom:"12px",padding:"8px 12px",borderRadius:"8px",border:"1px solid #DEE4EB"},sectionLabel:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"8px",whiteSpace:"pre-line"},summaryText:{marginTop:"0px"},sectionText:{fontSize:"16px",fontWeight:400,lineHeight:"1.625",color:"#64748B",marginBottom:"8px"},button:{color:"#5928ED",fontSize:"14px",fontWeight:600,background:"none",border:"none",cursor:"pointer",padding:0,textDecoration:"none"},lineClamp:{display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical",overflow:"hidden"},container:{fontFamily:"Inter, sans-serif",color:"#434C54",marginBottom:"8px"},partContainer:{marginBottom:"8px"},partTitle:{fontSize:"16px",fontWeight:"600",marginBottom:"10px"},chapterList:{listStyle:"none",paddingLeft:"20px",margin:0},chapterItem:{marginBottom:"6px"},chapterLink:{textDecoration:"none",color:"#63748A",fontSize:"16px",lineHeight:"1.5"},chapterLinkHover:{textDecoration:"underline"},singleChapter:{marginBottom:"4px",fontSize:"16px"},chapterNumber:{color:"#63748A"}};exports.default=function(i){var l,o,a,h,m,p,_,x,v,f,y,b,j,k,T,S=i.data,C=i.highlightTerms,N=i.onHighlightMatch,H=n.useState(!1),L=H[0],B=H[1],w=n.useState(!1),F=w[0],I=w[1],z=n.useState(!1),M=z[0],D=z[1],O=n.useState(!1),A=O[0],E=O[1],W=n.useRef(null),q=n.useRef(null),P=(null==S?void 0:S.tableOfContent)&&S.tableOfContent.every(function(e){return!e.title||""===e.title.trim()}),R=null===(h=null===(a=null===(o=null===(l=null==S?void 0:S.bookDescription)||void 0===l?void 0:l.replace(/display:\s*-webkit-box;?/g,""))||void 0===o?void 0:o.replace(/-webkit-line-clamp:\s*\d+;?/g,""))||void 0===a?void 0:a.replace(/-webkit-box-orient:\s*vertical;?/g,""))||void 0===h?void 0:h.replace(/overflow:\s*hidden;?/g,"");return n.useLayoutEffect(function(){if(W.current){var e=W.current.scrollHeight>W.current.clientHeight;E(e)}},[null==S?void 0:S.bookDescription,F]),n.useEffect(function(){var e;if(null==C?void 0:C.length){var t=C.map(function(e){return e.toLowerCase()}),n=function(e){return e&&t.some(function(t){return e.toLowerCase().includes(t)})},i=n(S.title),l=n(S.author),o=n(S.bookDescription),s=n(S.summary),r=n(S.totalSectionCount.toString()),a=n(S.totalPages.toString()),u=n(S.readingTime),c=null===(e=null==S?void 0:S.tableOfContent)||void 0===e?void 0:e.some(function(e){var t;return n(null==e?void 0:e.title)||(null===(t=null==e?void 0:e.children)||void 0===t?void 0:t.some(function(e){return n(null==e?void 0:e.title)}))}),d=i||l||o||s||r||a||u||c;null==N||N(d),d&&(o&&I(!0),s&&B(!0),c&&D(!0))}},[C,S]),t.jsxs("div",e.__assign({ref:q,style:g.card,className:"book-card-container"},{children:[t.jsxs("div",e.__assign({style:g.grid,className:"book-card-grid"},{children:[t.jsxs("div",e.__assign({style:g.gridItem},{children:[t.jsx("p",e.__assign({style:g.label},{children:"Book Title"})),C&&C.length>0?t.jsx("p",{style:g.value,className:"book-card-value",title:null==S?void 0:S.title,dangerouslySetInnerHTML:{__html:r.sanitizeHtml(s.highlightTermsFunc(null!==(m=null==S?void 0:S.title)&&void 0!==m?m:"NA",C))}}):t.jsx("p",e.__assign({style:g.value,className:"book-card-value",title:null==S?void 0:S.title},{children:null!==(p=null==S?void 0:S.title)&&void 0!==p?p:"NA"}))]})),t.jsxs("div",e.__assign({style:g.gridItem},{children:[t.jsx("p",e.__assign({style:g.label},{children:"Book Author"})),C&&C.length>0?t.jsx("p",{style:g.value,className:"book-card-value",title:null==S?void 0:S.author,dangerouslySetInnerHTML:{__html:r.sanitizeHtml(s.highlightTermsFunc(null!==(_=null==S?void 0:S.author)&&void 0!==_?_:"NA",C))}}):t.jsx("p",e.__assign({style:g.value,className:"book-card-value",title:null==S?void 0:S.author},{children:null!==(x=null==S?void 0:S.author)&&void 0!==x?x:"NA"}))]})),t.jsxs("div",e.__assign({style:g.gridItem},{children:[t.jsx("p",e.__assign({style:g.label},{children:"Total Sections"})),C&&C.length>0?t.jsx("p",{style:g.value,className:"book-card-value",dangerouslySetInnerHTML:{__html:r.sanitizeHtml(s.highlightTermsFunc(null!==(v=String(null==S?void 0:S.totalSectionCount))&&void 0!==v?v:"NA",C))}}):t.jsx("p",e.__assign({style:g.value,className:"book-card-value"},{children:null!==(f=null==S?void 0:S.totalSectionCount)&&void 0!==f?f:"NA"}))]})),t.jsxs("div",e.__assign({style:g.gridItem},{children:[t.jsx("p",e.__assign({style:g.label},{children:"Total Pages"})),C&&C.length>0?t.jsx("p",{style:g.value,className:"book-card-value",dangerouslySetInnerHTML:{__html:r.sanitizeHtml(s.highlightTermsFunc(String(null!==(y=null==S?void 0:S.totalPages)&&void 0!==y?y:"NA"),C))}}):t.jsx("p",e.__assign({style:g.value,className:"book-card-value"},{children:null!==(b=null==S?void 0:S.totalPages)&&void 0!==b?b:"NA"}))]})),t.jsxs("div",e.__assign({style:g.gridItem},{children:[t.jsx("p",e.__assign({style:g.label},{children:"Reading Time"})),C&&C.length>0?t.jsx("p",{style:g.value,className:"book-card-value",dangerouslySetInnerHTML:{__html:r.sanitizeHtml(s.highlightTermsFunc(String(null!==(j=null==S?void 0:S.readingTime)&&void 0!==j?j:"NA"),C))}}):t.jsx("p",e.__assign({style:g.value,className:"book-card-value"},{children:null!==(k=null==S?void 0:S.readingTime)&&void 0!==k?k:"NA"}))]}))]})),(null==S?void 0:S.bookDescription)&&(null==S?void 0:S.bookDescription.length)>0&&t.jsxs("div",e.__assign({style:g.section,className:"book-card-section"},{children:[t.jsx("p",e.__assign({style:g.sectionLabel},{children:"Book Description"})),t.jsx("div",e.__assign({ref:W,className:"book-card-section-text",style:e.__assign(e.__assign(e.__assign({},g.sectionText),g.summaryText),F?{}:g.lineClamp)},{children:t.jsx("div",{dangerouslySetInnerHTML:{__html:C&&C.length>0?r.sanitizeHtml(s.highlightTermsFunc(R||"",C)):R}})})),(A||F)&&t.jsx("button",e.__assign({style:e.__assign(e.__assign({},g.button),{marginBottom:"10px"}),onClick:function(){return I(function(e){return!e})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:F?"View Less":"View More"}))]})),t.jsxs("div",e.__assign({style:g.section,className:"book-card-section"},{children:[t.jsx("p",e.__assign({style:g.sectionLabel},{children:"AI Book Summary"})),t.jsx("p",e.__assign({className:"book-card-section-text",style:e.__assign(e.__assign({},g.sectionText),L?{}:g.lineClamp)},{children:t.jsx(u.default,e.__assign({remarkPlugins:[c.default],rehypePlugins:[d.default],components:{p:function(n){n.node;var i=e.__rest(n,["node"]);return t.jsx("p",e.__assign({style:{marginTop:"0"}},i))}}},{children:s.processTextWithHighlight(null==S?void 0:S.summary,C)}))})),(null==S?void 0:S.summary)&&(null==S?void 0:S.summary.length)>0&&t.jsx("button",e.__assign({style:e.__assign(e.__assign({},g.button),{marginBottom:"10px"}),onClick:function(){return B(function(e){return!e})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:L?"View Less":"View More"}))]})),t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},g.section),{marginTop:"10px"})},{children:[t.jsx("p",e.__assign({style:e.__assign(e.__assign({},g.sectionLabel),{marginBottom:"18px"})},{children:"Table Of Content"})),t.jsx("div",e.__assign({style:e.__assign(e.__assign({},g.container),M?{}:g.lineClamp)},{children:(null==S?void 0:S.tableOfContent)&&!P?null===(T=null==S?void 0:S.tableOfContent)||void 0===T?void 0:T.map(function(n,i){return t.jsx("div",e.__assign({style:g.partContainer},{children:n.children?t.jsxs(t.Fragment,{children:[t.jsx("p",{style:g.partTitle,className:"book-card-part-title",dangerouslySetInnerHTML:{__html:C&&C.length>0?r.sanitizeHtml(s.highlightTermsFunc(n.title,C)):n.title}}),t.jsx("ul",e.__assign({style:g.chapterList},{children:n.children.map(function(n,i){return t.jsx("li",e.__assign({style:g.chapterItem},{children:t.jsx("span",{style:g.chapterLink,className:"book-card-chapter-link",dangerouslySetInnerHTML:{__html:C&&C.length>0?r.sanitizeHtml(s.highlightTermsFunc(n.title,C)):n.title}})}),i)})}))]}):t.jsx("div",e.__assign({style:g.singleChapter},{children:t.jsx("span",{style:g.chapterLink,className:"book-card-chapter-link",dangerouslySetInnerHTML:{__html:C&&C.length>0?r.sanitizeHtml(s.highlightTermsFunc(n.title,C)):n.title}})}))}),i)}):t.jsx("p",e.__assign({style:{fontStyle:"italic",fontSize:"16px",color:"#6B7280",margin:"8px 0"}},{children:"Table of Contents not found for this book."}))})),(null==S?void 0:S.tableOfContent)&&!P&&(null==S?void 0:S.tableOfContent.length)>0&&t.jsx("button",e.__assign({style:e.__assign(e.__assign({},g.button),{marginBottom:"10px"}),onClick:function(){return D(function(e){return!e})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:M?"View Less":"View More"}))]}))]}))};
|
|
2
2
|
//# sourceMappingURL=BookOverviewCard.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),l=require("../utils/highlight.js"),t=require("../../../utils/sanitizeHtml.js"),r={sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},card:{backgroundColor:"#ECEEF1",padding:"8px 12px",fontWeight:500,fontSize:"14px",borderRadius:"4px",color:"#64748B",maxWidth:"100%",wordBreak:"break-word",marginBottom:"24px",width:"fit-content"},tag:{padding:"4px 12px",fontSize:"14px",fontWeight:500,color:"#3B82F6",backgroundColor:"#F3F8FF",borderRadius:"6px"},avatar:{display:"flex",alignItems:"center",justifyContent:"center",height:"35px",width:"35px",borderRadius:"50%",backgroundColor:"#E5E7EB",color:"#4B5563",fontWeight:600,flexShrink:0,fontSize:"12px"},contributorName:{fontWeight:600,color:"#111827",marginTop:"8px",fontSize:"14px"},contributorRole:{fontSize:"12px",color:"#6B7280"},grid:{display:"grid",gridTemplateColumns:"repeat(4, minmax(0, 1fr))",gap:"24px",marginBottom:"24px",padding:"0 12px"},awardMeta:{fontSize:"14px",color:"#4B5563"},awardDesc:{fontSize:"14px",color:"#4B5563"},awardContainer:{display:"flex",gap:"8px"},awardInfo:{backgroundColor:"#ECEEF1",padding:"8px 12px",fontWeight:600,fontSize:"12px",borderRadius:"4px",color:"#434C54",maxWidth:"100%",wordBreak:"break-word",width:"fit-content"},listContainerWrapper:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"30px",marginBottom:"24px"},awardContainerWrapper:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"16px"}};exports.default=function(a){var o,s,d,p=a.data,u=a.highlightTerms,c=a.onHighlightMatch,g=p.publisher,h=p.contributors,m=p.awards,x=void 0===m?[]:m,v=function(e){var n=e.trim().split(/\s+/).map(function(e){var n;return null===(n=e[0])||void 0===n?void 0:n.toUpperCase()}).join("");return n.length>3?"".concat(n.slice(0,3)):n};return i.useEffect(function(){var n,i,l,t,r,a,o,s,d,g,h,m;if(u&&0!==u.length){var x=e.__spreadArray(e.__spreadArray(e.__spreadArray(e.__spreadArray([null!==(i=null===(n=p.publisher)||void 0===n?void 0:n.name)&&void 0!==i?i:""],null!==(t=null===(l=p.publisher)||void 0===l?void 0:l.tags)&&void 0!==t?t:[],!0),null!==(o=null===(a=null===(r=p.contributors)||void 0===r?void 0:r.primary)||void 0===a?void 0:a.flatMap(function(n){var i;return e.__spreadArray([n.name,n.role],null!==(i=n.tags)&&void 0!==i?i:[],!0)}))&&void 0!==o?o:[],!0),null!==(g=null===(d=null===(s=p.contributors)||void 0===s?void 0:s.additional)||void 0===d?void 0:d.flatMap(function(n){var i;return e.__spreadArray([n.name,n.role],null!==(i=n.tags)&&void 0!==i?i:[],!0)}))&&void 0!==g?g:[],!0),null!==(m=null===(h=p.awards)||void 0===h?void 0:h.flatMap(function(e){return[e.title,e.org,String(e.year),e.country]}))&&void 0!==m?m:[],!0).some(function(e){return!!e&&u.some(function(n){return e.toLowerCase().includes(n.toLowerCase())})});null==c||c(x)}},[u,p]),n.jsxs("div",e.__assign({className:"book-people-container"},{children:[n.jsx("p",e.__assign({style:r.sectionTitle,className:"book-people-section-title"},{children:"Publishers"})),n.jsxs("div",e.__assign({style:r.card,className:"book-people-card"},{children:[n.jsx("span",e.__assign({style:{color:"rgb(67, 76, 85)"}},{children:u&&u.length>0?n.jsx("span",{dangerouslySetInnerHTML:{__html:t.sanitizeHtml(l.highlightTermsFunc(g.name,u))}}):g.name})),(null==g?void 0:g.tags)&&(null==g?void 0:g.tags.length)>0&&n.jsx("div",e.__assign({style:{display:"flex",gap:"8px",marginTop:"18px"}},{children:null===(o=null==g?void 0:g.tags)||void 0===o?void 0:o.map(function(i,a){return n.jsx("span",e.__assign({style:r.tag},{children:u&&u.length>0?n.jsx("span",{dangerouslySetInnerHTML:{__html:t.sanitizeHtml(l.highlightTermsFunc(i,u))}}):i}),a)})}))]})),n.jsx("p",e.__assign({style:r.sectionTitle,className:"book-people-section-title"},{children:"Contributors"})),n.jsx("div",e.__assign({style:r.listContainerWrapper,className:"book-people-list-wrapper"},{children:null===(s=null==h?void 0:h.primary)||void 0===s?void 0:s.map(function(i,a){var o;return n.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}},{children:[n.jsx("div",e.__assign({style:r.avatar,className:"book-people-avatar"},{children:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),l=require("../utils/highlight.js"),t=require("../../../utils/sanitizeHtml.js"),r={sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},card:{backgroundColor:"#ECEEF1",padding:"8px 12px",fontWeight:500,fontSize:"14px",borderRadius:"4px",color:"#64748B",maxWidth:"100%",wordBreak:"break-word",marginBottom:"24px",width:"fit-content"},tag:{padding:"4px 12px",fontSize:"14px",fontWeight:500,color:"#3B82F6",backgroundColor:"#F3F8FF",borderRadius:"6px"},avatar:{display:"flex",alignItems:"center",justifyContent:"center",height:"35px",width:"35px",borderRadius:"50%",backgroundColor:"#E5E7EB",color:"#4B5563",fontWeight:600,flexShrink:0,fontSize:"12px"},contributorName:{fontWeight:600,color:"#111827",marginTop:"8px",fontSize:"14px"},contributorRole:{fontSize:"12px",color:"#6B7280"},grid:{display:"grid",gridTemplateColumns:"repeat(4, minmax(0, 1fr))",gap:"24px",marginBottom:"24px",padding:"0 12px"},awardMeta:{fontSize:"14px",color:"#4B5563"},awardDesc:{fontSize:"14px",color:"#4B5563"},awardContainer:{display:"flex",gap:"8px"},awardInfo:{backgroundColor:"#ECEEF1",padding:"8px 12px",fontWeight:600,fontSize:"12px",borderRadius:"4px",color:"#434C54",maxWidth:"100%",wordBreak:"break-word",width:"fit-content"},listContainerWrapper:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"30px",marginBottom:"24px"},awardContainerWrapper:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"16px"}};exports.default=function(a){var o,s,d,p=a.data,u=a.highlightTerms,c=a.onHighlightMatch,g=p.publisher,h=p.contributors,m=p.awards,x=void 0===m?[]:m,v=i.useRef(null),_=function(e){var n=e.trim().split(/\s+/).map(function(e){var n;return null===(n=e[0])||void 0===n?void 0:n.toUpperCase()}).join("");return n.length>3?"".concat(n.slice(0,3)):n};return i.useEffect(function(){var n,i,l,t,r,a,o,s,d,g,h,m;if(u&&0!==u.length){var x=e.__spreadArray(e.__spreadArray(e.__spreadArray(e.__spreadArray([null!==(i=null===(n=p.publisher)||void 0===n?void 0:n.name)&&void 0!==i?i:""],null!==(t=null===(l=p.publisher)||void 0===l?void 0:l.tags)&&void 0!==t?t:[],!0),null!==(o=null===(a=null===(r=p.contributors)||void 0===r?void 0:r.primary)||void 0===a?void 0:a.flatMap(function(n){var i;return e.__spreadArray([n.name,n.role],null!==(i=n.tags)&&void 0!==i?i:[],!0)}))&&void 0!==o?o:[],!0),null!==(g=null===(d=null===(s=p.contributors)||void 0===s?void 0:s.additional)||void 0===d?void 0:d.flatMap(function(n){var i;return e.__spreadArray([n.name,n.role],null!==(i=n.tags)&&void 0!==i?i:[],!0)}))&&void 0!==g?g:[],!0),null!==(m=null===(h=p.awards)||void 0===h?void 0:h.flatMap(function(e){return[e.title,e.org,String(e.year),e.country]}))&&void 0!==m?m:[],!0).some(function(e){return!!e&&u.some(function(n){return e.toLowerCase().includes(n.toLowerCase())})});null==c||c(x)}},[u,p]),n.jsxs("div",e.__assign({ref:v,className:"book-people-container"},{children:[n.jsx("p",e.__assign({style:r.sectionTitle,className:"book-people-section-title"},{children:"Publishers"})),n.jsxs("div",e.__assign({style:r.card,className:"book-people-card"},{children:[n.jsx("span",e.__assign({style:{color:"rgb(67, 76, 85)"}},{children:u&&u.length>0?n.jsx("span",{dangerouslySetInnerHTML:{__html:t.sanitizeHtml(l.highlightTermsFunc(g.name,u))}}):g.name})),(null==g?void 0:g.tags)&&(null==g?void 0:g.tags.length)>0&&n.jsx("div",e.__assign({style:{display:"flex",gap:"8px",marginTop:"18px"}},{children:null===(o=null==g?void 0:g.tags)||void 0===o?void 0:o.map(function(i,a){return n.jsx("span",e.__assign({style:r.tag},{children:u&&u.length>0?n.jsx("span",{dangerouslySetInnerHTML:{__html:t.sanitizeHtml(l.highlightTermsFunc(i,u))}}):i}),a)})}))]})),n.jsx("p",e.__assign({style:r.sectionTitle,className:"book-people-section-title"},{children:"Contributors"})),n.jsx("div",e.__assign({style:r.listContainerWrapper,className:"book-people-list-wrapper"},{children:null===(s=null==h?void 0:h.primary)||void 0===s?void 0:s.map(function(i,a){var o;return n.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}},{children:[n.jsx("div",e.__assign({style:r.avatar,className:"book-people-avatar"},{children:_(null==i?void 0:i.name)})),n.jsx("span",e.__assign({style:r.contributorName,className:"book-people-name"},{children:u&&u.length>0?n.jsx("span",{dangerouslySetInnerHTML:{__html:t.sanitizeHtml(l.highlightTermsFunc(null==i?void 0:i.name,u))}}):null==i?void 0:i.name})),n.jsx("span",e.__assign({style:r.contributorRole,className:"book-people-role"},{children:u&&u.length>0?n.jsx("span",{dangerouslySetInnerHTML:{__html:t.sanitizeHtml(l.highlightTermsFunc(null==i?void 0:i.role,u))}}):null==i?void 0:i.role})),n.jsx("div",e.__assign({style:{display:"flex",gap:"8px",marginTop:"8px"}},{children:null===(o=null==i?void 0:i.tags)||void 0===o?void 0:o.map(function(i,a){return n.jsx("span",e.__assign({style:r.tag},{children:u&&u.length>0?n.jsx("span",{dangerouslySetInnerHTML:{__html:t.sanitizeHtml(l.highlightTermsFunc(i,u))}}):i}),a)})}))]}),a)})})),h.additional&&h.additional.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("p",e.__assign({style:r.sectionTitle,className:"book-people-section-title"},{children:"Additional Contributors"})),n.jsx("div",e.__assign({style:r.listContainerWrapper,className:"book-people-list-wrapper"},{children:null===(d=null==h?void 0:h.additional)||void 0===d?void 0:d.map(function(i,a){return n.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}},{children:[n.jsx("div",e.__assign({style:r.avatar,className:"book-people-avatar"},{children:_(null==i?void 0:i.name)})),n.jsx("span",e.__assign({style:r.contributorName,className:"book-people-name"},{children:u&&u.length>0?n.jsx("span",{dangerouslySetInnerHTML:{__html:t.sanitizeHtml(l.highlightTermsFunc(null==i?void 0:i.name,u))}}):null==i?void 0:i.name})),n.jsx("span",e.__assign({style:r.contributorRole,className:"book-people-role"},{children:u&&u.length>0?n.jsx("span",{dangerouslySetInnerHTML:{__html:t.sanitizeHtml(l.highlightTermsFunc(null==i?void 0:i.role,u))}}):null==i?void 0:i.role}))]}),a)})}))]}),x.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("p",e.__assign({style:r.sectionTitle,className:"book-people-section-title"},{children:"Awards"})),n.jsx("div",e.__assign({style:r.awardContainerWrapper,className:"book-people-award-wrapper"},{children:null==x?void 0:x.map(function(i,a){return n.jsx("div",e.__assign({style:r.awardInfo},{children:n.jsx("span",{children:u&&u.length>0?n.jsx("span",{dangerouslySetInnerHTML:{__html:t.sanitizeHtml(l.highlightTermsFunc(null==i?void 0:i.title,u))}}):null==i?void 0:i.title})}),a)})}))]})]}))};
|
|
2
2
|
//# sourceMappingURL=BookPeopleAwardsCard.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),o=require("react/jsx-runtime"),i=require("@mui/material/Dialog"),t=require("@mui/material/DialogContent"),n=require("./BookemonContent.js");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),o=require("react/jsx-runtime"),i=require("@mui/material/Dialog"),t=require("@mui/material/DialogContent"),n=require("./BookemonContent.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=s(i),r=s(t),a={maxWidth:"none",fontFamily:"Inter, sans-serif"},g={wrapper:{alignItems:"center",justifyContent:"center",textAlign:"center"},inner:{width:"100%"},iconWrapper:{width:"80px",height:"80px",background:"linear-gradient(to right, #3B82F6, #9333EA)",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 24px auto"},icon:{width:"40px",height:"40px",color:"#FFFFFF"},heading:{fontSize:"36px",fontWeight:"bold",color:"#9333EA",marginBottom:"16px"},text:{fontSize:"18px",color:"#4B5563",lineHeight:1.6,textAlign:"center"},errorState:{color:"#CE3928",padding:"18px 0px",display:"flex",justifyContent:"center",width:"100%"}},d=o.jsx("svg",e.__assign({style:g.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},{children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}));exports.comingSoonStyles=g,exports.default=function(i){var t=i.open,s=i.onClose,g=i.isDialog,h=void 0===g||g,u=i.isBookPreview,c=void 0===u||u,m=i.isNonHighlightedBlur,p=i.isBookemon,x=i.getHighlightContent,f=i.handleFetchManuscriptElements,B=i.data,C=i.showComingSoon,v=void 0!==C&&C,y=i.comingSoonData,k=void 0===y?{header:"Bookemon Coming Soon!!",subheader:"We're working on something amazing. Stay tuned for updates!",icon:d}:y,S=i.customStyle,j=void 0===S?{}:S,w=i.isBlurToggleVisible,_=void 0!==w&&w,F=i.highlightTerms,b=i.defaultElementPages,D=null!=t&&t,E=null!=s?s:function(){};return h?o.jsx(l.default,e.__assign({open:D,fullWidth:!0,PaperProps:{style:e.__assign(e.__assign({},a),null==j?void 0:j.dialogDimension)}},{children:o.jsx(r.default,e.__assign({style:{padding:0}},{children:o.jsx(n.BookemonContent,{data:B,customStyle:j,comingSoonData:k,showComingSoon:v,isNonHighlightedBlur:m,isBlurToggleVisible:_,isBookemon:p,highlightTerms:F,getHighlightContent:x,handleFetchManuscriptElements:f,isBookPreview:c,isDialog:h,onClose:E,defaultElementPages:b})}))})):o.jsx("div",e.__assign({style:{width:"100%",height:"100%"}},{children:o.jsx(n.BookemonContent,{data:B,customStyle:j,comingSoonData:k,showComingSoon:v,isNonHighlightedBlur:m,isBlurToggleVisible:_,isBookemon:p,highlightTerms:F,getHighlightContent:x,handleFetchManuscriptElements:f,isBookPreview:c,isDialog:h,onClose:E,defaultElementPages:b})}))},exports.defaultIcon=d;
|
|
2
2
|
//# sourceMappingURL=Bookemon.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),i=require("react"),n=require("react-resizable-panels"),a=require("@mui/material/Accordion"),o=require("@mui/material/AccordionSummary"),r=require("@mui/material/Typography"),s=require("@mui/material/AccordionDetails"),l=require("@mui/material/IconButton"),d=require("./BookDetailsCard/BookDetailsCard.js"),u=require("./BookOverviewCard/BookOverviewCard.js"),c=require("./BookElementsCard/BookElementsCard.js"),g=require("./BookCopyrightsCard/BookCopyrightsCard.js"),h=require("./BookPeopleAwardsCard/BookPeopleAwardsCard.js"),x=require("./BookPreview/BookPreview.js"),p=require("@mui/icons-material/ExpandMore"),f=require("@mui/icons-material/Close");function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=_(a),y=_(o),v=_(r),j=_(s),b=_(l),C=_(p),k=_(f),w={dialogPaper:{maxWidth:"none",fontFamily:"Inter, sans-serif"},dialogHeight:{overflow:"hidden",height:"90vh",position:"relative"},dialogContent:{padding:0,backgroundColor:"#FFFFFF"},container:{display:"flex",height:"100%",width:"100%",alignItems:"flex-start"},leftPanel:{height:"100%",padding:"24px",overflowY:"auto",backgroundColor:"#F3F4F6",borderRadius:"12px",boxSizing:"border-box"},rightPanel:{width:"40%",backgroundColor:"#FFFFFF",height:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-start",overflow:"auto",flex:1,boxSizing:"border-box",overflowY:"auto"},accordion:{borderRadius:"12px",boxShadow:"none",marginBottom:"24px"},accordionSummary:{paddingLeft:"16px",paddingRight:"16px"},accordionDetails:{paddingLeft:"16px",paddingRight:"16px",paddingBottom:"16px"},heading:{fontWeight:"bold",color:"#000000",fontSize:"16px"},blurOverlay:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",backgroundColor:"rgba(255, 255, 255, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:10,borderRadius:"12px"},closeButton:{position:"absolute",top:"8px",right:"8px",color:"#111827"},resizeHandle:{width:"10px",backgroundColor:"#e5e7eb",cursor:"col-resize",display:"flex",alignItems:"center",justifyContent:"center"},iconContainer:{display:"flex",flexDirection:"column",gap:"4px"},dot:{width:"4px",height:"4px",backgroundColor:"#6b7280",borderRadius:"50%"},resizeHandleBar:{width:"2px",height:"24px",backgroundColor:"#666",borderRadius:"2px"}},B={wrapper:{alignItems:"center",justifyContent:"center",textAlign:"center"},inner:{width:"100%"},iconWrapper:{width:"80px",height:"80px",background:"linear-gradient(to right, #3B82F6, #9333EA)",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 24px auto"},icon:{width:"40px",height:"40px",color:"#FFFFFF"},heading:{fontSize:"36px",fontWeight:"bold",color:"#9333EA",marginBottom:"16px"},text:{fontSize:"18px",color:"#4B5563",lineHeight:1.6,textAlign:"center"},errorState:{color:"#CE3928",padding:"18px 0px",display:"flex",justifyContent:"center",width:"100%"}},S=function(i){var n=i.header,a=i.subheader,o=i.icon;return t.jsx("div",e.__assign({style:B.wrapper},{children:t.jsxs("div",e.__assign({style:B.inner},{children:[t.jsx("div",e.__assign({style:{marginBottom:"32px"}},{children:t.jsx("div",e.__assign({style:B.iconWrapper},{children:o}))})),t.jsxs("div",{children:[t.jsx("h1",e.__assign({style:B.heading},{children:n})),t.jsx("p",e.__assign({style:B.text},{children:a}))]})]}))}))};exports.BookemonContent=function(a){var o=a.showComingSoon,r=a.onClose,s=a.highlightTerms,l=a.data,p=a.customStyle,f=a.comingSoonData,_=a.isNonHighlightedBlur,B=a.isBlurToggleVisible,D=a.isBookemon,F=a.getHighlightContent,H=a.handleFetchManuscriptElements,z=a.isBookPreview,P=a.isDialog,q=i.useState({textToHighLight:"",content:""}),M=q[0],I=q[1],T=i.useState(1),A=T[0],E=T[1],O=i.useState(!1),R=O[0],L=O[1],W=i.useState("Book Preview"),N=W[0],V=W[1],Q=i.useState(70),Y=Q[0],G=Q[1],J=i.useRef(null),K=i.useState(!1),U=K[0],X=K[1],Z=function(t,i,n,a){return void 0===a&&(a=0),e.__awaiter(void 0,void 0,void 0,function(){var o,r,s,l,d,u,c,g,h,x,p,f,_,m,y,v;return e.__generator(this,function(e){switch(e.label){case 0:I({textToHighLight:"",content:""}),X(!1),L(!0),V(i),e.label=1;case 1:return e.trys.push([1,5,6,7]),n&&0!==n.length?[4,null==F?void 0:F([n[a]])]:(L(!1),G(70),null===(y=J.current)||void 0===y||y.resize(70),[2]);case 2:if(o=e.sent(),r=(null==o?void 0:o.data)||o||[],!Array.isArray(r)||0===r.length)return X(!0),L(!1),[2];for(l=(s=function(e){return e?e.replace(/<[^>]*>/g," ").replace(/ /g," ").replace(/[\u200B-\u200D\uFEFF]/g,"").replace(/[\u2018\u2019]/g,"'").replace(/[\u201C\u201D]/g,'"').replace(/[\u2013\u2014]/g,"-").replace(/[.,!?;:'"(){}\[\]—–…\/\\@#&*_|\^~%=+<>`]/g,"").replace(/\s+/g," ").trim().toLowerCase():""})(t),d=null,u=0,c=r;u<c.length;u++)if(f=c[u],s(f.normalizedContent||f.htmlContent).includes(l)){d=f;break}if(!d)for(g=l.split(" ").filter(Boolean);g.length>0;){for(h=g.join(" "),x=0,p=r;x<p.length;x++)if(f=p[x],s(f.normalizedContent||f.htmlContent).includes(h)){d=f;break}if(d)break;g.pop()}return _=r.map(function(e){return e.htmlContent}).join("\n"),I({textToHighLight:d?d.htmlContent:"",content:_}),G(50),null===(v=J.current)||void 0===v||v.resize(50),!d&&a+1<n.length?[4,Z(t,i,n,a+1)]:[3,4];case 3:return[2,e.sent()];case 4:return[2];case 5:return m=e.sent(),console.error("Highlight error:",m),X(!0),[3,7];case 6:return L(!1),[7];case 7:return[2]}})})},$=i.useState(!1),ee=$[0],te=$[1],ie=i.useState(!1),ne=ie[0],ae=ie[1],oe=i.useState(!1),re=oe[0],se=oe[1],le=i.useState(!1),de=le[0],ue=le[1],ce=i.useState(!1),ge=ce[0],he=ce[1],xe=i.useState(!1),pe=xe[0],fe=xe[1],_e=i.useState(!1),me=_e[0],ye=_e[1],ve=i.useState(!1),je=ve[0],be=ve[1],Ce=i.useState(!1),ke=Ce[0],we=Ce[1],Be=i.useState(!1),Se=Be[0],De=Be[1];i.useEffect(function(){ee&&fe(!0),ne&&ye(!0),re&&be(!0),de&&we(!0),ge&&De(!0)},[ee,ne,re,de,ge]);var Fe=l.bookAwards,He=l.bookCopyRight,ze=l.bookDetails,Pe=l.bookElements,qe=l.bookOverView,Me=l.bookCoverImage,Ie=null==ze?void 0:ze.isbn,Te=null!=r?r:function(){};return t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},w.dialogContent),P?w.dialogHeight:{})},{children:[!o&&t.jsx("div",e.__assign({style:w.container},{children:t.jsxs(n.PanelGroup,e.__assign({direction:"horizontal"},{children:[t.jsx(n.Panel,e.__assign({order:1,ref:J,defaultSize:Y||70},{children:t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},null==w?void 0:w.leftPanel),null==p?void 0:p.leftPanel)},{children:[t.jsx("div",e.__assign({style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:t.jsxs(m.default,e.__assign({expanded:pe,onChange:function(e,t){return fe(t)},elevation:0,style:w.accordion},{children:[t.jsx(y.default,e.__assign({expandIcon:t.jsx(C.default,{}),style:w.accordionSummary},{children:t.jsx(v.default,e.__assign({style:w.heading},{children:"Book Overview"}))})),t.jsx(j.default,e.__assign({style:w.accordionDetails},{children:qe&&Object.keys(qe).length>0?t.jsx(u.default,{data:qe,highlightTerms:s,onHighlightMatch:te}):t.jsx("div",e.__assign({style:w.errorState},{children:"No overview data available."}))}))]}))})),t.jsx("div",e.__assign({style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:t.jsxs(m.default,e.__assign({elevation:0,style:w.accordion,expanded:me,onChange:function(e,t){return ye(t)}},{children:[t.jsx(y.default,e.__assign({expandIcon:t.jsx(C.default,{}),style:w.accordionSummary},{children:t.jsx(v.default,e.__assign({style:w.heading},{children:"Book Manuscript Elements"}))})),t.jsx(j.default,e.__assign({style:w.accordionDetails},{children:t.jsx(c.default,{data:Pe,title:(null==qe?void 0:qe.title)||"",handleFetchManuscriptElements:H,BookIsbn:Ie,updateQuotesToHighLight:Z,highlightTerms:s,onHighlightMatch:ae})}))]}))})),t.jsx("div",e.__assign({style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:t.jsxs(m.default,e.__assign({expanded:je,onChange:function(e,t){return be(t)},elevation:0,style:w.accordion},{children:[t.jsx(y.default,e.__assign({expandIcon:t.jsx(C.default,{}),style:w.accordionSummary},{children:t.jsx(v.default,e.__assign({style:w.heading},{children:"Book Metadata Details"}))})),t.jsx(j.default,e.__assign({style:w.accordionDetails},{children:ze&&Object.keys(ze).length>0?t.jsx(d.default,{data:ze,highlightTerms:s,onHighlightMatch:se}):t.jsx("div",e.__assign({style:w.errorState},{children:"No Book Metadata data available."}))}))]}))})),t.jsx("div",e.__assign({style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:t.jsxs(m.default,e.__assign({elevation:0,style:w.accordion,expanded:ke,onChange:function(e,t){return we(t)}},{children:[t.jsx(y.default,e.__assign({expandIcon:t.jsx(C.default,{}),style:w.accordionSummary},{children:t.jsx(v.default,e.__assign({style:w.heading},{children:"Copyrights & Marketing"}))})),t.jsx(j.default,e.__assign({style:w.accordionDetails},{children:He&&Object.keys(He).length>0?t.jsx(g.default,{data:He,highlightTerms:s,onHighlightMatch:ue}):t.jsx("div",e.__assign({style:w.errorState},{children:"No Copyrights & Marketing data available."}))}))]}))})),t.jsx("div",{children:t.jsxs(m.default,e.__assign({elevation:0,style:w.accordion,expanded:Se,onChange:function(e,t){return De(t)}},{children:[t.jsx(y.default,e.__assign({expandIcon:t.jsx(C.default,{}),style:w.accordionSummary},{children:t.jsx(v.default,e.__assign({style:w.heading},{children:"People & Awards"}))})),t.jsx(j.default,e.__assign({style:w.accordionDetails},{children:Fe&&Object.keys(Fe).length>0?t.jsx(h.default,{data:Fe,highlightTerms:s,onHighlightMatch:he}):t.jsx("div",e.__assign({style:w.errorState},{children:"No People & Awards data available."}))}))]}))})]}))})),z&&t.jsx(n.PanelResizeHandle,{style:{width:"3px",background:"#D1D5DC",cursor:"col-resize"}}),z&&t.jsx(n.Panel,e.__assign({order:2,minSize:30,maxSize:50,style:{overflow:"visible",position:"relative",transition:"all 300ms ease-in-out",WebkitTransition:"all 300ms ease-in-out"}},{children:t.jsx(x.default,{bookOverView:qe,bookCoverImage:Me,onClose:Te,clickableElementCategory:N,quotesToHighLightData:M,updateQuotesToHighLight:Z,citationLoad:R,previewPage:A,setPreviewPage:E,customStyle:p,comingSoonData:f,isNonHighlightedBlur:_,isBlurToggleVisible:B,isBookemon:D,noHtmlContent:U})}))]}))})),o&&t.jsxs("div",e.__assign({style:w.blurOverlay},{children:[t.jsx(b.default,e.__assign({style:w.closeButton,onClick:r,size:"large"},{children:t.jsx(k.default,{})})),t.jsx(S,{header:null==f?void 0:f.header,subheader:null==f?void 0:f.subheader,icon:null==f?void 0:f.icon})]}))]}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),i=require("react"),n=require("react-resizable-panels"),o=require("@mui/material/Accordion"),r=require("@mui/material/AccordionSummary"),a=require("@mui/material/Typography"),l=require("@mui/material/AccordionDetails"),s=require("@mui/material/IconButton"),d=require("./BookDetailsCard/BookDetailsCard.js"),u=require("./BookOverviewCard/BookOverviewCard.js"),c=require("./BookElementsCard/BookElementsCard.js"),g=require("./BookCopyrightsCard/BookCopyrightsCard.js"),h=require("./BookPeopleAwardsCard/BookPeopleAwardsCard.js"),x=require("./BookPreview/BookPreview.js"),p=require("@mui/icons-material/ExpandMore"),f=require("@mui/icons-material/Close");function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var v=_(o),m=_(r),y=_(a),b=_(l),j=_(s),k=_(p),C=_(f),w={dialogPaper:{maxWidth:"none",fontFamily:"Inter, sans-serif"},dialogHeight:{overflow:"hidden",height:"90vh",position:"relative"},dialogContent:{padding:0,backgroundColor:"#FFFFFF"},container:{display:"flex",height:"100%",width:"100%",alignItems:"flex-start"},leftPanel:{height:"100%",padding:"24px",overflowY:"auto",backgroundColor:"#F3F4F6",borderRadius:"12px",boxSizing:"border-box"},rightPanel:{width:"40%",backgroundColor:"#FFFFFF",height:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-start",overflow:"auto",flex:1,boxSizing:"border-box",overflowY:"auto"},accordion:{borderRadius:"12px",boxShadow:"none",marginBottom:"24px"},accordionSummary:{paddingLeft:"16px",paddingRight:"16px"},accordionDetails:{paddingLeft:"16px",paddingRight:"16px",paddingBottom:"16px"},heading:{fontWeight:"bold",color:"#000000",fontSize:"16px"},blurOverlay:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",backgroundColor:"rgba(255, 255, 255, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:10,borderRadius:"12px"},closeButton:{position:"absolute",top:"8px",right:"8px",color:"#111827"},resizeHandle:{width:"10px",backgroundColor:"#e5e7eb",cursor:"col-resize",display:"flex",alignItems:"center",justifyContent:"center"},iconContainer:{display:"flex",flexDirection:"column",gap:"4px"},dot:{width:"4px",height:"4px",backgroundColor:"#6b7280",borderRadius:"50%"},resizeHandleBar:{width:"2px",height:"24px",backgroundColor:"#666",borderRadius:"2px"}},S={wrapper:{alignItems:"center",justifyContent:"center",textAlign:"center"},inner:{width:"100%"},iconWrapper:{width:"80px",height:"80px",background:"linear-gradient(to right, #3B82F6, #9333EA)",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 24px auto"},icon:{width:"40px",height:"40px",color:"#FFFFFF"},heading:{fontSize:"36px",fontWeight:"bold",color:"#9333EA",marginBottom:"16px"},text:{fontSize:"18px",color:"#4B5563",lineHeight:1.6,textAlign:"center"},errorState:{color:"#CE3928",padding:"18px 0px",display:"flex",justifyContent:"center",width:"100%"}},B=function(i){var n=i.header,o=i.subheader,r=i.icon;return t.jsx("div",e.__assign({style:S.wrapper},{children:t.jsxs("div",e.__assign({style:S.inner},{children:[t.jsx("div",e.__assign({style:{marginBottom:"32px"}},{children:t.jsx("div",e.__assign({style:S.iconWrapper},{children:r}))})),t.jsxs("div",{children:[t.jsx("h1",e.__assign({style:S.heading},{children:n})),t.jsx("p",e.__assign({style:S.text},{children:o}))]})]}))}))};exports.BookemonContent=function(o){var r=o.showComingSoon,a=o.onClose,l=o.highlightTerms,s=o.data,p=o.customStyle,f=o.comingSoonData,_=o.isNonHighlightedBlur,S=o.isBlurToggleVisible,D=o.isBookemon,F=o.getHighlightContent,P=o.handleFetchManuscriptElements,q=o.isBookPreview,H=o.isDialog,z=o.defaultElementPages,I=i.useState({textToHighLight:"",content:""}),E=I[0],M=I[1],R=i.useState(1),T=R[0],A=R[1],O=i.useState(!1),L=O[0],V=O[1],W=i.useState("Book Preview"),N=W[0],Q=W[1],Y=i.useState(70),G=Y[0],J=Y[1],K=i.useRef(null),U=i.useState(!1),X=U[0],Z=U[1],$=i.useRef(null),ee=i.useRef(null),te=i.useRef(null),ie=i.useRef(null),ne=i.useRef(null),oe=function(t,i,n,o){return void 0===o&&(o=0),e.__awaiter(void 0,void 0,void 0,function(){var r,a,l,s,d,u,c,g,h,x,p,f,_,v,m,y;return e.__generator(this,function(e){switch(e.label){case 0:M({textToHighLight:"",content:""}),Z(!1),V(!0),Q(i),e.label=1;case 1:return e.trys.push([1,5,6,7]),n&&0!==n.length?[4,null==F?void 0:F([n[o]])]:(V(!1),J(70),null===(m=K.current)||void 0===m||m.resize(70),[2]);case 2:if(r=e.sent(),a=(null==r?void 0:r.data)||r||[],!Array.isArray(a)||0===a.length)return Z(!0),V(!1),[2];for(s=(l=function(e){return e?e.replace(/<[^>]*>/g," ").replace(/ /g," ").replace(/[\u200B-\u200D\uFEFF]/g,"").replace(/[\u2018\u2019]/g,"'").replace(/[\u201C\u201D]/g,'"').replace(/[\u2013\u2014]/g,"-").replace(/[.,!?;:'"(){}\[\]—–…\/\\@#&*_|\^~%=+<>`]/g,"").replace(/\s+/g," ").trim().toLowerCase():""})(t),d=null,u=0,c=a;u<c.length;u++)if(f=c[u],l(f.normalizedContent||f.htmlContent).includes(s)){d=f;break}if(!d)for(g=s.split(" ").filter(Boolean);g.length>0;){for(h=g.join(" "),x=0,p=a;x<p.length;x++)if(f=p[x],l(f.normalizedContent||f.htmlContent).includes(h)){d=f;break}if(d)break;g.pop()}return _=a.map(function(e){return e.htmlContent}).join("\n"),M({textToHighLight:d?d.htmlContent:"",content:_}),J(50),null===(y=K.current)||void 0===y||y.resize(50),!d&&o+1<n.length?[4,oe(t,i,n,o+1)]:[3,4];case 3:return[2,e.sent()];case 4:return[2];case 5:return v=e.sent(),console.error("Highlight error:",v),Z(!0),[3,7];case 6:return V(!1),[7];case 7:return[2]}})})},re=i.useState(!1),ae=re[0],le=re[1],se=i.useState(!1),de=se[0],ue=se[1],ce=i.useState(!1),ge=ce[0],he=ce[1],xe=i.useState(!1),pe=xe[0],fe=xe[1],_e=i.useState(!1),ve=_e[0],me=_e[1],ye=i.useState(!1),be=ye[0],je=ye[1],ke=i.useState(!1),Ce=ke[0],we=ke[1],Se=i.useState(!1),Be=Se[0],De=Se[1],Fe=i.useState(!1),Pe=Fe[0],qe=Fe[1],He=i.useState(!1),ze=He[0],Ie=He[1];i.useEffect(function(){ae&&je(!0),de&&we(!0),ge&&De(!0),pe&&qe(!0),ve&&Ie(!0)},[ae,de,ge,pe,ve]);var Ee=s.bookAwards,Me=s.bookCopyRight,Re=s.bookDetails,Te=s.bookElements,Ae=s.bookOverView,Oe=s.bookCoverImage,Le=null==Re?void 0:Re.isbn,Ve=null!=a?a:function(){};return t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},w.dialogContent),H?w.dialogHeight:{})},{children:[!r&&t.jsx("div",e.__assign({style:w.container},{children:t.jsxs(n.PanelGroup,e.__assign({direction:"horizontal"},{children:[t.jsx(n.Panel,e.__assign({order:1,ref:K,defaultSize:G||70},{children:t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},null==w?void 0:w.leftPanel),null==p?void 0:p.leftPanel)},{children:[t.jsx("div",e.__assign({ref:$,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:t.jsxs(v.default,e.__assign({expanded:be,onChange:function(e,t){return je(t)},slotProps:{transition:{onEntered:function(){var e=$.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}},elevation:0,style:w.accordion},{children:[t.jsx(m.default,e.__assign({expandIcon:t.jsx(k.default,{}),style:w.accordionSummary},{children:t.jsx(y.default,e.__assign({style:w.heading},{children:"Book Overview"}))})),t.jsx(b.default,e.__assign({style:w.accordionDetails},{children:Ae&&Object.keys(Ae).length>0?t.jsx(u.default,{data:Ae,highlightTerms:l,onHighlightMatch:le}):t.jsx("div",e.__assign({style:w.errorState},{children:"No overview data available."}))}))]}))})),t.jsx("div",e.__assign({ref:ee,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:t.jsxs(v.default,e.__assign({elevation:0,style:w.accordion,expanded:Ce,onChange:function(e,t){return we(t)},slotProps:{transition:{onEntered:function(){var e=ee.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}}},{children:[t.jsx(m.default,e.__assign({expandIcon:t.jsx(k.default,{}),style:w.accordionSummary},{children:t.jsx(y.default,e.__assign({style:w.heading},{children:"Book Manuscript Elements"}))})),t.jsx(b.default,e.__assign({style:w.accordionDetails},{children:t.jsx(c.default,{data:Te,title:(null==Ae?void 0:Ae.title)||"",handleFetchManuscriptElements:P,BookIsbn:Le,updateQuotesToHighLight:oe,highlightTerms:l,onHighlightMatch:ue,defaultPages:z})}))]}))})),t.jsx("div",e.__assign({ref:te,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:t.jsxs(v.default,e.__assign({expanded:Be,onChange:function(e,t){return De(t)},elevation:0,style:w.accordion,slotProps:{transition:{onEntered:function(){var e=te.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}}},{children:[t.jsx(m.default,e.__assign({expandIcon:t.jsx(k.default,{}),style:w.accordionSummary},{children:t.jsx(y.default,e.__assign({style:w.heading},{children:"Book Metadata Details"}))})),t.jsx(b.default,e.__assign({style:w.accordionDetails},{children:Re&&Object.keys(Re).length>0?t.jsx(d.default,{data:Re,highlightTerms:l,onHighlightMatch:he}):t.jsx("div",e.__assign({style:w.errorState},{children:"No Book Metadata data available."}))}))]}))})),t.jsx("div",e.__assign({ref:ie,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:t.jsxs(v.default,e.__assign({elevation:0,style:w.accordion,expanded:Pe,onChange:function(e,t){return qe(t)},slotProps:{transition:{onEntered:function(){var e=ie.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}}},{children:[t.jsx(m.default,e.__assign({expandIcon:t.jsx(k.default,{}),style:w.accordionSummary},{children:t.jsx(y.default,e.__assign({style:w.heading},{children:"Copyrights & Marketing"}))})),t.jsx(b.default,e.__assign({style:w.accordionDetails},{children:Me&&Object.keys(Me).length>0?t.jsx(g.default,{data:Me,highlightTerms:l,onHighlightMatch:fe}):t.jsx("div",e.__assign({style:w.errorState},{children:"No Copyrights & Marketing data available."}))}))]}))})),t.jsx("div",e.__assign({ref:ne},{children:t.jsxs(v.default,e.__assign({elevation:0,style:w.accordion,expanded:ze,onChange:function(e,t){return Ie(t)},slotProps:{transition:{onEntered:function(){var e=ne.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}}},{children:[t.jsx(m.default,e.__assign({expandIcon:t.jsx(k.default,{}),style:w.accordionSummary},{children:t.jsx(y.default,e.__assign({style:w.heading},{children:"People & Awards"}))})),t.jsx(b.default,e.__assign({style:w.accordionDetails},{children:Ee&&Object.keys(Ee).length>0?t.jsx(h.default,{data:Ee,highlightTerms:l,onHighlightMatch:me}):t.jsx("div",e.__assign({style:w.errorState},{children:"No People & Awards data available."}))}))]}))}))]}))})),q&&t.jsx(n.PanelResizeHandle,{style:{width:"3px",background:"#D1D5DC",cursor:"col-resize"}}),q&&t.jsx(n.Panel,e.__assign({order:2,minSize:30,maxSize:50,style:{overflow:"visible",position:"relative",transition:"all 300ms ease-in-out",WebkitTransition:"all 300ms ease-in-out"}},{children:t.jsx(x.default,{bookOverView:Ae,bookCoverImage:Oe,onClose:Ve,clickableElementCategory:N,quotesToHighLightData:E,updateQuotesToHighLight:oe,citationLoad:L,previewPage:T,setPreviewPage:A,customStyle:p,comingSoonData:f,isNonHighlightedBlur:_,isBlurToggleVisible:S,isBookemon:D,noHtmlContent:X})}))]}))})),r&&t.jsxs("div",e.__assign({style:w.blurOverlay},{children:[t.jsx(j.default,e.__assign({style:w.closeButton,onClick:a,size:"large"},{children:t.jsx(C.default,{})})),t.jsx(B,{header:null==f?void 0:f.header,subheader:null==f?void 0:f.subheader,icon:null==f?void 0:f.icon})]}))]}))};
|
|
2
2
|
//# sourceMappingURL=BookemonContent.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("tslib")
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("tslib"),e=function(e,t){if(!e)return"";if(!t||0===t.length)return e;for(var n=e,i=0,o=r.__spreadArray([],t,!0).map(function(r){return r.trim()}).filter(Boolean).sort(function(r,e){return e.length-r.length});i<o.length;i++){var u=o[i].replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp("\\b(".concat(u,")\\b"),"gi");n=n.replace(a,'<span data-highlight="true" style="background-color:#ffffb8;border-radius:2px;">$1</span>')}return n};exports.highlightTermsFunc=e,exports.processTextWithHighlight=function(r,t){return r?t&&0!==t.length?e(r,t):r:""};
|
|
2
2
|
//# sourceMappingURL=highlight.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("tslib"),n=require("react/jsx-runtime"),e=require("react"),i=require("./InternalChatCitationRenderer.js"),t=require("./components/wrappers/Modal.js"),a=require("./components/IconContainer.js"),r=require("lucide-react");function s(o){return o&&"object"==typeof o&&"default"in o?o:{default:o}}var l=s(require("@mui/icons-material/SwapHoriz"));exports.default=function(s){var d,u,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("tslib"),n=require("react/jsx-runtime"),e=require("react"),i=require("./InternalChatCitationRenderer.js"),t=require("./components/wrappers/Modal.js"),a=require("./components/IconContainer.js"),r=require("lucide-react");function s(o){return o&&"object"==typeof o&&"default"in o?o:{default:o}}var l=s(require("@mui/icons-material/SwapHoriz"));exports.default=function(s){var d,c,u,_,C,v,p,h=e.useState(!1),y=h[0],g=h[1],x=e.useState(),f=x[0],j=x[1];function m(o){g(!0),j(o)}function b(){g(!1),j(void 0)}function A(o){j(o)}var k=e.useMemo(function(){var o;return!!(null===(o=s.ruleBookContainer)||void 0===o?void 0:o.data)},[null===(d=s.ruleBookContainer)||void 0===d?void 0:d.data]),w=e.useMemo(function(){var o;return!!((null===(o=s.tableComponent)||void 0===o?void 0:o.rows)&&Object.keys(s.tableComponent.rows).length>0)},[s.tableComponent]);return console.log("tableComponent data:",s.tableComponent),console.log("isTableDataPresent:",w),console.log("rootContainer",s.rootContainer),console.log("chatCitation",s.chatContainer),n.jsxs(n.Fragment,{children:[n.jsx(i.default,o.__assign({},s,{showRootContainer:s.showRootContainer,tableComponent:s.tableComponent,additionalData:o.__assign(o.__assign({},s.additionalData),{isExpanded:!1}),isRenderedCustomComponent:s.isRenderedCustomComponent||!1,closePreview:s.closePreview},s.chatContainer&&{chatContainer:o.__assign(o.__assign({},s.chatContainer),{show:!0,secondaryActions:function(e){var i,t,l,d,c;return o.__spreadArray(o.__spreadArray(o.__spreadArray([],e,!0),null!==(t=null===(i=s.chatContainer)||void 0===i?void 0:i.additionalSecondaryActions)&&void 0!==t?t:[],!0),[(null===(c=null===(d=null===(l=s.chatContainer)||void 0===l?void 0:l.detailedTab)||void 0===d?void 0:d.chip)||void 0===c?void 0:c.isActive)&&n.jsx("span",{style:{width:"1px",height:"100%",border:"1px solid #E2E8F0"}}),n.jsx(a.default,o.__assign({onClick:function(){return m("chat")},style:{cursor:"pointer"}},{children:n.jsx(r.Maximize2,{size:16,color:"#64748B"})}))],!1)}})},{ruleBookContainer:k?o.__assign(o.__assign({},s.ruleBookContainer),{show:!0,secondaryActions:function(e){var i,t;return o.__spreadArray(o.__spreadArray(o.__spreadArray([],e,!0),null!==(t=null===(i=s.ruleBookContainer)||void 0===i?void 0:i.additionalSecondaryActions)&&void 0!==t?t:[],!0),[n.jsx("span",{style:{width:"1px",border:"1px solid #E2E8F0"}}),n.jsx(a.default,o.__assign({onClick:function(){return m("rulebook")},style:{cursor:"pointer"}},{children:n.jsx(r.Maximize2,{size:16,color:"#64748B"})}))],!1)}}):void 0})),n.jsx(t.Modal,o.__assign({isOpen:y,onClose:b,containerStyle:s.modalContainerStyle},{children:n.jsx(i.default,o.__assign({},s,{showRootContainer:s.showRootContainer,tableComponent:s.tableComponent,additionalData:o.__assign(o.__assign({},s.additionalData),{isExpanded:!0}),rootContainer:o.__assign(o.__assign({},s.rootContainer),{secondaryActions:function(e){return o.__spreadArray(o.__spreadArray([],e,!0),[n.jsx(a.default,o.__assign({onClick:b,style:{cursor:"pointer"}},{children:n.jsx(r.X,{size:20,color:"#64748B"})}))],!1)}})},s.chatContainer&&{chatContainer:o.__assign(o.__assign({},s.chatContainer),{show:void 0===f?void 0:"chat"===f,secondaryActions:function(e){var i,t,d;return o.__spreadArray(o.__spreadArray([],e,!0),[(null===(d=null===(t=null===(i=s.chatContainer)||void 0===i?void 0:i.detailedTab)||void 0===t?void 0:t.chip)||void 0===d?void 0:d.isActive)&&(k||w)&&n.jsx("span",{style:{width:"1px",height:"100%",border:"1px solid #E2E8F0"}}),(k||w)&&n.jsx(a.default,o.__assign({style:{cursor:"pointer"},onClick:function(){return A("rulebook")}},{children:n.jsx(l.default,{style:{color:"gray",fontSize:22}})})),!s.showRootContainer&&n.jsx(a.default,o.__assign({onClick:b,style:{cursor:"pointer"}},{children:n.jsx(r.X,{size:20,color:"#64748B"})}))],!1)},slotStyles:o.__assign(o.__assign({},null===(c=s.chatContainer)||void 0===c?void 0:c.slotStyles),{chatDataContainer:o.__assign(o.__assign({},null===(_=null===(u=s.chatContainer)||void 0===u?void 0:u.slotStyles)||void 0===_?void 0:_.chatDataContainer),{maxHeight:void 0})})})},{ruleBookContainer:k?o.__assign(o.__assign({},s.ruleBookContainer),{show:void 0===f?void 0:"rulebook"===f,secondaryActions:function(e){return o.__spreadArray(o.__spreadArray([],e,!0),[n.jsx("span",{style:{width:"1px",border:"1px solid #E2E8F0"}}),n.jsx(a.default,o.__assign({style:{cursor:"pointer"},onClick:function(){return A("chat")}},{children:n.jsx(l.default,{style:{color:"gray",fontSize:22}})})),!s.showRootContainer&&n.jsx(a.default,o.__assign({onClick:b,style:{cursor:"pointer"}},{children:n.jsx(r.X,{size:20,color:"#64748B"})}))],!1)},slotStyles:o.__assign(o.__assign({},null===(C=s.ruleBookContainer)||void 0===C?void 0:C.slotStyles),{dataContainer:o.__assign(o.__assign({},null===(p=null===(v=s.ruleBookContainer)||void 0===v?void 0:v.slotStyles)||void 0===p?void 0:p.dataContainer),{maxHeight:void 0})})}):void 0}))}))]})};
|
|
2
2
|
//# sourceMappingURL=ChatCitationRenderer.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),o=require("react/jsx-runtime"),t=require("react"),i=require("react-dom");exports.Modal=function(n){var r,l=n.isOpen,d=n.onClose,s=n.children,a=n.containerStyle;return t.useEffect(function(){return document.body.style.overflow=l?"hidden":"unset",function(){document.body.style.overflow="unset"}},[l]),l?i.createPortal(o.jsx("div",e.__assign({style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"rgba(0, 0, 0, 0.6)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:2147483647,backdropFilter:"blur(2px)"},onClick:d},{children:o.jsx("div",e.__assign({style:e.__assign({width:"80%",height:"80%",maxWidth:"1200px",backgroundColor:"#fff",borderRadius:"12px",overflow:"hidden",display:"flex",flexDirection:"column",boxShadow:"0 25px 50px -12px rgba(0,0,0,0.5)",position:"relative"},a),onClick:function(e){return e.stopPropagation()}},{children:o.jsx("div",e.__assign({style:{flex:1,overflow:"auto",padding:null!==(r=null==a?void 0:a.padding)&&void 0!==r?r:"16px"}},{children:s}))}))})),document.body):null};
|
|
2
2
|
//# sourceMappingURL=Modal.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),i=require("react-markdown"),t=require("rehype-raw"),n=require("remark-gfm"),r=require("react"),o=require("./CognitiveDecisioningWrapper.module.css.js");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),i=require("react-markdown"),t=require("rehype-raw"),n=require("remark-gfm"),r=require("react"),o=require("./CognitiveDecisioningWrapper.module.css.js"),a=require("../../assests/svg/ButtonCognitiveIcon.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=l(i),c=l(t),u=l(n),g=function(){return s.jsx("div",e.__assign({style:{display:"flex",height:"32px",width:"32px",alignItems:"center",justifyContent:"center",borderRadius:"50%",backgroundColor:"#f5f5ff",color:"#6b27d9",flexShrink:0,border:"1.5px solid #f5f5ff"}},{children:s.jsxs("svg",e.__assign({width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[s.jsx("path",{d:"M9 18h6"}),s.jsx("path",{d:"M10 22h4"}),s.jsx("path",{d:"M12 2a7 7 0 0 1 7 7c0 2.38-1.19 4.55-3 6H8a7 7 0 0 1-3-6 7 7 0 0 1 7-7z"})]}))}))},h=function(){return s.jsx("div",e.__assign({style:{display:"flex",height:"32px",width:"32px",alignItems:"center",justifyContent:"center",borderRadius:"50%",backgroundColor:"#f5f5ff",flexShrink:0,border:"1.5px solid #f5f5ff"}},{children:s.jsxs("svg",e.__assign({width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"#6b27d9",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"},{children:[s.jsx("path",{d:"M4.92363 2.64844H1.93457V5.34844M1.93457 10.7484V12.5484M8.90904 2.64844H12.9601M16.9455 2.64844H19.9346V5.34844M4.92363 20.6484H1.93457V17.9484"}),s.jsx("path",{d:"M18.2707 19.1183C19.6383 17.75 19.6383 15.53 18.2707 14.16C16.9031 12.79 14.6831 12.79 13.3155 14.16C11.9479 15.53 11.9479 17.75 13.3155 19.11C14.6831 20.48 16.9031 20.48 18.2707 19.11ZM18.2707 19.1183L21.1436 21.9987"})]}))}))},f=function(i){var t=i.color,n=void 0===t?"#7b39ed":t,r=i.width,o=void 0===r?13:r,a=i.height,l=void 0===a?13:a,d=i.style;return s.jsx("span",e.__assign({style:e.__assign({display:"inline-flex",alignItems:"center",marginLeft:"4px"},d)},{children:s.jsxs("svg",e.__assign({width:o,height:l,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[s.jsx("path",{d:"M12.9975 5.40607C12.8868 4.86464 12.1132 4.86464 12.0025 5.40607C11.3236 8.72775 8.72775 11.3236 5.40607 12.0025C4.86464 12.1132 4.86464 12.8868 5.40607 12.9975C8.72775 13.6764 11.3236 16.2723 12.0025 19.5939C12.1132 20.1354 12.8868 20.1354 12.9975 19.5939C13.6764 16.2723 16.2723 13.6764 19.5939 12.9975C20.1354 12.8868 20.1354 12.1132 19.5939 12.0025C16.2723 11.3236 13.6764 8.72775 12.9975 5.40607Z",fill:n}),s.jsx("path",{d:"M3.7829 0.026852C3.77558 -0.00895077 3.72442 -0.00895062 3.7171 0.0268522C3.33729 1.88509 1.88509 3.33729 0.0268517 3.7171C-0.00895119 3.72442 -0.00895119 3.77558 0.0268517 3.7829C1.88509 4.16271 3.33729 5.61491 3.7171 7.47315C3.72442 7.50895 3.77558 7.50895 3.7829 7.47315C4.16271 5.61491 5.61491 4.16271 7.47315 3.7829C7.50895 3.77558 7.50895 3.72442 7.47315 3.7171C5.61491 3.33729 4.16271 1.88509 3.7829 0.026852Z",fill:n})]}))}))},x=r.forwardRef(function(i,t){var n=i.reasoning,l=i.gap,x=i.score,p=i.isOpen,_=i.onToggle,j=i.title,v=void 0===j?"Cognitive Decisioning AI":j,m=i.sections,C=i.styles,y=void 0===C?{}:C,k=i.mdComponents,b=void 0===k?{}:k,w=i.headerIcon,M=i.reasoningIcon,N=i.gapIcon,I=i.scoreIcon,B=i.hideTrigger,L=void 0!==B&&B,T=r.useState({reasoning:!0,gap:!0}),q=T[0],H=T[1],W=w||s.jsx(a.ButtonCognitiveIcon,{}),S=M||s.jsx(g,{}),D=N||s.jsx(h,{}),R=I||s.jsx(f,{}),V=r.useMemo(function(){return m||[{id:"reasoning",title:"Reasoning",subtitle:"Why this was picked",icon:S,content:n||"No reasoning provided."},{id:"gap",title:"Gap",subtitle:"What's missing or unclear",icon:D,content:l||"No gaps identified."}]},[m,n,l]),A=r.useMemo(function(){return[c.default]},[]),G=r.useMemo(function(){return[u.default]},[]);return s.jsxs("div",e.__assign({style:{display:"contents"}},{children:[!L&&s.jsxs("button",e.__assign({onClick:_,className:"".concat(o.default.pill," ").concat(p?o.default.pillOpen:o.default.pillClosed),style:y.pill,"aria-expanded":p},{children:[W,s.jsx("svg",e.__assign({width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#4B5563",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:p?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}},{children:s.jsx("path",{d:"M6 9l6 6 6-6"})}))]})),p&&s.jsxs("div",e.__assign({ref:t,className:o.default.container,style:y.container},{children:[s.jsxs("div",e.__assign({className:o.default.header,style:y.header},{children:[s.jsxs("div",e.__assign({className:o.default.headerTitle,style:y.headerTitle},{children:[W,s.jsx("span",e.__assign({className:o.default.headerTitleText,style:y.headerTitleText},{children:v}))]})),x&&s.jsxs("div",e.__assign({className:o.default.badge,style:y.badge},{children:[R,"Decision Strength: ",x,"%"]}))]})),V.map(function(i,t){return s.jsxs("div",e.__assign({className:o.default.sectionItem,style:y.sectionItem},{children:[s.jsxs("button",e.__assign({onClick:function(){return s=i.id,void H(function(i){var t;return e.__assign(e.__assign({},i),((t={})[s]=!i[s],t))});var s},className:o.default.sectionButton,style:y.sectionButton},{children:[s.jsxs("div",e.__assign({className:o.default.sectionHeaderGroup,style:y.sectionHeaderGroup},{children:[i.icon,s.jsxs("div",{children:[s.jsx("h4",e.__assign({className:o.default.sectionTitle,style:y.sectionTitle},{children:i.title})),i.subtitle&&s.jsx("p",e.__assign({className:o.default.sectionSubtitle,style:y.sectionSubtitle},{children:i.subtitle}))]})]})),s.jsx("svg",e.__assign({width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#9CA3AF",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:q[i.id]?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}},{children:s.jsx("path",{d:"M6 9l6 6 6-6"})}))]})),q[i.id]&&s.jsx("div",e.__assign({className:o.default.textContent,style:y.textContent},{children:s.jsx(d.default,e.__assign({components:b,rehypePlugins:A,remarkPlugins:G},{children:i.content}))}))]}),i.id)})]}))]}))});x.displayName="CognitiveDecisioningCard",exports.default=x;
|
|
2
2
|
//# sourceMappingURL=CognitiveDecisioningWrapper.js.map
|
|
@@ -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 i=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;i&&e.setAttribute("nonce",i),e.appendChild(document.createTextNode('@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap");.CognitiveDecisioningWrapper-module_container__ztKXm{background-color:#fff;border:1.5px solid #cacdfa;border-radius:8px;box-shadow:0 2px 4px -1px #0000000d;display:block;font-family:Plus Jakarta Sans,sans-serif;margin-bottom:12px;margin-top:8px;max-width:100%;overflow:hidden;width:100%}.CognitiveDecisioningWrapper-module_header__3542F{align-items:center;background-color:#f4f2ff;border-bottom:1.5px solid #d4dbff;display:flex;gap:8px;justify-content:space-between;padding:8px 12px}.CognitiveDecisioningWrapper-module_headerTitle__72107{align-items:center;display:flex;gap:8px}.CognitiveDecisioningWrapper-module_headerTitleText__-DtFX{color:#1f2937;font-size:14px;font-weight:600}.CognitiveDecisioningWrapper-module_badge__TrxQq{align-items:center;background-color:#fff;border:1.3px solid #bb97f9;border-radius:9999px;color:#1e293b;display:flex;font-size:11px;font-weight:600;gap:4px;padding:2px 10px}.CognitiveDecisioningWrapper-module_pill__zQ6XY{align-items:center;border-radius:6px;cursor:pointer;display:inline-flex;font-family:Plus Jakarta Sans,sans-serif;gap:
|
|
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 i=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;i&&e.setAttribute("nonce",i),e.appendChild(document.createTextNode('@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap");.CognitiveDecisioningWrapper-module_container__ztKXm{background-color:#fff;border:1.5px solid #cacdfa;border-radius:8px;box-shadow:0 2px 4px -1px #0000000d;display:block;font-family:Plus Jakarta Sans,sans-serif;margin-bottom:12px;margin-top:8px;max-width:100%;overflow:hidden;width:100%}.CognitiveDecisioningWrapper-module_header__3542F{align-items:center;background-color:#f4f2ff;border-bottom:1.5px solid #d4dbff;display:flex;gap:8px;justify-content:space-between;padding:8px 12px}.CognitiveDecisioningWrapper-module_headerTitle__72107{align-items:center;display:flex;gap:8px}.CognitiveDecisioningWrapper-module_headerTitleText__-DtFX{color:#1f2937;font-size:14px;font-weight:600}.CognitiveDecisioningWrapper-module_badge__TrxQq{align-items:center;background-color:#fff;border:1.3px solid #bb97f9;border-radius:9999px;color:#1e293b;display:flex;font-size:11px;font-weight:600;gap:4px;padding:2px 10px}.CognitiveDecisioningWrapper-module_pill__zQ6XY{align-items:center;background-color:initial;border:none;border-radius:6px;cursor:pointer;display:inline-flex;font-family:Plus Jakarta Sans,sans-serif;gap:2px;outline:none;padding:4px 6px;transition:all .2s ease}.CognitiveDecisioningWrapper-module_sectionItem__ELgck{border-bottom:1.5px solid #f0f1f7}.CognitiveDecisioningWrapper-module_sectionItem__ELgck:last-child{border-bottom:none}.CognitiveDecisioningWrapper-module_sectionButton__PbbDt{align-items:center;background:none;border:none;cursor:pointer;display:flex;justify-content:space-between;padding:12px;text-align:left;width:100%}.CognitiveDecisioningWrapper-module_sectionHeaderGroup__sJnQq{align-items:center;display:flex;gap:12px}.CognitiveDecisioningWrapper-module_sectionTitle__gHzRy{color:#111827;font-size:14px;font-weight:600;margin:0}.CognitiveDecisioningWrapper-module_sectionSubtitle__ioISB{color:#6b7280;font-size:12px;margin:0}.CognitiveDecisioningWrapper-module_textContent__GJN-Z{color:#4b5563;font-size:14px;line-height:1.6;margin-top:2px;padding-bottom:12px;padding-left:52px;padding-right:16px}'));const n=document.head||document.getElementsByTagName("head")[0]||document.documentElement;n&&n.appendChild(e)}(),exports.default={container:"CognitiveDecisioningWrapper-module_container__ztKXm",header:"CognitiveDecisioningWrapper-module_header__3542F",headerTitle:"CognitiveDecisioningWrapper-module_headerTitle__72107",headerTitleText:"CognitiveDecisioningWrapper-module_headerTitleText__-DtFX",badge:"CognitiveDecisioningWrapper-module_badge__TrxQq",pill:"CognitiveDecisioningWrapper-module_pill__zQ6XY",sectionItem:"CognitiveDecisioningWrapper-module_sectionItem__ELgck",sectionButton:"CognitiveDecisioningWrapper-module_sectionButton__PbbDt",sectionHeaderGroup:"CognitiveDecisioningWrapper-module_sectionHeaderGroup__sJnQq",sectionTitle:"CognitiveDecisioningWrapper-module_sectionTitle__gHzRy",sectionSubtitle:"CognitiveDecisioningWrapper-module_sectionSubtitle__ioISB",textContent:"CognitiveDecisioningWrapper-module_textContent__GJN-Z"};
|
|
2
2
|
//# sourceMappingURL=CognitiveDecisioningWrapper.module.css.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__spreadArray as i,__assign as t}from"tslib";import{jsxs as l,jsx as n}from"react/jsx-runtime";import{useEffect as
|
|
1
|
+
import{__spreadArray as i,__assign as t}from"tslib";import{jsxs as l,jsx as n}from"react/jsx-runtime";import{useRef as o,useEffect as e}from"react";import{highlightTermsFunc as r}from"../utils/highlight.js";import{sanitizeHtml as s}from"../../../utils/sanitizeHtml.js";var d={sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},textBlock:{fontSize:"14px",fontWeight:400,color:"#64748B",marginBottom:"24px"}},h=function(h){var u,a,c,g,p,v,m,y,f=h.data,S=h.highlightTerms,x=h.onHighlightMatch,T=f.copyright,_=f.salesRights,w=o(null);return e(function(){var t,l,n,o,e,r,s,d;if(S&&0!==S.length){var h=i([String(null!==(l=null===(t=f.copyright)||void 0===t?void 0:t.year)&&void 0!==l?l:""),null!==(o=null===(n=f.copyright)||void 0===n?void 0:n.owner)&&void 0!==o?o:"",null!==(r=null===(e=f.salesRights)||void 0===e?void 0:e.description)&&void 0!==r?r:""],null!==(d=null===(s=f.salesRights)||void 0===s?void 0:s.territory)&&void 0!==d?d:[],!0).some(function(i){return!!i&&S.some(function(t){return i.toLowerCase().includes(t.toLowerCase())})});null==x||x(h)}},[S,f]),l("div",t({ref:w},{children:[n("p",t({style:d.sectionTitle},{children:"Copyrights"})),l("div",t({style:d.textBlock},{children:[l("p",{children:["Copyright Year:"," ",S&&S.length>0?n("span",{dangerouslySetInnerHTML:{__html:s(r(String(null!==(u=T.year)&&void 0!==u?u:"NA"),S))}}):null!==(a=T.year)&&void 0!==a?a:"NA"]}),l("p",{children:["Copyright Owner:"," ",S&&S.length>0?n("span",{dangerouslySetInnerHTML:{__html:s(r(null!==(c=T.owner)&&void 0!==c?c:"NA",S))}}):null!==(g=T.owner)&&void 0!==g?g:"NA"]})]})),n("p",t({style:d.sectionTitle},{children:"Sales Rights"})),l("div",t({style:d.textBlock},{children:[n("p",{children:S&&S.length>0?n("span",{dangerouslySetInnerHTML:{__html:s(r(null!==(p=_.description)&&void 0!==p?p:"",S))}}):null!==(v=_.description)&&void 0!==v?v:""}),l("p",{children:["Sales Territory:"," ",S&&S.length>0?n("span",{dangerouslySetInnerHTML:{__html:s(r(null!==(m=_.territory.join(", "))&&void 0!==m?m:"NA",S))}}):null!==(y=_.territory.join(", "))&&void 0!==y?y:"NA"]})]}))]}))};export{h as default};
|
|
2
2
|
//# sourceMappingURL=BookCopyrightsCard.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as t,jsx as n}from"react/jsx-runtime";import{useState as i,useRef as r,useMemo as o,useEffect as l}from"react";import{highlightTermsFunc as s}from"../utils/highlight.js";import{sanitizeHtml as a}from"../../../utils/sanitizeHtml.js";var d={container:{width:"100%"},sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},detailsContainer:{marginBottom:"24px",fontSize:"14px",fontWeight:400,color:"#64748B",display:"flex",flexDirection:"column",gap:"4px",paddingLeft:"12px"},detailsContainerItem:{margin:"4px 0"},boldText:{fontWeight:"bold"},categoriesContainer:{marginBottom:"24px"},categoriesList:{display:"flex",flexWrap:"wrap",gap:"12px",marginBottom:"8px",paddingLeft:"12px"},category:{backgroundColor:"#ECEEF1",padding:"8px 12px",fontWeight:400,fontSize:"12px",borderRadius:"4px",color:"#64748B",maxWidth:"100%",wordBreak:"break-word"},button:{color:"#5928ED",fontSize:"14px",fontWeight:600,background:"none",border:"none",cursor:"pointer",padding:0,textDecoration:"none",paddingLeft:"12px"},reviewsList:{paddingLeft:"12px"},reviewCard:{border:"1px solid #CBD5E1",borderRadius:"6px",padding:"16px",marginBottom:"12px",backgroundColor:"#F8FAFC"},reviewText:{fontSize:"14px",fontStyle:"italic",fontWeight:400,color:"#475569",marginBottom:"8px"},reviewSource:{fontSize:"10px",color:"#475569",fontWeight:600}},c=function(c){var u,g,p,h,m,b,f,v,x,y,C,w,T,N=c.data,k=c.highlightTerms,S=c.onHighlightMatch,I=i(!1),L=I[0],_=I[1],A=i(!1),M=A[0],B=A[1],D=r(null),j=o(function(){return L?N.subjectCategories||[]:(N.subjectCategories||[]).slice(0,10)},[L,N.subjectCategories]);return l(function(){var e,t;if(null==k?void 0:k.length){var n=k.map(function(e){return e.toLowerCase()}),i=function(e){return e&&n.some(function(t){return e.toLowerCase().includes(t)})},r=[N.isbn,N.isbn10,N.imprint,N.publisher,N.publishingDate,N.age].some(i),o=(null!==(e=N.subjectCategories)&&void 0!==e?e:[]).some(i),l=(null!==(t=N.reviews)&&void 0!==t?t:[]).some(function(e){return i(e.replace(/<[^>]+>/g,""))}),s=r||o||l;null==S||S(s),s&&(o&&!L&&_(!0),l&&!M&&B(!0))}},[k,N]),t("div",e({ref:D,style:d.container,className:"book-details-container"},{children:[n("p",e({style:d.sectionTitle,className:"book-details-section-title"},{children:"Product Details"})),t("div",e({style:d.detailsContainer,className:"book-details-details-container"},{children:[t("p",e({style:d.detailsContainerItem},{children:[n("span",e({style:d.boldText},{children:"ISBN:"}))," ",k&&k.length>0?n("span",{dangerouslySetInnerHTML:{__html:a(s(null!==(u=N.isbn)&&void 0!==u?u:"NA",k))}}):null!==(g=N.isbn)&&void 0!==g?g:"NA"]})),t("p",e({style:d.detailsContainerItem},{children:[n("span",e({style:d.boldText},{children:"ISBN 10:"}))," ",k&&k.length>0?n("span",{dangerouslySetInnerHTML:{__html:a(s(null!==(p=N.isbn10)&&void 0!==p?p:"NA",k))}}):null!==(h=N.isbn10)&&void 0!==h?h:"NA"]})),t("p",e({style:d.detailsContainerItem},{children:[n("span",e({style:d.boldText},{children:"Imprint:"}))," ",k&&k.length>0?n("span",{dangerouslySetInnerHTML:{__html:a(s(null!==(m=N.imprint)&&void 0!==m?m:"NA",k))}}):null!==(b=N.imprint)&&void 0!==b?b:"NA"]})),t("p",e({style:d.detailsContainerItem},{children:[n("span",e({style:d.boldText},{children:"Publisher:"}))," ",k&&k.length>0?n("span",{dangerouslySetInnerHTML:{__html:a(s(null!==(f=N.publisher)&&void 0!==f?f:"NA",k))}}):null!==(v=N.publisher)&&void 0!==v?v:"NA"]})),t("p",e({style:d.detailsContainerItem},{children:[n("span",e({style:d.boldText},{children:"Publishing Date:"}))," ",k&&k.length>0?n("span",{dangerouslySetInnerHTML:{__html:a(s(null!==(x=N.publishingDate)&&void 0!==x?x:"NA",k))}}):null!==(y=N.publishingDate)&&void 0!==y?y:"NA"]})),t("p",e({style:d.detailsContainerItem},{children:[n("span",e({style:d.boldText},{children:"Age:"}))," ",k&&k.length>0?n("span",{dangerouslySetInnerHTML:{__html:a(s(null!==(C=N.age)&&void 0!==C?C:"NA",k))}}):null!==(w=N.age)&&void 0!==w?w:"NA"]}))]})),t("div",e({style:d.categoriesContainer},{children:[n("p",e({style:d.sectionTitle,className:"book-details-section-title"},{children:"Subject Categories"})),t("div",e({style:d.categoriesList,className:"book-details-categories-list"},{children:[j.map(function(t,i){return n("span",e({style:d.category,className:"book-details-category"},{children:k&&k.length>0?n("span",{dangerouslySetInnerHTML:{__html:a(s(t,k))}}):t}),i)}),N.subjectCategories&&N.subjectCategories.length>10&&n("button",e({style:d.button,onClick:function(){return _(!L)},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:L?"View less":"View more"}))]}))]})),t("div",e({style:d.reviewsContainer},{children:[n("p",e({style:d.sectionTitle,className:"book-details-section-title"},{children:"Book Marketing Collateral"})),t("div",e({style:d.reviewsList,className:"book-details-reviews-list"},{children:[N.reviews&&N.reviews.length>0?(T=N.reviews.filter(function(e){return e.replace(/<[^>]+>/g,"").trim().replace(/&[#A-Za-z0-9]+;/g,"").trim().length>0}),(M?T:T.slice(0,3)).map(function(t,i){return n("div",e({style:d.reviewCard,className:"book-details-review-card"},{children:n("div",{style:d.reviewText,dangerouslySetInnerHTML:{__html:k&&k.length>0?a(s(t,k)):t}})}),i)})):n("p",e({style:d.reviewText},{children:"No Book Marketing Collateral available for this book."})),N.reviews&&N.reviews.length>3&&n("button",e({style:d.button,onClick:function(){return B(function(e){return!e})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:M?"View less":"View more"}))]}))]}))]}))};export{c as default};
|
|
2
2
|
//# sourceMappingURL=BookDetailsCard.js.map
|