@e-llm-studio/citation 0.0.138 → 0.0.140

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.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),a=require("react/jsx-runtime"),n=require("react"),t=require("./BookCitation.module.css.js"),i=require("./text-cleaner.js");exports.default=function(o){var c=o.title,s=o.author,r=o.paragraphs,l=o.chevronUpComponent,d=o.chevronDownComponent,u=o.externalLinkComponent,f=o.textToHighlight,h=o.pageNumber,v=o.totalPageNumber,m=void 0===v?null:v,p=o.citationTitle;o.customStyle;var g=o.handleExternalLinkClick,x=o.bookCoverImage,_=o.partialMatch,N=void 0!==_&&_,j=o.citationNumber,b=void 0===j?1:j,C=o.defaultState,k=void 0!==C&&C,E=o.isNonHighlightedBlur,T=void 0!==E&&E,q=o.toggleBlur,y=void 0===q?T:q,A=o.fixedWidth,L=void 0===A||A,w=o.isBookemon,I=void 0!==w&&w,B=n.useState(k),M=B[0],H=B[1],W=["address","article","aside","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","li","main","nav","noscript","ol","p","pre","section","table","tfoot","ul","video"];n.useEffect(function(){if(M){var e,a="quotes-citations-".concat(null!=b?b:""),n=!1;return requestAnimationFrame(function(){requestAnimationFrame(function(){e=function(){var e=document.getElementById(a);if(e&&!n){e.scrollIntoView({behavior:"smooth",block:"center"});var t=setTimeout(function(){if(!n){var a=e.getBoundingClientRect(),t=window.innerHeight/2;Math.abs(a.top-t)>40&&e.scrollIntoView({behavior:"auto",block:"center"})}},400);return function(){return clearTimeout(t)}}}()||void 0})}),function(){n=!0,e&&e()}}},[M,f,b]);var S=function(e){void 0===e&&(e="");var a=document.createElement("div");a.innerHTML=e;var n=a.textContent||a.innerText||"";return(n=(n=n.replace(/<\/?[^>]+(>|$)/g,"")).replace(/\s+/g," ")).trim()};function O(e){var a=document.createElement("div");a.innerHTML=e;var n=t.default.highlighted,i=function(e,a){var o,c;if(void 0===a&&(a=!1),e.nodeType===Node.TEXT_NODE){if(!a&&(null===(o=e.textContent)||void 0===o?void 0:o.trim())){var s=document.createElement("span");s.classList.add(t.default.blurred),s.textContent=e.textContent,null===(c=e.parentNode)||void 0===c||c.replaceChild(s,e)}}else if(e.nodeType===Node.ELEMENT_NODE){var r=e,l=r.classList.contains(n);Array.from(r.childNodes).forEach(function(e){return i(e,a||l)})}};return Array.from(a.childNodes).forEach(function(e){return i(e)}),a.innerHTML}function R(e,a,n,i,o,c){void 0===o&&(o=[]),void 0===c&&(c=!1);var s,r=t.default.highlighted,l=t.default.highlightedInline,d=t.default.highlightedBlock,u="".concat(r," ").concat(l),f="".concat(r," ").concat(d),h=a,v=(s=document.createElement("textarea"),function(e){return s.innerHTML=e,s.value});if(o.length>0){if(c){return o.forEach(function(e){e&&(h=function(e,a,n){for(var t='<span id="'.concat(n,'" class="').concat(u,'">'),i="</span>",o=e,c=0,s=new RegExp("(<(?:".concat(W.join("|"),")[^>]*>.*?)(?=<(?:").concat(W.join("|"),")|$)"),"gi"),r=(a.match(s)||[a]).map(function(e){var a=e.match(/^<([a-zA-Z0-9]+)([^>]*)>/);if(a&&W.includes(a[1].toLowerCase())){var n=a[0].length;return a[0]+t+e.slice(n)+i}return t+e+i}).join("");;){var l=o.indexOf(a,c);if(-1===l)break;o=o.slice(0,l)+r+o.slice(l+a.length),c=l+r.length}var f=d;return o.replace(/<span([^>]*)>([\s\S]*?)<\/span>/gi,function(e,a,n){if(W.some(function(e){return new RegExp("<".concat(e,"\\b[^>]*>"),"i").test(n)})){var t=a.match(/\sclass\s*=\s*(['"])(.*?)\1/);if(t){var i=t[2],o=i.split(/\s+/).includes(f)?i:"".concat(i," ").concat(f);a=a.replace(t[0],' class="'.concat(o,'"'))}else a+=' class="'.concat(f,'"')}return"<span".concat(a,">").concat(n,"</span>")})}(h,e,"Annotation"===n?"quotes-annotations-".concat(null!=i?i:""):"quotes-citations-".concat(null!=i?i:"")))}),T&&y?O(h):h}return o.forEach(function(e){var t=v(e).trim();if(t&&v(a).trim().toLowerCase()===t.toLowerCase()){var o="Annotation"===n?"quotes-annotations-".concat(null!=i?i:""):"quotes-citations-".concat(null!=i?i:"");h='<span id="'.concat(o,'" class="').concat(f,'">').concat(a,"</span>")}}),T&&y?O(h):h}var m=f;if(!e||!a)return"Annotation"===n?a:'<span id="quotes-citations" class="'.concat(m,'">').concat(a,"</span>");var p=Array.from(e.matchAll(/`([^`]+)`/g));if(0===p.length)return"Annotation"===n?a:'<span id="quotes-citations" class="'.concat(m,'">').concat(a,"</span>");h=a;var g=!1;return p.forEach(function(e){var a=v(e[1]).trim();if(a){var t=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=new RegExp("(".concat(t,")"),"gi");h.match(i)&&(g=!0,h=h.replace(i,'<span id="'.concat("Annotation"===n?"quotes-annotations":"quotes-citations",'" class="').concat(m,'">$1</span>')))}}),g?h:"Annotation"===n?a:'<span id="quotes-citations" class="'.concat(m,'">').concat(a,"</span>")}return a.jsx(a.Fragment,{children:a.jsxs("span",e.__assign({className:"".concat(t.default.relativeWrapper," ").concat(I?t.default.height95percent+" "+t.default.displayFlex:t.default.height100percent)},{children:[!k&&a.jsx("div",e.__assign({className:t.default.citationButtonWrapper},{children:a.jsxs("div",e.__assign({onClick:function(){return H(function(e){return!e})},className:t.default.citationButton},{children:[a.jsx("span",e.__assign({className:t.default.citationText},{children:p})),M?l:d]}))})),M&&a.jsx("div",e.__assign({className:t.default.expandedWrapper},{children:a.jsx("div",e.__assign({className:"".concat(t.default.expandableContainer," ").concat(L?t.default.expandableContainerWidth:"")},{children:a.jsx("div",e.__assign({className:t.default.expandableContent},{children:a.jsxs("div",e.__assign({className:t.default.bookBodyContent},{children:[!k&&a.jsx("div",e.__assign({className:t.default.header},{children:a.jsxs("div",e.__assign({className:t.default.bookInfo},{children:[x&&a.jsx("div",e.__assign({className:t.default.bookImageWrapper},{children:a.jsx("img",{src:x,alt:c||"Book cover",className:t.default.bookImage})})),a.jsxs("div",e.__assign({className:t.default.bookTextInfo},{children:[a.jsx("h1",e.__assign({className:t.default.bookTitle},{children:c})),s||Array.isArray(s)&&a.jsxs("p",e.__assign({className:t.default.bookAuthor},{children:["by"," ",Array.isArray(s)?s.join(", "):s||""]}))]})),a.jsx("div",e.__assign({onClick:g,className:t.default.externalLink},{children:u}))]}))})),a.jsx("div",e.__assign({className:t.default.relativeContainer},{children:a.jsx("div",e.__assign({className:t.default.container},{children:a.jsxs("div",e.__assign({className:"".concat(t.default.contentWrapper," ").concat(t.default.customScrollbarClass," ").concat(I?"":t.default.maxheight38rem)},{children:[a.jsx("div",{className:t.default.gradientOverlayLeft}),a.jsx("div",{className:t.default.gradientOverlayRight}),a.jsxs("div",e.__assign({className:t.default.contentWrapper},{children:[r.map(function(e,n){i.cleanScannedText(e);var o=(N?e.includes(f[0]):f.some(function(a){return S(e).toLowerCase()===S(a).toLowerCase()}))?R(r.join("\n"),e,"Citation",b,f,N):e;return a.jsx("div",{className:"".concat(t.default.paragraph," ").concat(0!==n?t.default.textIndent:""),dangerouslySetInnerHTML:{__html:o}},n)}),h&&a.jsx("div",e.__assign({className:t.default.pageIndex},{children:a.jsxs("div",e.__assign({className:t.default.pageLabel},{children:[h," ",m&&"of ".concat(m)]}))}))]}))]}))}))}))]}))}))}))}))]}))})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),a=require("./BookCitation.module.css.js"),i=require("./text-cleaner.js");exports.default=function(o){var s,r=o.title,c=o.author,l=o.paragraphs,d=o.chevronUpComponent,u=o.chevronDownComponent,f=o.externalLinkComponent,v=o.textToHighlight,h=o.pageNumber,p=o.totalPageNumber,m=void 0===p?null:p,g=o.citationTitle,x=o.customStyle,_=void 0===x?{}:x,j=o.handleExternalLinkClick,N=o.bookCoverImage,b=o.partialMatch,y=void 0!==b&&b,C=o.citationNumber,k=void 0===C?1:C,E=o.defaultState,T=void 0!==E&&E,q=o.isNonHighlightedBlur,A=void 0!==q&&q,L=o.toggleBlur,w=void 0===L?A:L,B=o.fixedWidth,I=void 0===B||B,W=o.isBookemon,H=void 0!==W&&W,M=t.useState(T),S=M[0],O=M[1],F=null===(s=null==_?void 0:_.showGradientOverlay)||void 0===s||s,R=["address","article","aside","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","li","main","nav","noscript","ol","p","pre","section","table","tfoot","ul","video"];t.useEffect(function(){if(S){var e,n="quotes-citations-".concat(null!=k?k:""),t=!1;return requestAnimationFrame(function(){requestAnimationFrame(function(){e=function(){var e=document.getElementById(n);if(e&&!t){e.scrollIntoView({behavior:"smooth",block:"center"});var a=setTimeout(function(){if(!t){var n=e.getBoundingClientRect(),a=window.innerHeight/2;Math.abs(n.top-a)>40&&e.scrollIntoView({behavior:"auto",block:"center"})}},400);return function(){return clearTimeout(a)}}}()||void 0})}),function(){t=!0,e&&e()}}},[S,v,k]);var $=function(e){void 0===e&&(e="");var n=document.createElement("div");n.innerHTML=e;var t=n.textContent||n.innerText||"";return(t=(t=t.replace(/<\/?[^>]+(>|$)/g,"")).replace(/\s+/g," ")).trim()};function D(e){var n=document.createElement("div");n.innerHTML=e;var t=a.default.highlighted,i=function(e,n){var o,s;if(void 0===n&&(n=!1),e.nodeType===Node.TEXT_NODE){if(!n&&(null===(o=e.textContent)||void 0===o?void 0:o.trim())){var r=document.createElement("span");r.classList.add(a.default.blurred),r.textContent=e.textContent,null===(s=e.parentNode)||void 0===s||s.replaceChild(r,e)}}else if(e.nodeType===Node.ELEMENT_NODE){var c=e,l=c.classList.contains(t);Array.from(c.childNodes).forEach(function(e){return i(e,n||l)})}};return Array.from(n.childNodes).forEach(function(e){return i(e)}),n.innerHTML}function P(e,n,t,i,o,s){void 0===o&&(o=[]),void 0===s&&(s=!1);var r,c=a.default.highlighted,l=a.default.highlightedInline,d=a.default.highlightedBlock,u="".concat(c," ").concat(l),f="".concat(c," ").concat(d),v=n,h=(r=document.createElement("textarea"),function(e){return r.innerHTML=e,r.value});if(o.length>0){if(s){return o.forEach(function(e){e&&(v=function(e,n,t){for(var a='<span id="'.concat(t,'" class="').concat(u,'">'),i="</span>",o=e,s=0,r=new RegExp("(<(?:".concat(R.join("|"),")[^>]*>.*?)(?=<(?:").concat(R.join("|"),")|$)"),"gi"),c=(n.match(r)||[n]).map(function(e){var n=e.match(/^<([a-zA-Z0-9]+)([^>]*)>/);if(n&&R.includes(n[1].toLowerCase())){var t=n[0].length;return n[0]+a+e.slice(t)+i}return a+e+i}).join("");;){var l=o.indexOf(n,s);if(-1===l)break;o=o.slice(0,l)+c+o.slice(l+n.length),s=l+c.length}var f=d;return o.replace(/<span([^>]*)>([\s\S]*?)<\/span>/gi,function(e,n,t){if(R.some(function(e){return new RegExp("<".concat(e,"\\b[^>]*>"),"i").test(t)})){var a=n.match(/\sclass\s*=\s*(['"])(.*?)\1/);if(a){var i=a[2],o=i.split(/\s+/).includes(f)?i:"".concat(i," ").concat(f);n=n.replace(a[0],' class="'.concat(o,'"'))}else n+=' class="'.concat(f,'"')}return"<span".concat(n,">").concat(t,"</span>")})}(v,e,"Annotation"===t?"quotes-annotations-".concat(null!=i?i:""):"quotes-citations-".concat(null!=i?i:"")))}),A&&w?D(v):v}return o.forEach(function(e){var a=h(e).trim();if(a&&h(n).trim().toLowerCase()===a.toLowerCase()){var o="Annotation"===t?"quotes-annotations-".concat(null!=i?i:""):"quotes-citations-".concat(null!=i?i:"");v='<span id="'.concat(o,'" class="').concat(f,'">').concat(n,"</span>")}}),A&&w?D(v):v}var p=f;if(!e||!n)return"Annotation"===t?n:'<span id="quotes-citations" class="'.concat(p,'">').concat(n,"</span>");var m=Array.from(e.matchAll(/`([^`]+)`/g));if(0===m.length)return"Annotation"===t?n:'<span id="quotes-citations" class="'.concat(p,'">').concat(n,"</span>");v=n;var g=!1;return m.forEach(function(e){var n=h(e[1]).trim();if(n){var a=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=new RegExp("(".concat(a,")"),"gi");v.match(i)&&(g=!0,v=v.replace(i,'<span id="'.concat("Annotation"===t?"quotes-annotations":"quotes-citations",'" class="').concat(p,'">$1</span>')))}}),g?v:"Annotation"===t?n:'<span id="quotes-citations" class="'.concat(p,'">').concat(n,"</span>")}return n.jsx(n.Fragment,{children:n.jsxs("span",e.__assign({className:"".concat(a.default.relativeWrapper," ").concat(H?a.default.height95percent+" "+a.default.displayFlex:a.default.height100percent),style:null==_?void 0:_.relativeWrapper},{children:[!T&&n.jsx("div",e.__assign({className:a.default.citationButtonWrapper,style:null==_?void 0:_.citationButtonWrapper},{children:n.jsxs("div",e.__assign({onClick:function(){return O(function(e){return!e})},className:a.default.citationButton,style:null==_?void 0:_.citationButton},{children:[n.jsx("span",e.__assign({className:a.default.citationText},{children:g})),n.jsx("span",e.__assign({style:null==_?void 0:_.arrow},{children:S?d:u}))]}))})),S&&n.jsx("div",e.__assign({className:a.default.expandedWrapper,style:null==_?void 0:_.expandedWrapper},{children:n.jsx("div",e.__assign({className:"".concat(a.default.expandableContainer," ").concat(I?a.default.expandableContainerWidth:""),style:null==_?void 0:_.expandableContainer},{children:n.jsx("div",e.__assign({className:a.default.expandableContent,style:null==_?void 0:_.expandableContent},{children:n.jsxs("div",e.__assign({className:a.default.bookBodyContent,style:null==_?void 0:_.bookBodyContent},{children:[!T&&n.jsx("div",e.__assign({className:a.default.header,style:null==_?void 0:_.bookHeader},{children:n.jsxs("div",e.__assign({className:a.default.bookInfo},{children:[N&&n.jsx("div",e.__assign({className:a.default.bookImageWrapper},{children:n.jsx("img",{src:N,alt:r||"Book cover",className:a.default.bookImage})})),n.jsxs("div",e.__assign({className:a.default.bookTextInfo},{children:[n.jsx("h1",e.__assign({className:a.default.bookTitle},{children:r})),c||Array.isArray(c)&&n.jsxs("p",e.__assign({className:a.default.bookAuthor},{children:["by"," ",Array.isArray(c)?c.join(", "):c||""]}))]})),n.jsx("div",e.__assign({onClick:j,className:a.default.externalLink},{children:f}))]}))})),n.jsx("div",e.__assign({className:a.default.relativeContainer,style:null==_?void 0:_.relative},{children:n.jsx("div",e.__assign({className:a.default.container},{children:n.jsxs("div",e.__assign({className:"".concat(a.default.contentWrapper," ").concat(a.default.customScrollbarClass," ").concat(H?"":a.default.maxheight38rem),style:null==_?void 0:_.customScrollbarClass},{children:[F&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:a.default.gradientOverlayLeft}),n.jsx("div",{className:a.default.gradientOverlayRight})]}),n.jsxs("div",e.__assign({className:a.default.contentWrapper},{children:[l.map(function(e,t){i.cleanScannedText(e);var o=(y?e.includes(v[0]):v.some(function(n){return $(e).toLowerCase()===$(n).toLowerCase()}))?P(l.join("\n"),e,"Citation",k,v,y):e;return n.jsx("div",{className:"".concat(a.default.paragraph," ").concat(0!==t?a.default.textIndent:""),dangerouslySetInnerHTML:{__html:o}},t)}),h&&n.jsx("div",e.__assign({className:a.default.pageIndex},{children:n.jsxs("div",e.__assign({className:a.default.pageLabel,style:null==_?void 0:_.pageColor},{children:[h," ",m&&"of ".concat(m)]}))}))]}))]}))}))}))]}))}))}))}))]}))})};
2
2
  //# sourceMappingURL=BookCitation.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});!function(){if("undefined"==typeof document)return;if(document.getElementById("bookCitationStyles"))return;const o=document.createElement("style");o.id="bookCitationStyles",o.type="text/css";const t=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;t&&o.setAttribute("nonce",t),o.appendChild(document.createTextNode(".BookCitation-module_relativeWrapper__jFpTh{position:relative;width:100%}.BookCitation-module_displayFlex__iMb2e{align-items:center;display:flex;justify-content:center}.BookCitation-module_height95percent__kWGUx{height:90%}.BookCitation-module_height100percent__zQeLG{height:100%}.BookCitation-module_relativeContainer__HLngm{height:100%;min-height:0;position:relative}.BookCitation-module_citationButtonWrapper__einPL{color:#be87ff;cursor:pointer;display:inline-block;height:100%;margin-right:.25rem}.BookCitation-module_citationButton__8U9MO{align-items:center;background-color:initial;border:none;border-radius:9999px;color:#d63384;cursor:pointer;display:inline-flex;font-family:Plus Jakarta Sans,sans-serif;font-size:16px;font-weight:700;margin:0;padding:0;text-decoration:none;white-space:normal;width:fit-content;word-break:break-word}.BookCitation-module_citationText__aH2j-{align-items:center;display:flex;justify-content:center;text-align:center}.BookCitation-module_pageText__nEM69{margin-left:6px}.BookCitation-module_expandedWrapper__roHmf{align-items:center;display:flex;height:100%;justify-content:start;min-height:0}.BookCitation-module_expandableContainer__yNmEx{height:100%;left:0;margin-top:.5rem;min-height:0;top:100%;width:100%;z-index:49}.BookCitation-module_expandableContainerWidth__O7mEU{width:32rem}.BookCitation-module_expandableContent__AvgFX{background-color:#fff;border:1px solid #60a3f8;border-radius:8px;box-shadow:0 1.694px 6.775px 0 #0000000d,0 37.262px 40.65px -10.162px #00000026,0 0 20.325px 3.387px #0000000d;color:#fff;height:fit-content;height:100%;margin-bottom:1.5rem;min-height:0;padding:.75rem}.BookCitation-module_bookBodyContent__a20pD{height:100%;margin:0 auto;min-height:0}.BookCitation-module_header__kMSfc{display:flex;justify-content:space-between;margin-bottom:1rem}.BookCitation-module_bookInfo__AzKFV{align-items:center;display:flex;gap:1rem;justify-content:center;width:100%}.BookCitation-module_bookImageWrapper__JNna7{flex-shrink:0}.BookCitation-module_bookImage__CXga1{height:70px;object-fit:cover;width:70px}.BookCitation-module_bookTextInfo__zVuts{display:flex;flex-direction:column;gap:.1rem}.BookCitation-module_bookTitle__lHfz0{color:#60a3f8;font-family:Inter,sans-serif;font-size:1rem;font-weight:700;line-height:1;margin:0}.BookCitation-module_bookAuthor__Chqif{color:#60a3f8;font-family:Inter,sans-serif;font-size:.8rem;font-weight:500;line-height:1;margin:0}.BookCitation-module_externalLink__cQ3aM{margin-left:auto}.BookCitation-module_audioHover__XquBK{border-radius:.5rem;transition:background-color .2s}.BookCitation-module_audioHover__XquBK:hover{background-color:#fff3}.BookCitation-module_audioIcon__hoXWS{width:5rem}.BookCitation-module_container__msLn5{background-color:#fff;border-radius:.75rem;box-shadow:0 4px 6px #0000001a;display:flex;flex-direction:column;height:100%;margin-left:auto;margin-right:auto;max-width:100%;position:relative;width:100%}.BookCitation-module_gradientOverlayLeft__vKN9H{background:linear-gradient(270deg,#000 0,#000000b3 40%,#0006 70%,#0000);bottom:0;box-shadow:-4px 0 8px #0000001a;opacity:.5;pointer-events:none;position:absolute;right:20px;top:0;width:16px;z-index:0}.BookCitation-module_gradientOverlayRight__lElq0{background:linear-gradient(90deg,#000 0,#0009 40%,#0003 70%,#0000);bottom:0;box-shadow:4px 0 8px #0000001a;opacity:.5;pointer-events:none;position:absolute;right:5px;top:0;width:16px;z-index:0}.BookCitation-module_contentWrapper__2y1ae{display:flex;flex-direction:column;height:100%;overflow-y:auto;padding-right:.94rem;position:relative;word-break:break-word;z-index:0}.BookCitation-module_paragraph__9gQDG{height:100%;margin-bottom:1rem;text-align:justify}.BookCitation-module_textIndent__ejJaC{text-indent:1rem}.BookCitation-module_pageIndex__wUixS{margin-top:auto;padding:.5rem 0;text-align:right}.BookCitation-module_pageLabel__NZ6CE{border-radius:9999px;color:#4b5563;display:inline-block;font-size:1rem;font-weight:500;padding:.25rem .75rem}.BookCitation-module_highlighted__n9p6V{background-color:#eaea79;font-weight:700}.BookCitation-module_highlightedInline__Vaoms{display:inline}.BookCitation-module_highlightedBlock__c-R3J{display:block}.BookCitation-module_blurred__E0v59{filter:blur(2px);pointer-events:none;user-select:none}.BookCitation-module_customScrollbarClass__mwGyt{background-color:#f5f4f4;border:1px solid #cbd5e1;border-radius:.5rem;color:#181b1f;font-family:Times New Roman,Times,serif;font-size:14.4px;font-weight:400;letter-spacing:0;line-height:100%;overflow:auto;padding:40px 50px 0 20px}.BookCitation-module_maxheight38rem__8icW1{max-height:38rem}.BookCitation-module_customScrollbarClass__mwGyt::-webkit-scrollbar{height:0;width:0}.BookCitation-module_customScrollbarClass__mwGyt::-webkit-scrollbar-track{background:#0000}.BookCitation-module_customScrollbarClass__mwGyt::-webkit-scrollbar-thumb{background-color:#a3a4ae;border-radius:10px}.BookCitation-module_customScrollbarClass__mwGyt::-webkit-scrollbar-button{display:none}"));const e=document.head||document.getElementsByTagName("head")[0]||document.documentElement;e&&e.appendChild(o)}(),exports.default={relativeWrapper:"BookCitation-module_relativeWrapper__jFpTh",displayFlex:"BookCitation-module_displayFlex__iMb2e",height95percent:"BookCitation-module_height95percent__kWGUx",height100percent:"BookCitation-module_height100percent__zQeLG",relativeContainer:"BookCitation-module_relativeContainer__HLngm",citationButtonWrapper:"BookCitation-module_citationButtonWrapper__einPL",citationButton:"BookCitation-module_citationButton__8U9MO",citationText:"BookCitation-module_citationText__aH2j-",pageText:"BookCitation-module_pageText__nEM69",expandedWrapper:"BookCitation-module_expandedWrapper__roHmf",expandableContainer:"BookCitation-module_expandableContainer__yNmEx",expandableContainerWidth:"BookCitation-module_expandableContainerWidth__O7mEU",expandableContent:"BookCitation-module_expandableContent__AvgFX",bookBodyContent:"BookCitation-module_bookBodyContent__a20pD",header:"BookCitation-module_header__kMSfc",bookInfo:"BookCitation-module_bookInfo__AzKFV",bookImageWrapper:"BookCitation-module_bookImageWrapper__JNna7",bookImage:"BookCitation-module_bookImage__CXga1",bookTextInfo:"BookCitation-module_bookTextInfo__zVuts",bookTitle:"BookCitation-module_bookTitle__lHfz0",bookAuthor:"BookCitation-module_bookAuthor__Chqif",externalLink:"BookCitation-module_externalLink__cQ3aM",audioHover:"BookCitation-module_audioHover__XquBK",audioIcon:"BookCitation-module_audioIcon__hoXWS",container:"BookCitation-module_container__msLn5",gradientOverlayLeft:"BookCitation-module_gradientOverlayLeft__vKN9H",gradientOverlayRight:"BookCitation-module_gradientOverlayRight__lElq0",contentWrapper:"BookCitation-module_contentWrapper__2y1ae",paragraph:"BookCitation-module_paragraph__9gQDG",textIndent:"BookCitation-module_textIndent__ejJaC",pageIndex:"BookCitation-module_pageIndex__wUixS",pageLabel:"BookCitation-module_pageLabel__NZ6CE",highlighted:"BookCitation-module_highlighted__n9p6V",highlightedInline:"BookCitation-module_highlightedInline__Vaoms",highlightedBlock:"BookCitation-module_highlightedBlock__c-R3J",blurred:"BookCitation-module_blurred__E0v59",customScrollbarClass:"BookCitation-module_customScrollbarClass__mwGyt",maxheight38rem:"BookCitation-module_maxheight38rem__8icW1"};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});!function(){if("undefined"==typeof document)return;if(document.getElementById("bookCitationStyles"))return;const o=document.createElement("style");o.id="bookCitationStyles",o.type="text/css";const t=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;t&&o.setAttribute("nonce",t),o.appendChild(document.createTextNode(".BookCitation-module_relativeWrapper__jFpTh{position:relative;width:100%}.BookCitation-module_displayFlex__iMb2e{align-items:center;display:flex;justify-content:center}.BookCitation-module_height95percent__kWGUx{height:90%}.BookCitation-module_height100percent__zQeLG{height:100%}.BookCitation-module_relativeContainer__HLngm{height:100%;min-height:0;position:relative}.BookCitation-module_citationButtonWrapper__einPL{color:#be87ff;cursor:pointer;display:inline-block;height:100%;margin-right:.25rem}.BookCitation-module_citationButton__8U9MO{align-items:center;background-color:initial;border:none;border-radius:9999px;color:#d63384;cursor:pointer;display:inline-flex;font-family:Plus Jakarta Sans,sans-serif;font-size:16px;font-weight:700;margin:0;padding:0;text-decoration:none;white-space:normal;width:fit-content;word-break:break-word}.BookCitation-module_citationText__aH2j-{align-items:center;display:flex;justify-content:center;text-align:center}.BookCitation-module_pageText__nEM69{margin-left:6px}.BookCitation-module_expandedWrapper__roHmf{align-items:center;display:flex;height:100%;justify-content:start;min-height:0}.BookCitation-module_expandableContainer__yNmEx{height:100%;left:0;margin-top:.5rem;min-height:0;top:100%;width:100%;z-index:49}.BookCitation-module_expandableContainerWidth__O7mEU{width:32rem}.BookCitation-module_expandableContent__AvgFX{background-color:#fff;border:1px solid #60a3f8;border-radius:8px;box-shadow:0 1.694px 6.775px 0 #0000000d,0 37.262px 40.65px -10.162px #00000026,0 0 20.325px 3.387px #0000000d;color:#fff;height:fit-content;height:100%;margin-bottom:1.5rem;min-height:0;padding:.75rem}.BookCitation-module_bookBodyContent__a20pD{height:100%;margin:0 auto;min-height:0}.BookCitation-module_header__kMSfc{display:flex;justify-content:space-between;margin-bottom:1rem}.BookCitation-module_bookInfo__AzKFV{align-items:center;display:flex;gap:1rem;justify-content:center;width:100%}.BookCitation-module_bookImageWrapper__JNna7{flex-shrink:0}.BookCitation-module_bookImage__CXga1{height:70px;object-fit:cover;width:70px}.BookCitation-module_bookTextInfo__zVuts{display:flex;flex-direction:column;gap:.1rem}.BookCitation-module_bookTitle__lHfz0{font-family:Inter,sans-serif;font-size:1rem;font-weight:700;line-height:1;margin:0}.BookCitation-module_bookAuthor__Chqif{font-family:Inter,sans-serif;font-size:.8rem;font-weight:500;line-height:1;margin:0}.BookCitation-module_externalLink__cQ3aM{margin-left:auto}.BookCitation-module_audioHover__XquBK{border-radius:.5rem;transition:background-color .2s}.BookCitation-module_audioHover__XquBK:hover{background-color:#fff3}.BookCitation-module_audioIcon__hoXWS{width:5rem}.BookCitation-module_container__msLn5{background-color:#fff;border-radius:.75rem;box-shadow:0 4px 6px #0000001a;display:flex;flex-direction:column;height:100%;margin-left:auto;margin-right:auto;max-width:100%;position:relative;width:100%}.BookCitation-module_gradientOverlayLeft__vKN9H{background:linear-gradient(270deg,#000 0,#000000b3 40%,#0006 70%,#0000);bottom:0;box-shadow:-4px 0 8px #0000001a;opacity:.5;pointer-events:none;position:absolute;right:20px;top:0;width:16px;z-index:0}.BookCitation-module_gradientOverlayRight__lElq0{background:linear-gradient(90deg,#000 0,#0009 40%,#0003 70%,#0000);bottom:0;box-shadow:4px 0 8px #0000001a;opacity:.5;pointer-events:none;position:absolute;right:5px;top:0;width:16px;z-index:0}.BookCitation-module_contentWrapper__2y1ae{display:flex;flex-direction:column;height:100%;overflow-y:auto;padding-right:.94rem;position:relative;word-break:break-word;z-index:0}.BookCitation-module_paragraph__9gQDG{height:100%;margin-bottom:1rem;text-align:justify}.BookCitation-module_textIndent__ejJaC{text-indent:1rem}.BookCitation-module_pageIndex__wUixS{margin-top:auto;padding:.5rem 0;text-align:right}.BookCitation-module_pageLabel__NZ6CE{border-radius:9999px;color:#4b5563;display:inline-block;font-size:1rem;font-weight:500;padding:.25rem .75rem}.BookCitation-module_highlighted__n9p6V{background-color:#eaea79;font-weight:700}.BookCitation-module_highlightedInline__Vaoms{display:inline}.BookCitation-module_highlightedBlock__c-R3J{display:block}.BookCitation-module_blurred__E0v59{filter:blur(2px);pointer-events:none;user-select:none}.BookCitation-module_customScrollbarClass__mwGyt{background-color:#f5f4f4;border:1px solid #cbd5e1;border-radius:.5rem;color:#181b1f;font-family:Times New Roman,Times,serif;font-size:14.4px;font-weight:400;letter-spacing:0;line-height:100%;overflow:auto;padding:40px 50px 0 20px}.BookCitation-module_maxheight38rem__8icW1{max-height:38rem}.BookCitation-module_customScrollbarClass__mwGyt::-webkit-scrollbar{height:0;width:0}.BookCitation-module_customScrollbarClass__mwGyt::-webkit-scrollbar-track{background:#0000}.BookCitation-module_customScrollbarClass__mwGyt::-webkit-scrollbar-thumb{background-color:#a3a4ae;border-radius:10px}.BookCitation-module_customScrollbarClass__mwGyt::-webkit-scrollbar-button{display:none}"));const e=document.head||document.getElementsByTagName("head")[0]||document.documentElement;e&&e.appendChild(o)}(),exports.default={relativeWrapper:"BookCitation-module_relativeWrapper__jFpTh",displayFlex:"BookCitation-module_displayFlex__iMb2e",height95percent:"BookCitation-module_height95percent__kWGUx",height100percent:"BookCitation-module_height100percent__zQeLG",relativeContainer:"BookCitation-module_relativeContainer__HLngm",citationButtonWrapper:"BookCitation-module_citationButtonWrapper__einPL",citationButton:"BookCitation-module_citationButton__8U9MO",citationText:"BookCitation-module_citationText__aH2j-",pageText:"BookCitation-module_pageText__nEM69",expandedWrapper:"BookCitation-module_expandedWrapper__roHmf",expandableContainer:"BookCitation-module_expandableContainer__yNmEx",expandableContainerWidth:"BookCitation-module_expandableContainerWidth__O7mEU",expandableContent:"BookCitation-module_expandableContent__AvgFX",bookBodyContent:"BookCitation-module_bookBodyContent__a20pD",header:"BookCitation-module_header__kMSfc",bookInfo:"BookCitation-module_bookInfo__AzKFV",bookImageWrapper:"BookCitation-module_bookImageWrapper__JNna7",bookImage:"BookCitation-module_bookImage__CXga1",bookTextInfo:"BookCitation-module_bookTextInfo__zVuts",bookTitle:"BookCitation-module_bookTitle__lHfz0",bookAuthor:"BookCitation-module_bookAuthor__Chqif",externalLink:"BookCitation-module_externalLink__cQ3aM",audioHover:"BookCitation-module_audioHover__XquBK",audioIcon:"BookCitation-module_audioIcon__hoXWS",container:"BookCitation-module_container__msLn5",gradientOverlayLeft:"BookCitation-module_gradientOverlayLeft__vKN9H",gradientOverlayRight:"BookCitation-module_gradientOverlayRight__lElq0",contentWrapper:"BookCitation-module_contentWrapper__2y1ae",paragraph:"BookCitation-module_paragraph__9gQDG",textIndent:"BookCitation-module_textIndent__ejJaC",pageIndex:"BookCitation-module_pageIndex__wUixS",pageLabel:"BookCitation-module_pageLabel__NZ6CE",highlighted:"BookCitation-module_highlighted__n9p6V",highlightedInline:"BookCitation-module_highlightedInline__Vaoms",highlightedBlock:"BookCitation-module_highlightedBlock__c-R3J",blurred:"BookCitation-module_blurred__E0v59",customScrollbarClass:"BookCitation-module_customScrollbarClass__mwGyt",maxheight38rem:"BookCitation-module_maxheight38rem__8icW1"};
2
2
  //# sourceMappingURL=BookCitation.module.css.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"),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(/&nbsp;/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})]}))]}))};
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"),f=require("@mui/icons-material/ExpandMore"),p=require("@mui/icons-material/Close");function v(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var _=v(o),m=v(r),y=v(a),b=v(l),j=v(s),k=v(f),C=v(p),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,f=o.customStyle,p=o.comingSoonData,v=o.isNonHighlightedBlur,S=o.isBlurToggleVisible,D=o.isBookemon,F=o.getHighlightContent,P=o.handleFetchManuscriptElements,q=o.isBookPreview,H=o.isDialog,I=o.defaultElementPages,z=i.useState({textToHighLight:"",content:""}),E=z[0],M=z[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,f,p,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(/&nbsp;/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(p=c[u],l(p.normalizedContent||p.htmlContent).includes(s)){d=p;break}if(!d)for(g=s.split(" ").filter(Boolean);g.length>0;){for(h=g.join(" "),x=0,f=a;x<f.length;x++)if(p=f[x],l(p.normalizedContent||p.htmlContent).includes(h)){d=p;break}if(d)break;g.pop()}return v=a.map(function(e){return e.htmlContent}).join("\n"),M({textToHighLight:d?d.htmlContent:"",content:v}),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 _=e.sent(),console.error("Highlight error:",_),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),fe=xe[0],pe=xe[1],ve=i.useState(!1),_e=ve[0],me=ve[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),Ie=He[0],ze=He[1];i.useEffect(function(){ae&&je(!0),de&&we(!0),ge&&De(!0),fe&&qe(!0),_e&&ze(!0)},[ae,de,ge,fe,_e]);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==f?void 0:f.leftPanel)},{children:[t.jsx("div",e.__assign({ref:$,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:t.jsxs(_.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(_.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;if(e){var t=e.querySelector('[data-highlight="true"]');if(t){t.scrollIntoView({behavior:"smooth",block:"center"});var i=new MutationObserver(function(){var t=e.querySelector('[data-highlight="true"]');t&&t.scrollIntoView({behavior:"auto",block:"center"}),i.disconnect()});i.observe(e,{childList:!0,subtree:!0})}}}}}},{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:I})}))]}))})),t.jsx("div",e.__assign({ref:te,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:t.jsxs(_.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(_.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:pe}):t.jsx("div",e.__assign({style:w.errorState},{children:"No Copyrights & Marketing data available."}))}))]}))})),t.jsx("div",e.__assign({ref:ne},{children:t.jsxs(_.default,e.__assign({elevation:0,style:w.accordion,expanded:Ie,onChange:function(e,t){return ze(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:f,comingSoonData:p,isNonHighlightedBlur:v,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==p?void 0:p.header,subheader:null==p?void 0:p.subheader,icon:null==p?void 0:p.icon})]}))]}))};
2
2
  //# sourceMappingURL=BookemonContent.js.map
@@ -1,2 +1,2 @@
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:""};
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("(".concat(u,")"),"giu");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 e=require("tslib"),l=require("react/jsx-runtime"),o=require("./components/ChatCitation.js"),i=require("./utils/helpers.js"),n=require("./components/Chip.js"),t=require("./assets/message-chat-square.svg.js");require("@mui/icons-material/KeyboardArrowDown"),require("@mui/icons-material/KeyboardArrowUp"),require("@mui/icons-material/Clear");var r=require("./components/InViewNavigation.js"),d=require("./components/DetailedView.js"),s=require("./components/SummarizedView.js"),a=require("./components/RuleBook.js"),u=require("react"),v=require("./constants/renderer.js"),c=require("./components/IconContainer.js"),h=require("lucide-react"),f=require("./BigQueryTable.js");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var b=g(require("@mui/icons-material/CloseOutlined"));exports.default=function(g){var p,x,m,y,_,C,w,k,j,S,q,A,T,D,R,I,V,F,z,P,E,B,H,M,N,W,Y,O,K,Q,U,G,J,L,X,Z,$,ee,le,oe,ie,ne,te,re,de,se=g.rootContainer,ae=g.chatContainer,ue=void 0===ae?{chatData:[]}:ae,ve=g.ruleBookContainer,ce=g.renderer,he=g.additionalData,fe=g.tableComponent,ge=g.closePreview,be=g.isRenderedCustomComponent,pe=void 0!==be&&be,xe=g.showRootContainer,me=void 0===xe||xe,ye=g.reversePanels,_e=void 0!==ye&&ye,Ce=u.useState(0),we=Ce[0],ke=Ce[1],je=u.useState(0),Se=je[0],qe=je[1],Ae=u.useState(0),Te=Ae[0],De=Ae[1],Re=u.useState(0),Ie=Re[0],Ve=Re[1],Fe=u.useRef(null),ze=u.useRef(null),Pe=u.useMemo(function(){return e.__assign(e.__assign({},v.defaultRenderer),ce)},[ce]),Ee=u.useMemo(function(){return!!((null==fe?void 0:fe.rows)&&Object.keys(fe.rows).length>0)},[fe]),Be=u.useMemo(function(){var e;return null!==(e=null==he?void 0:he.RuleBookDetailedViewVerticallyStacked)&&void 0!==e&&e},[null==he?void 0:he.RuleBookDetailedViewVerticallyStacked]);u.useEffect(function(){var e,l;if((null==ve?void 0:ve.show)&&Fe.current){var o=null===(e=Fe.current)||void 0===e?void 0:e.querySelectorAll(".rule-book-highlight");if(ke((null==o?void 0:o.length)||0),qe(0),o&&o.length>0)(i=o[0]).style.backgroundColor="#ffff5c",i.scrollIntoView({behavior:"smooth",block:"center"})}if((null==ue?void 0:ue.show)&&(null==ze?void 0:ze.current)){var i,n=null===(l=ze.current)||void 0===l?void 0:l.querySelectorAll(".user-chat-highlight");if(De((null==n?void 0:n.length)||0),Ve(0),n&&n.length>0)(i=n[0]).style.backgroundColor="#ffff5c",i.scrollIntoView({behavior:"smooth",block:"center"})}},[null==ue?void 0:ue.show,null==ve?void 0:ve.show,null==ve?void 0:ve.data,null==ue?void 0:ue.chatData]);var He=u.useCallback(function(){var e;if(Se+1<we){var l=null===(e=Fe.current)||void 0===e?void 0:e.querySelectorAll(".rule-book-highlight");if(!l)return;l[Se].style.backgroundColor="#ffffb8";var o=Se+1;qe(o);var i=l[o];i.style.backgroundColor="#ffff5c",null==i||i.scrollIntoView({behavior:"smooth",block:"center"})}},[Se,we]),Me=u.useCallback(function(){var e;if(!(Se-1<0)){var l=null===(e=Fe.current)||void 0===e?void 0:e.querySelectorAll(".rule-book-highlight");if(l){l[Se].style.backgroundColor="#ffffb8";var o=Se-1,i=l[o];i.style.backgroundColor="#ffff5c",qe(o),null==i||i.scrollIntoView({behavior:"smooth",block:"center"})}}},[Se]),Ne=u.useCallback(function(){var e;if(Ie+1<Te){var l=null===(e=ze.current)||void 0===e?void 0:e.querySelectorAll(".user-chat-highlight");if(!l)return;l[Ie].style.backgroundColor="#ffffb8";var o=Ie+1,i=l[o];i.style.backgroundColor="#ffff5c",Ve(o),null==i||i.scrollIntoView({behavior:"smooth",block:"center"})}},[Ie,Te]),We=u.useCallback(function(){var e;if(!(Ie-1<0)){var l=null===(e=ze.current)||void 0===e?void 0:e.querySelectorAll(".user-chat-highlight");if(l){l[Ie].style.backgroundColor="#ffffb8";var o=Ie-1,i=l[o];i.style.backgroundColor="#ffff5c",Ve(o),null==i||i.scrollIntoView({behavior:"smooth",block:"center"})}}},[Ie]),Ye=i.getColorCode((null==se?void 0:se.relevanceScore)||0),Oe=u.useMemo(function(){var o,i=l.jsxs("span",e.__assign({style:e.__assign({display:"flex",border:"1px solid",alignItems:"center",gap:"4px",borderRadius:"6px",padding:"2px 8px",fontSize:"12px",borderColor:Ye.border,backgroundColor:Ye.background,color:Ye.text},null===(o=null==se?void 0:se.slotStyles)||void 0===o?void 0:o.relevanceScore)},{children:[(null==se?void 0:se.relevanceTitle)||"Decision Strength",":"," ",(null==se?void 0:se.relevanceScore)||0,"%"]}),"relevance-score"),n=l.jsx("span",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px",borderRadius:"6px",padding:"2px 8px",fontSize:"12px",backgroundColor:"white",color:"black",cursor:"pointer"},onClick:ge},{children:l.jsx(b.default,{})}),"close-preview");return pe&&!(null==he?void 0:he.isExpanded)?[i,n]:[i]},[pe,Ye.background,Ye.border,Ye.text,null==se?void 0:se.relevanceScore,null===(p=null==se?void 0:se.slotStyles)||void 0===p?void 0:p.relevanceScore,null==se?void 0:se.relevanceTitle]),Ke=u.useMemo(function(){return[we>0&&l.jsx(r.default,{currentItemNumber:Se+1,totalItems:we,disableNext:Se+1>=we,onNext:He,onPrevious:Me,disablePrevious:Se<=0},"rulebook-nav")]},[Se,He,Me,we]),Qe=u.useMemo(function(){return(null==he?void 0:he.RuleBookContainerHeight)?he.RuleBookContainerHeight:!(!Be||(null==he?void 0:he.isExpanded))&&"600px"},[null==he?void 0:he.RuleBookContainerHeight,Be]),Ue=u.useMemo(function(){var e,o;return[(null===(o=null===(e=null==ue?void 0:ue.detailedTab)||void 0===e?void 0:e.chip)||void 0===o?void 0:o.isActive)&&Te>0&&l.jsx(r.default,{currentItemNumber:Ie+1,totalItems:Te,onNext:Ne,onPrevious:We,disableNext:Ie+1>=Te,disablePrevious:Ie<=0},"chat-nav")]},[null===(m=null===(x=null==ue?void 0:ue.detailedTab)||void 0===x?void 0:x.chip)||void 0===m?void 0:m.isActive,Ie,Ne,We,Te]),Ge=l.jsxs("div",e.__assign({style:e.__assign({display:"flex",flexDirection:_e?Be?"column-reverse":"row-reverse":Be?"column":"row",gap:"12px",height:Qe||"100%",minHeight:0},null===(y=null==se?void 0:se.slotStyles)||void 0===y?void 0:y.container)},{children:[Ee&&l.jsx("span",e.__assign({style:e.__assign({flex:"1 1 0%",minWidth:0},null===(_=null==ue?void 0:ue.slotStyles)||void 0===_?void 0:_.outerContainer)},{children:l.jsx(o.default,e.__assign({title:"Invoice Data Preview",icon:l.jsx(c.default,{children:l.jsx(h.Table,{size:16})}),slotStyles:{title:{color:"#475569",fontWeight:500}},secondaryActions:[]},{children:l.jsx("div",e.__assign({style:{height:"100%",maxHeight:(null==he?void 0:he.isExpanded)?"none":"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",backgroundColor:"#FFFFFF",position:"relative",overflow:"hidden"}},{children:(null==fe?void 0:fe.rows)&&l.jsx(f.BigQueryTable,{rows:fe.rows,columns:fe.columns||[]})}))}))})),(null==ve?void 0:ve.data)&&(ve.show||void 0===ve.show)&&l.jsx("span",e.__assign({style:e.__assign({flex:"1 1 0%",minWidth:0},null===(C=null==ve?void 0:ve.slotStyles)||void 0===C?void 0:C.outerContainer)},{children:l.jsx(o.default,e.__assign({title:null!==(w=null==ve?void 0:ve.title)&&void 0!==w?w:"Rule book",icon:null==ve?void 0:ve.ruleBookIcon,slotStyles:{title:e.__assign({color:"#475569",fontWeight:500},null===(k=null==ve?void 0:ve.slotStyles)||void 0===k?void 0:k.title)},secondaryActions:(null==ve?void 0:ve.secondaryActions)?ve.secondaryActions(Ke):Ke},{children:l.jsx("div",e.__assign({style:e.__assign({height:"100%",maxHeight:"275px",minHeight:0,border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"12px",backgroundColor:"#F8FAFC",position:"relative",overflowY:"auto"},null===(j=null==ve?void 0:ve.slotStyles)||void 0===j?void 0:j.dataContainer)},{children:l.jsx("div",e.__assign({style:{padding:"12px",height:"100%",overflowY:"auto"},ref:Fe},{children:l.jsx(a.default,{data:ve.data,renderers:null!==(S=null==ve?void 0:ve.renderer)&&void 0!==S?S:Pe})}))}))}))})),(null==ue?void 0:ue.chatData)&&ue.chatData.length>0&&(ue.show||void 0===ue.show)&&l.jsx("span",e.__assign({style:e.__assign({flex:"1 1 0%",minWidth:0},null===(q=null==ue?void 0:ue.slotStyles)||void 0===q?void 0:q.outerContainer)},{children:l.jsx(o.default,e.__assign({title:null!==(A=null==ue?void 0:ue.title)&&void 0!==A?A:"Chat",icon:null==ue?void 0:ue.chatIcon,containerStyles:null===(T=null==ue?void 0:ue.slotStyles)||void 0===T?void 0:T.container,slotStyles:{title:e.__assign({color:"#475569",fontWeight:500},null===(D=null==ue?void 0:ue.slotStyles)||void 0===D?void 0:D.title)},primaryActions:[((null===(I=null===(R=null==ue?void 0:ue.summarizedTab)||void 0===R?void 0:R.chip)||void 0===I?void 0:I.show)||void 0===(null===(F=null===(V=null==ue?void 0:ue.summarizedTab)||void 0===V?void 0:V.chip)||void 0===F?void 0:F.show))&&l.jsx(n.default,e.__assign({label:"Summarized"},null===(z=null==ue?void 0:ue.summarizedTab)||void 0===z?void 0:z.chip)),l.jsx(n.default,e.__assign({label:"Detailed"},null===(P=null==ue?void 0:ue.detailedTab)||void 0===P?void 0:P.chip))],secondaryActions:ue.secondaryActions?null==ue?void 0:ue.secondaryActions(Ue):Ue},{children:l.jsxs("div",e.__assign({style:e.__assign({height:"100%",maxHeight:"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"12px",backgroundColor:"#F8FAFC",position:"relative",overflowY:"auto"},null===(E=null==ue?void 0:ue.slotStyles)||void 0===E?void 0:E.chatDataContainer)},{children:[(null===(H=null===(B=null==ue?void 0:ue.detailedTab)||void 0===B?void 0:B.chip)||void 0===H?void 0:H.isActive)&&l.jsx("div",e.__assign({ref:ze,style:{position:(null==he?void 0:he.isExpanded)?"absolute":"relative",inset:0,padding:"12px",overflowY:"auto"}},{children:l.jsx(d.default,{chatData:null!==(M=ue.chatData)&&void 0!==M?M:[],assistantChatProps:e.__assign(e.__assign({},null===(W=null===(N=null==ue?void 0:ue.detailedTab)||void 0===N?void 0:N.view)||void 0===W?void 0:W.assistantChatProps),{renderers:null!==(K=null===(O=null===(Y=null==ue?void 0:ue.detailedTab)||void 0===Y?void 0:Y.detailedViewRenderer)||void 0===O?void 0:O.assistantText)&&void 0!==K?K:Pe}),userChatItemProps:e.__assign(e.__assign({},null===(U=null===(Q=null==ue?void 0:ue.detailedTab)||void 0===Q?void 0:Q.view)||void 0===U?void 0:U.userChatItemProps),{renderers:null!==(L=null===(J=null===(G=null==ue?void 0:ue.detailedTab)||void 0===G?void 0:G.detailedViewRenderer)||void 0===J?void 0:J.userText)&&void 0!==L?L:Pe})})})),(null===(Z=null===(X=null==ue?void 0:ue.summarizedTab)||void 0===X?void 0:X.chip)||void 0===Z?void 0:Z.show)&&(null===(ee=null===($=null==ue?void 0:ue.summarizedTab)||void 0===$?void 0:$.chip)||void 0===ee?void 0:ee.isActive)&&l.jsx(s.default,e.__assign({chatData:null!==(le=ue.chatData)&&void 0!==le?le:[]},null===(oe=null==ue?void 0:ue.summarizedTab)||void 0===oe?void 0:oe.view,{renderer:null!==(ne=null===(ie=null==ue?void 0:ue.summarizedTab)||void 0===ie?void 0:ie.summarizedViewRenderer)&&void 0!==ne?ne:Pe}))]}))}))}))]}));return me?l.jsx(o.default,e.__assign({title:null==se?void 0:se.title,slotStyles:{title:null===(te=null==se?void 0:se.slotStyles)||void 0===te?void 0:te.title},containerStyles:null===(re=null==se?void 0:se.slotStyles)||void 0===re?void 0:re.container,icon:null!==(de=null==se?void 0:se.icon)&&void 0!==de?de:l.jsx(c.default,{children:l.jsx("img",{src:t.default,alt:"chat icon",style:{width:16,height:16}})}),secondaryActions:(null==se?void 0:se.secondaryActions)?se.secondaryActions(Oe):Oe},{children:Ge})):Ge};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),l=require("react/jsx-runtime"),o=require("./components/ChatCitation.js"),i=require("./utils/helpers.js"),n=require("./components/Chip.js"),t=require("./assets/message-chat-square.svg.js");require("@mui/icons-material/KeyboardArrowDown"),require("@mui/icons-material/KeyboardArrowUp"),require("@mui/icons-material/Clear");var r=require("./components/InViewNavigation.js"),d=require("./components/DetailedView.js"),s=require("./components/SummarizedView.js"),a=require("./components/RuleBook.js"),u=require("react"),v=require("./constants/renderer.js"),c=require("./components/IconContainer.js"),h=require("lucide-react"),f=require("./BigQueryTable.js");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var b=g(require("@mui/icons-material/CloseOutlined"));exports.default=function(g){var p,x,m,y,_,w,C,k,j,S,q,A,D,T,R,I,V,F,z,P,B,E,H,M,N,W,Y,O,K,Q,U,G,J,L,X,Z,$,ee,le,oe,ie,ne,te,re,de,se=g.rootContainer,ae=g.chatContainer,ue=void 0===ae?{chatData:[]}:ae,ve=g.ruleBookContainer,ce=g.renderer,he=g.additionalData,fe=g.tableComponent,ge=g.closePreview,be=g.isRenderedCustomComponent,pe=void 0!==be&&be,xe=g.showRootContainer,me=void 0===xe||xe,ye=g.reversePanels,_e=void 0!==ye&&ye,we=u.useState(0),Ce=we[0],ke=we[1],je=u.useState(0),Se=je[0],qe=je[1],Ae=u.useState(0),De=Ae[0],Te=Ae[1],Re=u.useState(0),Ie=Re[0],Ve=Re[1],Fe=u.useRef(null),ze=u.useRef(null),Pe=u.useMemo(function(){return e.__assign(e.__assign({},v.defaultRenderer),ce)},[ce]),Be=u.useMemo(function(){return!!((null==fe?void 0:fe.rows)&&Object.keys(fe.rows).length>0)},[fe]),Ee=u.useMemo(function(){var e;return null!==(e=null==he?void 0:he.RuleBookDetailedViewVerticallyStacked)&&void 0!==e&&e},[null==he?void 0:he.RuleBookDetailedViewVerticallyStacked]);u.useEffect(function(){var e,l;if((null==ve?void 0:ve.show)&&Fe.current){var o=null===(e=Fe.current)||void 0===e?void 0:e.querySelectorAll(".rule-book-highlight");if(ke((null==o?void 0:o.length)||0),qe(0),o&&o.length>0)(i=o[0]).style.backgroundColor="#ffff5c",i.scrollIntoView({behavior:"smooth",block:"center"})}if((null==ue?void 0:ue.show)&&(null==ze?void 0:ze.current)){var i,n=null===(l=ze.current)||void 0===l?void 0:l.querySelectorAll(".user-chat-highlight");if(Te((null==n?void 0:n.length)||0),Ve(0),n&&n.length>0)(i=n[0]).style.backgroundColor="#ffff5c",i.scrollIntoView({behavior:"smooth",block:"center"})}},[null==ue?void 0:ue.show,null==ve?void 0:ve.show,null==ve?void 0:ve.data,null==ue?void 0:ue.chatData]);var He=u.useCallback(function(){var e;if(Se+1<Ce){var l=null===(e=Fe.current)||void 0===e?void 0:e.querySelectorAll(".rule-book-highlight");if(!l)return;l[Se].style.backgroundColor="#ffffb8";var o=Se+1;qe(o);var i=l[o];i.style.backgroundColor="#ffff5c",null==i||i.scrollIntoView({behavior:"smooth",block:"center"})}},[Se,Ce]),Me=u.useCallback(function(){var e;if(!(Se-1<0)){var l=null===(e=Fe.current)||void 0===e?void 0:e.querySelectorAll(".rule-book-highlight");if(l){l[Se].style.backgroundColor="#ffffb8";var o=Se-1,i=l[o];i.style.backgroundColor="#ffff5c",qe(o),null==i||i.scrollIntoView({behavior:"smooth",block:"center"})}}},[Se]),Ne=u.useCallback(function(){var e;if(Ie+1<De){var l=null===(e=ze.current)||void 0===e?void 0:e.querySelectorAll(".user-chat-highlight");if(!l)return;l[Ie].style.backgroundColor="#ffffb8";var o=Ie+1,i=l[o];i.style.backgroundColor="#ffff5c",Ve(o),null==i||i.scrollIntoView({behavior:"smooth",block:"center"})}},[Ie,De]),We=u.useCallback(function(){var e;if(!(Ie-1<0)){var l=null===(e=ze.current)||void 0===e?void 0:e.querySelectorAll(".user-chat-highlight");if(l){l[Ie].style.backgroundColor="#ffffb8";var o=Ie-1,i=l[o];i.style.backgroundColor="#ffff5c",Ve(o),null==i||i.scrollIntoView({behavior:"smooth",block:"center"})}}},[Ie]),Ye=i.getColorCode((null==se?void 0:se.relevanceScore)||0),Oe=u.useMemo(function(){var o,i=l.jsxs("span",e.__assign({style:e.__assign({display:"flex",border:"1px solid",alignItems:"center",gap:"4px",borderRadius:"6px",padding:"2px 8px",fontSize:"12px",borderColor:Ye.border,backgroundColor:Ye.background,color:Ye.text},null===(o=null==se?void 0:se.slotStyles)||void 0===o?void 0:o.relevanceScore)},{children:[(null==se?void 0:se.relevanceTitle)||"Decision Strength",":"," ",(null==se?void 0:se.relevanceScore)||0,"%"]}),"relevance-score"),n=l.jsx("span",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px",borderRadius:"6px",padding:"2px 8px",fontSize:"12px",backgroundColor:"white",color:"black",cursor:"pointer"},onClick:ge},{children:l.jsx(b.default,{})}),"close-preview");return pe&&!(null==he?void 0:he.isExpanded)?[i,n]:[i]},[pe,Ye.background,Ye.border,Ye.text,null==se?void 0:se.relevanceScore,null===(p=null==se?void 0:se.slotStyles)||void 0===p?void 0:p.relevanceScore,null==se?void 0:se.relevanceTitle]),Ke=u.useMemo(function(){return[Ce>0&&l.jsx(r.default,{currentItemNumber:Se+1,totalItems:Ce,disableNext:Se+1>=Ce,onNext:He,onPrevious:Me,disablePrevious:Se<=0},"rulebook-nav")]},[Se,He,Me,Ce]),Qe=u.useMemo(function(){return(null==he?void 0:he.RuleBookContainerHeight)?he.RuleBookContainerHeight:!(!Ee||(null==he?void 0:he.isExpanded))&&"600px"},[null==he?void 0:he.RuleBookContainerHeight,Ee]),Ue=u.useMemo(function(){var e,o;return[(null===(o=null===(e=null==ue?void 0:ue.detailedTab)||void 0===e?void 0:e.chip)||void 0===o?void 0:o.isActive)&&De>0&&l.jsx(r.default,{currentItemNumber:Ie+1,totalItems:De,onNext:Ne,onPrevious:We,disableNext:Ie+1>=De,disablePrevious:Ie<=0},"chat-nav")]},[null===(m=null===(x=null==ue?void 0:ue.detailedTab)||void 0===x?void 0:x.chip)||void 0===m?void 0:m.isActive,Ie,Ne,We,De]),Ge=l.jsxs("div",e.__assign({style:e.__assign({display:"flex",flexDirection:_e?Ee?"column-reverse":"row-reverse":Ee?"column":"row",gap:[(null==ue?void 0:ue.chatData)&&ue.chatData.length>0&&(ue.show||void 0===ue.show),(null==ve?void 0:ve.data)&&(ve.show||void 0===ve.show),Be].filter(Boolean).length>1?"12px":"0",height:Qe||"100%",minHeight:0},null===(y=null==se?void 0:se.slotStyles)||void 0===y?void 0:y.container)},{children:[Be&&l.jsx("span",e.__assign({style:e.__assign({flex:"1 1 0%",minWidth:0},null===(_=null==ue?void 0:ue.slotStyles)||void 0===_?void 0:_.outerContainer)},{children:l.jsx(o.default,e.__assign({title:"Invoice Data Preview",icon:l.jsx(c.default,{children:l.jsx(h.Table,{size:16})}),slotStyles:{title:{color:"#475569",fontWeight:500}},secondaryActions:[]},{children:l.jsx("div",e.__assign({style:{height:"100%",maxHeight:(null==he?void 0:he.isExpanded)?"none":"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",backgroundColor:"#FFFFFF",position:"relative",overflow:"hidden"}},{children:(null==fe?void 0:fe.rows)&&l.jsx(f.BigQueryTable,{rows:fe.rows,columns:fe.columns||[]})}))}))})),(null==ve?void 0:ve.data)&&(ve.show||void 0===ve.show)&&l.jsx("span",e.__assign({style:e.__assign({flex:"1 1 0%",minWidth:0},null===(w=null==ve?void 0:ve.slotStyles)||void 0===w?void 0:w.outerContainer)},{children:l.jsx(o.default,e.__assign({title:null!==(C=null==ve?void 0:ve.title)&&void 0!==C?C:"Rule book",icon:null==ve?void 0:ve.ruleBookIcon,slotStyles:{title:e.__assign({color:"#475569",fontWeight:500},null===(k=null==ve?void 0:ve.slotStyles)||void 0===k?void 0:k.title)},secondaryActions:(null==ve?void 0:ve.secondaryActions)?ve.secondaryActions(Ke):Ke},{children:l.jsx("div",e.__assign({style:e.__assign({height:"100%",maxHeight:"275px",minHeight:0,border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"12px",backgroundColor:"#F8FAFC",position:"relative",overflowY:"auto"},null===(j=null==ve?void 0:ve.slotStyles)||void 0===j?void 0:j.dataContainer)},{children:l.jsx("div",e.__assign({style:{padding:"12px",height:"100%",overflowY:"auto"},ref:Fe},{children:l.jsx(a.default,{data:ve.data,renderers:null!==(S=null==ve?void 0:ve.renderer)&&void 0!==S?S:Pe})}))}))}))})),(null==ue?void 0:ue.chatData)&&ue.chatData.length>0&&(ue.show||void 0===ue.show)&&l.jsx("span",e.__assign({style:e.__assign({flex:"1 1 0%",minWidth:0},null===(q=null==ue?void 0:ue.slotStyles)||void 0===q?void 0:q.outerContainer)},{children:l.jsx(o.default,e.__assign({title:null!==(A=null==ue?void 0:ue.title)&&void 0!==A?A:"Chat",icon:null==ue?void 0:ue.chatIcon,containerStyles:null===(D=null==ue?void 0:ue.slotStyles)||void 0===D?void 0:D.container,slotStyles:{title:e.__assign({color:"#475569",fontWeight:500},null===(T=null==ue?void 0:ue.slotStyles)||void 0===T?void 0:T.title)},primaryActions:[((null===(I=null===(R=null==ue?void 0:ue.summarizedTab)||void 0===R?void 0:R.chip)||void 0===I?void 0:I.show)||void 0===(null===(F=null===(V=null==ue?void 0:ue.summarizedTab)||void 0===V?void 0:V.chip)||void 0===F?void 0:F.show))&&l.jsx(n.default,e.__assign({label:"Summarized"},null===(z=null==ue?void 0:ue.summarizedTab)||void 0===z?void 0:z.chip)),l.jsx(n.default,e.__assign({label:"Detailed"},null===(P=null==ue?void 0:ue.detailedTab)||void 0===P?void 0:P.chip))],secondaryActions:ue.secondaryActions?null==ue?void 0:ue.secondaryActions(Ue):Ue},{children:l.jsxs("div",e.__assign({style:e.__assign({height:"100%",maxHeight:"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"12px",backgroundColor:"#F8FAFC",position:"relative",overflowY:"auto"},null===(B=null==ue?void 0:ue.slotStyles)||void 0===B?void 0:B.chatDataContainer)},{children:[(null===(H=null===(E=null==ue?void 0:ue.detailedTab)||void 0===E?void 0:E.chip)||void 0===H?void 0:H.isActive)&&l.jsx("div",e.__assign({ref:ze,style:{position:(null==he?void 0:he.isExpanded)?"absolute":"relative",inset:0,padding:"12px",overflowY:"auto"}},{children:l.jsx(d.default,{chatData:null!==(M=ue.chatData)&&void 0!==M?M:[],assistantChatProps:e.__assign(e.__assign({},null===(W=null===(N=null==ue?void 0:ue.detailedTab)||void 0===N?void 0:N.view)||void 0===W?void 0:W.assistantChatProps),{renderers:null!==(K=null===(O=null===(Y=null==ue?void 0:ue.detailedTab)||void 0===Y?void 0:Y.detailedViewRenderer)||void 0===O?void 0:O.assistantText)&&void 0!==K?K:Pe}),userChatItemProps:e.__assign(e.__assign({},null===(U=null===(Q=null==ue?void 0:ue.detailedTab)||void 0===Q?void 0:Q.view)||void 0===U?void 0:U.userChatItemProps),{renderers:null!==(L=null===(J=null===(G=null==ue?void 0:ue.detailedTab)||void 0===G?void 0:G.detailedViewRenderer)||void 0===J?void 0:J.userText)&&void 0!==L?L:Pe})})})),(null===(Z=null===(X=null==ue?void 0:ue.summarizedTab)||void 0===X?void 0:X.chip)||void 0===Z?void 0:Z.show)&&(null===(ee=null===($=null==ue?void 0:ue.summarizedTab)||void 0===$?void 0:$.chip)||void 0===ee?void 0:ee.isActive)&&l.jsx(s.default,e.__assign({chatData:null!==(le=ue.chatData)&&void 0!==le?le:[]},null===(oe=null==ue?void 0:ue.summarizedTab)||void 0===oe?void 0:oe.view,{renderer:null!==(ne=null===(ie=null==ue?void 0:ue.summarizedTab)||void 0===ie?void 0:ie.summarizedViewRenderer)&&void 0!==ne?ne:Pe}))]}))}))}))]}));return me?l.jsx(o.default,e.__assign({title:null==se?void 0:se.title,slotStyles:{title:null===(te=null==se?void 0:se.slotStyles)||void 0===te?void 0:te.title},containerStyles:null===(re=null==se?void 0:se.slotStyles)||void 0===re?void 0:re.container,icon:null!==(de=null==se?void 0:se.icon)&&void 0!==de?de:l.jsx(c.default,{children:l.jsx("img",{src:t.default,alt:"chat icon",style:{width:16,height:16}})}),secondaryActions:(null==se?void 0:se.secondaryActions)?se.secondaryActions(Oe):Oe},{children:Ge})):Ge};
2
2
  //# sourceMappingURL=InternalChatCitationRenderer.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as n}from"tslib";import{jsx as t,Fragment as e,jsxs as a}from"react/jsx-runtime";import{useState as o,useEffect as i}from"react";import c from"./BookCitation.module.css.js";import{cleanScannedText as r}from"./text-cleaner.js";var s=function(s){var l=s.title,d=s.author,u=s.paragraphs,h=s.chevronUpComponent,m=s.chevronDownComponent,v=s.externalLinkComponent,p=s.textToHighlight,f=s.pageNumber,g=s.totalPageNumber,N=void 0===g?null:g,b=s.citationTitle;s.customStyle;var x=s.handleExternalLinkClick,C=s.bookCoverImage,k=s.partialMatch,E=void 0!==k&&k,A=s.citationNumber,L=void 0===A?1:A,T=s.defaultState,y=void 0!==T&&T,q=s.isNonHighlightedBlur,w=void 0!==q&&q,I=s.toggleBlur,B=void 0===I?w:I,j=s.fixedWidth,H=void 0===j||j,M=s.isBookemon,W=void 0!==M&&M,O=o(y),R=O[0],S=O[1],$=["address","article","aside","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","li","main","nav","noscript","ol","p","pre","section","table","tfoot","ul","video"];i(function(){if(R){var n,t="quotes-citations-".concat(null!=L?L:""),e=!1;return requestAnimationFrame(function(){requestAnimationFrame(function(){n=function(){var n=document.getElementById(t);if(n&&!e){n.scrollIntoView({behavior:"smooth",block:"center"});var a=setTimeout(function(){if(!e){var t=n.getBoundingClientRect(),a=window.innerHeight/2;Math.abs(t.top-a)>40&&n.scrollIntoView({behavior:"auto",block:"center"})}},400);return function(){return clearTimeout(a)}}}()||void 0})}),function(){e=!0,n&&n()}}},[R,p,L]);var _=function(n){void 0===n&&(n="");var t=document.createElement("div");t.innerHTML=n;var e=t.textContent||t.innerText||"";return(e=(e=e.replace(/<\/?[^>]+(>|$)/g,"")).replace(/\s+/g," ")).trim()};function D(n){var t=document.createElement("div");t.innerHTML=n;var e=c.highlighted,a=function(n,t){var o,i;if(void 0===t&&(t=!1),n.nodeType===Node.TEXT_NODE){if(!t&&(null===(o=n.textContent)||void 0===o?void 0:o.trim())){var r=document.createElement("span");r.classList.add(c.blurred),r.textContent=n.textContent,null===(i=n.parentNode)||void 0===i||i.replaceChild(r,n)}}else if(n.nodeType===Node.ELEMENT_NODE){var s=n,l=s.classList.contains(e);Array.from(s.childNodes).forEach(function(n){return a(n,t||l)})}};return Array.from(t.childNodes).forEach(function(n){return a(n)}),t.innerHTML}function F(n,t,e,a,o,i){void 0===o&&(o=[]),void 0===i&&(i=!1);var r,s=c.highlighted,l=c.highlightedInline,d=c.highlightedBlock,u="".concat(s," ").concat(l),h="".concat(s," ").concat(d),m=t,v=(r=document.createElement("textarea"),function(n){return r.innerHTML=n,r.value});if(o.length>0){if(i){return o.forEach(function(n){n&&(m=function(n,t,e){for(var a='<span id="'.concat(e,'" class="').concat(u,'">'),o="</span>",i=n,c=0,r=new RegExp("(<(?:".concat($.join("|"),")[^>]*>.*?)(?=<(?:").concat($.join("|"),")|$)"),"gi"),s=(t.match(r)||[t]).map(function(n){var t=n.match(/^<([a-zA-Z0-9]+)([^>]*)>/);if(t&&$.includes(t[1].toLowerCase())){var e=t[0].length;return t[0]+a+n.slice(e)+o}return a+n+o}).join("");;){var l=i.indexOf(t,c);if(-1===l)break;i=i.slice(0,l)+s+i.slice(l+t.length),c=l+s.length}var h=d;return i.replace(/<span([^>]*)>([\s\S]*?)<\/span>/gi,function(n,t,e){if($.some(function(n){return new RegExp("<".concat(n,"\\b[^>]*>"),"i").test(e)})){var a=t.match(/\sclass\s*=\s*(['"])(.*?)\1/);if(a){var o=a[2],i=o.split(/\s+/).includes(h)?o:"".concat(o," ").concat(h);t=t.replace(a[0],' class="'.concat(i,'"'))}else t+=' class="'.concat(h,'"')}return"<span".concat(t,">").concat(e,"</span>")})}(m,n,"Annotation"===e?"quotes-annotations-".concat(null!=a?a:""):"quotes-citations-".concat(null!=a?a:"")))}),w&&B?D(m):m}return o.forEach(function(n){var o=v(n).trim();if(o&&v(t).trim().toLowerCase()===o.toLowerCase()){var i="Annotation"===e?"quotes-annotations-".concat(null!=a?a:""):"quotes-citations-".concat(null!=a?a:"");m='<span id="'.concat(i,'" class="').concat(h,'">').concat(t,"</span>")}}),w&&B?D(m):m}var p=h;if(!n||!t)return"Annotation"===e?t:'<span id="quotes-citations" class="'.concat(p,'">').concat(t,"</span>");var f=Array.from(n.matchAll(/`([^`]+)`/g));if(0===f.length)return"Annotation"===e?t:'<span id="quotes-citations" class="'.concat(p,'">').concat(t,"</span>");m=t;var g=!1;return f.forEach(function(n){var t=v(n[1]).trim();if(t){var a=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp("(".concat(a,")"),"gi");m.match(o)&&(g=!0,m=m.replace(o,'<span id="'.concat("Annotation"===e?"quotes-annotations":"quotes-citations",'" class="').concat(p,'">$1</span>')))}}),g?m:"Annotation"===e?t:'<span id="quotes-citations" class="'.concat(p,'">').concat(t,"</span>")}return t(e,{children:a("span",n({className:"".concat(c.relativeWrapper," ").concat(W?c.height95percent+" "+c.displayFlex:c.height100percent)},{children:[!y&&t("div",n({className:c.citationButtonWrapper},{children:a("div",n({onClick:function(){return S(function(n){return!n})},className:c.citationButton},{children:[t("span",n({className:c.citationText},{children:b})),R?h:m]}))})),R&&t("div",n({className:c.expandedWrapper},{children:t("div",n({className:"".concat(c.expandableContainer," ").concat(H?c.expandableContainerWidth:"")},{children:t("div",n({className:c.expandableContent},{children:a("div",n({className:c.bookBodyContent},{children:[!y&&t("div",n({className:c.header},{children:a("div",n({className:c.bookInfo},{children:[C&&t("div",n({className:c.bookImageWrapper},{children:t("img",{src:C,alt:l||"Book cover",className:c.bookImage})})),a("div",n({className:c.bookTextInfo},{children:[t("h1",n({className:c.bookTitle},{children:l})),d||Array.isArray(d)&&a("p",n({className:c.bookAuthor},{children:["by"," ",Array.isArray(d)?d.join(", "):d||""]}))]})),t("div",n({onClick:x,className:c.externalLink},{children:v}))]}))})),t("div",n({className:c.relativeContainer},{children:t("div",n({className:c.container},{children:a("div",n({className:"".concat(c.contentWrapper," ").concat(c.customScrollbarClass," ").concat(W?"":c.maxheight38rem)},{children:[t("div",{className:c.gradientOverlayLeft}),t("div",{className:c.gradientOverlayRight}),a("div",n({className:c.contentWrapper},{children:[u.map(function(n,e){r(n);var a=(E?n.includes(p[0]):p.some(function(t){return _(n).toLowerCase()===_(t).toLowerCase()}))?F(u.join("\n"),n,"Citation",L,p,E):n;return t("div",{className:"".concat(c.paragraph," ").concat(0!==e?c.textIndent:""),dangerouslySetInnerHTML:{__html:a}},e)}),f&&t("div",n({className:c.pageIndex},{children:a("div",n({className:c.pageLabel},{children:[f," ",N&&"of ".concat(N)]}))}))]}))]}))}))}))]}))}))}))}))]}))})};export{s as default};
1
+ import{__assign as n}from"tslib";import{jsx as e,Fragment as t,jsxs as a}from"react/jsx-runtime";import{useState as o,useEffect as i}from"react";import r from"./BookCitation.module.css.js";import{cleanScannedText as c}from"./text-cleaner.js";var l=function(l){var s,d=l.title,u=l.author,v=l.paragraphs,h=l.chevronUpComponent,m=l.chevronDownComponent,p=l.externalLinkComponent,f=l.textToHighlight,g=l.pageNumber,N=l.totalPageNumber,b=void 0===N?null:N,x=l.citationTitle,y=l.customStyle,C=void 0===y?{}:y,k=l.handleExternalLinkClick,E=l.bookCoverImage,A=l.partialMatch,L=void 0!==A&&A,T=l.citationNumber,w=void 0===T?1:T,B=l.defaultState,q=void 0!==B&&B,I=l.isNonHighlightedBlur,W=void 0!==I&&I,H=l.toggleBlur,j=void 0===H?W:H,M=l.fixedWidth,O=void 0===M||M,S=l.isBookemon,R=void 0!==S&&S,$=o(q),_=$[0],D=$[1],F=null===(s=null==C?void 0:C.showGradientOverlay)||void 0===s||s,V=["address","article","aside","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","li","main","nav","noscript","ol","p","pre","section","table","tfoot","ul","video"];i(function(){if(_){var n,e="quotes-citations-".concat(null!=w?w:""),t=!1;return requestAnimationFrame(function(){requestAnimationFrame(function(){n=function(){var n=document.getElementById(e);if(n&&!t){n.scrollIntoView({behavior:"smooth",block:"center"});var a=setTimeout(function(){if(!t){var e=n.getBoundingClientRect(),a=window.innerHeight/2;Math.abs(e.top-a)>40&&n.scrollIntoView({behavior:"auto",block:"center"})}},400);return function(){return clearTimeout(a)}}}()||void 0})}),function(){t=!0,n&&n()}}},[_,f,w]);var z=function(n){void 0===n&&(n="");var e=document.createElement("div");e.innerHTML=n;var t=e.textContent||e.innerText||"";return(t=(t=t.replace(/<\/?[^>]+(>|$)/g,"")).replace(/\s+/g," ")).trim()};function G(n){var e=document.createElement("div");e.innerHTML=n;var t=r.highlighted,a=function(n,e){var o,i;if(void 0===e&&(e=!1),n.nodeType===Node.TEXT_NODE){if(!e&&(null===(o=n.textContent)||void 0===o?void 0:o.trim())){var c=document.createElement("span");c.classList.add(r.blurred),c.textContent=n.textContent,null===(i=n.parentNode)||void 0===i||i.replaceChild(c,n)}}else if(n.nodeType===Node.ELEMENT_NODE){var l=n,s=l.classList.contains(t);Array.from(l.childNodes).forEach(function(n){return a(n,e||s)})}};return Array.from(e.childNodes).forEach(function(n){return a(n)}),e.innerHTML}function P(n,e,t,a,o,i){void 0===o&&(o=[]),void 0===i&&(i=!1);var c,l=r.highlighted,s=r.highlightedInline,d=r.highlightedBlock,u="".concat(l," ").concat(s),v="".concat(l," ").concat(d),h=e,m=(c=document.createElement("textarea"),function(n){return c.innerHTML=n,c.value});if(o.length>0){if(i){return o.forEach(function(n){n&&(h=function(n,e,t){for(var a='<span id="'.concat(t,'" class="').concat(u,'">'),o="</span>",i=n,r=0,c=new RegExp("(<(?:".concat(V.join("|"),")[^>]*>.*?)(?=<(?:").concat(V.join("|"),")|$)"),"gi"),l=(e.match(c)||[e]).map(function(n){var e=n.match(/^<([a-zA-Z0-9]+)([^>]*)>/);if(e&&V.includes(e[1].toLowerCase())){var t=e[0].length;return e[0]+a+n.slice(t)+o}return a+n+o}).join("");;){var s=i.indexOf(e,r);if(-1===s)break;i=i.slice(0,s)+l+i.slice(s+e.length),r=s+l.length}var v=d;return i.replace(/<span([^>]*)>([\s\S]*?)<\/span>/gi,function(n,e,t){if(V.some(function(n){return new RegExp("<".concat(n,"\\b[^>]*>"),"i").test(t)})){var a=e.match(/\sclass\s*=\s*(['"])(.*?)\1/);if(a){var o=a[2],i=o.split(/\s+/).includes(v)?o:"".concat(o," ").concat(v);e=e.replace(a[0],' class="'.concat(i,'"'))}else e+=' class="'.concat(v,'"')}return"<span".concat(e,">").concat(t,"</span>")})}(h,n,"Annotation"===t?"quotes-annotations-".concat(null!=a?a:""):"quotes-citations-".concat(null!=a?a:"")))}),W&&j?G(h):h}return o.forEach(function(n){var o=m(n).trim();if(o&&m(e).trim().toLowerCase()===o.toLowerCase()){var i="Annotation"===t?"quotes-annotations-".concat(null!=a?a:""):"quotes-citations-".concat(null!=a?a:"");h='<span id="'.concat(i,'" class="').concat(v,'">').concat(e,"</span>")}}),W&&j?G(h):h}var p=v;if(!n||!e)return"Annotation"===t?e:'<span id="quotes-citations" class="'.concat(p,'">').concat(e,"</span>");var f=Array.from(n.matchAll(/`([^`]+)`/g));if(0===f.length)return"Annotation"===t?e:'<span id="quotes-citations" class="'.concat(p,'">').concat(e,"</span>");h=e;var g=!1;return f.forEach(function(n){var e=m(n[1]).trim();if(e){var a=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp("(".concat(a,")"),"gi");h.match(o)&&(g=!0,h=h.replace(o,'<span id="'.concat("Annotation"===t?"quotes-annotations":"quotes-citations",'" class="').concat(p,'">$1</span>')))}}),g?h:"Annotation"===t?e:'<span id="quotes-citations" class="'.concat(p,'">').concat(e,"</span>")}return e(t,{children:a("span",n({className:"".concat(r.relativeWrapper," ").concat(R?r.height95percent+" "+r.displayFlex:r.height100percent),style:null==C?void 0:C.relativeWrapper},{children:[!q&&e("div",n({className:r.citationButtonWrapper,style:null==C?void 0:C.citationButtonWrapper},{children:a("div",n({onClick:function(){return D(function(n){return!n})},className:r.citationButton,style:null==C?void 0:C.citationButton},{children:[e("span",n({className:r.citationText},{children:x})),e("span",n({style:null==C?void 0:C.arrow},{children:_?h:m}))]}))})),_&&e("div",n({className:r.expandedWrapper,style:null==C?void 0:C.expandedWrapper},{children:e("div",n({className:"".concat(r.expandableContainer," ").concat(O?r.expandableContainerWidth:""),style:null==C?void 0:C.expandableContainer},{children:e("div",n({className:r.expandableContent,style:null==C?void 0:C.expandableContent},{children:a("div",n({className:r.bookBodyContent,style:null==C?void 0:C.bookBodyContent},{children:[!q&&e("div",n({className:r.header,style:null==C?void 0:C.bookHeader},{children:a("div",n({className:r.bookInfo},{children:[E&&e("div",n({className:r.bookImageWrapper},{children:e("img",{src:E,alt:d||"Book cover",className:r.bookImage})})),a("div",n({className:r.bookTextInfo},{children:[e("h1",n({className:r.bookTitle},{children:d})),u||Array.isArray(u)&&a("p",n({className:r.bookAuthor},{children:["by"," ",Array.isArray(u)?u.join(", "):u||""]}))]})),e("div",n({onClick:k,className:r.externalLink},{children:p}))]}))})),e("div",n({className:r.relativeContainer,style:null==C?void 0:C.relative},{children:e("div",n({className:r.container},{children:a("div",n({className:"".concat(r.contentWrapper," ").concat(r.customScrollbarClass," ").concat(R?"":r.maxheight38rem),style:null==C?void 0:C.customScrollbarClass},{children:[F&&a(t,{children:[e("div",{className:r.gradientOverlayLeft}),e("div",{className:r.gradientOverlayRight})]}),a("div",n({className:r.contentWrapper},{children:[v.map(function(n,t){c(n);var a=(L?n.includes(f[0]):f.some(function(e){return z(n).toLowerCase()===z(e).toLowerCase()}))?P(v.join("\n"),n,"Citation",w,f,L):n;return e("div",{className:"".concat(r.paragraph," ").concat(0!==t?r.textIndent:""),dangerouslySetInnerHTML:{__html:a}},t)}),g&&e("div",n({className:r.pageIndex},{children:a("div",n({className:r.pageLabel,style:null==C?void 0:C.pageColor},{children:[g," ",b&&"of ".concat(b)]}))}))]}))]}))}))}))]}))}))}))}))]}))})};export{l as default};
2
2
  //# sourceMappingURL=BookCitation.js.map
@@ -1,2 +1,2 @@
1
- var o={relativeWrapper:"BookCitation-module_relativeWrapper__jFpTh",displayFlex:"BookCitation-module_displayFlex__iMb2e",height95percent:"BookCitation-module_height95percent__kWGUx",height100percent:"BookCitation-module_height100percent__zQeLG",relativeContainer:"BookCitation-module_relativeContainer__HLngm",citationButtonWrapper:"BookCitation-module_citationButtonWrapper__einPL",citationButton:"BookCitation-module_citationButton__8U9MO",citationText:"BookCitation-module_citationText__aH2j-",pageText:"BookCitation-module_pageText__nEM69",expandedWrapper:"BookCitation-module_expandedWrapper__roHmf",expandableContainer:"BookCitation-module_expandableContainer__yNmEx",expandableContainerWidth:"BookCitation-module_expandableContainerWidth__O7mEU",expandableContent:"BookCitation-module_expandableContent__AvgFX",bookBodyContent:"BookCitation-module_bookBodyContent__a20pD",header:"BookCitation-module_header__kMSfc",bookInfo:"BookCitation-module_bookInfo__AzKFV",bookImageWrapper:"BookCitation-module_bookImageWrapper__JNna7",bookImage:"BookCitation-module_bookImage__CXga1",bookTextInfo:"BookCitation-module_bookTextInfo__zVuts",bookTitle:"BookCitation-module_bookTitle__lHfz0",bookAuthor:"BookCitation-module_bookAuthor__Chqif",externalLink:"BookCitation-module_externalLink__cQ3aM",audioHover:"BookCitation-module_audioHover__XquBK",audioIcon:"BookCitation-module_audioIcon__hoXWS",container:"BookCitation-module_container__msLn5",gradientOverlayLeft:"BookCitation-module_gradientOverlayLeft__vKN9H",gradientOverlayRight:"BookCitation-module_gradientOverlayRight__lElq0",contentWrapper:"BookCitation-module_contentWrapper__2y1ae",paragraph:"BookCitation-module_paragraph__9gQDG",textIndent:"BookCitation-module_textIndent__ejJaC",pageIndex:"BookCitation-module_pageIndex__wUixS",pageLabel:"BookCitation-module_pageLabel__NZ6CE",highlighted:"BookCitation-module_highlighted__n9p6V",highlightedInline:"BookCitation-module_highlightedInline__Vaoms",highlightedBlock:"BookCitation-module_highlightedBlock__c-R3J",blurred:"BookCitation-module_blurred__E0v59",customScrollbarClass:"BookCitation-module_customScrollbarClass__mwGyt",maxheight38rem:"BookCitation-module_maxheight38rem__8icW1"};!function(){if("undefined"==typeof document)return;if(document.getElementById("bookCitationStyles"))return;const o=document.createElement("style");o.id="bookCitationStyles",o.type="text/css";const t=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;t&&o.setAttribute("nonce",t),o.appendChild(document.createTextNode(".BookCitation-module_relativeWrapper__jFpTh{position:relative;width:100%}.BookCitation-module_displayFlex__iMb2e{align-items:center;display:flex;justify-content:center}.BookCitation-module_height95percent__kWGUx{height:90%}.BookCitation-module_height100percent__zQeLG{height:100%}.BookCitation-module_relativeContainer__HLngm{height:100%;min-height:0;position:relative}.BookCitation-module_citationButtonWrapper__einPL{color:#be87ff;cursor:pointer;display:inline-block;height:100%;margin-right:.25rem}.BookCitation-module_citationButton__8U9MO{align-items:center;background-color:initial;border:none;border-radius:9999px;color:#d63384;cursor:pointer;display:inline-flex;font-family:Plus Jakarta Sans,sans-serif;font-size:16px;font-weight:700;margin:0;padding:0;text-decoration:none;white-space:normal;width:fit-content;word-break:break-word}.BookCitation-module_citationText__aH2j-{align-items:center;display:flex;justify-content:center;text-align:center}.BookCitation-module_pageText__nEM69{margin-left:6px}.BookCitation-module_expandedWrapper__roHmf{align-items:center;display:flex;height:100%;justify-content:start;min-height:0}.BookCitation-module_expandableContainer__yNmEx{height:100%;left:0;margin-top:.5rem;min-height:0;top:100%;width:100%;z-index:49}.BookCitation-module_expandableContainerWidth__O7mEU{width:32rem}.BookCitation-module_expandableContent__AvgFX{background-color:#fff;border:1px solid #60a3f8;border-radius:8px;box-shadow:0 1.694px 6.775px 0 #0000000d,0 37.262px 40.65px -10.162px #00000026,0 0 20.325px 3.387px #0000000d;color:#fff;height:fit-content;height:100%;margin-bottom:1.5rem;min-height:0;padding:.75rem}.BookCitation-module_bookBodyContent__a20pD{height:100%;margin:0 auto;min-height:0}.BookCitation-module_header__kMSfc{display:flex;justify-content:space-between;margin-bottom:1rem}.BookCitation-module_bookInfo__AzKFV{align-items:center;display:flex;gap:1rem;justify-content:center;width:100%}.BookCitation-module_bookImageWrapper__JNna7{flex-shrink:0}.BookCitation-module_bookImage__CXga1{height:70px;object-fit:cover;width:70px}.BookCitation-module_bookTextInfo__zVuts{display:flex;flex-direction:column;gap:.1rem}.BookCitation-module_bookTitle__lHfz0{color:#60a3f8;font-family:Inter,sans-serif;font-size:1rem;font-weight:700;line-height:1;margin:0}.BookCitation-module_bookAuthor__Chqif{color:#60a3f8;font-family:Inter,sans-serif;font-size:.8rem;font-weight:500;line-height:1;margin:0}.BookCitation-module_externalLink__cQ3aM{margin-left:auto}.BookCitation-module_audioHover__XquBK{border-radius:.5rem;transition:background-color .2s}.BookCitation-module_audioHover__XquBK:hover{background-color:#fff3}.BookCitation-module_audioIcon__hoXWS{width:5rem}.BookCitation-module_container__msLn5{background-color:#fff;border-radius:.75rem;box-shadow:0 4px 6px #0000001a;display:flex;flex-direction:column;height:100%;margin-left:auto;margin-right:auto;max-width:100%;position:relative;width:100%}.BookCitation-module_gradientOverlayLeft__vKN9H{background:linear-gradient(270deg,#000 0,#000000b3 40%,#0006 70%,#0000);bottom:0;box-shadow:-4px 0 8px #0000001a;opacity:.5;pointer-events:none;position:absolute;right:20px;top:0;width:16px;z-index:0}.BookCitation-module_gradientOverlayRight__lElq0{background:linear-gradient(90deg,#000 0,#0009 40%,#0003 70%,#0000);bottom:0;box-shadow:4px 0 8px #0000001a;opacity:.5;pointer-events:none;position:absolute;right:5px;top:0;width:16px;z-index:0}.BookCitation-module_contentWrapper__2y1ae{display:flex;flex-direction:column;height:100%;overflow-y:auto;padding-right:.94rem;position:relative;word-break:break-word;z-index:0}.BookCitation-module_paragraph__9gQDG{height:100%;margin-bottom:1rem;text-align:justify}.BookCitation-module_textIndent__ejJaC{text-indent:1rem}.BookCitation-module_pageIndex__wUixS{margin-top:auto;padding:.5rem 0;text-align:right}.BookCitation-module_pageLabel__NZ6CE{border-radius:9999px;color:#4b5563;display:inline-block;font-size:1rem;font-weight:500;padding:.25rem .75rem}.BookCitation-module_highlighted__n9p6V{background-color:#eaea79;font-weight:700}.BookCitation-module_highlightedInline__Vaoms{display:inline}.BookCitation-module_highlightedBlock__c-R3J{display:block}.BookCitation-module_blurred__E0v59{filter:blur(2px);pointer-events:none;user-select:none}.BookCitation-module_customScrollbarClass__mwGyt{background-color:#f5f4f4;border:1px solid #cbd5e1;border-radius:.5rem;color:#181b1f;font-family:Times New Roman,Times,serif;font-size:14.4px;font-weight:400;letter-spacing:0;line-height:100%;overflow:auto;padding:40px 50px 0 20px}.BookCitation-module_maxheight38rem__8icW1{max-height:38rem}.BookCitation-module_customScrollbarClass__mwGyt::-webkit-scrollbar{height:0;width:0}.BookCitation-module_customScrollbarClass__mwGyt::-webkit-scrollbar-track{background:#0000}.BookCitation-module_customScrollbarClass__mwGyt::-webkit-scrollbar-thumb{background-color:#a3a4ae;border-radius:10px}.BookCitation-module_customScrollbarClass__mwGyt::-webkit-scrollbar-button{display:none}"));const e=document.head||document.getElementsByTagName("head")[0]||document.documentElement;e&&e.appendChild(o)}();export{o as default};
1
+ var o={relativeWrapper:"BookCitation-module_relativeWrapper__jFpTh",displayFlex:"BookCitation-module_displayFlex__iMb2e",height95percent:"BookCitation-module_height95percent__kWGUx",height100percent:"BookCitation-module_height100percent__zQeLG",relativeContainer:"BookCitation-module_relativeContainer__HLngm",citationButtonWrapper:"BookCitation-module_citationButtonWrapper__einPL",citationButton:"BookCitation-module_citationButton__8U9MO",citationText:"BookCitation-module_citationText__aH2j-",pageText:"BookCitation-module_pageText__nEM69",expandedWrapper:"BookCitation-module_expandedWrapper__roHmf",expandableContainer:"BookCitation-module_expandableContainer__yNmEx",expandableContainerWidth:"BookCitation-module_expandableContainerWidth__O7mEU",expandableContent:"BookCitation-module_expandableContent__AvgFX",bookBodyContent:"BookCitation-module_bookBodyContent__a20pD",header:"BookCitation-module_header__kMSfc",bookInfo:"BookCitation-module_bookInfo__AzKFV",bookImageWrapper:"BookCitation-module_bookImageWrapper__JNna7",bookImage:"BookCitation-module_bookImage__CXga1",bookTextInfo:"BookCitation-module_bookTextInfo__zVuts",bookTitle:"BookCitation-module_bookTitle__lHfz0",bookAuthor:"BookCitation-module_bookAuthor__Chqif",externalLink:"BookCitation-module_externalLink__cQ3aM",audioHover:"BookCitation-module_audioHover__XquBK",audioIcon:"BookCitation-module_audioIcon__hoXWS",container:"BookCitation-module_container__msLn5",gradientOverlayLeft:"BookCitation-module_gradientOverlayLeft__vKN9H",gradientOverlayRight:"BookCitation-module_gradientOverlayRight__lElq0",contentWrapper:"BookCitation-module_contentWrapper__2y1ae",paragraph:"BookCitation-module_paragraph__9gQDG",textIndent:"BookCitation-module_textIndent__ejJaC",pageIndex:"BookCitation-module_pageIndex__wUixS",pageLabel:"BookCitation-module_pageLabel__NZ6CE",highlighted:"BookCitation-module_highlighted__n9p6V",highlightedInline:"BookCitation-module_highlightedInline__Vaoms",highlightedBlock:"BookCitation-module_highlightedBlock__c-R3J",blurred:"BookCitation-module_blurred__E0v59",customScrollbarClass:"BookCitation-module_customScrollbarClass__mwGyt",maxheight38rem:"BookCitation-module_maxheight38rem__8icW1"};!function(){if("undefined"==typeof document)return;if(document.getElementById("bookCitationStyles"))return;const o=document.createElement("style");o.id="bookCitationStyles",o.type="text/css";const t=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;t&&o.setAttribute("nonce",t),o.appendChild(document.createTextNode(".BookCitation-module_relativeWrapper__jFpTh{position:relative;width:100%}.BookCitation-module_displayFlex__iMb2e{align-items:center;display:flex;justify-content:center}.BookCitation-module_height95percent__kWGUx{height:90%}.BookCitation-module_height100percent__zQeLG{height:100%}.BookCitation-module_relativeContainer__HLngm{height:100%;min-height:0;position:relative}.BookCitation-module_citationButtonWrapper__einPL{color:#be87ff;cursor:pointer;display:inline-block;height:100%;margin-right:.25rem}.BookCitation-module_citationButton__8U9MO{align-items:center;background-color:initial;border:none;border-radius:9999px;color:#d63384;cursor:pointer;display:inline-flex;font-family:Plus Jakarta Sans,sans-serif;font-size:16px;font-weight:700;margin:0;padding:0;text-decoration:none;white-space:normal;width:fit-content;word-break:break-word}.BookCitation-module_citationText__aH2j-{align-items:center;display:flex;justify-content:center;text-align:center}.BookCitation-module_pageText__nEM69{margin-left:6px}.BookCitation-module_expandedWrapper__roHmf{align-items:center;display:flex;height:100%;justify-content:start;min-height:0}.BookCitation-module_expandableContainer__yNmEx{height:100%;left:0;margin-top:.5rem;min-height:0;top:100%;width:100%;z-index:49}.BookCitation-module_expandableContainerWidth__O7mEU{width:32rem}.BookCitation-module_expandableContent__AvgFX{background-color:#fff;border:1px solid #60a3f8;border-radius:8px;box-shadow:0 1.694px 6.775px 0 #0000000d,0 37.262px 40.65px -10.162px #00000026,0 0 20.325px 3.387px #0000000d;color:#fff;height:fit-content;height:100%;margin-bottom:1.5rem;min-height:0;padding:.75rem}.BookCitation-module_bookBodyContent__a20pD{height:100%;margin:0 auto;min-height:0}.BookCitation-module_header__kMSfc{display:flex;justify-content:space-between;margin-bottom:1rem}.BookCitation-module_bookInfo__AzKFV{align-items:center;display:flex;gap:1rem;justify-content:center;width:100%}.BookCitation-module_bookImageWrapper__JNna7{flex-shrink:0}.BookCitation-module_bookImage__CXga1{height:70px;object-fit:cover;width:70px}.BookCitation-module_bookTextInfo__zVuts{display:flex;flex-direction:column;gap:.1rem}.BookCitation-module_bookTitle__lHfz0{font-family:Inter,sans-serif;font-size:1rem;font-weight:700;line-height:1;margin:0}.BookCitation-module_bookAuthor__Chqif{font-family:Inter,sans-serif;font-size:.8rem;font-weight:500;line-height:1;margin:0}.BookCitation-module_externalLink__cQ3aM{margin-left:auto}.BookCitation-module_audioHover__XquBK{border-radius:.5rem;transition:background-color .2s}.BookCitation-module_audioHover__XquBK:hover{background-color:#fff3}.BookCitation-module_audioIcon__hoXWS{width:5rem}.BookCitation-module_container__msLn5{background-color:#fff;border-radius:.75rem;box-shadow:0 4px 6px #0000001a;display:flex;flex-direction:column;height:100%;margin-left:auto;margin-right:auto;max-width:100%;position:relative;width:100%}.BookCitation-module_gradientOverlayLeft__vKN9H{background:linear-gradient(270deg,#000 0,#000000b3 40%,#0006 70%,#0000);bottom:0;box-shadow:-4px 0 8px #0000001a;opacity:.5;pointer-events:none;position:absolute;right:20px;top:0;width:16px;z-index:0}.BookCitation-module_gradientOverlayRight__lElq0{background:linear-gradient(90deg,#000 0,#0009 40%,#0003 70%,#0000);bottom:0;box-shadow:4px 0 8px #0000001a;opacity:.5;pointer-events:none;position:absolute;right:5px;top:0;width:16px;z-index:0}.BookCitation-module_contentWrapper__2y1ae{display:flex;flex-direction:column;height:100%;overflow-y:auto;padding-right:.94rem;position:relative;word-break:break-word;z-index:0}.BookCitation-module_paragraph__9gQDG{height:100%;margin-bottom:1rem;text-align:justify}.BookCitation-module_textIndent__ejJaC{text-indent:1rem}.BookCitation-module_pageIndex__wUixS{margin-top:auto;padding:.5rem 0;text-align:right}.BookCitation-module_pageLabel__NZ6CE{border-radius:9999px;color:#4b5563;display:inline-block;font-size:1rem;font-weight:500;padding:.25rem .75rem}.BookCitation-module_highlighted__n9p6V{background-color:#eaea79;font-weight:700}.BookCitation-module_highlightedInline__Vaoms{display:inline}.BookCitation-module_highlightedBlock__c-R3J{display:block}.BookCitation-module_blurred__E0v59{filter:blur(2px);pointer-events:none;user-select:none}.BookCitation-module_customScrollbarClass__mwGyt{background-color:#f5f4f4;border:1px solid #cbd5e1;border-radius:.5rem;color:#181b1f;font-family:Times New Roman,Times,serif;font-size:14.4px;font-weight:400;letter-spacing:0;line-height:100%;overflow:auto;padding:40px 50px 0 20px}.BookCitation-module_maxheight38rem__8icW1{max-height:38rem}.BookCitation-module_customScrollbarClass__mwGyt::-webkit-scrollbar{height:0;width:0}.BookCitation-module_customScrollbarClass__mwGyt::-webkit-scrollbar-track{background:#0000}.BookCitation-module_customScrollbarClass__mwGyt::-webkit-scrollbar-thumb{background-color:#a3a4ae;border-radius:10px}.BookCitation-module_customScrollbarClass__mwGyt::-webkit-scrollbar-button{display:none}"));const e=document.head||document.getElementsByTagName("head")[0]||document.documentElement;e&&e.appendChild(o)}();export{o as default};
2
2
  //# sourceMappingURL=BookCitation.module.css.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e,__awaiter as t,__generator as o}from"tslib";import{jsxs as r,jsx as i}from"react/jsx-runtime";import{useState as n,useRef as l,useEffect as a}from"react";import{PanelGroup as d,Panel as c,PanelResizeHandle as s}from"react-resizable-panels";import h from"@mui/material/Accordion";import u from"@mui/material/AccordionSummary";import g from"@mui/material/Typography";import p from"@mui/material/AccordionDetails";import m from"@mui/material/IconButton";import f from"./BookDetailsCard/BookDetailsCard.js";import v from"./BookOverviewCard/BookOverviewCard.js";import y from"./BookElementsCard/BookElementsCard.js";import b from"./BookCopyrightsCard/BookCopyrightsCard.js";import x from"./BookPeopleAwardsCard/BookPeopleAwardsCard.js";import k from"./BookPreview/BookPreview.js";import C from"@mui/icons-material/ExpandMore";import w from"@mui/icons-material/Close";var B={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%"}},D=function(t){var o=t.header,n=t.subheader,l=t.icon;return i("div",e({style:S.wrapper},{children:r("div",e({style:S.inner},{children:[i("div",e({style:{marginBottom:"32px"}},{children:i("div",e({style:S.iconWrapper},{children:l}))})),r("div",{children:[i("h1",e({style:S.heading},{children:o})),i("p",e({style:S.text},{children:n}))]})]}))}))},F=function(S){var F=S.showComingSoon,P=S.onClose,H=S.highlightTerms,I=S.data,z=S.customStyle,j=S.comingSoonData,E=S.isNonHighlightedBlur,M=S.isBlurToggleVisible,T=S.isBookemon,A=S.getHighlightContent,O=S.handleFetchManuscriptElements,L=S.isBookPreview,R=S.isDialog,V=S.defaultElementPages,W=n({textToHighLight:"",content:""}),q=W[0],N=W[1],Q=n(1),Y=Q[0],_=Q[1],G=n(!1),J=G[0],K=G[1],U=n("Book Preview"),X=U[0],Z=U[1],$=n(70),ee=$[0],te=$[1],oe=l(null),re=n(!1),ie=re[0],ne=re[1],le=l(null),ae=l(null),de=l(null),ce=l(null),se=l(null),he=function(e,r,i,n){return void 0===n&&(n=0),t(void 0,void 0,void 0,function(){var t,l,a,d,c,s,h,u,g,p,m,f,v,y,b,x;return o(this,function(o){switch(o.label){case 0:N({textToHighLight:"",content:""}),ne(!1),K(!0),Z(r),o.label=1;case 1:return o.trys.push([1,5,6,7]),i&&0!==i.length?[4,null==A?void 0:A([i[n]])]:(K(!1),te(70),null===(b=oe.current)||void 0===b||b.resize(70),[2]);case 2:if(t=o.sent(),l=(null==t?void 0:t.data)||t||[],!Array.isArray(l)||0===l.length)return ne(!0),K(!1),[2];for(d=(a=function(e){return e?e.replace(/<[^>]*>/g," ").replace(/&nbsp;/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():""})(e),c=null,s=0,h=l;s<h.length;s++)if(f=h[s],a(f.normalizedContent||f.htmlContent).includes(d)){c=f;break}if(!c)for(u=d.split(" ").filter(Boolean);u.length>0;){for(g=u.join(" "),p=0,m=l;p<m.length;p++)if(f=m[p],a(f.normalizedContent||f.htmlContent).includes(g)){c=f;break}if(c)break;u.pop()}return v=l.map(function(e){return e.htmlContent}).join("\n"),N({textToHighLight:c?c.htmlContent:"",content:v}),te(50),null===(x=oe.current)||void 0===x||x.resize(50),!c&&n+1<i.length?[4,he(e,r,i,n+1)]:[3,4];case 3:return[2,o.sent()];case 4:return[2];case 5:return y=o.sent(),console.error("Highlight error:",y),ne(!0),[3,7];case 6:return K(!1),[7];case 7:return[2]}})})},ue=n(!1),ge=ue[0],pe=ue[1],me=n(!1),fe=me[0],ve=me[1],ye=n(!1),be=ye[0],xe=ye[1],ke=n(!1),Ce=ke[0],we=ke[1],Be=n(!1),Se=Be[0],De=Be[1],Fe=n(!1),Pe=Fe[0],He=Fe[1],Ie=n(!1),ze=Ie[0],je=Ie[1],Ee=n(!1),Me=Ee[0],Te=Ee[1],Ae=n(!1),Oe=Ae[0],Le=Ae[1],Re=n(!1),Ve=Re[0],We=Re[1];a(function(){ge&&He(!0),fe&&je(!0),be&&Te(!0),Ce&&Le(!0),Se&&We(!0)},[ge,fe,be,Ce,Se]);var qe=I.bookAwards,Ne=I.bookCopyRight,Qe=I.bookDetails,Ye=I.bookElements,_e=I.bookOverView,Ge=I.bookCoverImage,Je=null==Qe?void 0:Qe.isbn,Ke=null!=P?P:function(){};return r("div",e({style:e(e({},B.dialogContent),R?B.dialogHeight:{})},{children:[!F&&i("div",e({style:B.container},{children:r(d,e({direction:"horizontal"},{children:[i(c,e({order:1,ref:oe,defaultSize:ee||70},{children:r("div",e({style:e(e({},null==B?void 0:B.leftPanel),null==z?void 0:z.leftPanel)},{children:[i("div",e({ref:le,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:r(h,e({expanded:Pe,onChange:function(e,t){return He(t)},slotProps:{transition:{onEntered:function(){var e=le.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:B.accordion},{children:[i(u,e({expandIcon:i(C,{}),style:B.accordionSummary},{children:i(g,e({style:B.heading},{children:"Book Overview"}))})),i(p,e({style:B.accordionDetails},{children:_e&&Object.keys(_e).length>0?i(v,{data:_e,highlightTerms:H,onHighlightMatch:pe}):i("div",e({style:B.errorState},{children:"No overview data available."}))}))]}))})),i("div",e({ref:ae,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:r(h,e({elevation:0,style:B.accordion,expanded:ze,onChange:function(e,t){return je(t)},slotProps:{transition:{onEntered:function(){var e=ae.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:[i(u,e({expandIcon:i(C,{}),style:B.accordionSummary},{children:i(g,e({style:B.heading},{children:"Book Manuscript Elements"}))})),i(p,e({style:B.accordionDetails},{children:i(y,{data:Ye,title:(null==_e?void 0:_e.title)||"",handleFetchManuscriptElements:O,BookIsbn:Je,updateQuotesToHighLight:he,highlightTerms:H,onHighlightMatch:ve,defaultPages:V})}))]}))})),i("div",e({ref:de,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:r(h,e({expanded:Me,onChange:function(e,t){return Te(t)},elevation:0,style:B.accordion,slotProps:{transition:{onEntered:function(){var e=de.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:[i(u,e({expandIcon:i(C,{}),style:B.accordionSummary},{children:i(g,e({style:B.heading},{children:"Book Metadata Details"}))})),i(p,e({style:B.accordionDetails},{children:Qe&&Object.keys(Qe).length>0?i(f,{data:Qe,highlightTerms:H,onHighlightMatch:xe}):i("div",e({style:B.errorState},{children:"No Book Metadata data available."}))}))]}))})),i("div",e({ref:ce,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:r(h,e({elevation:0,style:B.accordion,expanded:Oe,onChange:function(e,t){return Le(t)},slotProps:{transition:{onEntered:function(){var e=ce.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:[i(u,e({expandIcon:i(C,{}),style:B.accordionSummary},{children:i(g,e({style:B.heading},{children:"Copyrights & Marketing"}))})),i(p,e({style:B.accordionDetails},{children:Ne&&Object.keys(Ne).length>0?i(b,{data:Ne,highlightTerms:H,onHighlightMatch:we}):i("div",e({style:B.errorState},{children:"No Copyrights & Marketing data available."}))}))]}))})),i("div",e({ref:se},{children:r(h,e({elevation:0,style:B.accordion,expanded:Ve,onChange:function(e,t){return We(t)},slotProps:{transition:{onEntered:function(){var e=se.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:[i(u,e({expandIcon:i(C,{}),style:B.accordionSummary},{children:i(g,e({style:B.heading},{children:"People & Awards"}))})),i(p,e({style:B.accordionDetails},{children:qe&&Object.keys(qe).length>0?i(x,{data:qe,highlightTerms:H,onHighlightMatch:De}):i("div",e({style:B.errorState},{children:"No People & Awards data available."}))}))]}))}))]}))})),L&&i(s,{style:{width:"3px",background:"#D1D5DC",cursor:"col-resize"}}),L&&i(c,e({order:2,minSize:30,maxSize:50,style:{overflow:"visible",position:"relative",transition:"all 300ms ease-in-out",WebkitTransition:"all 300ms ease-in-out"}},{children:i(k,{bookOverView:_e,bookCoverImage:Ge,onClose:Ke,clickableElementCategory:X,quotesToHighLightData:q,updateQuotesToHighLight:he,citationLoad:J,previewPage:Y,setPreviewPage:_,customStyle:z,comingSoonData:j,isNonHighlightedBlur:E,isBlurToggleVisible:M,isBookemon:T,noHtmlContent:ie})}))]}))})),F&&r("div",e({style:B.blurOverlay},{children:[i(m,e({style:B.closeButton,onClick:P,size:"large"},{children:i(w,{})})),i(D,{header:null==j?void 0:j.header,subheader:null==j?void 0:j.subheader,icon:null==j?void 0:j.icon})]}))]}))};export{F as BookemonContent};
1
+ import{__assign as e,__awaiter as t,__generator as o}from"tslib";import{jsxs as r,jsx as i}from"react/jsx-runtime";import{useState as n,useRef as l,useEffect as a}from"react";import{PanelGroup as d,Panel as c,PanelResizeHandle as s}from"react-resizable-panels";import h from"@mui/material/Accordion";import u from"@mui/material/AccordionSummary";import g from"@mui/material/Typography";import p from"@mui/material/AccordionDetails";import m from"@mui/material/IconButton";import f from"./BookDetailsCard/BookDetailsCard.js";import v from"./BookOverviewCard/BookOverviewCard.js";import y from"./BookElementsCard/BookElementsCard.js";import b from"./BookCopyrightsCard/BookCopyrightsCard.js";import x from"./BookPeopleAwardsCard/BookPeopleAwardsCard.js";import k from"./BookPreview/BookPreview.js";import C from"@mui/icons-material/ExpandMore";import w from"@mui/icons-material/Close";var B={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%"}},D=function(t){var o=t.header,n=t.subheader,l=t.icon;return i("div",e({style:S.wrapper},{children:r("div",e({style:S.inner},{children:[i("div",e({style:{marginBottom:"32px"}},{children:i("div",e({style:S.iconWrapper},{children:l}))})),r("div",{children:[i("h1",e({style:S.heading},{children:o})),i("p",e({style:S.text},{children:n}))]})]}))}))},F=function(S){var F=S.showComingSoon,P=S.onClose,I=S.highlightTerms,H=S.data,z=S.customStyle,j=S.comingSoonData,E=S.isNonHighlightedBlur,M=S.isBlurToggleVisible,T=S.isBookemon,A=S.getHighlightContent,O=S.handleFetchManuscriptElements,L=S.isBookPreview,V=S.isDialog,R=S.defaultElementPages,q=n({textToHighLight:"",content:""}),W=q[0],N=q[1],Q=n(1),Y=Q[0],_=Q[1],G=n(!1),J=G[0],K=G[1],U=n("Book Preview"),X=U[0],Z=U[1],$=n(70),ee=$[0],te=$[1],oe=l(null),re=n(!1),ie=re[0],ne=re[1],le=l(null),ae=l(null),de=l(null),ce=l(null),se=l(null),he=function(e,r,i,n){return void 0===n&&(n=0),t(void 0,void 0,void 0,function(){var t,l,a,d,c,s,h,u,g,p,m,f,v,y,b,x;return o(this,function(o){switch(o.label){case 0:N({textToHighLight:"",content:""}),ne(!1),K(!0),Z(r),o.label=1;case 1:return o.trys.push([1,5,6,7]),i&&0!==i.length?[4,null==A?void 0:A([i[n]])]:(K(!1),te(70),null===(b=oe.current)||void 0===b||b.resize(70),[2]);case 2:if(t=o.sent(),l=(null==t?void 0:t.data)||t||[],!Array.isArray(l)||0===l.length)return ne(!0),K(!1),[2];for(d=(a=function(e){return e?e.replace(/<[^>]*>/g," ").replace(/&nbsp;/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():""})(e),c=null,s=0,h=l;s<h.length;s++)if(f=h[s],a(f.normalizedContent||f.htmlContent).includes(d)){c=f;break}if(!c)for(u=d.split(" ").filter(Boolean);u.length>0;){for(g=u.join(" "),p=0,m=l;p<m.length;p++)if(f=m[p],a(f.normalizedContent||f.htmlContent).includes(g)){c=f;break}if(c)break;u.pop()}return v=l.map(function(e){return e.htmlContent}).join("\n"),N({textToHighLight:c?c.htmlContent:"",content:v}),te(50),null===(x=oe.current)||void 0===x||x.resize(50),!c&&n+1<i.length?[4,he(e,r,i,n+1)]:[3,4];case 3:return[2,o.sent()];case 4:return[2];case 5:return y=o.sent(),console.error("Highlight error:",y),ne(!0),[3,7];case 6:return K(!1),[7];case 7:return[2]}})})},ue=n(!1),ge=ue[0],pe=ue[1],me=n(!1),fe=me[0],ve=me[1],ye=n(!1),be=ye[0],xe=ye[1],ke=n(!1),Ce=ke[0],we=ke[1],Be=n(!1),Se=Be[0],De=Be[1],Fe=n(!1),Pe=Fe[0],Ie=Fe[1],He=n(!1),ze=He[0],je=He[1],Ee=n(!1),Me=Ee[0],Te=Ee[1],Ae=n(!1),Oe=Ae[0],Le=Ae[1],Ve=n(!1),Re=Ve[0],qe=Ve[1];a(function(){ge&&Ie(!0),fe&&je(!0),be&&Te(!0),Ce&&Le(!0),Se&&qe(!0)},[ge,fe,be,Ce,Se]);var We=H.bookAwards,Ne=H.bookCopyRight,Qe=H.bookDetails,Ye=H.bookElements,_e=H.bookOverView,Ge=H.bookCoverImage,Je=null==Qe?void 0:Qe.isbn,Ke=null!=P?P:function(){};return r("div",e({style:e(e({},B.dialogContent),V?B.dialogHeight:{})},{children:[!F&&i("div",e({style:B.container},{children:r(d,e({direction:"horizontal"},{children:[i(c,e({order:1,ref:oe,defaultSize:ee||70},{children:r("div",e({style:e(e({},null==B?void 0:B.leftPanel),null==z?void 0:z.leftPanel)},{children:[i("div",e({ref:le,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:r(h,e({expanded:Pe,onChange:function(e,t){return Ie(t)},slotProps:{transition:{onEntered:function(){var e=le.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:B.accordion},{children:[i(u,e({expandIcon:i(C,{}),style:B.accordionSummary},{children:i(g,e({style:B.heading},{children:"Book Overview"}))})),i(p,e({style:B.accordionDetails},{children:_e&&Object.keys(_e).length>0?i(v,{data:_e,highlightTerms:I,onHighlightMatch:pe}):i("div",e({style:B.errorState},{children:"No overview data available."}))}))]}))})),i("div",e({ref:ae,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:r(h,e({elevation:0,style:B.accordion,expanded:ze,onChange:function(e,t){return je(t)},slotProps:{transition:{onEntered:function(){var e=ae.current;if(e){var t=e.querySelector('[data-highlight="true"]');if(t){t.scrollIntoView({behavior:"smooth",block:"center"});var o=new MutationObserver(function(){var t=e.querySelector('[data-highlight="true"]');t&&t.scrollIntoView({behavior:"auto",block:"center"}),o.disconnect()});o.observe(e,{childList:!0,subtree:!0})}}}}}},{children:[i(u,e({expandIcon:i(C,{}),style:B.accordionSummary},{children:i(g,e({style:B.heading},{children:"Book Manuscript Elements"}))})),i(p,e({style:B.accordionDetails},{children:i(y,{data:Ye,title:(null==_e?void 0:_e.title)||"",handleFetchManuscriptElements:O,BookIsbn:Je,updateQuotesToHighLight:he,highlightTerms:I,onHighlightMatch:ve,defaultPages:R})}))]}))})),i("div",e({ref:de,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:r(h,e({expanded:Me,onChange:function(e,t){return Te(t)},elevation:0,style:B.accordion,slotProps:{transition:{onEntered:function(){var e=de.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:[i(u,e({expandIcon:i(C,{}),style:B.accordionSummary},{children:i(g,e({style:B.heading},{children:"Book Metadata Details"}))})),i(p,e({style:B.accordionDetails},{children:Qe&&Object.keys(Qe).length>0?i(f,{data:Qe,highlightTerms:I,onHighlightMatch:xe}):i("div",e({style:B.errorState},{children:"No Book Metadata data available."}))}))]}))})),i("div",e({ref:ce,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:r(h,e({elevation:0,style:B.accordion,expanded:Oe,onChange:function(e,t){return Le(t)},slotProps:{transition:{onEntered:function(){var e=ce.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:[i(u,e({expandIcon:i(C,{}),style:B.accordionSummary},{children:i(g,e({style:B.heading},{children:"Copyrights & Marketing"}))})),i(p,e({style:B.accordionDetails},{children:Ne&&Object.keys(Ne).length>0?i(b,{data:Ne,highlightTerms:I,onHighlightMatch:we}):i("div",e({style:B.errorState},{children:"No Copyrights & Marketing data available."}))}))]}))})),i("div",e({ref:se},{children:r(h,e({elevation:0,style:B.accordion,expanded:Re,onChange:function(e,t){return qe(t)},slotProps:{transition:{onEntered:function(){var e=se.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:[i(u,e({expandIcon:i(C,{}),style:B.accordionSummary},{children:i(g,e({style:B.heading},{children:"People & Awards"}))})),i(p,e({style:B.accordionDetails},{children:We&&Object.keys(We).length>0?i(x,{data:We,highlightTerms:I,onHighlightMatch:De}):i("div",e({style:B.errorState},{children:"No People & Awards data available."}))}))]}))}))]}))})),L&&i(s,{style:{width:"3px",background:"#D1D5DC",cursor:"col-resize"}}),L&&i(c,e({order:2,minSize:30,maxSize:50,style:{overflow:"visible",position:"relative",transition:"all 300ms ease-in-out",WebkitTransition:"all 300ms ease-in-out"}},{children:i(k,{bookOverView:_e,bookCoverImage:Ge,onClose:Ke,clickableElementCategory:X,quotesToHighLightData:W,updateQuotesToHighLight:he,citationLoad:J,previewPage:Y,setPreviewPage:_,customStyle:z,comingSoonData:j,isNonHighlightedBlur:E,isBlurToggleVisible:M,isBookemon:T,noHtmlContent:ie})}))]}))})),F&&r("div",e({style:B.blurOverlay},{children:[i(m,e({style:B.closeButton,onClick:P,size:"large"},{children:i(w,{})})),i(D,{header:null==j?void 0:j.header,subheader:null==j?void 0:j.subheader,icon:null==j?void 0:j.icon})]}))]}))};export{F as BookemonContent};
2
2
  //# sourceMappingURL=BookemonContent.js.map
@@ -1,2 +1,2 @@
1
- import{__spreadArray as r}from"tslib";var t=function(t,n){if(!t)return"";if(!n||0===n.length)return t;for(var e=t,o=0,a=r([],n,!0).map(function(r){return r.trim()}).filter(Boolean).sort(function(r,t){return t.length-r.length});o<a.length;o++){var i=a[o].replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),f=new RegExp("\\b(".concat(i,")\\b"),"gi");e=e.replace(f,'<span data-highlight="true" style="background-color:#ffffb8;border-radius:2px;">$1</span>')}return e},n=function(r,n){return r?n&&0!==n.length?t(r,n):r:""};export{t as highlightTermsFunc,n as processTextWithHighlight};
1
+ import{__spreadArray as r}from"tslib";var t=function(t,n){if(!t)return"";if(!n||0===n.length)return t;for(var e=t,o=0,a=r([],n,!0).map(function(r){return r.trim()}).filter(Boolean).sort(function(r,t){return t.length-r.length});o<a.length;o++){var i=a[o].replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),u=new RegExp("(".concat(i,")"),"giu");e=e.replace(u,'<span data-highlight="true" style="background-color:#ffffb8;border-radius:2px;">$1</span>')}return e},n=function(r,n){return r?n&&0!==n.length?t(r,n):r:""};export{t as highlightTermsFunc,n as processTextWithHighlight};
2
2
  //# sourceMappingURL=highlight.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as o}from"tslib";import{jsxs as l,jsx as i}from"react/jsx-runtime";import e from"./components/ChatCitation.js";import{getColorCode as n}from"./utils/helpers.js";import t from"./components/Chip.js";import r from"./assets/message-chat-square.svg.js";import"@mui/icons-material/KeyboardArrowDown";import"@mui/icons-material/KeyboardArrowUp";import"@mui/icons-material/Clear";import d from"./components/InViewNavigation.js";import a from"./components/DetailedView.js";import u from"./components/SummarizedView.js";import v from"./components/RuleBook.js";import{useState as s,useRef as c,useMemo as h,useEffect as m,useCallback as f}from"react";import{defaultRenderer as p}from"./constants/renderer.js";import b from"./components/IconContainer.js";import{Table as y}from"lucide-react";import{BigQueryTable as g}from"./BigQueryTable.js";import x from"@mui/icons-material/CloseOutlined";function w(w){var C,k,S,A,D,T,I,R,V,F,j,z,P,E,B,H,q,N,W,Y,K,O,Q,U,G,J,L,M,X,Z,$,_,oo,lo,io,eo,no,to,ro,ao,uo,vo,so,co,ho,mo=w.rootContainer,fo=w.chatContainer,po=void 0===fo?{chatData:[]}:fo,bo=w.ruleBookContainer,yo=w.renderer,go=w.additionalData,xo=w.tableComponent,wo=w.closePreview,Co=w.isRenderedCustomComponent,ko=void 0!==Co&&Co,So=w.showRootContainer,Ao=void 0===So||So,Do=w.reversePanels,To=void 0!==Do&&Do,Io=s(0),Ro=Io[0],Vo=Io[1],Fo=s(0),jo=Fo[0],zo=Fo[1],Po=s(0),Eo=Po[0],Bo=Po[1],Ho=s(0),qo=Ho[0],No=Ho[1],Wo=c(null),Yo=c(null),Ko=h(function(){return o(o({},p),yo)},[yo]),Oo=h(function(){return!!((null==xo?void 0:xo.rows)&&Object.keys(xo.rows).length>0)},[xo]),Qo=h(function(){var o;return null!==(o=null==go?void 0:go.RuleBookDetailedViewVerticallyStacked)&&void 0!==o&&o},[null==go?void 0:go.RuleBookDetailedViewVerticallyStacked]);m(function(){var o,l;if((null==bo?void 0:bo.show)&&Wo.current){var i=null===(o=Wo.current)||void 0===o?void 0:o.querySelectorAll(".rule-book-highlight");if(Vo((null==i?void 0:i.length)||0),zo(0),i&&i.length>0)(e=i[0]).style.backgroundColor="#ffff5c",e.scrollIntoView({behavior:"smooth",block:"center"})}if((null==po?void 0:po.show)&&(null==Yo?void 0:Yo.current)){var e,n=null===(l=Yo.current)||void 0===l?void 0:l.querySelectorAll(".user-chat-highlight");if(Bo((null==n?void 0:n.length)||0),No(0),n&&n.length>0)(e=n[0]).style.backgroundColor="#ffff5c",e.scrollIntoView({behavior:"smooth",block:"center"})}},[null==po?void 0:po.show,null==bo?void 0:bo.show,null==bo?void 0:bo.data,null==po?void 0:po.chatData]);var Uo=f(function(){var o;if(jo+1<Ro){var l=null===(o=Wo.current)||void 0===o?void 0:o.querySelectorAll(".rule-book-highlight");if(!l)return;l[jo].style.backgroundColor="#ffffb8";var i=jo+1;zo(i);var e=l[i];e.style.backgroundColor="#ffff5c",null==e||e.scrollIntoView({behavior:"smooth",block:"center"})}},[jo,Ro]),Go=f(function(){var o;if(!(jo-1<0)){var l=null===(o=Wo.current)||void 0===o?void 0:o.querySelectorAll(".rule-book-highlight");if(l){l[jo].style.backgroundColor="#ffffb8";var i=jo-1,e=l[i];e.style.backgroundColor="#ffff5c",zo(i),null==e||e.scrollIntoView({behavior:"smooth",block:"center"})}}},[jo]),Jo=f(function(){var o;if(qo+1<Eo){var l=null===(o=Yo.current)||void 0===o?void 0:o.querySelectorAll(".user-chat-highlight");if(!l)return;l[qo].style.backgroundColor="#ffffb8";var i=qo+1,e=l[i];e.style.backgroundColor="#ffff5c",No(i),null==e||e.scrollIntoView({behavior:"smooth",block:"center"})}},[qo,Eo]),Lo=f(function(){var o;if(!(qo-1<0)){var l=null===(o=Yo.current)||void 0===o?void 0:o.querySelectorAll(".user-chat-highlight");if(l){l[qo].style.backgroundColor="#ffffb8";var i=qo-1,e=l[i];e.style.backgroundColor="#ffff5c",No(i),null==e||e.scrollIntoView({behavior:"smooth",block:"center"})}}},[qo]),Mo=n((null==mo?void 0:mo.relevanceScore)||0),Xo=h(function(){var e,n=l("span",o({style:o({display:"flex",border:"1px solid",alignItems:"center",gap:"4px",borderRadius:"6px",padding:"2px 8px",fontSize:"12px",borderColor:Mo.border,backgroundColor:Mo.background,color:Mo.text},null===(e=null==mo?void 0:mo.slotStyles)||void 0===e?void 0:e.relevanceScore)},{children:[(null==mo?void 0:mo.relevanceTitle)||"Decision Strength",":"," ",(null==mo?void 0:mo.relevanceScore)||0,"%"]}),"relevance-score"),t=i("span",o({style:{display:"flex",alignItems:"center",gap:"4px",borderRadius:"6px",padding:"2px 8px",fontSize:"12px",backgroundColor:"white",color:"black",cursor:"pointer"},onClick:wo},{children:i(x,{})}),"close-preview");return ko&&!(null==go?void 0:go.isExpanded)?[n,t]:[n]},[ko,Mo.background,Mo.border,Mo.text,null==mo?void 0:mo.relevanceScore,null===(C=null==mo?void 0:mo.slotStyles)||void 0===C?void 0:C.relevanceScore,null==mo?void 0:mo.relevanceTitle]),Zo=h(function(){return[Ro>0&&i(d,{currentItemNumber:jo+1,totalItems:Ro,disableNext:jo+1>=Ro,onNext:Uo,onPrevious:Go,disablePrevious:jo<=0},"rulebook-nav")]},[jo,Uo,Go,Ro]),$o=h(function(){return(null==go?void 0:go.RuleBookContainerHeight)?go.RuleBookContainerHeight:!(!Qo||(null==go?void 0:go.isExpanded))&&"600px"},[null==go?void 0:go.RuleBookContainerHeight,Qo]),_o=h(function(){var o,l;return[(null===(l=null===(o=null==po?void 0:po.detailedTab)||void 0===o?void 0:o.chip)||void 0===l?void 0:l.isActive)&&Eo>0&&i(d,{currentItemNumber:qo+1,totalItems:Eo,onNext:Jo,onPrevious:Lo,disableNext:qo+1>=Eo,disablePrevious:qo<=0},"chat-nav")]},[null===(S=null===(k=null==po?void 0:po.detailedTab)||void 0===k?void 0:k.chip)||void 0===S?void 0:S.isActive,qo,Jo,Lo,Eo]),ol=l("div",o({style:o({display:"flex",flexDirection:To?Qo?"column-reverse":"row-reverse":Qo?"column":"row",gap:"12px",height:$o||"100%",minHeight:0},null===(A=null==mo?void 0:mo.slotStyles)||void 0===A?void 0:A.container)},{children:[Oo&&i("span",o({style:o({flex:"1 1 0%",minWidth:0},null===(D=null==po?void 0:po.slotStyles)||void 0===D?void 0:D.outerContainer)},{children:i(e,o({title:"Invoice Data Preview",icon:i(b,{children:i(y,{size:16})}),slotStyles:{title:{color:"#475569",fontWeight:500}},secondaryActions:[]},{children:i("div",o({style:{height:"100%",maxHeight:(null==go?void 0:go.isExpanded)?"none":"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",backgroundColor:"#FFFFFF",position:"relative",overflow:"hidden"}},{children:(null==xo?void 0:xo.rows)&&i(g,{rows:xo.rows,columns:xo.columns||[]})}))}))})),(null==bo?void 0:bo.data)&&(bo.show||void 0===bo.show)&&i("span",o({style:o({flex:"1 1 0%",minWidth:0},null===(T=null==bo?void 0:bo.slotStyles)||void 0===T?void 0:T.outerContainer)},{children:i(e,o({title:null!==(I=null==bo?void 0:bo.title)&&void 0!==I?I:"Rule book",icon:null==bo?void 0:bo.ruleBookIcon,slotStyles:{title:o({color:"#475569",fontWeight:500},null===(R=null==bo?void 0:bo.slotStyles)||void 0===R?void 0:R.title)},secondaryActions:(null==bo?void 0:bo.secondaryActions)?bo.secondaryActions(Zo):Zo},{children:i("div",o({style:o({height:"100%",maxHeight:"275px",minHeight:0,border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"12px",backgroundColor:"#F8FAFC",position:"relative",overflowY:"auto"},null===(V=null==bo?void 0:bo.slotStyles)||void 0===V?void 0:V.dataContainer)},{children:i("div",o({style:{padding:"12px",height:"100%",overflowY:"auto"},ref:Wo},{children:i(v,{data:bo.data,renderers:null!==(F=null==bo?void 0:bo.renderer)&&void 0!==F?F:Ko})}))}))}))})),(null==po?void 0:po.chatData)&&po.chatData.length>0&&(po.show||void 0===po.show)&&i("span",o({style:o({flex:"1 1 0%",minWidth:0},null===(j=null==po?void 0:po.slotStyles)||void 0===j?void 0:j.outerContainer)},{children:i(e,o({title:null!==(z=null==po?void 0:po.title)&&void 0!==z?z:"Chat",icon:null==po?void 0:po.chatIcon,containerStyles:null===(P=null==po?void 0:po.slotStyles)||void 0===P?void 0:P.container,slotStyles:{title:o({color:"#475569",fontWeight:500},null===(E=null==po?void 0:po.slotStyles)||void 0===E?void 0:E.title)},primaryActions:[((null===(H=null===(B=null==po?void 0:po.summarizedTab)||void 0===B?void 0:B.chip)||void 0===H?void 0:H.show)||void 0===(null===(N=null===(q=null==po?void 0:po.summarizedTab)||void 0===q?void 0:q.chip)||void 0===N?void 0:N.show))&&i(t,o({label:"Summarized"},null===(W=null==po?void 0:po.summarizedTab)||void 0===W?void 0:W.chip)),i(t,o({label:"Detailed"},null===(Y=null==po?void 0:po.detailedTab)||void 0===Y?void 0:Y.chip))],secondaryActions:po.secondaryActions?null==po?void 0:po.secondaryActions(_o):_o},{children:l("div",o({style:o({height:"100%",maxHeight:"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"12px",backgroundColor:"#F8FAFC",position:"relative",overflowY:"auto"},null===(K=null==po?void 0:po.slotStyles)||void 0===K?void 0:K.chatDataContainer)},{children:[(null===(Q=null===(O=null==po?void 0:po.detailedTab)||void 0===O?void 0:O.chip)||void 0===Q?void 0:Q.isActive)&&i("div",o({ref:Yo,style:{position:(null==go?void 0:go.isExpanded)?"absolute":"relative",inset:0,padding:"12px",overflowY:"auto"}},{children:i(a,{chatData:null!==(U=po.chatData)&&void 0!==U?U:[],assistantChatProps:o(o({},null===(J=null===(G=null==po?void 0:po.detailedTab)||void 0===G?void 0:G.view)||void 0===J?void 0:J.assistantChatProps),{renderers:null!==(X=null===(M=null===(L=null==po?void 0:po.detailedTab)||void 0===L?void 0:L.detailedViewRenderer)||void 0===M?void 0:M.assistantText)&&void 0!==X?X:Ko}),userChatItemProps:o(o({},null===($=null===(Z=null==po?void 0:po.detailedTab)||void 0===Z?void 0:Z.view)||void 0===$?void 0:$.userChatItemProps),{renderers:null!==(lo=null===(oo=null===(_=null==po?void 0:po.detailedTab)||void 0===_?void 0:_.detailedViewRenderer)||void 0===oo?void 0:oo.userText)&&void 0!==lo?lo:Ko})})})),(null===(eo=null===(io=null==po?void 0:po.summarizedTab)||void 0===io?void 0:io.chip)||void 0===eo?void 0:eo.show)&&(null===(to=null===(no=null==po?void 0:po.summarizedTab)||void 0===no?void 0:no.chip)||void 0===to?void 0:to.isActive)&&i(u,o({chatData:null!==(ro=po.chatData)&&void 0!==ro?ro:[]},null===(ao=null==po?void 0:po.summarizedTab)||void 0===ao?void 0:ao.view,{renderer:null!==(vo=null===(uo=null==po?void 0:po.summarizedTab)||void 0===uo?void 0:uo.summarizedViewRenderer)&&void 0!==vo?vo:Ko}))]}))}))}))]}));return Ao?i(e,o({title:null==mo?void 0:mo.title,slotStyles:{title:null===(so=null==mo?void 0:mo.slotStyles)||void 0===so?void 0:so.title},containerStyles:null===(co=null==mo?void 0:mo.slotStyles)||void 0===co?void 0:co.container,icon:null!==(ho=null==mo?void 0:mo.icon)&&void 0!==ho?ho:i(b,{children:i("img",{src:r,alt:"chat icon",style:{width:16,height:16}})}),secondaryActions:(null==mo?void 0:mo.secondaryActions)?mo.secondaryActions(Xo):Xo},{children:ol})):ol}export{w as default};
1
+ import{__assign as o}from"tslib";import{jsxs as l,jsx as i}from"react/jsx-runtime";import e from"./components/ChatCitation.js";import{getColorCode as n}from"./utils/helpers.js";import t from"./components/Chip.js";import r from"./assets/message-chat-square.svg.js";import"@mui/icons-material/KeyboardArrowDown";import"@mui/icons-material/KeyboardArrowUp";import"@mui/icons-material/Clear";import d from"./components/InViewNavigation.js";import a from"./components/DetailedView.js";import u from"./components/SummarizedView.js";import v from"./components/RuleBook.js";import{useState as s,useRef as c,useMemo as h,useEffect as f,useCallback as m}from"react";import{defaultRenderer as p}from"./constants/renderer.js";import b from"./components/IconContainer.js";import{Table as g}from"lucide-react";import{BigQueryTable as y}from"./BigQueryTable.js";import x from"@mui/icons-material/CloseOutlined";function w(w){var C,k,S,A,D,T,I,R,V,F,j,z,P,B,E,H,q,N,W,Y,K,O,Q,U,G,J,L,M,X,Z,$,_,oo,lo,io,eo,no,to,ro,ao,uo,vo,so,co,ho,fo=w.rootContainer,mo=w.chatContainer,po=void 0===mo?{chatData:[]}:mo,bo=w.ruleBookContainer,go=w.renderer,yo=w.additionalData,xo=w.tableComponent,wo=w.closePreview,Co=w.isRenderedCustomComponent,ko=void 0!==Co&&Co,So=w.showRootContainer,Ao=void 0===So||So,Do=w.reversePanels,To=void 0!==Do&&Do,Io=s(0),Ro=Io[0],Vo=Io[1],Fo=s(0),jo=Fo[0],zo=Fo[1],Po=s(0),Bo=Po[0],Eo=Po[1],Ho=s(0),qo=Ho[0],No=Ho[1],Wo=c(null),Yo=c(null),Ko=h(function(){return o(o({},p),go)},[go]),Oo=h(function(){return!!((null==xo?void 0:xo.rows)&&Object.keys(xo.rows).length>0)},[xo]),Qo=h(function(){var o;return null!==(o=null==yo?void 0:yo.RuleBookDetailedViewVerticallyStacked)&&void 0!==o&&o},[null==yo?void 0:yo.RuleBookDetailedViewVerticallyStacked]);f(function(){var o,l;if((null==bo?void 0:bo.show)&&Wo.current){var i=null===(o=Wo.current)||void 0===o?void 0:o.querySelectorAll(".rule-book-highlight");if(Vo((null==i?void 0:i.length)||0),zo(0),i&&i.length>0)(e=i[0]).style.backgroundColor="#ffff5c",e.scrollIntoView({behavior:"smooth",block:"center"})}if((null==po?void 0:po.show)&&(null==Yo?void 0:Yo.current)){var e,n=null===(l=Yo.current)||void 0===l?void 0:l.querySelectorAll(".user-chat-highlight");if(Eo((null==n?void 0:n.length)||0),No(0),n&&n.length>0)(e=n[0]).style.backgroundColor="#ffff5c",e.scrollIntoView({behavior:"smooth",block:"center"})}},[null==po?void 0:po.show,null==bo?void 0:bo.show,null==bo?void 0:bo.data,null==po?void 0:po.chatData]);var Uo=m(function(){var o;if(jo+1<Ro){var l=null===(o=Wo.current)||void 0===o?void 0:o.querySelectorAll(".rule-book-highlight");if(!l)return;l[jo].style.backgroundColor="#ffffb8";var i=jo+1;zo(i);var e=l[i];e.style.backgroundColor="#ffff5c",null==e||e.scrollIntoView({behavior:"smooth",block:"center"})}},[jo,Ro]),Go=m(function(){var o;if(!(jo-1<0)){var l=null===(o=Wo.current)||void 0===o?void 0:o.querySelectorAll(".rule-book-highlight");if(l){l[jo].style.backgroundColor="#ffffb8";var i=jo-1,e=l[i];e.style.backgroundColor="#ffff5c",zo(i),null==e||e.scrollIntoView({behavior:"smooth",block:"center"})}}},[jo]),Jo=m(function(){var o;if(qo+1<Bo){var l=null===(o=Yo.current)||void 0===o?void 0:o.querySelectorAll(".user-chat-highlight");if(!l)return;l[qo].style.backgroundColor="#ffffb8";var i=qo+1,e=l[i];e.style.backgroundColor="#ffff5c",No(i),null==e||e.scrollIntoView({behavior:"smooth",block:"center"})}},[qo,Bo]),Lo=m(function(){var o;if(!(qo-1<0)){var l=null===(o=Yo.current)||void 0===o?void 0:o.querySelectorAll(".user-chat-highlight");if(l){l[qo].style.backgroundColor="#ffffb8";var i=qo-1,e=l[i];e.style.backgroundColor="#ffff5c",No(i),null==e||e.scrollIntoView({behavior:"smooth",block:"center"})}}},[qo]),Mo=n((null==fo?void 0:fo.relevanceScore)||0),Xo=h(function(){var e,n=l("span",o({style:o({display:"flex",border:"1px solid",alignItems:"center",gap:"4px",borderRadius:"6px",padding:"2px 8px",fontSize:"12px",borderColor:Mo.border,backgroundColor:Mo.background,color:Mo.text},null===(e=null==fo?void 0:fo.slotStyles)||void 0===e?void 0:e.relevanceScore)},{children:[(null==fo?void 0:fo.relevanceTitle)||"Decision Strength",":"," ",(null==fo?void 0:fo.relevanceScore)||0,"%"]}),"relevance-score"),t=i("span",o({style:{display:"flex",alignItems:"center",gap:"4px",borderRadius:"6px",padding:"2px 8px",fontSize:"12px",backgroundColor:"white",color:"black",cursor:"pointer"},onClick:wo},{children:i(x,{})}),"close-preview");return ko&&!(null==yo?void 0:yo.isExpanded)?[n,t]:[n]},[ko,Mo.background,Mo.border,Mo.text,null==fo?void 0:fo.relevanceScore,null===(C=null==fo?void 0:fo.slotStyles)||void 0===C?void 0:C.relevanceScore,null==fo?void 0:fo.relevanceTitle]),Zo=h(function(){return[Ro>0&&i(d,{currentItemNumber:jo+1,totalItems:Ro,disableNext:jo+1>=Ro,onNext:Uo,onPrevious:Go,disablePrevious:jo<=0},"rulebook-nav")]},[jo,Uo,Go,Ro]),$o=h(function(){return(null==yo?void 0:yo.RuleBookContainerHeight)?yo.RuleBookContainerHeight:!(!Qo||(null==yo?void 0:yo.isExpanded))&&"600px"},[null==yo?void 0:yo.RuleBookContainerHeight,Qo]),_o=h(function(){var o,l;return[(null===(l=null===(o=null==po?void 0:po.detailedTab)||void 0===o?void 0:o.chip)||void 0===l?void 0:l.isActive)&&Bo>0&&i(d,{currentItemNumber:qo+1,totalItems:Bo,onNext:Jo,onPrevious:Lo,disableNext:qo+1>=Bo,disablePrevious:qo<=0},"chat-nav")]},[null===(S=null===(k=null==po?void 0:po.detailedTab)||void 0===k?void 0:k.chip)||void 0===S?void 0:S.isActive,qo,Jo,Lo,Bo]),ol=l("div",o({style:o({display:"flex",flexDirection:To?Qo?"column-reverse":"row-reverse":Qo?"column":"row",gap:[(null==po?void 0:po.chatData)&&po.chatData.length>0&&(po.show||void 0===po.show),(null==bo?void 0:bo.data)&&(bo.show||void 0===bo.show),Oo].filter(Boolean).length>1?"12px":"0",height:$o||"100%",minHeight:0},null===(A=null==fo?void 0:fo.slotStyles)||void 0===A?void 0:A.container)},{children:[Oo&&i("span",o({style:o({flex:"1 1 0%",minWidth:0},null===(D=null==po?void 0:po.slotStyles)||void 0===D?void 0:D.outerContainer)},{children:i(e,o({title:"Invoice Data Preview",icon:i(b,{children:i(g,{size:16})}),slotStyles:{title:{color:"#475569",fontWeight:500}},secondaryActions:[]},{children:i("div",o({style:{height:"100%",maxHeight:(null==yo?void 0:yo.isExpanded)?"none":"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",backgroundColor:"#FFFFFF",position:"relative",overflow:"hidden"}},{children:(null==xo?void 0:xo.rows)&&i(y,{rows:xo.rows,columns:xo.columns||[]})}))}))})),(null==bo?void 0:bo.data)&&(bo.show||void 0===bo.show)&&i("span",o({style:o({flex:"1 1 0%",minWidth:0},null===(T=null==bo?void 0:bo.slotStyles)||void 0===T?void 0:T.outerContainer)},{children:i(e,o({title:null!==(I=null==bo?void 0:bo.title)&&void 0!==I?I:"Rule book",icon:null==bo?void 0:bo.ruleBookIcon,slotStyles:{title:o({color:"#475569",fontWeight:500},null===(R=null==bo?void 0:bo.slotStyles)||void 0===R?void 0:R.title)},secondaryActions:(null==bo?void 0:bo.secondaryActions)?bo.secondaryActions(Zo):Zo},{children:i("div",o({style:o({height:"100%",maxHeight:"275px",minHeight:0,border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"12px",backgroundColor:"#F8FAFC",position:"relative",overflowY:"auto"},null===(V=null==bo?void 0:bo.slotStyles)||void 0===V?void 0:V.dataContainer)},{children:i("div",o({style:{padding:"12px",height:"100%",overflowY:"auto"},ref:Wo},{children:i(v,{data:bo.data,renderers:null!==(F=null==bo?void 0:bo.renderer)&&void 0!==F?F:Ko})}))}))}))})),(null==po?void 0:po.chatData)&&po.chatData.length>0&&(po.show||void 0===po.show)&&i("span",o({style:o({flex:"1 1 0%",minWidth:0},null===(j=null==po?void 0:po.slotStyles)||void 0===j?void 0:j.outerContainer)},{children:i(e,o({title:null!==(z=null==po?void 0:po.title)&&void 0!==z?z:"Chat",icon:null==po?void 0:po.chatIcon,containerStyles:null===(P=null==po?void 0:po.slotStyles)||void 0===P?void 0:P.container,slotStyles:{title:o({color:"#475569",fontWeight:500},null===(B=null==po?void 0:po.slotStyles)||void 0===B?void 0:B.title)},primaryActions:[((null===(H=null===(E=null==po?void 0:po.summarizedTab)||void 0===E?void 0:E.chip)||void 0===H?void 0:H.show)||void 0===(null===(N=null===(q=null==po?void 0:po.summarizedTab)||void 0===q?void 0:q.chip)||void 0===N?void 0:N.show))&&i(t,o({label:"Summarized"},null===(W=null==po?void 0:po.summarizedTab)||void 0===W?void 0:W.chip)),i(t,o({label:"Detailed"},null===(Y=null==po?void 0:po.detailedTab)||void 0===Y?void 0:Y.chip))],secondaryActions:po.secondaryActions?null==po?void 0:po.secondaryActions(_o):_o},{children:l("div",o({style:o({height:"100%",maxHeight:"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"12px",backgroundColor:"#F8FAFC",position:"relative",overflowY:"auto"},null===(K=null==po?void 0:po.slotStyles)||void 0===K?void 0:K.chatDataContainer)},{children:[(null===(Q=null===(O=null==po?void 0:po.detailedTab)||void 0===O?void 0:O.chip)||void 0===Q?void 0:Q.isActive)&&i("div",o({ref:Yo,style:{position:(null==yo?void 0:yo.isExpanded)?"absolute":"relative",inset:0,padding:"12px",overflowY:"auto"}},{children:i(a,{chatData:null!==(U=po.chatData)&&void 0!==U?U:[],assistantChatProps:o(o({},null===(J=null===(G=null==po?void 0:po.detailedTab)||void 0===G?void 0:G.view)||void 0===J?void 0:J.assistantChatProps),{renderers:null!==(X=null===(M=null===(L=null==po?void 0:po.detailedTab)||void 0===L?void 0:L.detailedViewRenderer)||void 0===M?void 0:M.assistantText)&&void 0!==X?X:Ko}),userChatItemProps:o(o({},null===($=null===(Z=null==po?void 0:po.detailedTab)||void 0===Z?void 0:Z.view)||void 0===$?void 0:$.userChatItemProps),{renderers:null!==(lo=null===(oo=null===(_=null==po?void 0:po.detailedTab)||void 0===_?void 0:_.detailedViewRenderer)||void 0===oo?void 0:oo.userText)&&void 0!==lo?lo:Ko})})})),(null===(eo=null===(io=null==po?void 0:po.summarizedTab)||void 0===io?void 0:io.chip)||void 0===eo?void 0:eo.show)&&(null===(to=null===(no=null==po?void 0:po.summarizedTab)||void 0===no?void 0:no.chip)||void 0===to?void 0:to.isActive)&&i(u,o({chatData:null!==(ro=po.chatData)&&void 0!==ro?ro:[]},null===(ao=null==po?void 0:po.summarizedTab)||void 0===ao?void 0:ao.view,{renderer:null!==(vo=null===(uo=null==po?void 0:po.summarizedTab)||void 0===uo?void 0:uo.summarizedViewRenderer)&&void 0!==vo?vo:Ko}))]}))}))}))]}));return Ao?i(e,o({title:null==fo?void 0:fo.title,slotStyles:{title:null===(so=null==fo?void 0:fo.slotStyles)||void 0===so?void 0:so.title},containerStyles:null===(co=null==fo?void 0:fo.slotStyles)||void 0===co?void 0:co.container,icon:null!==(ho=null==fo?void 0:fo.icon)&&void 0!==ho?ho:i(b,{children:i("img",{src:r,alt:"chat icon",style:{width:16,height:16}})}),secondaryActions:(null==fo?void 0:fo.secondaryActions)?fo.secondaryActions(Xo):Xo},{children:ol})):ol}export{w as default};
2
2
  //# sourceMappingURL=InternalChatCitationRenderer.js.map
@@ -26,6 +26,7 @@ interface CitationLinkProps {
26
26
  bookBodyContent?: CSSProperties;
27
27
  customScrollbarClass?: CSSProperties;
28
28
  relativeWrapper?: CSSProperties;
29
+ showGradientOverlay?: boolean;
29
30
  };
30
31
  citationNumber?: number;
31
32
  partialMatch?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"BookCitation.d.ts","sourceRoot":"","sources":["../../../../../src/features/BookCitation/BookCitation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAuB,MAAM,OAAO,CAAC;AAIlE,UAAU,iBAAiB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uBAAuB,CAAC,EAAE,MAAM,IAAI,CAAC;IACrC,qBAAqB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxC,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACrC,oBAAoB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvC,WAAW,CAAC,EAAE;QACZ,qBAAqB,CAAC,EAAE,aAAa,CAAC;QACtC,KAAK,CAAC,EAAE,aAAa,CAAC;QACtB,cAAc,CAAC,EAAE,aAAa,CAAC;QAC/B,iBAAiB,CAAC,EAAE,aAAa,CAAC;QAClC,UAAU,CAAC,EAAE,aAAa,CAAC;QAC3B,QAAQ,CAAC,EAAE,aAAa,CAAC;QACzB,SAAS,CAAC,EAAE,aAAa,CAAC;QAC1B,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,mBAAmB,CAAC,EAAE,aAAa,CAAC;QACpC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,oBAAoB,CAAC,EAAE,aAAa,CAAC;QACrC,eAAe,CAAC,EAAE,aAAa,CAAC;KACjC,CAAC;IACF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAoc7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"BookCitation.d.ts","sourceRoot":"","sources":["../../../../../src/features/BookCitation/BookCitation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAuB,MAAM,OAAO,CAAC;AAIlE,UAAU,iBAAiB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uBAAuB,CAAC,EAAE,MAAM,IAAI,CAAC;IACrC,qBAAqB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxC,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACrC,oBAAoB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvC,WAAW,CAAC,EAAE;QACZ,qBAAqB,CAAC,EAAE,aAAa,CAAC;QACtC,KAAK,CAAC,EAAE,aAAa,CAAC;QACtB,cAAc,CAAC,EAAE,aAAa,CAAC;QAC/B,iBAAiB,CAAC,EAAE,aAAa,CAAC;QAClC,UAAU,CAAC,EAAE,aAAa,CAAC;QAC3B,QAAQ,CAAC,EAAE,aAAa,CAAC;QACzB,SAAS,CAAC,EAAE,aAAa,CAAC;QAC1B,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,mBAAmB,CAAC,EAAE,aAAa,CAAC;QACpC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,oBAAoB,CAAC,EAAE,aAAa,CAAC;QACrC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,mBAAmB,CAAC,EAAE,OAAO,CAAA;KAC9B,CAAC;IACF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAmf7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"BookemonContent.d.ts","sourceRoot":"","sources":["../../../../../src/features/Bookemon/BookemonContent.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AA0LvD,eAAO,MAAM,eAAe,4OAevB,aAAa,4CAsff,CAAC"}
1
+ {"version":3,"file":"BookemonContent.d.ts","sourceRoot":"","sources":["../../../../../src/features/Bookemon/BookemonContent.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AA0LvD,eAAO,MAAM,eAAe,4OAevB,aAAa,4CAwgBf,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"highlight.d.ts","sourceRoot":"","sources":["../../../../../../src/features/Bookemon/utils/highlight.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,kBAAkB,SACvB,MAAM,GAAG,IAAI,GAAG,SAAS,UACvB,MAAM,EAAE,KACf,MA4BF,CAAC;AAEF,eAAO,MAAM,wBAAwB,SAC7B,MAAM,GAAG,IAAI,GAAG,SAAS,mBACd,MAAM,EAAE,KACxB,MAQF,CAAC"}
1
+ {"version":3,"file":"highlight.d.ts","sourceRoot":"","sources":["../../../../../../src/features/Bookemon/utils/highlight.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,kBAAkB,SACvB,MAAM,GAAG,IAAI,GAAG,SAAS,UACvB,MAAM,EAAE,KACf,MA6BF,CAAC;AAEF,eAAO,MAAM,wBAAwB,SAC7B,MAAM,GAAG,IAAI,GAAG,SAAS,mBACd,MAAM,EAAE,KACxB,MAQF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"InternalChatCitationRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/features/ChatCitation/InternalChatCitationRenderer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAU5D,OAAO,qBAAqB,CAAC;AAM7B,UAAU,iBAAiB;IACzB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAGD,KAAK,iCAAiC,GAAG,iBAAiB,GAAG;IAC3D,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,cAAc,CAAC,EAAE,iBAAiB,CAAC;CACpC,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,4BAA4B,CAAC,EACnD,aAAa,EACb,aAAgC,EAChC,iBAAiB,EACjB,QAAQ,EACR,cAAc,EACd,cAAc,EACd,YAAY,EACZ,yBAAiC,EACjC,iBAAwB,EACxB,aAAmB,EACpB,EAAE,iCAAiC,2CAigBnC"}
1
+ {"version":3,"file":"InternalChatCitationRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/features/ChatCitation/InternalChatCitationRenderer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAU5D,OAAO,qBAAqB,CAAC;AAM7B,UAAU,iBAAiB;IACzB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAGD,KAAK,iCAAiC,GAAG,iBAAiB,GAAG;IAC3D,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,cAAc,CAAC,EAAE,iBAAiB,CAAC;CACpC,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,4BAA4B,CAAC,EACnD,aAAa,EACb,aAAgC,EAChC,iBAAiB,EACjB,QAAQ,EACR,cAAc,EACd,cAAc,EACd,YAAY,EACZ,yBAAiC,EACjC,iBAAwB,EACxB,aAAmB,EACpB,EAAE,iCAAiC,2CA2gBnC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-llm-studio/citation",
3
- "version": "0.0.138",
3
+ "version": "0.0.140",
4
4
  "author": "Devesh Patel",
5
5
  "description": "",
6
6
  "license": "MIT",