@e-llm-studio/citation 0.0.236 → 0.0.238
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/cjs/features/PdfViewer/PdfToolbar.js +1 -1
- package/dist/cjs/features/PdfViewer/PdfViewer.js +1 -1
- package/dist/cjs/features/SPBAnalysisPanel/Spbanalysispanel.js +1 -1
- package/dist/features/PdfViewer/PdfToolbar.js +1 -1
- package/dist/features/PdfViewer/PdfViewer.js +1 -1
- package/dist/features/SPBAnalysisPanel/Spbanalysispanel.js +1 -1
- package/dist/types/src/PdfViewerTest.d.ts.map +1 -1
- package/dist/types/src/Spbanalysispaneltest.d.ts.map +1 -1
- package/dist/types/src/features/PdfViewer/PdfContainer.d.ts +2 -2
- package/dist/types/src/features/PdfViewer/PdfContainer.d.ts.map +1 -1
- package/dist/types/src/features/PdfViewer/PdfToolbar.d.ts +7 -2
- package/dist/types/src/features/PdfViewer/PdfToolbar.d.ts.map +1 -1
- package/dist/types/src/features/PdfViewer/PdfViewer.d.ts +9 -1
- package/dist/types/src/features/PdfViewer/PdfViewer.d.ts.map +1 -1
- package/dist/types/src/features/SPBAnalysisPanel/Spbanalysispanel.d.ts +3 -1
- package/dist/types/src/features/SPBAnalysisPanel/Spbanalysispanel.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3239,7 +3239,7 @@ A full-featured interface for reviewing the analysis of a System Prompt Block (S
|
|
|
3239
3239
|
- **Specifications** — Strict Rules / Input / Output, with automatic `<code>` block extraction in Output
|
|
3240
3240
|
- **Dependency Graph** — Interactive, pannable/zoomable graph of APB relationships
|
|
3241
3241
|
- **Persistent code panel (optional)** — Dark/light toggle and fullscreen expand, togglable via `showCodePanel`
|
|
3242
|
-
- **Markdown + cognitive decisioning** — Text fields render through a shared markdown renderer supporting citations and expandable "cognitive reasoning" panels
|
|
3242
|
+
- **Markdown + cognitive decisioning** — Text fields render through a shared markdown renderer supporting citations and expandable "cognitive reasoning" panels, resolved against a single shared `extraMetaData` map passed to the panel
|
|
3243
3243
|
|
|
3244
3244
|
### Usage
|
|
3245
3245
|
|
|
@@ -3253,6 +3253,7 @@ import SPBAnalysisPanel from '@e-llm-studio/citation/SPBAnalysisPanel'
|
|
|
3253
3253
|
overviewSummary={overviewSummary}
|
|
3254
3254
|
functionalityOfSPB={functionalityOfSPB}
|
|
3255
3255
|
spbAdditionalInfo={spbAdditionalInfo}
|
|
3256
|
+
extraMetaData={extraMetaData}
|
|
3256
3257
|
showCodePanel={true}
|
|
3257
3258
|
/>
|
|
3258
3259
|
```
|
|
@@ -3267,8 +3268,8 @@ import SPBAnalysisPanel from '@e-llm-studio/citation/SPBAnalysisPanel'
|
|
|
3267
3268
|
| `overviewSummary` | `SPBOverviewSummary \| null` | ❌ | — | Overview section content |
|
|
3268
3269
|
| `functionalityOfSPB` | `SPBFunctionalityItem[]` | ❌ | `[]` | Functional areas and their APB references |
|
|
3269
3270
|
| `spbAdditionalInfo` | `SPBAdditionalInfo \| null` | ❌ | — | Applicability, Specifications, and Dependency Graph content |
|
|
3271
|
+
| `extraMetaData` | `Record<string, any> \| null` | ❌ | — | Shared citation/reasoning map, keyed by the id referenced in `data-cognitive-reasoning="{id}"` anchors. One map is used across **all** sections (Overview, Functionality, APB references, Applicability, Specifications) since anchor ids are assigned globally, not per section |
|
|
3270
3272
|
| `showCodePanel` | `boolean` | ❌ | `true` | Show/hide the persistent right-side editor panel |
|
|
3271
|
-
|
|
3272
3273
|
## EmailCitation
|
|
3273
3274
|
|
|
3274
3275
|
A composable React UI component for rendering email-style citations with rich formatting, attachments, and highlight/quote handling. Part of the `@e-llm-studio/citation` package, this component is designed to display email content (subject, sender, recipients, body, attachments, timestamps) in an expandable, accessible, and customizable way.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("./PdfStyle.js"),s=require("../../assests/svg/PdfViewerIcons.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),t=require("./PdfStyle.js"),s=require("../../assests/svg/PdfViewerIcons.js"),o=require("@mui/material"),r=require("lucide-react");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=l(i);exports.default=function(i){i.highlightIndex;var l=i.totalHighlights,d=i.controls,c=i.currentPosition,p=i.pdfName,g=i.onClose,x=i.pdfUrl,u=i.viewerRef,h=i.customStyles,f=i.customClasses,_=i.customIcons,v=i.headerAction,y=i.isZoomEnabled,m=void 0===y||y,j=i.showHighlightsAction,b=void 0===j||j,w=i.showFullScreenAction,S=void 0===w||w,k=i.currentSegment,I=i.segmentTooltipText,F=void 0===I?"Details of current segment":I,C=i.currentPage,D=i.totalPages,W=i.onPageNavigate,E=d.ZoomInButton,B=d.ZoomOutButton,P=d.ZoomPopover,T=d.goToPrevious,z=d.goToNext,A=a.default.useState(String(C)),L=A[0],q=A[1];a.default.useEffect(function(){q(String(C))},[C]);var N={padding:"4px",borderRadius:"6px",background:"transparent",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s ease",flexShrink:0},R=function(e){return String(e).padStart(2,"0")};return n.jsxs("div",e.__assign({style:e.__assign(e.__assign(e.__assign({marginBottom:"12px",background:"#FAFAFA",borderBottom:"1px solid #F3F4F6",borderTopLeftRadius:"12px",borderTopRightRadius:"12px"},t.pdfStyles.header),null==h?void 0:h.header),{display:"flex",flexDirection:"column",alignItems:"stretch",gap:"12px"})},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",minWidth:0}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"12px",flex:1,minWidth:0,overflow:"hidden"}},{children:[n.jsx("div",e.__assign({style:e.__assign(e.__assign(e.__assign({},{borderRadius:"21px",border:"6px solid #E8F3FF",background:"#D5E8FF",display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",boxSizing:"content-box"}),null==h?void 0:h.pdfIconWrapper),{flexShrink:0})},{children:(null==_?void 0:_.pdfIcon)||n.jsx(s.DefaultPdfIcon,{})})),n.jsx(o.Tooltip,e.__assign({title:p||"",arrow:!0,placement:"top"},{children:n.jsx("div",e.__assign({style:{flex:1,minWidth:0,overflow:"hidden"}},{children:n.jsx("span",e.__assign({style:e.__assign({display:"block",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontWeight:500,cursor:"default"},null==h?void 0:h.pdfName),className:null==f?void 0:f.pdfName},{children:p}))}))}))]})),n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:b?"16px":"2px",color:"#4B5563",flexShrink:0,whiteSpace:"nowrap",minWidth:"fit-content"}},{children:[D>0&&n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px",color:"#475467",flexShrink:0,whiteSpace:"nowrap"}},{children:[n.jsx("input",{"aria-label":"Current page",inputMode:"numeric",pattern:"[0-9]*",value:L,onChange:function(e){var n=e.target.value.replace(/\D/g,"");q(n)},onBlur:function(){var e=Number(L);if(!Number.isInteger(e)||e<1)q(String(C));else{var n=D?Math.min(e,D):e;W(n),q(String(n))}},onKeyDown:function(e){"Enter"===e.key&&e.currentTarget.blur(),"Escape"===e.key&&(q(String(C)),e.currentTarget.blur())},style:{width:"40px",height:"28px",border:"1px solid #E5E7EB",borderRadius:"4px",background:"#FFFFFF",color:"#111827",fontSize:"14px",fontWeight:500,textAlign:"center",outline:"none",boxSizing:"border-box"}}),n.jsx("span",e.__assign({style:{fontSize:"14px",fontWeight:500,color:"#111827"}},{children:"/"})),n.jsx("span",e.__assign({style:{fontSize:"14px",fontWeight:500,color:"#111827"}},{children:String(D)}))]})),m&&n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[n.jsx(B,{}),n.jsx("div",e.__assign({style:{fontSize:"14px",fontWeight:500,width:"56px",textAlign:"center"}},{children:n.jsx(P,{})})),n.jsx(E,{})]})),!!l&&b&&n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[n.jsxs("span",e.__assign({style:{fontSize:"14px",color:"#475467",fontWeight:500,lineHeight:1}},{children:[c," of ",l]})),n.jsx("button",e.__assign({style:{background:"none",border:"none",cursor:c<=1?"not-allowed":"pointer",padding:"2px 4px",color:c<=1?"#D0D5DD":"#475467",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,height:"20px",width:"20px"},onClick:T,disabled:c<=1},{children:n.jsx("svg",e.__assign({width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},{children:n.jsx("path",{d:"M2 8L6 4L10 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))})),n.jsx("button",e.__assign({style:{background:"none",border:"none",cursor:c===l?"not-allowed":"pointer",padding:"2px 4px",color:c===l?"#D0D5DD":"#475467",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,height:"20px",width:"20px"},onClick:z,disabled:c===l},{children:n.jsx("svg",e.__assign({width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},{children:n.jsx("path",{d:"M2 4L6 8L10 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))}))]})),n.jsx("div",{style:{width:"1px",height:"20px",background:"#D1D5DB",margin:"0 4px",flexShrink:0}}),n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0,whiteSpace:"nowrap"}},{children:[!1!==S&&((null==v?void 0:v.icon)&&(null==v?void 0:v.onClick)?n.jsx(o.Tooltip,e.__assign({title:(null==v?void 0:v.tooltip)||"",arrow:!0,placement:"top"},{children:n.jsx("div",e.__assign({onClick:v.onClick,style:e.__assign({display:"flex",alignItems:"center",cursor:"pointer"},N)},{children:v.icon}))})):n.jsx("button",e.__assign({onClick:function(){var e=null==u?void 0:u.current;e&&(document.fullscreenElement?document.exitFullscreen():e.requestFullscreen().catch(function(e){console.error("Error attempting to enable fullscreen: ".concat(e.message))}))},style:N,title:"Full Screen"},{children:(null==_?void 0:_.fullScreenIcon)||n.jsx(s.DefaultFullScreenIcon,{})}))),x&&n.jsx("a",e.__assign({href:x,target:"_blank",rel:"noopener noreferrer",style:N,title:"Open in new tab"},{children:(null==_?void 0:_.downloadIcon)||n.jsx(s.DefaultDownloadIcon,{})})),g&&n.jsx("button",e.__assign({onClick:g,style:N,title:"Close"},{children:(null==_?void 0:_.closeIcon)||n.jsx(s.DefaultCloseIcon,{})}))]}))]}))]})),k&&n.jsxs("div",e.__assign({style:{background:"#EEF2FF",border:"1px solid #A5B4FC",borderRadius:"8px",color:"#4F46E5",display:"flex",alignItems:"center",gap:"12px",minWidth:0,padding:"10px 16px",fontSize:"12px",fontWeight:500,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},{children:[n.jsx(o.Tooltip,e.__assign({title:F,arrow:!0,placement:"top"},{children:n.jsx(r.Info,{size:16,color:"#4F46E5",strokeWidth:2,style:{flexShrink:0}})})),n.jsxs("span",e.__assign({style:{overflow:"hidden",textOverflow:"ellipsis"}},{children:["Viewing ",k.title," • Pages ",R(k.start_page),"-",R(k.end_page)]}))]}))]}))};
|
|
2
2
|
//# sourceMappingURL=PdfToolbar.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),i=require("@react-pdf-viewer/core"),o=require("./PdfContainer.js"),n=require("./PdfToolbar.js"),r=require("./PdfStyle.js"),a=require("./usePdfHighlight.js");require("@react-pdf-viewer/zoom/lib/styles/index.css"),require("@react-pdf-viewer/page-navigation/lib/styles/index.css"),require("@react-pdf-viewer/core/lib/styles/index.css"),require("@react-pdf-viewer/search/lib/styles/index.css");var s=require("react"),l=require("../ScannedDocCitation/ScannedDocCitation.js"),u=function(e){switch(e){case"ActualSize":return i.SpecialZoomLevel.ActualSize;case"PageFit":return i.SpecialZoomLevel.PageFit;case"PageWidth":return i.SpecialZoomLevel.PageWidth;default:return null!=e?e:i.SpecialZoomLevel.PageWidth}};exports.default=function(c){var d,g=c.pdfUrl,f=c.highlightText,h=c.highlightPages,v=c.highlightCordinatePages,p=c.highlightColor,m=void 0===p?"yellow":p,x=c.activeHighlightColor,S=void 0===x?"#f7dc51":x,_=c.jumpToPageValue,P=void 0===_?0:_,T=c.pdfName,C=c.onClose,w=c.customStyles,y=c.customClasses,b=c.customIcons,A=c.useCoordinates,q=c.fallbackPages,j=c.activeCitationIndex,H=c.onActiveCitationChange,I=c.headerAction,F=c.isZoomEnabled,Z=void 0===F||F,L=c.showHighlightsAction,N=void 0===L||L,z=c.defaultScale,R=void 0===z?i.SpecialZoomLevel.ActualSize:z,D=c.useRange,E=void 0!==D&&D,M=c.rangeOfPages,V=void 0===M?null:M,W=c.showFullScreenAction,O=void 0===W||W,B=c.segments,U=void 0===B?[{title:"Document 2",start_page:52,end_page:52,page_count:1}]:B,k=c.segmentTooltipText,J=s.useRef(null),K=s.useState(0),G=K[0],Q=K[1],X=s.useState(0),Y=X[0],$=X[1],ee=s.useMemo(function(){if(A)return new Set(v.map(function(e){return e.pageIndex}));var e=new Set;return Object.values(h).forEach(function(t){t>0&&e.add(t-1)}),e},[v,h,A]),te=(d=f)&&0!==d.length?d.filter(function(e){return!d.some(function(t){return t!==e&&t.includes(e)})}):d,ie=a.PdfHighlightControls(te,A?{}:h,J,ee,A,A?v:[],m,S),oe=ie.highlightIndex,ne=ie.cursorIndex,re=ie.setCursorIndex,ae=ie.orderedKeys,se=ie.totalHighlights,le=ie.getValidPosition,ue=ie.tryJump,ce=ie.jumpToPage,de=ie.zoomTo,ge=ie.plugins,fe=ie.controls,he=ie.hideNonTargetHighlights,ve=ie.deduplicateHighlights,pe=le(ne),me=s.useMemo(function(){var e=G+1;return U.find(function(t){return e>=t.start_page&&e<=t.end_page})},[G,U]);s.useEffect(function(){void 0!==j&&j!==ne&&re(j)},[j]);var xe=e.__assign(e.__assign({},fe),{goToNext:function(){ne>=se-1||(fe.goToNext(),H&&H(ne+1))},goToPrevious:function(){ne<=0||(fe.goToPrevious(),H&&H(ne-1))}});if(!g)return t.jsx(l.default,{pages:q,activeCitationIndex:j,onActiveCitationChange:H,headerAction:I});return t.jsxs("div",e.__assign({ref:J,className:(null==y?void 0:y.pdfViewerWrapper)||"",style:e.__assign(e.__assign(e.__assign({height:"100%",minHeight:0,minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column"},r.pdfStyles.pdfViewer),{display:"flex",flexDirection:"column",height:"100%",width:"100%",backgroundColor:"#FAFAFA"}),null==w?void 0:w.pdfViewer)},{children:[t.jsx(n.default,{highlightIndex:oe,totalHighlights:se,controls:xe,currentPosition:pe,pdfName:T,onClose:C,pdfUrl:g,viewerRef:J,customStyles:w,customClasses:y,customIcons:b,headerAction:I,isZoomEnabled:Z,showHighlightsAction:N,showFullScreenAction:O,currentSegment:me,segmentTooltipText:k,currentPage:G+1,totalPages:Y,onPageNavigate:function(e){var t=Math.min(Math.max(e,1),Y||e);Q(t-1),ce(t-1)}}),t.jsx(o.default,{defaultScale:u(R),pdfUrl:g,plugins:ge,customStyles:w,onLoad:function(t){$(t.doc.numPages);var o=!A&&!E&&P<=0;if(de(i.SpecialZoomLevel.ActualSize),P>0&&!E){var n=P-1,r=ae[n],a=h[r],s=v[n];re(n),console.log(s,"cordinateTargetHighlight"),A&&s.pageIndex>0&&ce(s.pageIndex),a>0&&(setTimeout(function(){he(ee),ve(a-1)},1e3),A||ce(a-1))}else if(E&&V&&2===V.length){e.__awaiter(void 0,void 0,void 0,function(){var t,i,o,n,r;return e.__generator(this,function(e){switch(e.label){case 0:t=V[0],i=V[1],o=t,e.label=1;case 1:return o<=i?(ce(n=o-1),[4,new Promise(function(e){return setTimeout(e,1e3)})]):[3,4];case 2:if(e.sent(),he(ee),(r=ve(n))&&r>0)return[3,4];e.label=3;case 3:return o++,[3,1];case 4:return[2]}})})}else if(!A&&h){var l=ae.find(function(e){return h[e]>0});if(void 0!==l){var u=h[l]-1;ce(u),setTimeout(function(){he(ee),ve(u)},1e3)}}requestAnimationFrame(function(){o&&ue(),!A&&P>0&&!E&&function(){if(J.current){var e=P-1,t=ae[e],i=h[t],o=i>0?i-1:0,n={};ae.forEach(function(e,t){var i=h[e];i>0&&(n[i]||(n[i]=[]),n[i].push(t))});var r=(n[i]||[]).indexOf(e),a=0,s=function(){var e,t;if(!(++a>40)){var i=null===(e=J.current)||void 0===e?void 0:e.querySelector(".rpv-core__inner-pages");if(i){var n=null===(t=J.current)||void 0===t?void 0:t.querySelector('[data-testid="core__page-layer-'.concat(o,'"]'));if(n){var l=i.getBoundingClientRect(),u=n.getBoundingClientRect();if(u.top<l.bottom&&u.bottom>l.top){var c=n.querySelectorAll(".rpv-search__highlight")[r];if(c){var d=c.getBoundingClientRect(),g=i.scrollTop+(d.top-l.top)-i.clientHeight/2+d.height/2;i.scrollTo({top:g,behavior:"smooth"})}else setTimeout(s,100)}else setTimeout(s,100)}else setTimeout(s,100)}else setTimeout(s,100)}};setTimeout(s,500)}}()})},onPageChange:function(e){var t=e.currentPage;Q(t),ee.has(t)?(ve(t),he(ee)):he(ee)}})]}))};
|
|
2
2
|
//# sourceMappingURL=PdfViewer.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("react"),o=require("@mui/material"),s=require("@mui/icons-material/ExpandMore"),t=require("@mui/icons-material/Fullscreen"),r=require("@mui/icons-material/Close"),l=require("@mui/icons-material/NearMeOutlined"),a=require("@mui/icons-material/ChevronLeft"),d=require("@mui/icons-material/ChevronRight"),c=require("./DependencyGraph.js"),x=require("./Markdownrenderer.js"),p=require("./Internaleditor.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=h(s),g=h(t),f=h(r),_=h(l),m=h(a),y=h(d),j=function(s){var t=s.text,r=s.detailedSummary,l=s.extraMetaData,a=s.isDarkMode,d=void 0!==a&&a,c=s.markdownRendererStyle,p=n.useState(!1),h=p[0],u=p[1],g=function(e,i){void 0===i&&(i=220);var n=e.replace(/<!--\s*<ai_reasoning>[\s\S]*?<\/ai_reasoning>\s*-->/g,"").replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim();if(n.length<=i)return{preview:n,truncated:!1};var o=n.slice(0,i),s=o.lastIndexOf(" ");return{preview:(s>0?o.slice(0,s):o).trim(),truncated:!0}}(t),f=g.preview,_=g.truncated;return i.jsx(o.Box,{children:h?i.jsxs(o.Box,{children:[i.jsx(x.MarkdownRenderer,{message:t,fontSize:"0.8rem",extraMetaData:l,isDarkMode:d,style:c}),(null==r?void 0:r.trim())&&i.jsx(x.MarkdownRenderer,{message:r,fontSize:"0.8rem",extraMetaData:l,isDarkMode:d,style:c}),i.jsx(o.Typography,e.__assign({component:"span",onClick:function(){return u(!1)},sx:{fontSize:"0.72rem",color:d?"#a78bfa":"#5928ed",fontWeight:600,cursor:"pointer"}},{children:"view less"}))]}):i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column"}},{children:[i.jsxs(o.Typography,e.__assign({sx:{fontSize:"0.8rem",color:d?"#cbd5e1":"#4B5563",lineHeight:1.6}},{children:[f,_&&"…"]})),(_||(null==r?void 0:r.trim()))&&i.jsx(o.Box,e.__assign({sx:{display:"flex",justifyContent:"flex-end"}},{children:i.jsx(o.Typography,e.__assign({component:"span",onClick:function(){return u(!0)},sx:{fontSize:"0.72rem",color:d?"#a78bfa":"#5928ed",fontWeight:600,cursor:"pointer"}},{children:"...view more"}))}))]}))})},v=function(s){var t=s.text,r=n.useState(!1),l=r[0],a=r[1],d=n.useState(!1),c=d[0],x=d[1],p=n.useRef(null);return n.useEffect(function(){var e=p.current;e&&x(e.scrollWidth>e.clientWidth)},[t]),i.jsx(o.Box,e.__assign({sx:{pl:1}},{children:l?i.jsxs(o.Typography,e.__assign({sx:{fontSize:"0.68rem",color:"#9CA3AF",lineHeight:1.4}},{children:[t," ",i.jsx(o.Typography,e.__assign({component:"span",onClick:function(){return a(!1)},sx:{fontSize:"0.65rem",color:"#5928ed",cursor:"pointer",fontWeight:600}},{children:"view less"}))]})):i.jsxs(o.Box,e.__assign({sx:{display:"flex",alignItems:"baseline",gap:.5}},{children:[i.jsx(o.Typography,e.__assign({ref:p,sx:{fontSize:"0.68rem",color:"#9CA3AF",lineHeight:1.4,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",flex:1,minWidth:0}},{children:t})),c&&i.jsx(o.Typography,e.__assign({component:"span",onClick:function(){return a(!0)},sx:{fontSize:"0.65rem",color:"#5928ed",cursor:"pointer",fontWeight:600,flexShrink:0}},{children:"view more"}))]}))}))};exports.default=function(s){var t,r=s.promptContent,l=s.promptTitle,a=s.isLoading,d=void 0!==a&&a,h=s.overviewSummary,b=s.functionalityOfSPB,S=void 0===b?[]:b,w=s.spbAdditionalInfo,B=s.showCodePanel,k=void 0===B||B,E=s.showCollapseStrip,z=void 0===E||E,D=s.showFullscreenButton,T=void 0===D||D,A=s.showFullscreenModal,M=void 0===A||A,C=s.showThemeToggle,R=void 0===C||C,F=s.isDarkMode,I=void 0===F||F,W=s.styles,H=s.className,P=s.style,L=s.sx,q=n.useState(null),O=q[0],G=q[1],N=n.useState(null),X=N[0],Y=N[1],J=n.useState(""),K=J[0],Q=J[1],U=void 0!==(null==W?void 0:W.isDarkMode)?W.isDarkMode:I,V=n.useState(U),Z=V[0],$=V[1],ee=n.useState(null),ie=ee[0],ne=ee[1];n.useEffect(function(){void 0!==(null==W?void 0:W.isDarkMode)&&$(W.isDarkMode)},[null==W?void 0:W.isDarkMode]);var oe=n.useState(!1),se=oe[0],te=oe[1],re=n.useState(480),le=re[0],ae=re[1],de=n.useRef(!1),ce=n.useRef(null);n.useEffect(function(){var e,i,n;S.length>0&&G((e=new Date,i=e.toLocaleTimeString("en-IN",{hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0}),n=e.toLocaleDateString("en-IN",{day:"numeric",month:"short",year:"numeric"}),"".concat(i||""," | ").concat(n||"")))},[S]),n.useEffect(function(){d&&G(null)},[d]),n.useEffect(function(){ie&&(Q(""),setTimeout(function(){return Q(ie.ref)},500))},[ie]);return i.jsxs(o.Box,e.__assign({className:H,style:e.__assign(e.__assign({},null==W?void 0:W.root),P),sx:e.__assign({height:"100%",display:"flex",flexDirection:"column",width:"100%",minHeight:0,overflow:"hidden"},L)},{children:[i.jsx(o.Box,e.__assign({sx:e.__assign({px:2.5,py:1.5,borderBottom:"1px solid #e5e7eb",display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#fff",flexShrink:0},null==W?void 0:W.header)},{children:i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.25}},{children:[i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:700,fontSize:"0.9rem",color:"#111827"},null==W?void 0:W.headerTitle)},{children:l||"SPB Analysis"})),i.jsx(o.Typography,e.__assign({sx:e.__assign({fontSize:"0.7rem",color:"#9CA3AF"},null==W?void 0:W.headerSubtitle)},{children:O?"Last Analyzed at ".concat(O):""}))]}))})),i.jsxs(o.Box,e.__assign({ref:ce,sx:{display:"flex",flex:1,minHeight:0,overflow:"hidden",position:"relative"}},{children:[i.jsx(o.Box,e.__assign({sx:e.__assign({width:k?se&&z?0:le:"100%",flexShrink:0,minHeight:0,overflow:"hidden",transition:de.current?"none":"width 0.15s",borderRight:!k||se&&z?"none":"1px solid #e5e7eb"},null==W?void 0:W.leftPanel)},{children:i.jsxs(o.Box,e.__assign({sx:{width:"100%",height:"100%",minHeight:0,overflowY:"auto",display:"flex",flexDirection:"column",gap:1,px:1.25,py:1.25,pb:2}},{children:[i.jsxs(o.Box,e.__assign({sx:e.__assign({border:"1px solid #E5E7EB",borderRadius:"8px",bgcolor:"#F8FAFC",p:1.5},null==W?void 0:W.overviewSection)},{children:[i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:600,fontSize:"0.85rem",color:"#111827",mb:1},null==W?void 0:W.overviewTitle)},{children:"Overview"})),i.jsx(o.Box,e.__assign({sx:e.__assign({bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5},null==W?void 0:W.overviewContent)},{children:(null===(t=null==h?void 0:h.overallSummary)||void 0===t?void 0:t.trim())?i.jsx(j,{text:h.overallSummary,detailedSummary:h.detailedSummary,extraMetaData:h.extraMetaData,isDarkMode:Z,markdownRendererStyle:null==W?void 0:W.markdownRenderer}):i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[i.jsx(o.Skeleton,{variant:"text",width:"100%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"90%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"95%",height:14})]}))}))]})),i.jsxs(o.Accordion,e.__assign({disableGutters:!0,elevation:0,sx:e.__assign({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==W?void 0:W.functionalitySection)},{children:[i.jsx(o.AccordionSummary,e.__assign({expandIcon:i.jsx(u.default,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75}}},{children:i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==W?void 0:W.functionalityTitle)},{children:"Functionality of SPB"}))})),i.jsx(o.AccordionDetails,e.__assign({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"column",gap:1}},{children:S.length>0?S.map(function(n,s){return i.jsxs(o.Accordion,e.__assign({disableGutters:!0,elevation:0,defaultExpanded:0===s,sx:e.__assign({bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},overflow:"hidden"},null==W?void 0:W.functionalityItem)},{children:[i.jsx(o.AccordionSummary,e.__assign({expandIcon:i.jsx(u.default,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:38,"& .MuiAccordionSummary-content":{my:.5}}},{children:i.jsxs(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.8rem",color:"#111827"}},{children:[s+1,". ",n.name||n.section_name]}))})),i.jsxs(o.AccordionDetails,e.__assign({sx:{px:1.5,pb:1.5,pt:0,display:"flex",flexDirection:"column",gap:.75}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.74rem",color:"#6B7280",lineHeight:1.5}},{children:n.description||n.reason_for_inclusion})),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.72rem",color:"#9CA3AF",fontWeight:500,mt:.25}},{children:"APB References"})),i.jsx(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.75}},{children:n.apb_references.map(function(n,s){var t="string"==typeof n?n:n.apb_name,r=X===t;return i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.15}},{children:[i.jsxs(o.Box,e.__assign({onClick:function(){return function(e){X===e?(Y(null),Q("")):(Y(e),Q(""),setTimeout(function(){return Q(e)},50))}(t)},sx:{display:"flex",alignItems:"center",gap:.25,cursor:"pointer"}},{children:[i.jsxs(o.Typography,e.__assign({sx:{fontSize:"0.78rem",color:r?"#5928ed":"#DB2877",fontWeight:500}},{children:[s+1,". ",t]})),i.jsx(_.default,{sx:{fontSize:"0.75rem",color:r?"#5928ed":"#DB2877"}})]})),"string"!=typeof n&&(n.description||n.context)&&i.jsx(v,{text:n.description||n.context||""})]}),s)})}))]}))]}),s)}):i.jsx(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:1}},{children:[1,2,3].map(function(n){return i.jsxs(o.Box,e.__assign({sx:{bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5,display:"flex",flexDirection:"column",gap:.5}},{children:[i.jsx(o.Skeleton,{variant:"text",width:"40%",height:16}),i.jsx(o.Skeleton,{variant:"text",width:"90%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"80%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"30%",height:14})]}),n)})}))}))]})),i.jsxs(o.Accordion,e.__assign({disableGutters:!0,elevation:0,sx:e.__assign({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==W?void 0:W.applicabilitySection)},{children:[i.jsxs(o.AccordionSummary,e.__assign({expandIcon:i.jsx(u.default,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75,alignItems:"center",gap:1}}},{children:[i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==W?void 0:W.applicabilityTitle)},{children:"Applicability"})),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.7rem",color:"#9CA3AF"}},{children:"When to Apply this SPB / When Not Apply"}))]})),i.jsx(o.AccordionDetails,e.__assign({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC"}},{children:i.jsx(o.Box,e.__assign({sx:{display:"flex",gap:1}},{children:[{label:"When to apply",content:null==w?void 0:w.when_to_apply},{label:"When NOT to apply",content:null==w?void 0:w.when_not_to_apply}].map(function(n){var s=n.label,t=n.content;return i.jsxs(o.Box,e.__assign({sx:{flex:1,bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"6px",p:1.25}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.76rem",color:"#374151",mb:.75}},{children:s})),t?i.jsx(x.MarkdownRenderer,{fontSize:"0.8rem",message:t,isDarkMode:Z,style:null==W?void 0:W.markdownRenderer}):d?i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[i.jsx(o.Skeleton,{variant:"text",width:"100%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"80%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"90%",height:14})]})):i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.8rem",color:"#6B7280",lineHeight:1.5}},{children:"— Not yet available"}))]}),s)})}))}))]})),i.jsxs(o.Accordion,e.__assign({disableGutters:!0,elevation:0,sx:e.__assign({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==W?void 0:W.specificationsSection)},{children:[i.jsxs(o.AccordionSummary,e.__assign({expandIcon:i.jsx(u.default,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75,alignItems:"center",gap:1}}},{children:[i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==W?void 0:W.specificationsTitle)},{children:"Specifications"})),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.7rem",color:"#9CA3AF"}},{children:"Strict Rules / Input / Output"}))]})),i.jsx(o.AccordionDetails,e.__assign({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"column",gap:1}},{children:[{label:"Strict Rules",tooltip:null,content:null==w?void 0:w.constraints_and_rules},{label:"Input",tooltip:"Input specification for this SPB",content:null==w?void 0:w.input_analysis},{label:"Output",tooltip:"Output specification for this SPB",content:null==w?void 0:w.output_analysis}].map(function(n){var s=n.label,t=n.tooltip,r=n.content,l="Output"===s,a=l&&r?function(e){var i=[];return{text:e.replace(/<code>([\s\S]*?)<\/code>/g,function(e,n){return i.push(n.trim()),""}).trim(),code:i.join("\n\n")}}(r):null,c=a?a.text:r,h=a?a.code:"";return i.jsxs(o.Accordion,e.__assign({disableGutters:!0,elevation:0,defaultExpanded:"Strict Rules"===s,sx:{bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"6px !important","&:before":{display:"none"},overflow:"hidden"}},{children:[i.jsx(o.AccordionSummary,e.__assign({expandIcon:i.jsx(u.default,{sx:{fontSize:"1rem"}}),sx:{minHeight:34,px:1.25,"& .MuiAccordionSummary-content":{my:.4}}},{children:i.jsxs(o.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:.5}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.76rem",color:"#374151"}},{children:s})),t&&i.jsx(o.Tooltip,e.__assign({title:t,placement:"top"},{children:i.jsx(o.Box,e.__assign({component:"span",sx:{width:13,height:13,borderRadius:"50%",background:"#E5E7EB",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"0.58rem",color:"#6B7280",fontWeight:700,cursor:"default",flexShrink:0}},{children:"i"}))}))]}))})),i.jsx(o.AccordionDetails,e.__assign({sx:{px:1.25,pb:1.25,pt:0}},{children:r?i.jsxs(i.Fragment,{children:[c&&i.jsx(x.MarkdownRenderer,{fontSize:"0.8rem",message:c,isDarkMode:Z,style:null==W?void 0:W.markdownRenderer}),l&&h&&i.jsxs(o.Box,e.__assign({sx:{width:"100%",height:"35vh",mt:1.5}},{children:[i.jsxs(o.Box,e.__assign({sx:{display:"flex",gap:.1,backgroundColor:"black",flexDirection:"row",alignItems:"center",justifyContent:"space-between",p:1,borderTopLeftRadius:"8px",borderTopRightRadius:"8px"}},{children:[i.jsx(o.Typography,e.__assign({sx:{color:"white",fontWeight:500,fontSize:"0.8rem"}},{children:"Output preview"})),i.jsx(o.Tooltip,e.__assign({title:"Copy Code to clipboard"},{children:i.jsx(o.IconButton,e.__assign({size:"small",onClick:function(){return e=h,navigator.clipboard.writeText(e);var e}},{children:i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.7rem",color:"white"}},{children:"Copy"}))}))}))]})),i.jsx(o.Box,e.__assign({sx:{mt:-1,height:"calc(100% - 40px)",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px",overflow:"hidden"}},{children:i.jsx(p.InternalEditor,{content:h,isDarkMode:Z,height:"100%",fontSize:10})}))]}))]}):d?i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[i.jsx(o.Skeleton,{variant:"text",width:"100%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"90%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"75%",height:14})]})):i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.74rem",color:"#6B7280",lineHeight:1.5}},{children:"— Not yet available"}))}))]}),s)})}))]})),i.jsxs(o.Accordion,e.__assign({defaultExpanded:!0,disableGutters:!0,elevation:0,sx:e.__assign({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},bgcolor:"#fff"},null==W?void 0:W.dependencyGraphSection)},{children:[i.jsx(o.AccordionSummary,e.__assign({expandIcon:i.jsx(u.default,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75},"&.Mui-expanded":{bgcolor:"#F8FAFC",borderRadius:"8px 8px 0 0"}}},{children:i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==W?void 0:W.dependencyGraphTitle)},{children:"Dependency Graph"}))})),i.jsx(o.AccordionDetails,e.__assign({sx:{px:0,pb:0,pt:0}},{children:(null==w?void 0:w.dependency_graph)?i.jsxs(o.Box,e.__assign({sx:{bgcolor:"#F8FAFC",borderRadius:"0 0 8px 8px",p:1.5,display:"flex",flexDirection:"column",gap:1.5}},{children:[i.jsx(o.Box,e.__assign({sx:{height:500,borderRadius:"8px",overflow:"hidden"}},{children:i.jsx(c.default,{data:w.dependency_graph,isDarkMode:Z,style:null==W?void 0:W.dependencyGraph})})),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.72rem",color:"#64748B",lineHeight:1.6}},{children:"This graph visualises how Atomic Prompt Blocks (APBs) depend on, influence, or exchange information with one another within the prompt architecture."}))]})):i.jsxs(o.Box,e.__assign({sx:{bgcolor:"#fff",borderRadius:"0 0 8px 8px",p:1.5,display:"flex",flexDirection:"column",gap:1}},{children:[i.jsx(o.Skeleton,{variant:"rectangular",width:"100%",height:400,sx:{borderRadius:"8px"}}),i.jsx(o.Skeleton,{variant:"text",width:"100%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"80%",height:14})]}))}))]}))]}))})),k&&z&&i.jsx(o.Box,e.__assign({onClick:function(){return te(function(e){return!e})},sx:e.__assign({width:20,flexShrink:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",borderRight:"1px solid #e5e7eb",borderLeft:"1px solid #e5e7eb",bgcolor:"#f9fafb",position:"relative",py:2,"&:hover":{bgcolor:"#f0f0f0"}},null==W?void 0:W.collapseStrip)},{children:i.jsx(o.Typography,e.__assign({sx:{fontSize:10,fontWeight:600,color:"#6b7280",writingMode:"vertical-rl",textOrientation:"mixed",transform:"rotate(180deg)",letterSpacing:"0.05em",userSelect:"none"}},{children:"SPB Details"}))})),k&&z&&i.jsx(o.Box,e.__assign({onClick:function(){return te(function(e){return!e})},onMouseDown:function(e){e.preventDefault(),de.current=!0;var i=function(e){if(de.current&&ce.current){var o=ce.current.getBoundingClientRect(),s=o.left,t=o.width,r=e.clientX-s;if(r<200)return te(!0),de.current=!1,document.removeEventListener("mousemove",i),void document.removeEventListener("mouseup",n);r>.7*t||(te(!1),ae(r))}},n=function(){de.current=!1,document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",n)};document.addEventListener("mousemove",i),document.addEventListener("mouseup",n)},sx:e.__assign({position:"absolute",left:se?20:le+20,top:"50%",transform:"translateY(-50%)",width:18,height:28,bgcolor:"#fff",border:"1px solid #e5e7eb",borderRadius:"0 6px 6px 0",display:"flex",alignItems:"center",justifyContent:"center",cursor:"col-resize",zIndex:5,boxShadow:"2px 0 4px rgba(0,0,0,0.06)","&:hover":{bgcolor:"#f9fafb"}},null==W?void 0:W.dragHandle)},{children:se?i.jsx(y.default,{sx:{fontSize:12,color:"#6b7280"}}):i.jsx(m.default,{sx:{fontSize:12,color:"#6b7280"}})})),k&&i.jsxs(o.Box,e.__assign({sx:e.__assign({flex:1,minWidth:0,minHeight:0,display:"flex",flexDirection:"column",overflow:"hidden",p:2,gap:1.5,bgcolor:"#f8fafc"},null==W?void 0:W.codePanel)},{children:[i.jsxs(o.Box,e.__assign({sx:e.__assign({display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0},null==W?void 0:W.codePanelHeader)},{children:[i.jsx(o.Typography,e.__assign({sx:e.__assign({fontSize:13,fontWeight:600,color:"#374151"},null==W?void 0:W.codePanelTitle)},{children:l||"SPB Analysis"})),i.jsxs(o.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:1.5}},{children:[R&&i.jsx(o.Switch,{checked:Z,onChange:function(e){return $(e.target.checked)},size:"small",sx:{width:36,height:20,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:"2px","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{bgcolor:"#5928ed",opacity:1}}},"& .MuiSwitch-thumb":{width:16,height:16,bgcolor:"#fff"},"& .MuiSwitch-track":{borderRadius:10,bgcolor:"#d1d5db",opacity:1}}}),T&&M&&i.jsx(o.Tooltip,e.__assign({title:"Fullscreen",placement:"top"},{children:i.jsx(o.IconButton,e.__assign({size:"small",onClick:function(){return ne({ref:K||"",description:""})},sx:{color:"#6b7280"}},{children:i.jsx(g.default,{sx:{fontSize:16}})}))}))]}))]})),i.jsx(o.Box,e.__assign({sx:e.__assign({flex:1,minHeight:0,border:"1px solid #30363d",borderRadius:1,overflow:"hidden"},null==W?void 0:W.editorContainer)},{children:i.jsx(p.InternalEditor,{content:r,selectedTag:K,isDarkMode:Z,height:"100%",fontSize:13})}))]}))]})),M&&i.jsxs(o.Dialog,e.__assign({open:!!ie,onClose:function(){return ne(null)},maxWidth:!1,PaperProps:{sx:e.__assign({width:"82vw",height:"80vh",maxWidth:"none",borderRadius:"12px",overflow:"hidden",display:"flex",flexDirection:"column"},null==W?void 0:W.fullscreenModal)}},{children:[i.jsxs(o.Box,e.__assign({sx:{px:2.5,py:1.5,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontWeight:700,fontSize:"1rem",color:"#111827"}},{children:"Promptemon"})),i.jsx(o.IconButton,e.__assign({size:"small",onClick:function(){return ne(null)}},{children:i.jsx(f.default,{sx:{fontSize:"1.1rem",color:"#6B7280"}})}))]})),i.jsxs(o.Box,e.__assign({sx:{flex:1,display:"flex",overflow:"hidden",minHeight:0}},{children:[i.jsxs(o.Box,e.__assign({sx:{width:"40%",flexShrink:0,borderRight:"1px solid #E5E7EB",display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[i.jsxs(o.Box,e.__assign({sx:{px:2,py:1.25,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",gap:1}},{children:[i.jsx(o.Tooltip,e.__assign({title:"Atomic Prompt Block",placement:"top"},{children:i.jsx(o.Chip,{label:"APB",size:"small",sx:{bgcolor:"#f1f5f9",color:"#475569",fontWeight:700,fontSize:10,height:20,borderRadius:1}})})),i.jsx(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.9rem",color:"#111827"}},{children:null==ie?void 0:ie.ref}))]})),i.jsxs(o.Box,e.__assign({sx:{flex:1,p:2,display:"flex",flexDirection:"column",gap:1.5,overflowY:"auto"}},{children:[i.jsxs(o.Box,e.__assign({sx:{border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.8rem",color:"#111827",mb:.75}},{children:"Description"})),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.73rem",color:"#6B7280",lineHeight:1.6}},{children:null==ie?void 0:ie.description}))]})),i.jsxs(o.Box,e.__assign({sx:{border:"1px solid #E5E7EB",borderRadius:"8px",p:1.25,display:"flex",alignItems:"center",gap:.5}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.73rem",color:"#6B7280"}},{children:"Total Lines"})),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.73rem",fontWeight:700,color:"#111827"}},{children:r.split("\n").length}))]}))]}))]})),i.jsxs(o.Box,e.__assign({sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[i.jsxs(o.Box,e.__assign({sx:{px:2,py:1.25,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.85rem",color:"#111827"}},{children:"Prompt Preview"})),i.jsx(o.Switch,{checked:Z,onChange:function(e){return $(e.target.checked)},size:"small",sx:{width:36,height:20,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:"2px","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{bgcolor:"#5928ed",opacity:1}}},"& .MuiSwitch-thumb":{width:16,height:16,bgcolor:"#fff"},"& .MuiSwitch-track":{borderRadius:10,bgcolor:"#d1d5db",opacity:1}}})]})),i.jsx(o.Box,e.__assign({sx:{flex:1,minHeight:0,p:1.5}},{children:i.jsx(p.InternalEditor,{content:r,selectedTag:K,isDarkMode:Z,height:"100%",fontSize:13})}))]}))]}))]}))]}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("react"),o=require("@mui/material"),t=require("@mui/icons-material/ExpandMore"),s=require("@mui/icons-material/Fullscreen"),r=require("@mui/icons-material/Close"),l=require("@mui/icons-material/NearMeOutlined"),a=require("@mui/icons-material/ChevronLeft"),d=require("@mui/icons-material/ChevronRight"),c=require("./DependencyGraph.js"),x=require("./Markdownrenderer.js"),p=require("./Internaleditor.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=h(t),g=h(s),f=h(r),_=h(l),m=h(a),y=h(d),j=function(t){var s=t.text,r=t.detailedSummary,l=t.extraMetaData,a=t.isDarkMode,d=void 0!==a&&a,c=t.markdownRendererStyle,p=n.useState(!1),h=p[0],u=p[1],g=function(e,i){void 0===i&&(i=220);var n=e.replace(/<!--\s*<ai_reasoning>[\s\S]*?<\/ai_reasoning>\s*-->/g,"").replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim();if(n.length<=i)return{preview:n,truncated:!1};var o=n.slice(0,i),t=o.lastIndexOf(" ");return{preview:(t>0?o.slice(0,t):o).trim(),truncated:!0}}(s),f=g.preview,_=g.truncated;return i.jsx(o.Box,{children:h?i.jsxs(o.Box,{children:[i.jsx(x.MarkdownRenderer,{message:s,fontSize:"0.8rem",extraMetaData:l,isDarkMode:d,style:c}),(null==r?void 0:r.trim())&&i.jsx(x.MarkdownRenderer,{message:r,fontSize:"0.8rem",extraMetaData:l,isDarkMode:d,style:c}),i.jsx(o.Typography,e.__assign({component:"span",onClick:function(){return u(!1)},sx:{fontSize:"0.72rem",color:d?"#a78bfa":"#5928ed",fontWeight:600,cursor:"pointer"}},{children:"view less"}))]}):i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column"}},{children:[i.jsxs(o.Typography,e.__assign({sx:{fontSize:"0.8rem",color:d?"#cbd5e1":"#4B5563",lineHeight:1.6}},{children:[f,_&&"…"]})),(_||(null==r?void 0:r.trim()))&&i.jsx(o.Box,e.__assign({sx:{display:"flex",justifyContent:"flex-end"}},{children:i.jsx(o.Typography,e.__assign({component:"span",onClick:function(){return u(!0)},sx:{fontSize:"0.72rem",color:d?"#a78bfa":"#5928ed",fontWeight:600,cursor:"pointer"}},{children:"...view more"}))}))]}))})},v=function(t){var s=t.text,r=t.extraMetaData,l=n.useState(!1),a=l[0],d=l[1],c=n.useState(!1),p=c[0],h=c[1],u=n.useRef(null);return n.useEffect(function(){var e=u.current;e&&h(e.scrollWidth>e.clientWidth)},[s]),i.jsx(o.Box,e.__assign({sx:{pl:1}},{children:a?i.jsxs(o.Box,e.__assign({sx:{fontSize:"0.68rem",color:"#9CA3AF",lineHeight:1.4}},{children:[i.jsx(x.MarkdownRenderer,{message:s,fontSize:"0.68rem",extraMetaData:r}),i.jsx(o.Typography,e.__assign({component:"span",onClick:function(){return d(!1)},sx:{fontSize:"0.65rem",color:"#5928ed",cursor:"pointer",fontWeight:600}},{children:"view less"}))]})):i.jsxs(o.Box,e.__assign({sx:{display:"flex",alignItems:"baseline",gap:.5}},{children:[i.jsx(o.Typography,e.__assign({ref:u,sx:{fontSize:"0.68rem",color:"#9CA3AF",lineHeight:1.4,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",flex:1,minWidth:0}},{children:s})),p&&i.jsx(o.Typography,e.__assign({component:"span",onClick:function(){return d(!0)},sx:{fontSize:"0.65rem",color:"#5928ed",cursor:"pointer",fontWeight:600,flexShrink:0}},{children:"view more"}))]}))}))};exports.default=function(t){var s,r=t.promptContent,l=t.promptTitle,a=t.isLoading,d=void 0!==a&&a,h=t.overviewSummary,b=t.functionalityOfSPB,S=void 0===b?[]:b,w=t.spbAdditionalInfo,B=t.extraMetaData,k=t.showCodePanel,E=void 0===k||k,D=t.showCollapseStrip,z=void 0===D||D,M=t.showFullscreenButton,T=void 0===M||M,A=t.showFullscreenModal,R=void 0===A||A,C=t.showThemeToggle,F=void 0===C||C,I=t.isDarkMode,W=void 0===I||I,P=t.styles,H=t.className,L=t.style,q=t.sx,O=n.useState(null),G=O[0],N=O[1],X=n.useState(null),Y=X[0],J=X[1],K=n.useState(""),Q=K[0],U=K[1],V=void 0!==(null==P?void 0:P.isDarkMode)?P.isDarkMode:W,Z=n.useState(V),$=Z[0],ee=Z[1],ie=n.useState(null),ne=ie[0],oe=ie[1];n.useEffect(function(){void 0!==(null==P?void 0:P.isDarkMode)&&ee(P.isDarkMode)},[null==P?void 0:P.isDarkMode]);var te=n.useState(!1),se=te[0],re=te[1],le=n.useState(480),ae=le[0],de=le[1],ce=n.useRef(!1),xe=n.useRef(null);n.useEffect(function(){var e,i,n;S.length>0&&N((e=new Date,i=e.toLocaleTimeString("en-IN",{hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0}),n=e.toLocaleDateString("en-IN",{day:"numeric",month:"short",year:"numeric"}),"".concat(i||""," | ").concat(n||"")))},[S]),n.useEffect(function(){d&&N(null)},[d]),n.useEffect(function(){ne&&(U(""),setTimeout(function(){return U(ne.ref)},500))},[ne]);return i.jsxs(o.Box,e.__assign({className:H,style:e.__assign(e.__assign({},null==P?void 0:P.root),L),sx:e.__assign({height:"100%",display:"flex",flexDirection:"column",width:"100%",minHeight:0,overflow:"hidden"},q)},{children:[i.jsx(o.Box,e.__assign({sx:e.__assign({px:2.5,py:1.5,borderBottom:"1px solid #e5e7eb",display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#fff",flexShrink:0},null==P?void 0:P.header)},{children:i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.25}},{children:[i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:700,fontSize:"0.9rem",color:"#111827"},null==P?void 0:P.headerTitle)},{children:l||"SPB Analysis"})),i.jsx(o.Typography,e.__assign({sx:e.__assign({fontSize:"0.7rem",color:"#9CA3AF"},null==P?void 0:P.headerSubtitle)},{children:G?"Last Analyzed at ".concat(G):""}))]}))})),i.jsxs(o.Box,e.__assign({ref:xe,sx:{display:"flex",flex:1,minHeight:0,overflow:"hidden",position:"relative"}},{children:[i.jsx(o.Box,e.__assign({sx:e.__assign({width:E?se&&z?0:ae:"100%",flexShrink:0,minHeight:0,overflow:"hidden",transition:ce.current?"none":"width 0.15s",borderRight:!E||se&&z?"none":"1px solid #e5e7eb"},null==P?void 0:P.leftPanel)},{children:i.jsxs(o.Box,e.__assign({sx:{width:"100%",height:"100%",minHeight:0,overflowY:"auto",display:"flex",flexDirection:"column",gap:1,px:1.25,py:1.25,pb:2}},{children:[i.jsxs(o.Box,e.__assign({sx:e.__assign({border:"1px solid #E5E7EB",borderRadius:"8px",bgcolor:"#F8FAFC",p:1.5},null==P?void 0:P.overviewSection)},{children:[i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:600,fontSize:"0.85rem",color:"#111827",mb:1},null==P?void 0:P.overviewTitle)},{children:"Overview"})),i.jsx(o.Box,e.__assign({sx:e.__assign({bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5},null==P?void 0:P.overviewContent)},{children:(null===(s=null==h?void 0:h.overallSummary)||void 0===s?void 0:s.trim())?i.jsx(j,{text:h.overallSummary,detailedSummary:h.detailedSummary,extraMetaData:B,isDarkMode:$,markdownRendererStyle:null==P?void 0:P.markdownRenderer}):i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[i.jsx(o.Skeleton,{variant:"text",width:"100%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"90%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"95%",height:14})]}))}))]})),i.jsxs(o.Accordion,e.__assign({disableGutters:!0,elevation:0,sx:e.__assign({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==P?void 0:P.functionalitySection)},{children:[i.jsx(o.AccordionSummary,e.__assign({expandIcon:i.jsx(u.default,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75}}},{children:i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==P?void 0:P.functionalityTitle)},{children:"Functionality of SPB"}))})),i.jsx(o.AccordionDetails,e.__assign({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"column",gap:1}},{children:S.length>0?S.map(function(n,t){return i.jsxs(o.Accordion,e.__assign({disableGutters:!0,elevation:0,defaultExpanded:0===t,sx:e.__assign({bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},overflow:"hidden"},null==P?void 0:P.functionalityItem)},{children:[i.jsx(o.AccordionSummary,e.__assign({expandIcon:i.jsx(u.default,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:38,"& .MuiAccordionSummary-content":{my:.5}}},{children:i.jsxs(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.8rem",color:"#111827"}},{children:[t+1,". ",n.name||n.section_name]}))})),i.jsxs(o.AccordionDetails,e.__assign({sx:{px:1.5,pb:1.5,pt:0,display:"flex",flexDirection:"column",gap:.75}},{children:[i.jsx(x.MarkdownRenderer,{fontSize:"0.74rem",message:n.description||n.reason_for_inclusion||"",extraMetaData:B}),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.72rem",color:"#9CA3AF",fontWeight:500,mt:.25}},{children:"APB References"})),i.jsx(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.75}},{children:n.apb_references.map(function(n,t){var s="string"==typeof n?n:n.apb_name,r=Y===s;return i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.15}},{children:[i.jsxs(o.Box,e.__assign({onClick:function(){return function(e){Y===e?(J(null),U("")):(J(e),U(""),setTimeout(function(){return U(e)},50))}(s)},sx:{display:"flex",alignItems:"center",gap:.25,cursor:"pointer"}},{children:[i.jsxs(o.Typography,e.__assign({sx:{fontSize:"0.78rem",color:r?"#5928ed":"#DB2877",fontWeight:500}},{children:[t+1,". ",s]})),i.jsx(_.default,{sx:{fontSize:"0.75rem",color:r?"#5928ed":"#DB2877"}})]})),"string"!=typeof n&&(n.description||n.context)&&i.jsx(v,{text:n.description||n.context||"",extraMetaData:B})]}),t)})}))]}))]}),t)}):i.jsx(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:1}},{children:[1,2,3].map(function(n){return i.jsxs(o.Box,e.__assign({sx:{bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5,display:"flex",flexDirection:"column",gap:.5}},{children:[i.jsx(o.Skeleton,{variant:"text",width:"40%",height:16}),i.jsx(o.Skeleton,{variant:"text",width:"90%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"80%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"30%",height:14})]}),n)})}))}))]})),i.jsxs(o.Accordion,e.__assign({disableGutters:!0,elevation:0,sx:e.__assign({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==P?void 0:P.applicabilitySection)},{children:[i.jsxs(o.AccordionSummary,e.__assign({expandIcon:i.jsx(u.default,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75,alignItems:"center",gap:1}}},{children:[i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==P?void 0:P.applicabilityTitle)},{children:"Applicability"})),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.7rem",color:"#9CA3AF"}},{children:"When to Apply this SPB / When Not Apply"}))]})),i.jsx(o.AccordionDetails,e.__assign({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC"}},{children:i.jsx(o.Box,e.__assign({sx:{display:"flex",gap:1}},{children:[{label:"When to apply",content:null==w?void 0:w.when_to_apply},{label:"When NOT to apply",content:null==w?void 0:w.when_not_to_apply}].map(function(n){var t=n.label,s=n.content;return i.jsxs(o.Box,e.__assign({sx:{flex:1,bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"6px",p:1.25}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.76rem",color:"#374151",mb:.75}},{children:t})),s?i.jsx(x.MarkdownRenderer,{fontSize:"0.8rem",message:s,isDarkMode:$,style:null==P?void 0:P.markdownRenderer,extraMetaData:B}):d?i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[i.jsx(o.Skeleton,{variant:"text",width:"100%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"80%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"90%",height:14})]})):i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.8rem",color:"#6B7280",lineHeight:1.5}},{children:"— Not yet available"}))]}),t)})}))}))]})),i.jsxs(o.Accordion,e.__assign({disableGutters:!0,elevation:0,sx:e.__assign({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==P?void 0:P.specificationsSection)},{children:[i.jsxs(o.AccordionSummary,e.__assign({expandIcon:i.jsx(u.default,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75,alignItems:"center",gap:1}}},{children:[i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==P?void 0:P.specificationsTitle)},{children:"Specifications"})),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.7rem",color:"#9CA3AF"}},{children:"Strict Rules / Input / Output"}))]})),i.jsx(o.AccordionDetails,e.__assign({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"column",gap:1}},{children:[{label:"Strict Rules",tooltip:null,content:null==w?void 0:w.constraints_and_rules},{label:"Input",tooltip:"Input specification for this SPB",content:null==w?void 0:w.input_analysis},{label:"Output",tooltip:"Output specification for this SPB",content:null==w?void 0:w.output_analysis}].map(function(n){var t=n.label,s=n.tooltip,r=n.content,l="Output"===t,a=l&&r?function(e){var i=[];return{text:e.replace(/<code>([\s\S]*?)<\/code>/g,function(e,n){return i.push(n.trim()),""}).trim(),code:i.join("\n\n")}}(r):null,c=a?a.text:r,h=a?a.code:"";return i.jsxs(o.Accordion,e.__assign({disableGutters:!0,elevation:0,defaultExpanded:"Strict Rules"===t,sx:{bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"6px !important","&:before":{display:"none"},overflow:"hidden"}},{children:[i.jsx(o.AccordionSummary,e.__assign({expandIcon:i.jsx(u.default,{sx:{fontSize:"1rem"}}),sx:{minHeight:34,px:1.25,"& .MuiAccordionSummary-content":{my:.4}}},{children:i.jsxs(o.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:.5}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.76rem",color:"#374151"}},{children:t})),s&&i.jsx(o.Tooltip,e.__assign({title:s,placement:"top"},{children:i.jsx(o.Box,e.__assign({component:"span",sx:{width:13,height:13,borderRadius:"50%",background:"#E5E7EB",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"0.58rem",color:"#6B7280",fontWeight:700,cursor:"default",flexShrink:0}},{children:"i"}))}))]}))})),i.jsx(o.AccordionDetails,e.__assign({sx:{px:1.25,pb:1.25,pt:0}},{children:r?i.jsxs(i.Fragment,{children:[c&&i.jsx(x.MarkdownRenderer,{fontSize:"0.8rem",message:c,isDarkMode:$,style:null==P?void 0:P.markdownRenderer,extraMetaData:B}),l&&h&&i.jsxs(o.Box,e.__assign({sx:{width:"100%",height:"35vh",mt:1.5}},{children:[i.jsxs(o.Box,e.__assign({sx:{display:"flex",gap:.1,backgroundColor:"black",flexDirection:"row",alignItems:"center",justifyContent:"space-between",p:1,borderTopLeftRadius:"8px",borderTopRightRadius:"8px"}},{children:[i.jsx(o.Typography,e.__assign({sx:{color:"white",fontWeight:500,fontSize:"0.8rem"}},{children:"Output preview"})),i.jsx(o.Tooltip,e.__assign({title:"Copy Code to clipboard"},{children:i.jsx(o.IconButton,e.__assign({size:"small",onClick:function(){return e=h,navigator.clipboard.writeText(e);var e}},{children:i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.7rem",color:"white"}},{children:"Copy"}))}))}))]})),i.jsx(o.Box,e.__assign({sx:{mt:-1,height:"calc(100% - 40px)",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px",overflow:"hidden"}},{children:i.jsx(p.InternalEditor,{content:h,isDarkMode:$,height:"100%",fontSize:10})}))]}))]}):d?i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[i.jsx(o.Skeleton,{variant:"text",width:"100%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"90%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"75%",height:14})]})):i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.74rem",color:"#6B7280",lineHeight:1.5}},{children:"— Not yet available"}))}))]}),t)})}))]})),i.jsxs(o.Accordion,e.__assign({defaultExpanded:!0,disableGutters:!0,elevation:0,sx:e.__assign({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},bgcolor:"#fff"},null==P?void 0:P.dependencyGraphSection)},{children:[i.jsx(o.AccordionSummary,e.__assign({expandIcon:i.jsx(u.default,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75},"&.Mui-expanded":{bgcolor:"#F8FAFC",borderRadius:"8px 8px 0 0"}}},{children:i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==P?void 0:P.dependencyGraphTitle)},{children:"Dependency Graph"}))})),i.jsx(o.AccordionDetails,e.__assign({sx:{px:0,pb:0,pt:0}},{children:(null==w?void 0:w.dependency_graph)?i.jsxs(o.Box,e.__assign({sx:{bgcolor:"#F8FAFC",borderRadius:"0 0 8px 8px",p:1.5,display:"flex",flexDirection:"column",gap:1.5}},{children:[i.jsx(o.Box,e.__assign({sx:{height:500,borderRadius:"8px",overflow:"hidden"}},{children:i.jsx(c.default,{data:w.dependency_graph,isDarkMode:$,style:null==P?void 0:P.dependencyGraph})})),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.72rem",color:"#64748B",lineHeight:1.6}},{children:"This graph visualises how Atomic Prompt Blocks (APBs) depend on, influence, or exchange information with one another within the prompt architecture."}))]})):i.jsxs(o.Box,e.__assign({sx:{bgcolor:"#fff",borderRadius:"0 0 8px 8px",p:1.5,display:"flex",flexDirection:"column",gap:1}},{children:[i.jsx(o.Skeleton,{variant:"rectangular",width:"100%",height:400,sx:{borderRadius:"8px"}}),i.jsx(o.Skeleton,{variant:"text",width:"100%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"80%",height:14})]}))}))]}))]}))})),E&&z&&i.jsx(o.Box,e.__assign({onClick:function(){return re(function(e){return!e})},sx:e.__assign({width:20,flexShrink:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",borderRight:"1px solid #e5e7eb",borderLeft:"1px solid #e5e7eb",bgcolor:"#f9fafb",position:"relative",py:2,"&:hover":{bgcolor:"#f0f0f0"}},null==P?void 0:P.collapseStrip)},{children:i.jsx(o.Typography,e.__assign({sx:{fontSize:10,fontWeight:600,color:"#6b7280",writingMode:"vertical-rl",textOrientation:"mixed",transform:"rotate(180deg)",letterSpacing:"0.05em",userSelect:"none"}},{children:"SPB Details"}))})),E&&z&&i.jsx(o.Box,e.__assign({onClick:function(){return re(function(e){return!e})},onMouseDown:function(e){e.preventDefault(),ce.current=!0;var i=function(e){if(ce.current&&xe.current){var o=xe.current.getBoundingClientRect(),t=o.left,s=o.width,r=e.clientX-t;if(r<200)return re(!0),ce.current=!1,document.removeEventListener("mousemove",i),void document.removeEventListener("mouseup",n);r>.7*s||(re(!1),de(r))}},n=function(){ce.current=!1,document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",n)};document.addEventListener("mousemove",i),document.addEventListener("mouseup",n)},sx:e.__assign({position:"absolute",left:se?20:ae+20,top:"50%",transform:"translateY(-50%)",width:18,height:28,bgcolor:"#fff",border:"1px solid #e5e7eb",borderRadius:"0 6px 6px 0",display:"flex",alignItems:"center",justifyContent:"center",cursor:"col-resize",zIndex:5,boxShadow:"2px 0 4px rgba(0,0,0,0.06)","&:hover":{bgcolor:"#f9fafb"}},null==P?void 0:P.dragHandle)},{children:se?i.jsx(y.default,{sx:{fontSize:12,color:"#6b7280"}}):i.jsx(m.default,{sx:{fontSize:12,color:"#6b7280"}})})),E&&i.jsxs(o.Box,e.__assign({sx:e.__assign({flex:1,minWidth:0,minHeight:0,display:"flex",flexDirection:"column",overflow:"hidden",p:2,gap:1.5,bgcolor:"#f8fafc"},null==P?void 0:P.codePanel)},{children:[i.jsxs(o.Box,e.__assign({sx:e.__assign({display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0},null==P?void 0:P.codePanelHeader)},{children:[i.jsx(o.Typography,e.__assign({sx:e.__assign({fontSize:13,fontWeight:600,color:"#374151"},null==P?void 0:P.codePanelTitle)},{children:l||"SPB Analysis"})),i.jsxs(o.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:1.5}},{children:[F&&i.jsx(o.Switch,{checked:$,onChange:function(e){return ee(e.target.checked)},size:"small",sx:{width:36,height:20,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:"2px","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{bgcolor:"#5928ed",opacity:1}}},"& .MuiSwitch-thumb":{width:16,height:16,bgcolor:"#fff"},"& .MuiSwitch-track":{borderRadius:10,bgcolor:"#d1d5db",opacity:1}}}),T&&R&&i.jsx(o.Tooltip,e.__assign({title:"Fullscreen",placement:"top"},{children:i.jsx(o.IconButton,e.__assign({size:"small",onClick:function(){return oe({ref:Q||"",description:""})},sx:{color:"#6b7280"}},{children:i.jsx(g.default,{sx:{fontSize:16}})}))}))]}))]})),i.jsx(o.Box,e.__assign({sx:e.__assign({flex:1,minHeight:0,border:"1px solid #30363d",borderRadius:1,overflow:"hidden"},null==P?void 0:P.editorContainer)},{children:i.jsx(p.InternalEditor,{content:r,selectedTag:Q,isDarkMode:$,height:"100%",fontSize:13})}))]}))]})),R&&i.jsxs(o.Dialog,e.__assign({open:!!ne,onClose:function(){return oe(null)},maxWidth:!1,PaperProps:{sx:e.__assign({width:"82vw",height:"80vh",maxWidth:"none",borderRadius:"12px",overflow:"hidden",display:"flex",flexDirection:"column"},null==P?void 0:P.fullscreenModal)}},{children:[i.jsxs(o.Box,e.__assign({sx:{px:2.5,py:1.5,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontWeight:700,fontSize:"1rem",color:"#111827"}},{children:"Promptemon"})),i.jsx(o.IconButton,e.__assign({size:"small",onClick:function(){return oe(null)}},{children:i.jsx(f.default,{sx:{fontSize:"1.1rem",color:"#6B7280"}})}))]})),i.jsxs(o.Box,e.__assign({sx:{flex:1,display:"flex",overflow:"hidden",minHeight:0}},{children:[i.jsxs(o.Box,e.__assign({sx:{width:"40%",flexShrink:0,borderRight:"1px solid #E5E7EB",display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[i.jsxs(o.Box,e.__assign({sx:{px:2,py:1.25,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",gap:1}},{children:[i.jsx(o.Tooltip,e.__assign({title:"Atomic Prompt Block",placement:"top"},{children:i.jsx(o.Chip,{label:"APB",size:"small",sx:{bgcolor:"#f1f5f9",color:"#475569",fontWeight:700,fontSize:10,height:20,borderRadius:1}})})),i.jsx(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.9rem",color:"#111827"}},{children:null==ne?void 0:ne.ref}))]})),i.jsxs(o.Box,e.__assign({sx:{flex:1,p:2,display:"flex",flexDirection:"column",gap:1.5,overflowY:"auto"}},{children:[i.jsxs(o.Box,e.__assign({sx:{border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.8rem",color:"#111827",mb:.75}},{children:"Description"})),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.73rem",color:"#6B7280",lineHeight:1.6}},{children:null==ne?void 0:ne.description}))]})),i.jsxs(o.Box,e.__assign({sx:{border:"1px solid #E5E7EB",borderRadius:"8px",p:1.25,display:"flex",alignItems:"center",gap:.5}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.73rem",color:"#6B7280"}},{children:"Total Lines"})),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.73rem",fontWeight:700,color:"#111827"}},{children:r.split("\n").length}))]}))]}))]})),i.jsxs(o.Box,e.__assign({sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[i.jsxs(o.Box,e.__assign({sx:{px:2,py:1.25,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.85rem",color:"#111827"}},{children:"Prompt Preview"})),i.jsx(o.Switch,{checked:$,onChange:function(e){return ee(e.target.checked)},size:"small",sx:{width:36,height:20,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:"2px","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{bgcolor:"#5928ed",opacity:1}}},"& .MuiSwitch-thumb":{width:16,height:16,bgcolor:"#fff"},"& .MuiSwitch-track":{borderRadius:10,bgcolor:"#d1d5db",opacity:1}}})]})),i.jsx(o.Box,e.__assign({sx:{flex:1,minHeight:0,p:1.5}},{children:i.jsx(p.InternalEditor,{content:r,selectedTag:Q,isDarkMode:$,height:"100%",fontSize:13})}))]}))]}))]}))]}))};
|
|
2
2
|
//# sourceMappingURL=Spbanalysispanel.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as t,jsx as n}from"react/jsx-runtime";import i from"react";import{pdfStyles as o}from"./PdfStyle.js";import{DefaultPdfIcon as r,DefaultFullScreenIcon as l,DefaultDownloadIcon as d,DefaultCloseIcon as a}from"../../assests/svg/PdfViewerIcons.js";import{Tooltip as s}from"@mui/material";import{Info as c}from"lucide-react";var p=function(p){p.highlightIndex;var h=p.totalHighlights,u=p.controls,g=p.currentPosition,f=p.pdfName,x=p.onClose,m=p.pdfUrl,v=p.viewerRef,y=p.customStyles,b=p.customClasses,w=p.customIcons,k=p.headerAction,S=p.isZoomEnabled,F=void 0===S||S,I=p.showHighlightsAction,C=void 0===I||I,D=p.showFullScreenAction,W=void 0===D||D,E=p.currentSegment,B=p.segmentTooltipText,j=void 0===B?"Details of current segment":B,z=p.currentPage,A=p.totalPages,L=p.onPageNavigate,P=u.ZoomInButton,N=u.ZoomOutButton,R=u.ZoomPopover,T=u.goToPrevious,H=u.goToNext,O=i.useState(String(z)),M=O[0],Z=O[1];i.useEffect(function(){Z(String(z))},[z]);var _={padding:"4px",borderRadius:"6px",background:"transparent",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s ease",flexShrink:0},V=function(e){return String(e).padStart(2,"0")};return t("div",e({style:e(e(e({marginBottom:"12px",background:"#FAFAFA",borderBottom:"1px solid #F3F4F6",borderTopLeftRadius:"12px",borderTopRightRadius:"12px"},o.header),null==y?void 0:y.header),{display:"flex",flexDirection:"column",alignItems:"stretch",gap:"12px"})},{children:[t("div",e({style:{display:"flex",alignItems:"center",justifyContent:"space-between",minWidth:0}},{children:[t("div",e({style:{display:"flex",alignItems:"center",gap:"12px",flex:1,minWidth:0,overflow:"hidden"}},{children:[n("div",e({style:e(e(e({},{borderRadius:"21px",border:"6px solid #E8F3FF",background:"#D5E8FF",display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",boxSizing:"content-box"}),null==y?void 0:y.pdfIconWrapper),{flexShrink:0})},{children:(null==w?void 0:w.pdfIcon)||n(r,{})})),n(s,e({title:f||"",arrow:!0,placement:"top"},{children:n("div",e({style:{flex:1,minWidth:0,overflow:"hidden"}},{children:n("span",e({style:e({display:"block",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontWeight:500,cursor:"default"},null==y?void 0:y.pdfName),className:null==b?void 0:b.pdfName},{children:f}))}))}))]})),t("div",e({style:{display:"flex",alignItems:"center",gap:C?"16px":"2px",color:"#4B5563",flexShrink:0,whiteSpace:"nowrap",minWidth:"fit-content"}},{children:[A>0&&t("div",e({style:{display:"flex",alignItems:"center",gap:"4px",color:"#475467",flexShrink:0,whiteSpace:"nowrap"}},{children:[n("input",{"aria-label":"Current page",inputMode:"numeric",pattern:"[0-9]*",value:M,onChange:function(e){var t=e.target.value.replace(/\D/g,"");Z(t)},onBlur:function(){var e=Number(M);if(!Number.isInteger(e)||e<1)Z(String(z));else{var t=A?Math.min(e,A):e;L(t),Z(String(t))}},onKeyDown:function(e){"Enter"===e.key&&e.currentTarget.blur(),"Escape"===e.key&&(Z(String(z)),e.currentTarget.blur())},style:{width:"40px",height:"28px",border:"1px solid #E5E7EB",borderRadius:"4px",background:"#FFFFFF",color:"#111827",fontSize:"14px",fontWeight:500,textAlign:"center",outline:"none",boxSizing:"border-box"}}),n("span",e({style:{fontSize:"14px",fontWeight:500,color:"#111827"}},{children:"/"})),n("span",e({style:{fontSize:"14px",fontWeight:500,color:"#111827"}},{children:String(A)}))]})),F&&t("div",e({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[n(N,{}),n("div",e({style:{fontSize:"14px",fontWeight:500,width:"56px",textAlign:"center"}},{children:n(R,{})})),n(P,{})]})),!!h&&C&&t("div",e({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[t("span",e({style:{fontSize:"14px",color:"#475467",fontWeight:500,lineHeight:1}},{children:[g," of ",h]})),n("button",e({style:{background:"none",border:"none",cursor:g<=1?"not-allowed":"pointer",padding:"2px 4px",color:g<=1?"#D0D5DD":"#475467",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,height:"20px",width:"20px"},onClick:T,disabled:g<=1},{children:n("svg",e({width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},{children:n("path",{d:"M2 8L6 4L10 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))})),n("button",e({style:{background:"none",border:"none",cursor:g===h?"not-allowed":"pointer",padding:"2px 4px",color:g===h?"#D0D5DD":"#475467",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,height:"20px",width:"20px"},onClick:H,disabled:g===h},{children:n("svg",e({width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},{children:n("path",{d:"M2 4L6 8L10 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))}))]})),n("div",{style:{width:"1px",height:"20px",background:"#D1D5DB",margin:"0 4px",flexShrink:0}}),t("div",e({style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0,whiteSpace:"nowrap"}},{children:[!1!==W&&((null==k?void 0:k.icon)&&(null==k?void 0:k.onClick)?n(s,e({title:(null==k?void 0:k.tooltip)||"",arrow:!0,placement:"top"},{children:n("div",e({onClick:k.onClick,style:e({display:"flex",alignItems:"center",cursor:"pointer"},_)},{children:k.icon}))})):n("button",e({onClick:function(){var e=null==v?void 0:v.current;e&&(document.fullscreenElement?document.exitFullscreen():e.requestFullscreen().catch(function(e){console.error("Error attempting to enable fullscreen: ".concat(e.message))}))},style:_,title:"Full Screen"},{children:(null==w?void 0:w.fullScreenIcon)||n(l,{})}))),m&&n("a",e({href:m,target:"_blank",rel:"noopener noreferrer",style:_,title:"Open in new tab"},{children:(null==w?void 0:w.downloadIcon)||n(d,{})})),x&&n("button",e({onClick:x,style:_,title:"Close"},{children:(null==w?void 0:w.closeIcon)||n(a,{})}))]}))]}))]})),E&&t("div",e({style:{background:"#EEF2FF",border:"1px solid #A5B4FC",borderRadius:"8px",color:"#4F46E5",display:"flex",alignItems:"center",gap:"12px",minWidth:0,padding:"10px 16px",fontSize:"12px",fontWeight:500,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},{children:[n(s,e({title:j,arrow:!0,placement:"top"},{children:n(c,{size:16,color:"#4F46E5",strokeWidth:2,style:{flexShrink:0}})})),t("span",e({style:{overflow:"hidden",textOverflow:"ellipsis"}},{children:["Viewing ",E.title," • Pages ",V(E.start_page),"-",V(E.end_page)]}))]}))]}))};export{p as default};
|
|
2
2
|
//# sourceMappingURL=PdfToolbar.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__awaiter as t,__generator as i}from"tslib";import{jsx as o,jsxs as n}from"react/jsx-runtime";import{SpecialZoomLevel as r}from"@react-pdf-viewer/core";import a from"./PdfContainer.js";import l from"./PdfToolbar.js";import{pdfStyles as s}from"./PdfStyle.js";import{PdfHighlightControls as c}from"./usePdfHighlight.js";import"@react-pdf-viewer/zoom/lib/styles/index.css";import"@react-pdf-viewer/page-navigation/lib/styles/index.css";import"@react-pdf-viewer/core/lib/styles/index.css";import"@react-pdf-viewer/search/lib/styles/index.css";import{useRef as u,
|
|
1
|
+
import{__assign as e,__awaiter as t,__generator as i}from"tslib";import{jsx as o,jsxs as n}from"react/jsx-runtime";import{SpecialZoomLevel as r}from"@react-pdf-viewer/core";import a from"./PdfContainer.js";import l from"./PdfToolbar.js";import{pdfStyles as s}from"./PdfStyle.js";import{PdfHighlightControls as c}from"./usePdfHighlight.js";import"@react-pdf-viewer/zoom/lib/styles/index.css";import"@react-pdf-viewer/page-navigation/lib/styles/index.css";import"@react-pdf-viewer/core/lib/styles/index.css";import"@react-pdf-viewer/search/lib/styles/index.css";import{useRef as u,useState as d,useMemo as g,useEffect as f}from"react";import h from"../ScannedDocCitation/ScannedDocCitation.js";var m=function(e){switch(e){case"ActualSize":return r.ActualSize;case"PageFit":return r.PageFit;case"PageWidth":return r.PageWidth;default:return null!=e?e:r.PageWidth}},v=function(v){var p,x=v.pdfUrl,P=v.highlightText,T=v.highlightPages,C=v.highlightCordinatePages,w=v.highlightColor,S=void 0===w?"yellow":w,y=v.activeHighlightColor,A=void 0===y?"#f7dc51":y,b=v.jumpToPageValue,H=void 0===b?0:b,I=v.pdfName,_=v.onClose,j=v.customStyles,F=v.customClasses,N=v.customIcons,z=v.useCoordinates,D=v.fallbackPages,R=v.activeCitationIndex,V=v.onActiveCitationChange,W=v.headerAction,q=v.isZoomEnabled,E=void 0===q||q,B=v.showHighlightsAction,O=void 0===B||B,U=v.defaultScale,k=void 0===U?r.ActualSize:U,M=v.useRange,Z=void 0!==M&&M,J=v.rangeOfPages,K=void 0===J?null:J,L=v.showFullScreenAction,G=void 0===L||L,Q=v.segments,X=void 0===Q?[{title:"Document 2",start_page:52,end_page:52,page_count:1}]:Q,Y=v.segmentTooltipText,$=u(null),ee=d(0),te=ee[0],ie=ee[1],oe=d(0),ne=oe[0],re=oe[1],ae=g(function(){if(z)return new Set(C.map(function(e){return e.pageIndex}));var e=new Set;return Object.values(T).forEach(function(t){t>0&&e.add(t-1)}),e},[C,T,z]),le=(p=P)&&0!==p.length?p.filter(function(e){return!p.some(function(t){return t!==e&&t.includes(e)})}):p,se=c(le,z?{}:T,$,ae,z,z?C:[],S,A),ce=se.highlightIndex,ue=se.cursorIndex,de=se.setCursorIndex,ge=se.orderedKeys,fe=se.totalHighlights,he=se.getValidPosition,me=se.tryJump,ve=se.jumpToPage,pe=se.zoomTo,xe=se.plugins,Pe=se.controls,Te=se.hideNonTargetHighlights,Ce=se.deduplicateHighlights,we=he(ue),Se=g(function(){var e=te+1;return X.find(function(t){return e>=t.start_page&&e<=t.end_page})},[te,X]);f(function(){void 0!==R&&R!==ue&&de(R)},[R]);var ye=e(e({},Pe),{goToNext:function(){ue>=fe-1||(Pe.goToNext(),V&&V(ue+1))},goToPrevious:function(){ue<=0||(Pe.goToPrevious(),V&&V(ue-1))}});if(!x)return o(h,{pages:D,activeCitationIndex:R,onActiveCitationChange:V,headerAction:W});return n("div",e({ref:$,className:(null==F?void 0:F.pdfViewerWrapper)||"",style:e(e(e({height:"100%",minHeight:0,minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column"},s.pdfViewer),{display:"flex",flexDirection:"column",height:"100%",width:"100%",backgroundColor:"#FAFAFA"}),null==j?void 0:j.pdfViewer)},{children:[o(l,{highlightIndex:ce,totalHighlights:fe,controls:ye,currentPosition:we,pdfName:I,onClose:_,pdfUrl:x,viewerRef:$,customStyles:j,customClasses:F,customIcons:N,headerAction:W,isZoomEnabled:E,showHighlightsAction:O,showFullScreenAction:G,currentSegment:Se,segmentTooltipText:Y,currentPage:te+1,totalPages:ne,onPageNavigate:function(e){var t=Math.min(Math.max(e,1),ne||e);ie(t-1),ve(t-1)}}),o(a,{defaultScale:m(k),pdfUrl:x,plugins:xe,customStyles:j,onLoad:function(e){re(e.doc.numPages);var o=!z&&!Z&&H<=0;if(pe(r.ActualSize),H>0&&!Z){var n=H-1,a=ge[n],l=T[a],s=C[n];de(n),console.log(s,"cordinateTargetHighlight"),z&&s.pageIndex>0&&ve(s.pageIndex),l>0&&(setTimeout(function(){Te(ae),Ce(l-1)},1e3),z||ve(l-1))}else if(Z&&K&&2===K.length){t(void 0,void 0,void 0,function(){var e,t,o,n,r;return i(this,function(i){switch(i.label){case 0:e=K[0],t=K[1],o=e,i.label=1;case 1:return o<=t?(ve(n=o-1),[4,new Promise(function(e){return setTimeout(e,1e3)})]):[3,4];case 2:if(i.sent(),Te(ae),(r=Ce(n))&&r>0)return[3,4];i.label=3;case 3:return o++,[3,1];case 4:return[2]}})})}else if(!z&&T){var c=ge.find(function(e){return T[e]>0});if(void 0!==c){var u=T[c]-1;ve(u),setTimeout(function(){Te(ae),Ce(u)},1e3)}}requestAnimationFrame(function(){o&&me(),!z&&H>0&&!Z&&function(){if($.current){var e=H-1,t=ge[e],i=T[t],o=i>0?i-1:0,n={};ge.forEach(function(e,t){var i=T[e];i>0&&(n[i]||(n[i]=[]),n[i].push(t))});var r=(n[i]||[]).indexOf(e),a=0,l=function(){var e,t;if(!(++a>40)){var i=null===(e=$.current)||void 0===e?void 0:e.querySelector(".rpv-core__inner-pages");if(i){var n=null===(t=$.current)||void 0===t?void 0:t.querySelector('[data-testid="core__page-layer-'.concat(o,'"]'));if(n){var s=i.getBoundingClientRect(),c=n.getBoundingClientRect();if(c.top<s.bottom&&c.bottom>s.top){var u=n.querySelectorAll(".rpv-search__highlight")[r];if(u){var d=u.getBoundingClientRect(),g=i.scrollTop+(d.top-s.top)-i.clientHeight/2+d.height/2;i.scrollTo({top:g,behavior:"smooth"})}else setTimeout(l,100)}else setTimeout(l,100)}else setTimeout(l,100)}else setTimeout(l,100)}};setTimeout(l,500)}}()})},onPageChange:function(e){var t=e.currentPage;ie(t),ae.has(t)?(Ce(t),Te(ae)):Te(ae)}})]}))};export{v as default};
|
|
2
2
|
//# sourceMappingURL=PdfViewer.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as i,jsx as n,Fragment as t}from"react/jsx-runtime";import{useState as o,useEffect as r,useRef as l}from"react";import{Box as d,Typography as c,Skeleton as a,Accordion as s,AccordionSummary as h,AccordionDetails as p,Tooltip as f,IconButton as u,Switch as x,Dialog as m,Chip as g}from"@mui/material";import v from"@mui/icons-material/ExpandMore";import b from"@mui/icons-material/Fullscreen";import y from"@mui/icons-material/Close";import S from"@mui/icons-material/NearMeOutlined";import w from"@mui/icons-material/ChevronLeft";import z from"@mui/icons-material/ChevronRight";import E from"./DependencyGraph.js";import{MarkdownRenderer as B}from"./Markdownrenderer.js";import{InternalEditor as k}from"./Internaleditor.js";var D=function(t){var r=t.text,l=t.detailedSummary,a=t.extraMetaData,s=t.isDarkMode,h=void 0!==s&&s,p=t.markdownRendererStyle,f=o(!1),u=f[0],x=f[1],m=function(e,i){void 0===i&&(i=220);var n=e.replace(/<!--\s*<ai_reasoning>[\s\S]*?<\/ai_reasoning>\s*-->/g,"").replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim();if(n.length<=i)return{preview:n,truncated:!1};var t=n.slice(0,i),o=t.lastIndexOf(" ");return{preview:(o>0?t.slice(0,o):t).trim(),truncated:!0}}(r),g=m.preview,v=m.truncated;return n(d,{children:i(d,u?{children:[n(B,{message:r,fontSize:"0.8rem",extraMetaData:a,isDarkMode:h,style:p}),(null==l?void 0:l.trim())&&n(B,{message:l,fontSize:"0.8rem",extraMetaData:a,isDarkMode:h,style:p}),n(c,e({component:"span",onClick:function(){return x(!1)},sx:{fontSize:"0.72rem",color:h?"#a78bfa":"#5928ed",fontWeight:600,cursor:"pointer"}},{children:"view less"}))]}:e({sx:{display:"flex",flexDirection:"column"}},{children:[i(c,e({sx:{fontSize:"0.8rem",color:h?"#cbd5e1":"#4B5563",lineHeight:1.6}},{children:[g,v&&"…"]})),(v||(null==l?void 0:l.trim()))&&n(d,e({sx:{display:"flex",justifyContent:"flex-end"}},{children:n(c,e({component:"span",onClick:function(){return x(!0)},sx:{fontSize:"0.72rem",color:h?"#a78bfa":"#5928ed",fontWeight:600,cursor:"pointer"}},{children:"...view more"}))}))]}))})},C=function(t){var a=t.text,s=o(!1),h=s[0],p=s[1],f=o(!1),u=f[0],x=f[1],m=l(null);return r(function(){var e=m.current;e&&x(e.scrollWidth>e.clientWidth)},[a]),n(d,e({sx:{pl:1}},{children:h?i(c,e({sx:{fontSize:"0.68rem",color:"#9CA3AF",lineHeight:1.4}},{children:[a," ",n(c,e({component:"span",onClick:function(){return p(!1)},sx:{fontSize:"0.65rem",color:"#5928ed",cursor:"pointer",fontWeight:600}},{children:"view less"}))]})):i(d,e({sx:{display:"flex",alignItems:"baseline",gap:.5}},{children:[n(c,e({ref:m,sx:{fontSize:"0.68rem",color:"#9CA3AF",lineHeight:1.4,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",flex:1,minWidth:0}},{children:a})),u&&n(c,e({component:"span",onClick:function(){return p(!0)},sx:{fontSize:"0.65rem",color:"#5928ed",cursor:"pointer",fontWeight:600,flexShrink:0}},{children:"view more"}))]}))}))},M=function(M){var R,A=M.promptContent,F=M.promptTitle,W=M.isLoading,I=void 0!==W&&W,H=M.overviewSummary,P=M.functionalityOfSPB,T=void 0===P?[]:P,_=M.spbAdditionalInfo,L=M.showCodePanel,j=void 0===L||L,O=M.showCollapseStrip,G=void 0===O||O,N=M.showFullscreenButton,X=void 0===N||N,Y=M.showFullscreenModal,q=void 0===Y||Y,J=M.showThemeToggle,K=void 0===J||J,Q=M.isDarkMode,U=void 0===Q||Q,V=M.styles,Z=M.className,$=M.style,ee=M.sx,ie=o(null),ne=ie[0],te=ie[1],oe=o(null),re=oe[0],le=oe[1],de=o(""),ce=de[0],ae=de[1],se=void 0!==(null==V?void 0:V.isDarkMode)?V.isDarkMode:U,he=o(se),pe=he[0],fe=he[1],ue=o(null),xe=ue[0],me=ue[1];r(function(){void 0!==(null==V?void 0:V.isDarkMode)&&fe(V.isDarkMode)},[null==V?void 0:V.isDarkMode]);var ge=o(!1),ve=ge[0],be=ge[1],ye=o(480),Se=ye[0],we=ye[1],ze=l(!1),Ee=l(null);r(function(){var e,i,n;T.length>0&&te((e=new Date,i=e.toLocaleTimeString("en-IN",{hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0}),n=e.toLocaleDateString("en-IN",{day:"numeric",month:"short",year:"numeric"}),"".concat(i||""," | ").concat(n||"")))},[T]),r(function(){I&&te(null)},[I]),r(function(){xe&&(ae(""),setTimeout(function(){return ae(xe.ref)},500))},[xe]);return i(d,e({className:Z,style:e(e({},null==V?void 0:V.root),$),sx:e({height:"100%",display:"flex",flexDirection:"column",width:"100%",minHeight:0,overflow:"hidden"},ee)},{children:[n(d,e({sx:e({px:2.5,py:1.5,borderBottom:"1px solid #e5e7eb",display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#fff",flexShrink:0},null==V?void 0:V.header)},{children:i(d,e({sx:{display:"flex",flexDirection:"column",gap:.25}},{children:[n(c,e({sx:e({fontWeight:700,fontSize:"0.9rem",color:"#111827"},null==V?void 0:V.headerTitle)},{children:F||"SPB Analysis"})),n(c,e({sx:e({fontSize:"0.7rem",color:"#9CA3AF"},null==V?void 0:V.headerSubtitle)},{children:ne?"Last Analyzed at ".concat(ne):""}))]}))})),i(d,e({ref:Ee,sx:{display:"flex",flex:1,minHeight:0,overflow:"hidden",position:"relative"}},{children:[n(d,e({sx:e({width:j?ve&&G?0:Se:"100%",flexShrink:0,minHeight:0,overflow:"hidden",transition:ze.current?"none":"width 0.15s",borderRight:!j||ve&&G?"none":"1px solid #e5e7eb"},null==V?void 0:V.leftPanel)},{children:i(d,e({sx:{width:"100%",height:"100%",minHeight:0,overflowY:"auto",display:"flex",flexDirection:"column",gap:1,px:1.25,py:1.25,pb:2}},{children:[i(d,e({sx:e({border:"1px solid #E5E7EB",borderRadius:"8px",bgcolor:"#F8FAFC",p:1.5},null==V?void 0:V.overviewSection)},{children:[n(c,e({sx:e({fontWeight:600,fontSize:"0.85rem",color:"#111827",mb:1},null==V?void 0:V.overviewTitle)},{children:"Overview"})),n(d,e({sx:e({bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5},null==V?void 0:V.overviewContent)},{children:(null===(R=null==H?void 0:H.overallSummary)||void 0===R?void 0:R.trim())?n(D,{text:H.overallSummary,detailedSummary:H.detailedSummary,extraMetaData:H.extraMetaData,isDarkMode:pe,markdownRendererStyle:null==V?void 0:V.markdownRenderer}):i(d,e({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[n(a,{variant:"text",width:"100%",height:14}),n(a,{variant:"text",width:"90%",height:14}),n(a,{variant:"text",width:"95%",height:14})]}))}))]})),i(s,e({disableGutters:!0,elevation:0,sx:e({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==V?void 0:V.functionalitySection)},{children:[n(h,e({expandIcon:n(v,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75}}},{children:n(c,e({sx:e({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==V?void 0:V.functionalityTitle)},{children:"Functionality of SPB"}))})),n(p,e({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"column",gap:1}},{children:T.length>0?T.map(function(t,o){return i(s,e({disableGutters:!0,elevation:0,defaultExpanded:0===o,sx:e({bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},overflow:"hidden"},null==V?void 0:V.functionalityItem)},{children:[n(h,e({expandIcon:n(v,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:38,"& .MuiAccordionSummary-content":{my:.5}}},{children:i(c,e({sx:{fontWeight:600,fontSize:"0.8rem",color:"#111827"}},{children:[o+1,". ",t.name||t.section_name]}))})),i(p,e({sx:{px:1.5,pb:1.5,pt:0,display:"flex",flexDirection:"column",gap:.75}},{children:[n(c,e({sx:{fontSize:"0.74rem",color:"#6B7280",lineHeight:1.5}},{children:t.description||t.reason_for_inclusion})),n(c,e({sx:{fontSize:"0.72rem",color:"#9CA3AF",fontWeight:500,mt:.25}},{children:"APB References"})),n(d,e({sx:{display:"flex",flexDirection:"column",gap:.75}},{children:t.apb_references.map(function(t,o){var r="string"==typeof t?t:t.apb_name,l=re===r;return i(d,e({sx:{display:"flex",flexDirection:"column",gap:.15}},{children:[i(d,e({onClick:function(){return function(e){re===e?(le(null),ae("")):(le(e),ae(""),setTimeout(function(){return ae(e)},50))}(r)},sx:{display:"flex",alignItems:"center",gap:.25,cursor:"pointer"}},{children:[i(c,e({sx:{fontSize:"0.78rem",color:l?"#5928ed":"#DB2877",fontWeight:500}},{children:[o+1,". ",r]})),n(S,{sx:{fontSize:"0.75rem",color:l?"#5928ed":"#DB2877"}})]})),"string"!=typeof t&&(t.description||t.context)&&n(C,{text:t.description||t.context||""})]}),o)})}))]}))]}),o)}):n(d,e({sx:{display:"flex",flexDirection:"column",gap:1}},{children:[1,2,3].map(function(t){return i(d,e({sx:{bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5,display:"flex",flexDirection:"column",gap:.5}},{children:[n(a,{variant:"text",width:"40%",height:16}),n(a,{variant:"text",width:"90%",height:14}),n(a,{variant:"text",width:"80%",height:14}),n(a,{variant:"text",width:"30%",height:14})]}),t)})}))}))]})),i(s,e({disableGutters:!0,elevation:0,sx:e({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==V?void 0:V.applicabilitySection)},{children:[i(h,e({expandIcon:n(v,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75,alignItems:"center",gap:1}}},{children:[n(c,e({sx:e({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==V?void 0:V.applicabilityTitle)},{children:"Applicability"})),n(c,e({sx:{fontSize:"0.7rem",color:"#9CA3AF"}},{children:"When to Apply this SPB / When Not Apply"}))]})),n(p,e({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC"}},{children:n(d,e({sx:{display:"flex",gap:1}},{children:[{label:"When to apply",content:null==_?void 0:_.when_to_apply},{label:"When NOT to apply",content:null==_?void 0:_.when_not_to_apply}].map(function(t){var o=t.label,r=t.content;return i(d,e({sx:{flex:1,bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"6px",p:1.25}},{children:[n(c,e({sx:{fontWeight:600,fontSize:"0.76rem",color:"#374151",mb:.75}},{children:o})),r?n(B,{fontSize:"0.8rem",message:r,isDarkMode:pe,style:null==V?void 0:V.markdownRenderer}):I?i(d,e({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[n(a,{variant:"text",width:"100%",height:14}),n(a,{variant:"text",width:"80%",height:14}),n(a,{variant:"text",width:"90%",height:14})]})):n(c,e({sx:{fontSize:"0.8rem",color:"#6B7280",lineHeight:1.5}},{children:"— Not yet available"}))]}),o)})}))}))]})),i(s,e({disableGutters:!0,elevation:0,sx:e({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==V?void 0:V.specificationsSection)},{children:[i(h,e({expandIcon:n(v,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75,alignItems:"center",gap:1}}},{children:[n(c,e({sx:e({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==V?void 0:V.specificationsTitle)},{children:"Specifications"})),n(c,e({sx:{fontSize:"0.7rem",color:"#9CA3AF"}},{children:"Strict Rules / Input / Output"}))]})),n(p,e({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"column",gap:1}},{children:[{label:"Strict Rules",tooltip:null,content:null==_?void 0:_.constraints_and_rules},{label:"Input",tooltip:"Input specification for this SPB",content:null==_?void 0:_.input_analysis},{label:"Output",tooltip:"Output specification for this SPB",content:null==_?void 0:_.output_analysis}].map(function(o){var r=o.label,l=o.tooltip,x=o.content,m="Output"===r,g=m&&x?function(e){var i=[];return{text:e.replace(/<code>([\s\S]*?)<\/code>/g,function(e,n){return i.push(n.trim()),""}).trim(),code:i.join("\n\n")}}(x):null,b=g?g.text:x,y=g?g.code:"";return i(s,e({disableGutters:!0,elevation:0,defaultExpanded:"Strict Rules"===r,sx:{bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"6px !important","&:before":{display:"none"},overflow:"hidden"}},{children:[n(h,e({expandIcon:n(v,{sx:{fontSize:"1rem"}}),sx:{minHeight:34,px:1.25,"& .MuiAccordionSummary-content":{my:.4}}},{children:i(d,e({sx:{display:"flex",alignItems:"center",gap:.5}},{children:[n(c,e({sx:{fontWeight:600,fontSize:"0.76rem",color:"#374151"}},{children:r})),l&&n(f,e({title:l,placement:"top"},{children:n(d,e({component:"span",sx:{width:13,height:13,borderRadius:"50%",background:"#E5E7EB",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"0.58rem",color:"#6B7280",fontWeight:700,cursor:"default",flexShrink:0}},{children:"i"}))}))]}))})),n(p,e({sx:{px:1.25,pb:1.25,pt:0}},{children:x?i(t,{children:[b&&n(B,{fontSize:"0.8rem",message:b,isDarkMode:pe,style:null==V?void 0:V.markdownRenderer}),m&&y&&i(d,e({sx:{width:"100%",height:"35vh",mt:1.5}},{children:[i(d,e({sx:{display:"flex",gap:.1,backgroundColor:"black",flexDirection:"row",alignItems:"center",justifyContent:"space-between",p:1,borderTopLeftRadius:"8px",borderTopRightRadius:"8px"}},{children:[n(c,e({sx:{color:"white",fontWeight:500,fontSize:"0.8rem"}},{children:"Output preview"})),n(f,e({title:"Copy Code to clipboard"},{children:n(u,e({size:"small",onClick:function(){return e=y,navigator.clipboard.writeText(e);var e}},{children:n(c,e({sx:{fontSize:"0.7rem",color:"white"}},{children:"Copy"}))}))}))]})),n(d,e({sx:{mt:-1,height:"calc(100% - 40px)",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px",overflow:"hidden"}},{children:n(k,{content:y,isDarkMode:pe,height:"100%",fontSize:10})}))]}))]}):I?i(d,e({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[n(a,{variant:"text",width:"100%",height:14}),n(a,{variant:"text",width:"90%",height:14}),n(a,{variant:"text",width:"75%",height:14})]})):n(c,e({sx:{fontSize:"0.74rem",color:"#6B7280",lineHeight:1.5}},{children:"— Not yet available"}))}))]}),r)})}))]})),i(s,e({defaultExpanded:!0,disableGutters:!0,elevation:0,sx:e({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},bgcolor:"#fff"},null==V?void 0:V.dependencyGraphSection)},{children:[n(h,e({expandIcon:n(v,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75},"&.Mui-expanded":{bgcolor:"#F8FAFC",borderRadius:"8px 8px 0 0"}}},{children:n(c,e({sx:e({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==V?void 0:V.dependencyGraphTitle)},{children:"Dependency Graph"}))})),n(p,e({sx:{px:0,pb:0,pt:0}},{children:(null==_?void 0:_.dependency_graph)?i(d,e({sx:{bgcolor:"#F8FAFC",borderRadius:"0 0 8px 8px",p:1.5,display:"flex",flexDirection:"column",gap:1.5}},{children:[n(d,e({sx:{height:500,borderRadius:"8px",overflow:"hidden"}},{children:n(E,{data:_.dependency_graph,isDarkMode:pe,style:null==V?void 0:V.dependencyGraph})})),n(c,e({sx:{fontSize:"0.72rem",color:"#64748B",lineHeight:1.6}},{children:"This graph visualises how Atomic Prompt Blocks (APBs) depend on, influence, or exchange information with one another within the prompt architecture."}))]})):i(d,e({sx:{bgcolor:"#fff",borderRadius:"0 0 8px 8px",p:1.5,display:"flex",flexDirection:"column",gap:1}},{children:[n(a,{variant:"rectangular",width:"100%",height:400,sx:{borderRadius:"8px"}}),n(a,{variant:"text",width:"100%",height:14}),n(a,{variant:"text",width:"80%",height:14})]}))}))]}))]}))})),j&&G&&n(d,e({onClick:function(){return be(function(e){return!e})},sx:e({width:20,flexShrink:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",borderRight:"1px solid #e5e7eb",borderLeft:"1px solid #e5e7eb",bgcolor:"#f9fafb",position:"relative",py:2,"&:hover":{bgcolor:"#f0f0f0"}},null==V?void 0:V.collapseStrip)},{children:n(c,e({sx:{fontSize:10,fontWeight:600,color:"#6b7280",writingMode:"vertical-rl",textOrientation:"mixed",transform:"rotate(180deg)",letterSpacing:"0.05em",userSelect:"none"}},{children:"SPB Details"}))})),j&&G&&n(d,e({onClick:function(){return be(function(e){return!e})},onMouseDown:function(e){e.preventDefault(),ze.current=!0;var i=function(e){if(ze.current&&Ee.current){var t=Ee.current.getBoundingClientRect(),o=t.left,r=t.width,l=e.clientX-o;if(l<200)return be(!0),ze.current=!1,document.removeEventListener("mousemove",i),void document.removeEventListener("mouseup",n);l>.7*r||(be(!1),we(l))}},n=function(){ze.current=!1,document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",n)};document.addEventListener("mousemove",i),document.addEventListener("mouseup",n)},sx:e({position:"absolute",left:ve?20:Se+20,top:"50%",transform:"translateY(-50%)",width:18,height:28,bgcolor:"#fff",border:"1px solid #e5e7eb",borderRadius:"0 6px 6px 0",display:"flex",alignItems:"center",justifyContent:"center",cursor:"col-resize",zIndex:5,boxShadow:"2px 0 4px rgba(0,0,0,0.06)","&:hover":{bgcolor:"#f9fafb"}},null==V?void 0:V.dragHandle)},{children:n(ve?z:w,{sx:{fontSize:12,color:"#6b7280"}})})),j&&i(d,e({sx:e({flex:1,minWidth:0,minHeight:0,display:"flex",flexDirection:"column",overflow:"hidden",p:2,gap:1.5,bgcolor:"#f8fafc"},null==V?void 0:V.codePanel)},{children:[i(d,e({sx:e({display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0},null==V?void 0:V.codePanelHeader)},{children:[n(c,e({sx:e({fontSize:13,fontWeight:600,color:"#374151"},null==V?void 0:V.codePanelTitle)},{children:F||"SPB Analysis"})),i(d,e({sx:{display:"flex",alignItems:"center",gap:1.5}},{children:[K&&n(x,{checked:pe,onChange:function(e){return fe(e.target.checked)},size:"small",sx:{width:36,height:20,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:"2px","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{bgcolor:"#5928ed",opacity:1}}},"& .MuiSwitch-thumb":{width:16,height:16,bgcolor:"#fff"},"& .MuiSwitch-track":{borderRadius:10,bgcolor:"#d1d5db",opacity:1}}}),X&&q&&n(f,e({title:"Fullscreen",placement:"top"},{children:n(u,e({size:"small",onClick:function(){return me({ref:ce||"",description:""})},sx:{color:"#6b7280"}},{children:n(b,{sx:{fontSize:16}})}))}))]}))]})),n(d,e({sx:e({flex:1,minHeight:0,border:"1px solid #30363d",borderRadius:1,overflow:"hidden"},null==V?void 0:V.editorContainer)},{children:n(k,{content:A,selectedTag:ce,isDarkMode:pe,height:"100%",fontSize:13})}))]}))]})),q&&i(m,e({open:!!xe,onClose:function(){return me(null)},maxWidth:!1,PaperProps:{sx:e({width:"82vw",height:"80vh",maxWidth:"none",borderRadius:"12px",overflow:"hidden",display:"flex",flexDirection:"column"},null==V?void 0:V.fullscreenModal)}},{children:[i(d,e({sx:{px:2.5,py:1.5,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0}},{children:[n(c,e({sx:{fontWeight:700,fontSize:"1rem",color:"#111827"}},{children:"Promptemon"})),n(u,e({size:"small",onClick:function(){return me(null)}},{children:n(y,{sx:{fontSize:"1.1rem",color:"#6B7280"}})}))]})),i(d,e({sx:{flex:1,display:"flex",overflow:"hidden",minHeight:0}},{children:[i(d,e({sx:{width:"40%",flexShrink:0,borderRight:"1px solid #E5E7EB",display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[i(d,e({sx:{px:2,py:1.25,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",gap:1}},{children:[n(f,e({title:"Atomic Prompt Block",placement:"top"},{children:n(g,{label:"APB",size:"small",sx:{bgcolor:"#f1f5f9",color:"#475569",fontWeight:700,fontSize:10,height:20,borderRadius:1}})})),n(c,e({sx:{fontWeight:600,fontSize:"0.9rem",color:"#111827"}},{children:null==xe?void 0:xe.ref}))]})),i(d,e({sx:{flex:1,p:2,display:"flex",flexDirection:"column",gap:1.5,overflowY:"auto"}},{children:[i(d,e({sx:{border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5}},{children:[n(c,e({sx:{fontWeight:600,fontSize:"0.8rem",color:"#111827",mb:.75}},{children:"Description"})),n(c,e({sx:{fontSize:"0.73rem",color:"#6B7280",lineHeight:1.6}},{children:null==xe?void 0:xe.description}))]})),i(d,e({sx:{border:"1px solid #E5E7EB",borderRadius:"8px",p:1.25,display:"flex",alignItems:"center",gap:.5}},{children:[n(c,e({sx:{fontSize:"0.73rem",color:"#6B7280"}},{children:"Total Lines"})),n(c,e({sx:{fontSize:"0.73rem",fontWeight:700,color:"#111827"}},{children:A.split("\n").length}))]}))]}))]})),i(d,e({sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[i(d,e({sx:{px:2,py:1.25,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[n(c,e({sx:{fontWeight:600,fontSize:"0.85rem",color:"#111827"}},{children:"Prompt Preview"})),n(x,{checked:pe,onChange:function(e){return fe(e.target.checked)},size:"small",sx:{width:36,height:20,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:"2px","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{bgcolor:"#5928ed",opacity:1}}},"& .MuiSwitch-thumb":{width:16,height:16,bgcolor:"#fff"},"& .MuiSwitch-track":{borderRadius:10,bgcolor:"#d1d5db",opacity:1}}})]})),n(d,e({sx:{flex:1,minHeight:0,p:1.5}},{children:n(k,{content:A,selectedTag:ce,isDarkMode:pe,height:"100%",fontSize:13})}))]}))]}))]}))]}))};export{M as default};
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as i,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState as o,useEffect as r,useRef as l}from"react";import{Box as d,Typography as c,Skeleton as a,Accordion as s,AccordionSummary as h,AccordionDetails as p,Tooltip as f,IconButton as x,Switch as u,Dialog as m,Chip as g}from"@mui/material";import v from"@mui/icons-material/ExpandMore";import b from"@mui/icons-material/Fullscreen";import y from"@mui/icons-material/Close";import S from"@mui/icons-material/NearMeOutlined";import w from"@mui/icons-material/ChevronLeft";import z from"@mui/icons-material/ChevronRight";import E from"./DependencyGraph.js";import{MarkdownRenderer as D}from"./Markdownrenderer.js";import{InternalEditor as k}from"./Internaleditor.js";var B=function(n){var r=n.text,l=n.detailedSummary,a=n.extraMetaData,s=n.isDarkMode,h=void 0!==s&&s,p=n.markdownRendererStyle,f=o(!1),x=f[0],u=f[1],m=function(e,i){void 0===i&&(i=220);var t=e.replace(/<!--\s*<ai_reasoning>[\s\S]*?<\/ai_reasoning>\s*-->/g,"").replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim();if(t.length<=i)return{preview:t,truncated:!1};var n=t.slice(0,i),o=n.lastIndexOf(" ");return{preview:(o>0?n.slice(0,o):n).trim(),truncated:!0}}(r),g=m.preview,v=m.truncated;return t(d,{children:i(d,x?{children:[t(D,{message:r,fontSize:"0.8rem",extraMetaData:a,isDarkMode:h,style:p}),(null==l?void 0:l.trim())&&t(D,{message:l,fontSize:"0.8rem",extraMetaData:a,isDarkMode:h,style:p}),t(c,e({component:"span",onClick:function(){return u(!1)},sx:{fontSize:"0.72rem",color:h?"#a78bfa":"#5928ed",fontWeight:600,cursor:"pointer"}},{children:"view less"}))]}:e({sx:{display:"flex",flexDirection:"column"}},{children:[i(c,e({sx:{fontSize:"0.8rem",color:h?"#cbd5e1":"#4B5563",lineHeight:1.6}},{children:[g,v&&"…"]})),(v||(null==l?void 0:l.trim()))&&t(d,e({sx:{display:"flex",justifyContent:"flex-end"}},{children:t(c,e({component:"span",onClick:function(){return u(!0)},sx:{fontSize:"0.72rem",color:h?"#a78bfa":"#5928ed",fontWeight:600,cursor:"pointer"}},{children:"...view more"}))}))]}))})},M=function(n){var a=n.text,s=n.extraMetaData,h=o(!1),p=h[0],f=h[1],x=o(!1),u=x[0],m=x[1],g=l(null);return r(function(){var e=g.current;e&&m(e.scrollWidth>e.clientWidth)},[a]),t(d,e({sx:{pl:1}},{children:i(d,p?e({sx:{fontSize:"0.68rem",color:"#9CA3AF",lineHeight:1.4}},{children:[t(D,{message:a,fontSize:"0.68rem",extraMetaData:s}),t(c,e({component:"span",onClick:function(){return f(!1)},sx:{fontSize:"0.65rem",color:"#5928ed",cursor:"pointer",fontWeight:600}},{children:"view less"}))]}):e({sx:{display:"flex",alignItems:"baseline",gap:.5}},{children:[t(c,e({ref:g,sx:{fontSize:"0.68rem",color:"#9CA3AF",lineHeight:1.4,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",flex:1,minWidth:0}},{children:a})),u&&t(c,e({component:"span",onClick:function(){return f(!0)},sx:{fontSize:"0.65rem",color:"#5928ed",cursor:"pointer",fontWeight:600,flexShrink:0}},{children:"view more"}))]}))}))},C=function(C){var R,A=C.promptContent,F=C.promptTitle,W=C.isLoading,I=void 0!==W&&W,H=C.overviewSummary,P=C.functionalityOfSPB,T=void 0===P?[]:P,_=C.spbAdditionalInfo,L=C.extraMetaData,j=C.showCodePanel,O=void 0===j||j,G=C.showCollapseStrip,N=void 0===G||G,X=C.showFullscreenButton,Y=void 0===X||X,q=C.showFullscreenModal,J=void 0===q||q,K=C.showThemeToggle,Q=void 0===K||K,U=C.isDarkMode,V=void 0===U||U,Z=C.styles,$=C.className,ee=C.style,ie=C.sx,te=o(null),ne=te[0],oe=te[1],re=o(null),le=re[0],de=re[1],ce=o(""),ae=ce[0],se=ce[1],he=void 0!==(null==Z?void 0:Z.isDarkMode)?Z.isDarkMode:V,pe=o(he),fe=pe[0],xe=pe[1],ue=o(null),me=ue[0],ge=ue[1];r(function(){void 0!==(null==Z?void 0:Z.isDarkMode)&&xe(Z.isDarkMode)},[null==Z?void 0:Z.isDarkMode]);var ve=o(!1),be=ve[0],ye=ve[1],Se=o(480),we=Se[0],ze=Se[1],Ee=l(!1),De=l(null);r(function(){var e,i,t;T.length>0&&oe((e=new Date,i=e.toLocaleTimeString("en-IN",{hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0}),t=e.toLocaleDateString("en-IN",{day:"numeric",month:"short",year:"numeric"}),"".concat(i||""," | ").concat(t||"")))},[T]),r(function(){I&&oe(null)},[I]),r(function(){me&&(se(""),setTimeout(function(){return se(me.ref)},500))},[me]);return i(d,e({className:$,style:e(e({},null==Z?void 0:Z.root),ee),sx:e({height:"100%",display:"flex",flexDirection:"column",width:"100%",minHeight:0,overflow:"hidden"},ie)},{children:[t(d,e({sx:e({px:2.5,py:1.5,borderBottom:"1px solid #e5e7eb",display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#fff",flexShrink:0},null==Z?void 0:Z.header)},{children:i(d,e({sx:{display:"flex",flexDirection:"column",gap:.25}},{children:[t(c,e({sx:e({fontWeight:700,fontSize:"0.9rem",color:"#111827"},null==Z?void 0:Z.headerTitle)},{children:F||"SPB Analysis"})),t(c,e({sx:e({fontSize:"0.7rem",color:"#9CA3AF"},null==Z?void 0:Z.headerSubtitle)},{children:ne?"Last Analyzed at ".concat(ne):""}))]}))})),i(d,e({ref:De,sx:{display:"flex",flex:1,minHeight:0,overflow:"hidden",position:"relative"}},{children:[t(d,e({sx:e({width:O?be&&N?0:we:"100%",flexShrink:0,minHeight:0,overflow:"hidden",transition:Ee.current?"none":"width 0.15s",borderRight:!O||be&&N?"none":"1px solid #e5e7eb"},null==Z?void 0:Z.leftPanel)},{children:i(d,e({sx:{width:"100%",height:"100%",minHeight:0,overflowY:"auto",display:"flex",flexDirection:"column",gap:1,px:1.25,py:1.25,pb:2}},{children:[i(d,e({sx:e({border:"1px solid #E5E7EB",borderRadius:"8px",bgcolor:"#F8FAFC",p:1.5},null==Z?void 0:Z.overviewSection)},{children:[t(c,e({sx:e({fontWeight:600,fontSize:"0.85rem",color:"#111827",mb:1},null==Z?void 0:Z.overviewTitle)},{children:"Overview"})),t(d,e({sx:e({bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5},null==Z?void 0:Z.overviewContent)},{children:(null===(R=null==H?void 0:H.overallSummary)||void 0===R?void 0:R.trim())?t(B,{text:H.overallSummary,detailedSummary:H.detailedSummary,extraMetaData:L,isDarkMode:fe,markdownRendererStyle:null==Z?void 0:Z.markdownRenderer}):i(d,e({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[t(a,{variant:"text",width:"100%",height:14}),t(a,{variant:"text",width:"90%",height:14}),t(a,{variant:"text",width:"95%",height:14})]}))}))]})),i(s,e({disableGutters:!0,elevation:0,sx:e({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==Z?void 0:Z.functionalitySection)},{children:[t(h,e({expandIcon:t(v,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75}}},{children:t(c,e({sx:e({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==Z?void 0:Z.functionalityTitle)},{children:"Functionality of SPB"}))})),t(p,e({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"column",gap:1}},{children:T.length>0?T.map(function(n,o){return i(s,e({disableGutters:!0,elevation:0,defaultExpanded:0===o,sx:e({bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},overflow:"hidden"},null==Z?void 0:Z.functionalityItem)},{children:[t(h,e({expandIcon:t(v,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:38,"& .MuiAccordionSummary-content":{my:.5}}},{children:i(c,e({sx:{fontWeight:600,fontSize:"0.8rem",color:"#111827"}},{children:[o+1,". ",n.name||n.section_name]}))})),i(p,e({sx:{px:1.5,pb:1.5,pt:0,display:"flex",flexDirection:"column",gap:.75}},{children:[t(D,{fontSize:"0.74rem",message:n.description||n.reason_for_inclusion||"",extraMetaData:L}),t(c,e({sx:{fontSize:"0.72rem",color:"#9CA3AF",fontWeight:500,mt:.25}},{children:"APB References"})),t(d,e({sx:{display:"flex",flexDirection:"column",gap:.75}},{children:n.apb_references.map(function(n,o){var r="string"==typeof n?n:n.apb_name,l=le===r;return i(d,e({sx:{display:"flex",flexDirection:"column",gap:.15}},{children:[i(d,e({onClick:function(){return function(e){le===e?(de(null),se("")):(de(e),se(""),setTimeout(function(){return se(e)},50))}(r)},sx:{display:"flex",alignItems:"center",gap:.25,cursor:"pointer"}},{children:[i(c,e({sx:{fontSize:"0.78rem",color:l?"#5928ed":"#DB2877",fontWeight:500}},{children:[o+1,". ",r]})),t(S,{sx:{fontSize:"0.75rem",color:l?"#5928ed":"#DB2877"}})]})),"string"!=typeof n&&(n.description||n.context)&&t(M,{text:n.description||n.context||"",extraMetaData:L})]}),o)})}))]}))]}),o)}):t(d,e({sx:{display:"flex",flexDirection:"column",gap:1}},{children:[1,2,3].map(function(n){return i(d,e({sx:{bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5,display:"flex",flexDirection:"column",gap:.5}},{children:[t(a,{variant:"text",width:"40%",height:16}),t(a,{variant:"text",width:"90%",height:14}),t(a,{variant:"text",width:"80%",height:14}),t(a,{variant:"text",width:"30%",height:14})]}),n)})}))}))]})),i(s,e({disableGutters:!0,elevation:0,sx:e({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==Z?void 0:Z.applicabilitySection)},{children:[i(h,e({expandIcon:t(v,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75,alignItems:"center",gap:1}}},{children:[t(c,e({sx:e({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==Z?void 0:Z.applicabilityTitle)},{children:"Applicability"})),t(c,e({sx:{fontSize:"0.7rem",color:"#9CA3AF"}},{children:"When to Apply this SPB / When Not Apply"}))]})),t(p,e({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC"}},{children:t(d,e({sx:{display:"flex",gap:1}},{children:[{label:"When to apply",content:null==_?void 0:_.when_to_apply},{label:"When NOT to apply",content:null==_?void 0:_.when_not_to_apply}].map(function(n){var o=n.label,r=n.content;return i(d,e({sx:{flex:1,bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"6px",p:1.25}},{children:[t(c,e({sx:{fontWeight:600,fontSize:"0.76rem",color:"#374151",mb:.75}},{children:o})),r?t(D,{fontSize:"0.8rem",message:r,isDarkMode:fe,style:null==Z?void 0:Z.markdownRenderer,extraMetaData:L}):I?i(d,e({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[t(a,{variant:"text",width:"100%",height:14}),t(a,{variant:"text",width:"80%",height:14}),t(a,{variant:"text",width:"90%",height:14})]})):t(c,e({sx:{fontSize:"0.8rem",color:"#6B7280",lineHeight:1.5}},{children:"— Not yet available"}))]}),o)})}))}))]})),i(s,e({disableGutters:!0,elevation:0,sx:e({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==Z?void 0:Z.specificationsSection)},{children:[i(h,e({expandIcon:t(v,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75,alignItems:"center",gap:1}}},{children:[t(c,e({sx:e({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==Z?void 0:Z.specificationsTitle)},{children:"Specifications"})),t(c,e({sx:{fontSize:"0.7rem",color:"#9CA3AF"}},{children:"Strict Rules / Input / Output"}))]})),t(p,e({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"column",gap:1}},{children:[{label:"Strict Rules",tooltip:null,content:null==_?void 0:_.constraints_and_rules},{label:"Input",tooltip:"Input specification for this SPB",content:null==_?void 0:_.input_analysis},{label:"Output",tooltip:"Output specification for this SPB",content:null==_?void 0:_.output_analysis}].map(function(o){var r=o.label,l=o.tooltip,u=o.content,m="Output"===r,g=m&&u?function(e){var i=[];return{text:e.replace(/<code>([\s\S]*?)<\/code>/g,function(e,t){return i.push(t.trim()),""}).trim(),code:i.join("\n\n")}}(u):null,b=g?g.text:u,y=g?g.code:"";return i(s,e({disableGutters:!0,elevation:0,defaultExpanded:"Strict Rules"===r,sx:{bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"6px !important","&:before":{display:"none"},overflow:"hidden"}},{children:[t(h,e({expandIcon:t(v,{sx:{fontSize:"1rem"}}),sx:{minHeight:34,px:1.25,"& .MuiAccordionSummary-content":{my:.4}}},{children:i(d,e({sx:{display:"flex",alignItems:"center",gap:.5}},{children:[t(c,e({sx:{fontWeight:600,fontSize:"0.76rem",color:"#374151"}},{children:r})),l&&t(f,e({title:l,placement:"top"},{children:t(d,e({component:"span",sx:{width:13,height:13,borderRadius:"50%",background:"#E5E7EB",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"0.58rem",color:"#6B7280",fontWeight:700,cursor:"default",flexShrink:0}},{children:"i"}))}))]}))})),t(p,e({sx:{px:1.25,pb:1.25,pt:0}},{children:u?i(n,{children:[b&&t(D,{fontSize:"0.8rem",message:b,isDarkMode:fe,style:null==Z?void 0:Z.markdownRenderer,extraMetaData:L}),m&&y&&i(d,e({sx:{width:"100%",height:"35vh",mt:1.5}},{children:[i(d,e({sx:{display:"flex",gap:.1,backgroundColor:"black",flexDirection:"row",alignItems:"center",justifyContent:"space-between",p:1,borderTopLeftRadius:"8px",borderTopRightRadius:"8px"}},{children:[t(c,e({sx:{color:"white",fontWeight:500,fontSize:"0.8rem"}},{children:"Output preview"})),t(f,e({title:"Copy Code to clipboard"},{children:t(x,e({size:"small",onClick:function(){return e=y,navigator.clipboard.writeText(e);var e}},{children:t(c,e({sx:{fontSize:"0.7rem",color:"white"}},{children:"Copy"}))}))}))]})),t(d,e({sx:{mt:-1,height:"calc(100% - 40px)",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px",overflow:"hidden"}},{children:t(k,{content:y,isDarkMode:fe,height:"100%",fontSize:10})}))]}))]}):I?i(d,e({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[t(a,{variant:"text",width:"100%",height:14}),t(a,{variant:"text",width:"90%",height:14}),t(a,{variant:"text",width:"75%",height:14})]})):t(c,e({sx:{fontSize:"0.74rem",color:"#6B7280",lineHeight:1.5}},{children:"— Not yet available"}))}))]}),r)})}))]})),i(s,e({defaultExpanded:!0,disableGutters:!0,elevation:0,sx:e({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},bgcolor:"#fff"},null==Z?void 0:Z.dependencyGraphSection)},{children:[t(h,e({expandIcon:t(v,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75},"&.Mui-expanded":{bgcolor:"#F8FAFC",borderRadius:"8px 8px 0 0"}}},{children:t(c,e({sx:e({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==Z?void 0:Z.dependencyGraphTitle)},{children:"Dependency Graph"}))})),t(p,e({sx:{px:0,pb:0,pt:0}},{children:(null==_?void 0:_.dependency_graph)?i(d,e({sx:{bgcolor:"#F8FAFC",borderRadius:"0 0 8px 8px",p:1.5,display:"flex",flexDirection:"column",gap:1.5}},{children:[t(d,e({sx:{height:500,borderRadius:"8px",overflow:"hidden"}},{children:t(E,{data:_.dependency_graph,isDarkMode:fe,style:null==Z?void 0:Z.dependencyGraph})})),t(c,e({sx:{fontSize:"0.72rem",color:"#64748B",lineHeight:1.6}},{children:"This graph visualises how Atomic Prompt Blocks (APBs) depend on, influence, or exchange information with one another within the prompt architecture."}))]})):i(d,e({sx:{bgcolor:"#fff",borderRadius:"0 0 8px 8px",p:1.5,display:"flex",flexDirection:"column",gap:1}},{children:[t(a,{variant:"rectangular",width:"100%",height:400,sx:{borderRadius:"8px"}}),t(a,{variant:"text",width:"100%",height:14}),t(a,{variant:"text",width:"80%",height:14})]}))}))]}))]}))})),O&&N&&t(d,e({onClick:function(){return ye(function(e){return!e})},sx:e({width:20,flexShrink:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",borderRight:"1px solid #e5e7eb",borderLeft:"1px solid #e5e7eb",bgcolor:"#f9fafb",position:"relative",py:2,"&:hover":{bgcolor:"#f0f0f0"}},null==Z?void 0:Z.collapseStrip)},{children:t(c,e({sx:{fontSize:10,fontWeight:600,color:"#6b7280",writingMode:"vertical-rl",textOrientation:"mixed",transform:"rotate(180deg)",letterSpacing:"0.05em",userSelect:"none"}},{children:"SPB Details"}))})),O&&N&&t(d,e({onClick:function(){return ye(function(e){return!e})},onMouseDown:function(e){e.preventDefault(),Ee.current=!0;var i=function(e){if(Ee.current&&De.current){var n=De.current.getBoundingClientRect(),o=n.left,r=n.width,l=e.clientX-o;if(l<200)return ye(!0),Ee.current=!1,document.removeEventListener("mousemove",i),void document.removeEventListener("mouseup",t);l>.7*r||(ye(!1),ze(l))}},t=function(){Ee.current=!1,document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",t)};document.addEventListener("mousemove",i),document.addEventListener("mouseup",t)},sx:e({position:"absolute",left:be?20:we+20,top:"50%",transform:"translateY(-50%)",width:18,height:28,bgcolor:"#fff",border:"1px solid #e5e7eb",borderRadius:"0 6px 6px 0",display:"flex",alignItems:"center",justifyContent:"center",cursor:"col-resize",zIndex:5,boxShadow:"2px 0 4px rgba(0,0,0,0.06)","&:hover":{bgcolor:"#f9fafb"}},null==Z?void 0:Z.dragHandle)},{children:t(be?z:w,{sx:{fontSize:12,color:"#6b7280"}})})),O&&i(d,e({sx:e({flex:1,minWidth:0,minHeight:0,display:"flex",flexDirection:"column",overflow:"hidden",p:2,gap:1.5,bgcolor:"#f8fafc"},null==Z?void 0:Z.codePanel)},{children:[i(d,e({sx:e({display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0},null==Z?void 0:Z.codePanelHeader)},{children:[t(c,e({sx:e({fontSize:13,fontWeight:600,color:"#374151"},null==Z?void 0:Z.codePanelTitle)},{children:F||"SPB Analysis"})),i(d,e({sx:{display:"flex",alignItems:"center",gap:1.5}},{children:[Q&&t(u,{checked:fe,onChange:function(e){return xe(e.target.checked)},size:"small",sx:{width:36,height:20,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:"2px","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{bgcolor:"#5928ed",opacity:1}}},"& .MuiSwitch-thumb":{width:16,height:16,bgcolor:"#fff"},"& .MuiSwitch-track":{borderRadius:10,bgcolor:"#d1d5db",opacity:1}}}),Y&&J&&t(f,e({title:"Fullscreen",placement:"top"},{children:t(x,e({size:"small",onClick:function(){return ge({ref:ae||"",description:""})},sx:{color:"#6b7280"}},{children:t(b,{sx:{fontSize:16}})}))}))]}))]})),t(d,e({sx:e({flex:1,minHeight:0,border:"1px solid #30363d",borderRadius:1,overflow:"hidden"},null==Z?void 0:Z.editorContainer)},{children:t(k,{content:A,selectedTag:ae,isDarkMode:fe,height:"100%",fontSize:13})}))]}))]})),J&&i(m,e({open:!!me,onClose:function(){return ge(null)},maxWidth:!1,PaperProps:{sx:e({width:"82vw",height:"80vh",maxWidth:"none",borderRadius:"12px",overflow:"hidden",display:"flex",flexDirection:"column"},null==Z?void 0:Z.fullscreenModal)}},{children:[i(d,e({sx:{px:2.5,py:1.5,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0}},{children:[t(c,e({sx:{fontWeight:700,fontSize:"1rem",color:"#111827"}},{children:"Promptemon"})),t(x,e({size:"small",onClick:function(){return ge(null)}},{children:t(y,{sx:{fontSize:"1.1rem",color:"#6B7280"}})}))]})),i(d,e({sx:{flex:1,display:"flex",overflow:"hidden",minHeight:0}},{children:[i(d,e({sx:{width:"40%",flexShrink:0,borderRight:"1px solid #E5E7EB",display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[i(d,e({sx:{px:2,py:1.25,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",gap:1}},{children:[t(f,e({title:"Atomic Prompt Block",placement:"top"},{children:t(g,{label:"APB",size:"small",sx:{bgcolor:"#f1f5f9",color:"#475569",fontWeight:700,fontSize:10,height:20,borderRadius:1}})})),t(c,e({sx:{fontWeight:600,fontSize:"0.9rem",color:"#111827"}},{children:null==me?void 0:me.ref}))]})),i(d,e({sx:{flex:1,p:2,display:"flex",flexDirection:"column",gap:1.5,overflowY:"auto"}},{children:[i(d,e({sx:{border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5}},{children:[t(c,e({sx:{fontWeight:600,fontSize:"0.8rem",color:"#111827",mb:.75}},{children:"Description"})),t(c,e({sx:{fontSize:"0.73rem",color:"#6B7280",lineHeight:1.6}},{children:null==me?void 0:me.description}))]})),i(d,e({sx:{border:"1px solid #E5E7EB",borderRadius:"8px",p:1.25,display:"flex",alignItems:"center",gap:.5}},{children:[t(c,e({sx:{fontSize:"0.73rem",color:"#6B7280"}},{children:"Total Lines"})),t(c,e({sx:{fontSize:"0.73rem",fontWeight:700,color:"#111827"}},{children:A.split("\n").length}))]}))]}))]})),i(d,e({sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[i(d,e({sx:{px:2,py:1.25,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[t(c,e({sx:{fontWeight:600,fontSize:"0.85rem",color:"#111827"}},{children:"Prompt Preview"})),t(u,{checked:fe,onChange:function(e){return xe(e.target.checked)},size:"small",sx:{width:36,height:20,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:"2px","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{bgcolor:"#5928ed",opacity:1}}},"& .MuiSwitch-thumb":{width:16,height:16,bgcolor:"#fff"},"& .MuiSwitch-track":{borderRadius:10,bgcolor:"#d1d5db",opacity:1}}})]})),t(d,e({sx:{flex:1,minHeight:0,p:1.5}},{children:t(k,{content:A,selectedTag:ae,isDarkMode:fe,height:"100%",fontSize:13})}))]}))]}))]}))]}))};export{C as default};
|
|
2
2
|
//# sourceMappingURL=Spbanalysispanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdfViewerTest.d.ts","sourceRoot":"","sources":["../../../src/PdfViewerTest.tsx"],"names":[],"mappings":"AAcA,QAAA,MAAM,aAAa;;
|
|
1
|
+
{"version":3,"file":"PdfViewerTest.d.ts","sourceRoot":"","sources":["../../../src/PdfViewerTest.tsx"],"names":[],"mappings":"AAcA,QAAA,MAAM,aAAa;;6CA8GlB,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spbanalysispaneltest.d.ts","sourceRoot":"","sources":["../../../src/Spbanalysispaneltest.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Spbanalysispaneltest.d.ts","sourceRoot":"","sources":["../../../src/Spbanalysispaneltest.tsx"],"names":[],"mappings":"AAmiBA,QAAA,MAAM,oBAAoB,+CA6FzB,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { SpecialZoomLevel, PageChangeEvent } from "@react-pdf-viewer/core";
|
|
1
|
+
import { SpecialZoomLevel, PageChangeEvent, DocumentLoadEvent } from "@react-pdf-viewer/core";
|
|
2
2
|
import { CustomStylesType } from "./PdfViewer";
|
|
3
3
|
export declare const pdfWorker: string;
|
|
4
4
|
type Props = {
|
|
5
5
|
pdfUrl: string;
|
|
6
6
|
plugins: any[];
|
|
7
|
-
onLoad: () => void;
|
|
7
|
+
onLoad: (e: DocumentLoadEvent) => void;
|
|
8
8
|
customStyles?: CustomStylesType;
|
|
9
9
|
onPageChange: (e: PageChangeEvent) => void;
|
|
10
10
|
defaultScale?: SpecialZoomLevel | number | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdfContainer.d.ts","sourceRoot":"","sources":["../../../../../src/features/PdfViewer/PdfContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkB,gBAAgB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"PdfContainer.d.ts","sourceRoot":"","sources":["../../../../../src/features/PdfViewer/PdfContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkB,gBAAgB,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE9G,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,eAAO,MAAM,SAAS,EAAE,MAAwE,CAAC;AAEjG,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,GAAG,EAAE,CAAC;IACf,MAAM,EAAE,CAAC,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACvC,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,YAAY,EAAI,CAAC,CAAC,EAAG,eAAe,KAAK,IAAI,CAAC;IAC9C,YAAY,CAAC,EAAE,gBAAgB,GAAG,MAAM,GAAG,SAAS,CAAC;CACtD,CAAC;AAEF,QAAA,MAAM,YAAY,0EAA0E,KAAK,4CAchG,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { CustomIconsType, CustomStylesType, CustomClassesType } from "./PdfViewer";
|
|
2
|
+
import type { CustomIconsType, CustomStylesType, CustomClassesType, PdfSegment } from "./PdfViewer";
|
|
3
3
|
type Props = {
|
|
4
4
|
highlightIndex: number;
|
|
5
5
|
totalHighlights: number;
|
|
@@ -20,7 +20,12 @@ type Props = {
|
|
|
20
20
|
isZoomEnabled: boolean;
|
|
21
21
|
showHighlightsAction: boolean;
|
|
22
22
|
showFullScreenAction?: boolean;
|
|
23
|
+
currentSegment?: PdfSegment;
|
|
24
|
+
segmentTooltipText?: string;
|
|
25
|
+
currentPage: number;
|
|
26
|
+
totalPages: number;
|
|
27
|
+
onPageNavigate: (pageNumber: number) => void;
|
|
23
28
|
};
|
|
24
|
-
declare const PdfToolbar: ({ highlightIndex, totalHighlights, controls, currentPosition, pdfName, onClose, pdfUrl, viewerRef, customStyles, customClasses, customIcons, headerAction, isZoomEnabled, showHighlightsAction, showFullScreenAction, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
declare const PdfToolbar: ({ highlightIndex, totalHighlights, controls, currentPosition, pdfName, onClose, pdfUrl, viewerRef, customStyles, customClasses, customIcons, headerAction, isZoomEnabled, showHighlightsAction, showFullScreenAction, currentSegment, segmentTooltipText, currentPage, totalPages, onPageNavigate, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
25
30
|
export default PdfToolbar;
|
|
26
31
|
//# sourceMappingURL=PdfToolbar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdfToolbar.d.ts","sourceRoot":"","sources":["../../../../../src/features/PdfViewer/PdfToolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"PdfToolbar.d.ts","sourceRoot":"","sources":["../../../../../src/features/PdfViewer/PdfToolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAKpG,KAAK,KAAK,GAAG;IACX,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,GAAG,CAAC;IACd,eAAe,EAAE,GAAG,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC5C,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,YAAY,CAAC,EAAE;QACb,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;QACvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;QACrB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,aAAa,EAAE,OAAO,CAAA;IACtB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C,CAAC;AAEF,QAAA,MAAM,UAAU,ySAqBb,KAAK,4CAkWP,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -25,6 +25,12 @@ export type CustomClassesType = {
|
|
|
25
25
|
actionButton?: string;
|
|
26
26
|
pdfViewerWrapper?: string;
|
|
27
27
|
};
|
|
28
|
+
export type PdfSegment = {
|
|
29
|
+
title: string;
|
|
30
|
+
start_page: number;
|
|
31
|
+
end_page: number;
|
|
32
|
+
page_count: number;
|
|
33
|
+
};
|
|
28
34
|
type PdfScaleOption = "ActualSize" | "PageFit" | "PageWidth" | number;
|
|
29
35
|
interface PdfViewerProps {
|
|
30
36
|
pdfUrl?: string;
|
|
@@ -55,6 +61,8 @@ interface PdfViewerProps {
|
|
|
55
61
|
useRange?: boolean;
|
|
56
62
|
rangeOfPages?: number[] | null;
|
|
57
63
|
showFullScreenAction?: boolean;
|
|
64
|
+
segments?: PdfSegment[];
|
|
65
|
+
segmentTooltipText?: string;
|
|
58
66
|
}
|
|
59
67
|
export type HighlightArea = {
|
|
60
68
|
pageIndex: number;
|
|
@@ -64,6 +72,6 @@ export type HighlightArea = {
|
|
|
64
72
|
height: number;
|
|
65
73
|
pageNumber?: number;
|
|
66
74
|
};
|
|
67
|
-
declare const PdfViewer: ({ pdfUrl, highlightText, highlightPages, highlightCordinatePages, highlightColor, activeHighlightColor, jumpToPageValue, pdfName, onClose, customStyles, customClasses, customIcons, useCoordinates, fallbackPages, activeCitationIndex, onActiveCitationChange, headerAction, isZoomEnabled, showHighlightsAction, defaultScale, useRange, rangeOfPages, showFullScreenAction }: PdfViewerProps) => import("react/jsx-runtime").JSX.Element;
|
|
75
|
+
declare const PdfViewer: ({ pdfUrl, highlightText, highlightPages, highlightCordinatePages, highlightColor, activeHighlightColor, jumpToPageValue, pdfName, onClose, customStyles, customClasses, customIcons, useCoordinates, fallbackPages, activeCitationIndex, onActiveCitationChange, headerAction, isZoomEnabled, showHighlightsAction, defaultScale, useRange, rangeOfPages, showFullScreenAction, segments, segmentTooltipText, }: PdfViewerProps) => import("react/jsx-runtime").JSX.Element;
|
|
68
76
|
export default PdfViewer;
|
|
69
77
|
//# sourceMappingURL=PdfViewer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdfViewer.d.ts","sourceRoot":"","sources":["../../../../../src/features/PdfViewer/PdfViewer.tsx"],"names":[],"mappings":"AAKA,OAAO,6CAA6C,CAAC;AACrD,OAAO,wDAAwD,CAAC;AAChE,OAAO,6CAA6C,CAAC;AACrD,OAAO,+CAA+C,CAAC;AACvD,OAAO,
|
|
1
|
+
{"version":3,"file":"PdfViewer.d.ts","sourceRoot":"","sources":["../../../../../src/features/PdfViewer/PdfViewer.tsx"],"names":[],"mappings":"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"}
|
|
@@ -88,6 +88,8 @@ export interface SPBAnalysisPanelProps {
|
|
|
88
88
|
overviewSummary?: SPBOverviewSummary | null;
|
|
89
89
|
functionalityOfSPB?: SPBFunctionalityItem[];
|
|
90
90
|
spbAdditionalInfo?: SPBAdditionalInfo | null;
|
|
91
|
+
/** Shared citation/reasoning map keyed by the id referenced in data-cognitive-reasoning anchors across ALL sections (overview, functionality, applicability, specifications, APB references) */
|
|
92
|
+
extraMetaData?: Record<string, any> | null;
|
|
91
93
|
/** Show the persistent right-side code editor panel. Defaults to true. */
|
|
92
94
|
showCodePanel?: boolean;
|
|
93
95
|
/** Show the vertical collapse strip and drag handle pill. Defaults to true. */
|
|
@@ -109,6 +111,6 @@ export interface SPBAnalysisPanelProps {
|
|
|
109
111
|
/** Optional MUI sx prop overrides for the root container */
|
|
110
112
|
sx?: any;
|
|
111
113
|
}
|
|
112
|
-
declare const SPBAnalysisPanel: ({ promptContent, promptTitle, isLoading, overviewSummary, functionalityOfSPB, spbAdditionalInfo, showCodePanel, showCollapseStrip, showFullscreenButton, showFullscreenModal, showThemeToggle, isDarkMode: isDarkModeProp, styles, className, style, sx, }: SPBAnalysisPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
114
|
+
declare const SPBAnalysisPanel: ({ promptContent, promptTitle, isLoading, overviewSummary, functionalityOfSPB, spbAdditionalInfo, extraMetaData, showCodePanel, showCollapseStrip, showFullscreenButton, showFullscreenModal, showThemeToggle, isDarkMode: isDarkModeProp, styles, className, style, sx, }: SPBAnalysisPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
113
115
|
export default SPBAnalysisPanel;
|
|
114
116
|
//# sourceMappingURL=Spbanalysispanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spbanalysispanel.d.ts","sourceRoot":"","sources":["../../../../../src/features/SPBAnalysisPanel/Spbanalysispanel.tsx"],"names":[],"mappings":"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
|
|
1
|
+
{"version":3,"file":"Spbanalysispanel.d.ts","sourceRoot":"","sources":["../../../../../src/features/SPBAnalysisPanel/Spbanalysispanel.tsx"],"names":[],"mappings":"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"}
|