@e-llm-studio/citation 0.0.234 → 0.0.236

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/cjs/features/PromptemonBlockViewer/PromptemonBlockViewer.js +1 -1
  2. package/dist/cjs/features/PromptemonViewer/PromptemonViewer.js +1 -1
  3. package/dist/cjs/features/SPBAnalysisPanel/Cognitivereasoningpanel.js +2 -0
  4. package/dist/cjs/features/SPBAnalysisPanel/Cognitivereasoningpanel.js.map +1 -0
  5. package/dist/cjs/features/SPBAnalysisPanel/DependencyGraph.js +2 -0
  6. package/dist/cjs/features/SPBAnalysisPanel/DependencyGraph.js.map +1 -0
  7. package/dist/cjs/features/SPBAnalysisPanel/Internaleditor.js +2 -0
  8. package/dist/cjs/features/SPBAnalysisPanel/Internaleditor.js.map +1 -0
  9. package/dist/cjs/features/SPBAnalysisPanel/Markdownrenderer.js +2 -0
  10. package/dist/cjs/features/SPBAnalysisPanel/Markdownrenderer.js.map +1 -0
  11. package/dist/cjs/features/SPBAnalysisPanel/Spbanalysispanel.js +2 -0
  12. package/dist/cjs/features/SPBAnalysisPanel/Spbanalysispanel.js.map +1 -0
  13. package/dist/cjs/index.js +1 -1
  14. package/dist/features/PromptemonBlockViewer/PromptemonBlockViewer.js +1 -1
  15. package/dist/features/PromptemonViewer/PromptemonViewer.js +1 -1
  16. package/dist/features/SPBAnalysisPanel/Cognitivereasoningpanel.js +2 -0
  17. package/dist/features/SPBAnalysisPanel/Cognitivereasoningpanel.js.map +1 -0
  18. package/dist/features/SPBAnalysisPanel/DependencyGraph.js +2 -0
  19. package/dist/features/SPBAnalysisPanel/DependencyGraph.js.map +1 -0
  20. package/dist/features/SPBAnalysisPanel/Internaleditor.js +2 -0
  21. package/dist/features/SPBAnalysisPanel/Internaleditor.js.map +1 -0
  22. package/dist/features/SPBAnalysisPanel/Markdownrenderer.js +2 -0
  23. package/dist/features/SPBAnalysisPanel/Markdownrenderer.js.map +1 -0
  24. package/dist/features/SPBAnalysisPanel/Spbanalysispanel.js +2 -0
  25. package/dist/features/SPBAnalysisPanel/Spbanalysispanel.js.map +1 -0
  26. package/dist/index.js +1 -1
  27. package/dist/types/src/features/PromptemonBlockViewer/PromptemonBlockViewer.d.ts +15 -2
  28. package/dist/types/src/features/PromptemonBlockViewer/PromptemonBlockViewer.d.ts.map +1 -1
  29. package/dist/types/src/features/SPBAnalysisPanel/DependencyGraph.d.ts +11 -2
  30. package/dist/types/src/features/SPBAnalysisPanel/DependencyGraph.d.ts.map +1 -1
  31. package/dist/types/src/features/SPBAnalysisPanel/Markdownrenderer.d.ts +5 -1
  32. package/dist/types/src/features/SPBAnalysisPanel/Markdownrenderer.d.ts.map +1 -1
  33. package/dist/types/src/features/SPBAnalysisPanel/Spbanalysispanel.d.ts +76 -1
  34. package/dist/types/src/features/SPBAnalysisPanel/Spbanalysispanel.d.ts.map +1 -1
  35. package/dist/types/src/features/SPBAnalysisPanel/index.d.ts +1 -1
  36. package/dist/types/src/features/SPBAnalysisPanel/index.d.ts.map +1 -1
  37. package/dist/types/src/index.d.ts +2 -0
  38. package/dist/types/src/index.d.ts.map +1 -1
  39. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- import{__assign as e,__spreadArray as n}from"tslib";import{jsxs as o,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState as r,useRef as l,useEffect as d}from"react";import{Box as a,Stack as c,IconButton as s,Typography as u,Button as f,Tooltip as p,Chip as h,TextField as g,Accordion as m,AccordionSummary as x,AccordionDetails as b,Select as v,MenuItem as y,Divider as w,Dialog as S}from"@mui/material";import z from"@mui/icons-material/ExpandMore";import C from"@mui/icons-material/EditOutlined";import _ from"@mui/icons-material/Close";import k from"@mui/icons-material/ArrowBack";import I from"@mui/icons-material/NavigateBefore";import W from"@mui/icons-material/NavigateNext";import R from"@mui/icons-material/InfoOutlined";import A from"@mui/icons-material/AutoFixHighOutlined";import B from"@mui/icons-material/Check";import F from"@mui/icons-material/Add";import L from"@mui/icons-material/DeleteOutline";import D from"@monaco-editor/react";import*as M from"monaco-editor";import T from"@mui/icons-material/DarkMode";import V from"@mui/icons-material/LightMode";var E={base:"vs-dark",inherit:!0,rules:[{token:"tag",foreground:"714be3",fontStyle:"bold"},{token:"attribute.name",foreground:"87CEFA"},{token:"attribute.value",foreground:"98FB98"},{token:"variable",foreground:"00FFFF"},{token:"delimiter",foreground:"888888"},{token:"white",foreground:"AAAAAA"}],colors:{"editor.foreground":"#FFFFFF","editor.background":"#030202","editorLineNumber.foreground":"#858585","editorCursor.foreground":"#FFFFFF","editorIndentGuide.background":"#404040","editorIndentGuide.activeBackground":"#707070"}},O={base:"vs",inherit:!0,rules:[{token:"tag",foreground:"5928ED",fontStyle:"bold"},{token:"attribute.name",foreground:"AF00DB"},{token:"attribute.value",foreground:"008000"},{token:"variable",foreground:"B000B0"},{token:"delimiter",foreground:"808080"},{token:"white",foreground:"000000"}],colors:{"editor.foreground":"#000000","editor.background":"#FFFFFF","editorLineNumber.foreground":"#999999","editorCursor.foreground":"#000000","editorIndentGuide.background":"#CCCCCC","editorIndentGuide.activeBackground":"#999999"}},P=function(n){var i=n.description,c=r(!1),s=c[0],f=c[1],p=r(!1),h=p[0],g=p[1],m=l(null);return d(function(){var e=m.current;e&&g(e.scrollHeight>e.clientHeight+1)},[i,s]),o(a,e({sx:{mt:1.5,border:"1px solid #e5e7eb",borderRadius:2,bgcolor:"#fff",display:"flex",flexDirection:"column",px:1.25,py:1}},{children:[t(u,e({ref:m,component:"div",sx:e({fontSize:11,color:"#6b7280",lineHeight:1.5,overflowY:s?"auto":"hidden",maxHeight:s?"calc(1.6em * 5)":"calc(1.6em * 3)",whiteSpace:"normal",display:s?"block":"-webkit-box"},s?{}:{WebkitBoxOrient:"vertical",WebkitLineClamp:3})},{children:i})),h&&t(u,e({component:"span",onClick:function(){return f(function(e){return!e})},sx:{mt:.75,alignSelf:"flex-end",fontSize:10,color:"#7c3aed",cursor:"pointer",fontWeight:500}},{children:s?"View less":"View more"}))]}))},j=function(n){var i=n.value,l=n.onChange,d=n.onDelete,f=r(!1),p=f[0],h=f[1];return o(a,e({sx:{display:"flex",alignItems:"flex-start",gap:1,p:1,border:"1px solid #e5e7eb",borderRadius:"8px",bgcolor:"#fff"}},{children:[t(a,e({sx:{width:18,height:18,borderRadius:"4px",bgcolor:"#f1f5f9",display:"flex",alignItems:"center",justifyContent:"center",fontSize:11,color:"#64748b",flexShrink:0,mt:.1}},{children:"a"})),p?t(g,{autoFocus:!0,value:i,onChange:function(e){return l(e.target.value)},onBlur:function(){return h(!1)},size:"small",fullWidth:!0,multiline:!0,sx:{"& .MuiOutlinedInput-input":{fontSize:12.5}}}):t(u,e({sx:{fontSize:12.5,color:"#374151",lineHeight:1.55,flex:1}},{children:i})),o(c,e({direction:"row",gap:.25,sx:{flexShrink:0}},{children:[t(s,e({size:"small",onClick:function(){return h(!0)},sx:{color:"#6b7280"}},{children:t(C,{sx:{fontSize:14}})})),t(s,e({size:"small",onClick:d,sx:{color:"#dc2626"}},{children:t(L,{sx:{fontSize:14}})}))]}))]}))},N=function(n){var o=n.isDarkMode,i=n.onChange;return t(a,e({onClick:function(){return i(!o)},sx:{width:52,height:24,borderRadius:"12px",bgcolor:o?"#5928ed":"#f0f0f0",border:"1px solid",borderColor:o?"#5928ed":"#d1d5db",display:"flex",alignItems:"center",px:.4,cursor:"pointer",transition:"all 0.2s",justifyContent:o?"flex-end":"flex-start"}},{children:t(a,e({sx:{width:18,height:18,borderRadius:"50%",bgcolor:o?"#1e1e2e":"#f59e0b",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s"}},{children:t(o?T:V,{sx:{fontSize:11,color:"#fff"}})}))}))},G=function(n){var r=n.content,c=n.selectedTag,s=n.highlightVariable,u=n.isDarkMode,f=n.height,p=void 0===f?250:f,h=n.fontSize,g=void 0===h?12:h,m=l(),x=l();return d(function(){if(c&&m.current&&x.current){var e=m.current,n=e.getModel();if(n){for(var o=n.getValue().split("\n"),t=-1,i=0;i<o.length;i++){var r=o[i].match(/<([^\s>\/]+(?:\s[^\s>\/]+)*)/);if(r&&r[1].trim().toLowerCase()===c.toLowerCase()){t=i+1;break}}if(t>0){var l=t,d="</".concat(c.toLowerCase(),">");for(i=t;i<o.length;i++)if(o[i].toLowerCase().includes(d)){l=i+1;break}e.setSelection(new x.current.Selection(t,1,t,1)),e.trigger(null,"editor.unfold",{}),e.revealLineInCenterIfOutsideViewport(t);var a=e.deltaDecorations([],[{range:new x.current.Range(t,1,l,o[l-1].length+1),options:{isWholeLine:!0,className:"promptemon-viewer-highlight",inlineClassName:"promptemon-viewer-highlight"}}]);setTimeout(function(){return e.deltaDecorations(a,[])},2e3)}}}},[c]),d(function(){if(s&&m.current&&x.current){var e=m.current,n=e.getModel();if(n){for(var o=n.getValue().split("\n"),t=[],i=0;i<o.length;i++)for(var r=o[i].indexOf(s);-1!==r;)t.push(new M.Range(i+1,r+1,i+1,r+s.length+1)),r=o[i].indexOf(s,r+1);if(0!==t.length){e.revealLineInCenterIfOutsideViewport(t[0].startLineNumber);var l=e.deltaDecorations([],t.map(function(e){return{range:e,options:{inlineClassName:"promptemon-viewer-variable-highlight"}}}));setTimeout(function(){return e.deltaDecorations(l,[])},2e3)}}}},[s]),d(function(){x.current&&x.current.editor.setTheme(u?"promptemonViewerDark":"promptemonViewerLight")},[u]),o(i,{children:[t("style",{children:"\n .promptemon-viewer-highlight { background-color: rgba(89, 40, 237, 0.15); }\n .promptemon-viewer-variable-highlight { background-color: rgba(0, 255, 255, 0.2); border-radius: 2px; }\n "}),o(a,e({sx:{width:"100%",height:p,display:"flex",flexDirection:"column"}},{children:[t(a,{sx:{width:"100%",height:20,bgcolor:u?"#030202":"#fff",borderTopLeftRadius:8,borderTopRightRadius:8}}),t(a,e({sx:{flex:1,minHeight:0,overflow:"hidden"}},{children:t(D,{onMount:function(e,n){m.current=e,x.current=n,n.editor.defineTheme("promptemonViewerDark",E),n.editor.defineTheme("promptemonViewerLight",O),n.editor.setTheme(u?"promptemonViewerDark":"promptemonViewerLight"),n.languages.register({id:"promptemonViewerLang"}),n.languages.setMonarchTokensProvider("promptemonViewerLang",{tokenizer:{root:[[/(<)([a-zA-Z0-9\-]+)(\s*)/,["delimiter","tag","white"],"@tagBody"],[/(<\/)([a-zA-Z0-9\-]+)(\s*)(>)/,["delimiter","tag","white","delimiter"]],[/{{[^}]+}}/,"variable"]],tagBody:[[/[a-zA-Z0-9\:\-]+(?=\=)/,"attribute.name"],[/=/,"delimiter"],[/(".*?"|'.*?')/,"attribute.value"],[/\s+/,"white"],[/(\/?>)/,{token:"delimiter",next:"@pop"}]]}}),n.languages.registerFoldingRangeProvider("promptemonViewerLang",{provideFoldingRanges:function(e){var n=e.getLinesContent(),o=[],t=[];return n.forEach(function(e,n){var i=n+1,r=e.match(/<([a-zA-Z0-9\-]+)(\s[^>]*)?>/),l=e.match(/<\/([a-zA-Z0-9\-]+)>/);if(r&&!e.includes("/>")&&t.push({tag:r[1],start:i}),l)for(var d=l[1],a=t.length-1;a>=0;a--)if(t[a].tag===d){o.push({start:t[a].start,end:i}),t.splice(a,1);break}}),o}})},beforeMount:function(e){e.editor.defineTheme("promptemonViewerDark",E),e.editor.defineTheme("promptemonViewerLight",O),e.editor.setTheme(u?"promptemonViewerDark":"promptemonViewerLight")},theme:u?"promptemonViewerDark":"promptemonViewerLight",value:r,language:"promptemonViewerLang",onChange:function(){},options:{fontSize:g,minimap:{enabled:!1},wordWrap:"on",lineNumbers:"on",readOnly:!0,domReadOnly:!0,scrollBeyondLastLine:!1,padding:{top:4,bottom:12},folding:!0,automaticLayout:!0,scrollbar:{vertical:"visible",horizontal:"visible",verticalScrollbarSize:8}}})})),t(a,{sx:{width:"100%",height:20,bgcolor:u?"#030202":"#fff",borderBottomLeftRadius:8,borderBottomRightRadius:8}})]}))]})},H=function(i){var l,d,k,I,W=i.block,A=i.isExtracted,D=i.isSaved,M=i.showEditMode,T=i.onBlockUpdate,V=i.onTagSelect,E=i.onVariableSelect,O=i.categories,N=i.subCategories,G=i.selectedCategoryId,H=i.selectedSubCategoryId,Z=i.onCategoryChange,U=i.onSubCategoryChange,Y=r(!0),q=Y[0],J=Y[1],K=r(!0),Q=K[0],X=K[1],$=r(!0),ee=$[0],ne=$[1],oe=r(!0),te=oe[0],ie=oe[1],re=r(!1),le=re[0],de=re[1],ae=r(!0),ce=ae[0],se=ae[1],ue=r(!0),fe=ue[0],pe=ue[1],he=r(!1),ge=he[0],me=he[1],xe=r(!1),be=xe[0],ve=xe[1],ye=r(!1),we=ye[0],Se=ye[1],ze=r((null==W?void 0:W.title)||""),Ce=ze[0],_e=ze[1],ke=r((null==W?void 0:W.short_description)||""),Ie=ke[0],We=ke[1],Re=r((null==W?void 0:W.members)||[]),Ae=Re[0],Be=Re[1],Fe=r(Array.isArray(null==W?void 0:W.when_to_apply)?W.when_to_apply:(null==W?void 0:W.when_to_apply)?[W.when_to_apply]:[]),Le=Fe[0],De=Fe[1],Me=r(Array.isArray(null==W?void 0:W.when_not_to_apply)?W.when_not_to_apply:(null==W?void 0:W.when_not_to_apply)?[W.when_not_to_apply]:[]),Te=Me[0],Ve=Me[1],Ee=r(!1),Oe=Ee[0],Pe=Ee[1],je=r(""),Ne=je[0],Ge=je[1],He=r(""),Ze=He[0],Ue=He[1],Ye={boxShadow:"none",border:"1px solid #e5e7eb",borderRadius:"8px !important",mb:1.5,"&:before":{display:"none"},"&.Mui-expanded":{margin:"0 0 12px 0"}},qe={minHeight:44,px:2,borderRadius:2,"&.Mui-expanded":{minHeight:44},"& .MuiAccordionSummary-content":{my:"10px"}};return o(a,e({sx:{width:820,flexShrink:0,display:"flex",flexDirection:"column",overflow:"hidden",borderRight:"1px solid #e5e7eb"}},{children:[o(a,e({sx:{px:2.5,py:2,borderBottom:"1px solid #e5e7eb"}},{children:[o(c,e({direction:"row",alignItems:"center",justifyContent:"space-between"},{children:[o(c,e({direction:"row",alignItems:"center",gap:1,sx:{flex:1,minWidth:0}},{children:[t(p,e({title:"Functional Prompt Block",placement:"top"},{children:t(h,{label:"FPB",size:"small",sx:{bgcolor:"#f1f5f9",color:"#475569",fontWeight:700,fontSize:11,height:22,borderRadius:1}})})),we?t(g,{value:Ce,onChange:function(e){return _e(e.target.value)},size:"small",fullWidth:!0,sx:{"& .MuiOutlinedInput-input":{fontSize:15,fontWeight:700,py:.5}}}):t(u,e({sx:{fontWeight:700,fontSize:15,color:"#111827"}},{children:(null==W?void 0:W.title)||"—"}))]})),we?o(c,e({direction:"row",gap:.5},{children:[t(s,e({size:"small",sx:{color:"#6b7280"},onClick:function(){return Se(!1)}},{children:t(_,{sx:{fontSize:16}})})),t(s,e({size:"small",sx:{color:"#16a34a"},onClick:function(){T(e(e({},W),{title:Ce,short_description:Ie,members:Ae,when_to_apply:Le,when_not_to_apply:Te})),Se(!1)}},{children:t(B,{sx:{fontSize:16}})}))]})):!D&&M&&t(s,e({size:"small",sx:{color:"#6b7280"},onClick:function(){_e((null==W?void 0:W.title)||""),We((null==W?void 0:W.short_description)||""),Be((null==W?void 0:W.members)||[]),De(Array.isArray(null==W?void 0:W.when_to_apply)?W.when_to_apply:(null==W?void 0:W.when_to_apply)?[W.when_to_apply]:[]),Ve(Array.isArray(null==W?void 0:W.when_not_to_apply)?W.when_not_to_apply:(null==W?void 0:W.when_not_to_apply)?[W.when_not_to_apply]:[]),Se(!0)}},{children:t(C,{sx:{fontSize:16}})}))]})),we&&t(u,e({sx:{fontSize:11,color:"#5928ed",mt:.5}},{children:"Editing — changes won't be saved until you confirm"})),we?t(g,{value:Ie,onChange:function(e){return We(e.target.value)},size:"small",fullWidth:!0,multiline:!0,minRows:3,sx:{mt:1.5,"& .MuiOutlinedInput-input":{fontSize:12}}}):t(P,{description:(null==W?void 0:W.short_description)||"—"}),o(a,e({sx:{mt:1.5,border:"0.5px solid #d1d5db",borderRadius:"8px",display:"flex",overflow:"hidden"}},{children:[t(a,e({sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",borderRight:"1px solid #d1d5db",p:.5}},{children:o(c,e({direction:"row",alignItems:"center",gap:1},{children:[t(u,e({sx:{fontSize:10,color:"#87898d"}},{children:"Total APBs :"})),t(u,e({sx:{fontSize:10,fontWeight:700,color:"#5f5f5f"}},{children:(null===(l=null==W?void 0:W.members)||void 0===l?void 0:l.length)||0}))]}))})),t(a,e({sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",p:.5}},{children:o(c,e({direction:"row",alignItems:"center",gap:1},{children:[t(u,e({sx:{fontSize:10,color:"#87898d"}},{children:"Total Lines :"})),t(u,e({sx:{fontSize:10,fontWeight:700,color:"#5f5f5f"}},{children:(null===(d=null==W?void 0:W.members)||void 0===d?void 0:d.reduce(function(e,n){var o,t;return e+((null!==(o=n.end_line)&&void 0!==o?o:0)-(null!==(t=n.start_line)&&void 0!==t?t:0)+1)},0))||0}))]}))}))]}))]})),o(a,e({sx:{flex:1,overflow:"auto",px:2,py:2,"&::-webkit-scrollbar":{width:4},"&::-webkit-scrollbar-thumb":{bgcolor:"#e5e7eb",borderRadius:2}}},{children:[o(m,e({expanded:q,onChange:function(){return J(function(e){return!e})},sx:Ye,disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:18}}),sx:qe},{children:t(u,e({sx:{fontSize:13,fontWeight:600,color:"#374151"}},{children:"Categories"}))})),t(b,e({sx:{pt:0,px:2,pb:2}},{children:o(c,e({gap:1.5},{children:[o(a,{children:[t(u,e({sx:{fontSize:12,color:"#6b7280",mb:.5}},{children:"Category"})),we?t(v,e({fullWidth:!0,size:"small",value:G,onChange:function(e){Z(e.target.value),U("")},sx:{fontSize:13,borderRadius:1.5,"& fieldset":{borderColor:"#e5e7eb"}}},{children:O.map(function(n){return t(y,e({value:n.category_id},{children:n.category_name}),n.category_id)})})):t(g,{fullWidth:!0,size:"small",value:(null===(k=O.find(function(e){return e.category_id===G}))||void 0===k?void 0:k.category_name)||"—",InputProps:{readOnly:!0},sx:{"& .MuiOutlinedInput-root":{fontSize:13,borderRadius:1.5,"& fieldset":{borderColor:"#e5e7eb"}}}})]}),o(a,{children:[t(u,e({sx:{fontSize:12,color:"#6b7280",mb:.5}},{children:"Sub-Category"})),we?t(v,e({fullWidth:!0,size:"small",value:H,onChange:function(e){return U(e.target.value)},disabled:!G,sx:{fontSize:13,borderRadius:1.5,"& fieldset":{borderColor:"#e5e7eb"}}},{children:N.filter(function(e){return e.category_id===G}).map(function(n){return t(y,e({value:n.sub_category_id},{children:n.sub_category_name}),n.sub_category_id)})})):t(g,{fullWidth:!0,size:"small",value:(null===(I=N.find(function(e){return e.sub_category_id===H}))||void 0===I?void 0:I.sub_category_name)||"—",InputProps:{readOnly:!0},sx:{"& .MuiOutlinedInput-root":{fontSize:13,borderRadius:1.5,"& fieldset":{borderColor:"#e5e7eb"}}}})]})]}))}))]})),o(m,e({expanded:Q,onChange:function(){return X(function(e){return!e})},sx:Ye,disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:18}}),sx:qe},{children:t(u,e({sx:{fontSize:13,fontWeight:600,color:"#374151"}},{children:"Atomic Prompt Blocks (APBs)"}))})),o(b,e({sx:{pt:0,px:1,pb:2}},{children:[t(c,e({gap:1},{children:(we?Ae:(null==W?void 0:W.members)||[]).map(function(n,i){return o(a,e({sx:{px:2,py:1,borderRadius:2,bgcolor:"#fff"}},{children:[o(a,e({sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",mb:1,gap:1}},{children:[o(u,e({sx:{fontSize:14,fontWeight:500,color:"#111827"}},{children:[i+1,". ",n.section_name]})),we?t(s,e({size:"small",onClick:function(){return Be(function(e){return e.filter(function(e,n){return n!==i})})},sx:{color:"#dc2626",flexShrink:0}},{children:t(L,{sx:{fontSize:16}})})):t(a,e({onClick:function(){return V(n.section_name.split("_").map(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}).join("_"))},sx:{fontSize:14,color:"#475569",cursor:"pointer",flexShrink:0}},{children:"↗"}))]})),t(u,e({sx:{fontSize:12,lineHeight:1.5,color:"#64748b"}},{children:n.reason_for_inclusion})),A&&(r=n.segments||[],0===r.length?null:t(a,e({sx:{mt:1}},{children:t(a,e({sx:{display:"flex",flexWrap:"wrap",gap:1}},{children:r.map(function(e,n){return t(h,{clickable:!0,onClick:function(){return E(e.segmentized_text)},label:e.segmentized_text,sx:{borderRadius:1,bgcolor:"#eff6ff",color:"#3b82f6",border:"1px dashed #bfdbfe"}},n)})}))}))),t(w,{sx:{mt:2}})]}),i);var r})})),we&&o(a,e({onClick:function(){Ge(""),Ue(""),Pe(!0)},sx:{mt:1,display:"flex",alignItems:"center",justifyContent:"center",gap:.5,py:1,border:"1px dashed #d1d5db",borderRadius:1.5,cursor:"pointer",color:"#5928ed",fontSize:13,fontWeight:600,"&:hover":{bgcolor:"#f5f0ff"}}},{children:[t(F,{sx:{fontSize:16}})," Add APB"]}))]}))]})),o(m,e({expanded:ee,onChange:function(){return ne(function(e){return!e})},sx:Ye,disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:18}}),sx:qe},{children:o(u,e({sx:{fontSize:14,fontWeight:600,color:"#374151",display:"flex",alignItems:"center",flexDirection:"row"}},{children:["Applicability ",t("span",e({style:{color:"#94a3b8",fontWeight:400,fontSize:10,marginLeft:"12px"}},{children:"• When to apply / When not to apply"}))]}))})),o(b,e({sx:{pt:0,px:1.5,pb:1.5}},{children:[o(m,e({expanded:te,onChange:function(){return ie(function(e){return!e})},sx:{boxShadow:"none",border:"1px solid #e5e7eb",borderRadius:"6px !important",mb:1,"&:before":{display:"none"},"&.Mui-expanded":{margin:"0 0 8px 0"}},disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:16}}),sx:e(e({},qe),{bgcolor:"#f9fafb",borderRadius:"6px"})},{children:t(u,e({sx:{fontSize:12.5,fontWeight:500,color:"#374151"}},{children:"When to Apply this FPB"}))})),t(b,e({sx:{pt:.5,px:2,pb:1.5}},{children:o(c,e({gap:.75},{children:[(we?Le:Array.isArray(null==W?void 0:W.when_to_apply)?W.when_to_apply:(null==W?void 0:W.when_to_apply)?[W.when_to_apply]:["— Not yet available"]).map(function(n,i){return we?t(j,{value:n,onChange:function(e){return De(function(n){return n.map(function(n,o){return o===i?e:n})})},onDelete:function(){return De(function(e){return e.filter(function(e,n){return n!==i})})}},i):o(c,e({direction:"row",gap:1,alignItems:"flex-start"},{children:[o(u,e({sx:{fontSize:12,color:"#374151",fontWeight:700,mt:.1}},{children:[i+1,"."]})),t(u,e({sx:{fontSize:12.5,color:"#374151",lineHeight:1.55}},{children:n}))]}),i)}),we&&o(a,e({onClick:function(){return De(function(e){return n(n([],e,!0),[""],!1)})},sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:.5,py:.75,border:"1px dashed #d1d5db",borderRadius:1.5,cursor:"pointer",color:"#5928ed",fontSize:12.5,fontWeight:600,"&:hover":{bgcolor:"#f5f0ff"}}},{children:[t(F,{sx:{fontSize:15}})," Add When to Apply"]}))]}))}))]})),o(m,e({expanded:le,onChange:function(){return de(function(e){return!e})},sx:{boxShadow:"none",border:"1px solid #e5e7eb",borderRadius:"6px !important","&:before":{display:"none"}},disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:16}}),sx:e(e({},qe),{bgcolor:"#f9fafb",borderRadius:"6px"})},{children:t(u,e({sx:{fontSize:12.5,fontWeight:500,color:"#374151"}},{children:"When NOT to Apply this FPB"}))})),t(b,e({sx:{pt:.5,px:2,pb:1.5}},{children:we?o(c,e({gap:.75},{children:[Te.map(function(e,n){return t(j,{value:e,onChange:function(e){return Ve(function(o){return o.map(function(o,t){return t===n?e:o})})},onDelete:function(){return Ve(function(e){return e.filter(function(e,o){return o!==n})})}},n)}),o(a,e({onClick:function(){return Ve(function(e){return n(n([],e,!0),[""],!1)})},sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:.5,py:.75,border:"1px dashed #d1d5db",borderRadius:1.5,cursor:"pointer",color:"#5928ed",fontSize:12.5,fontWeight:600,"&:hover":{bgcolor:"#f5f0ff"}}},{children:[t(F,{sx:{fontSize:15}})," Add When NOT to Apply"]}))]})):Array.isArray(null==W?void 0:W.when_not_to_apply)||(null==W?void 0:W.when_not_to_apply)?t(c,e({gap:.75},{children:(Array.isArray(null==W?void 0:W.when_not_to_apply)?W.when_not_to_apply:[W.when_not_to_apply]).map(function(n,i){return o(c,e({direction:"row",gap:1,alignItems:"flex-start"},{children:[o(u,e({sx:{fontSize:12,color:"#374151",fontWeight:700,mt:.1}},{children:[i+1,"."]})),t(u,e({sx:{fontSize:12.5,color:"#374151",lineHeight:1.55}},{children:n}))]}),i)})})):t(u,e({sx:{fontSize:12.5,color:"#9ca3af",fontStyle:"italic"}},{children:"No conditions defined yet."}))}))]}))]}))]})),o(m,e({expanded:ce,onChange:function(){return se(function(e){return!e})},sx:Ye,disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:18}}),sx:qe},{children:o(u,e({sx:{fontSize:14,fontWeight:600,color:"#374151",display:"flex",alignItems:"center",flexDirection:"row"}},{children:["Specifications ",t("span",e({style:{color:"#94a3b8",fontWeight:400,fontSize:10,marginLeft:"12px"}},{children:"• Strict Rules / Input / Output"}))]}))})),t(b,e({sx:{pt:0,px:1.5,pb:1.5}},{children:[{label:"Guidelines",expanded:fe,setExpanded:pe,content:null==W?void 0:W.additional_guidelines},{label:"Input",expanded:ge,setExpanded:me,content:null},{label:"Output",expanded:be,setExpanded:ve,content:null}].map(function(n,i){var r=n.label,l=n.expanded,d=n.setExpanded,a=n.content;return o(m,e({expanded:l,onChange:function(){return d(function(e){return!e})},sx:{boxShadow:"none",border:"1px solid #e5e7eb",borderRadius:"6px !important",mb:i<2?1:0,"&:before":{display:"none"},"&.Mui-expanded":{margin:i<2?"0 0 8px 0":0}},disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:16}}),sx:e(e({},qe),{bgcolor:"#f9fafb",borderRadius:"6px"})},{children:o(c,e({direction:"row",alignItems:"center",gap:.5},{children:[t(u,e({sx:{fontSize:12.5,fontWeight:500,color:"#374151"}},{children:r})),"Guidelines"!==r&&t(R,{sx:{fontSize:13,color:"#9ca3af"}})]}))})),t(b,e({sx:{pt:.5,px:2,pb:1.5}},{children:t(u,e({sx:{fontSize:12.5,color:a?"#374151":"#9ca3af",fontStyle:a?"normal":"italic"}},{children:a||"No ".concat(r.toLowerCase()," defined yet.")}))}))]}),r)})}))]}))]})),o(S,e({open:Oe,onClose:function(){return Pe(!1)},maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{borderRadius:"12px"}}},{children:[o(a,e({sx:{px:3,py:2,display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e5e7eb"}},{children:[t(u,e({sx:{fontWeight:700,fontSize:"1rem",color:"#111827"}},{children:"Add new APB"})),t(s,e({size:"small",onClick:function(){return Pe(!1)}},{children:t(_,{sx:{fontSize:"1.1rem",color:"#6b7280"}})}))]})),o(a,e({sx:{px:3,py:2.5,display:"flex",flexDirection:"column",gap:2}},{children:[o(a,{children:[t(u,e({sx:{fontSize:13,fontWeight:600,color:"#374151",mb:.75}},{children:"Title"})),t(g,{fullWidth:!0,size:"small",placeholder:"Specify the title of APB",value:Ne,onChange:function(e){return Ge(e.target.value)}})]}),o(a,{children:[t(u,e({sx:{fontSize:13,fontWeight:600,color:"#374151",mb:.75}},{children:"Description"})),t(g,{fullWidth:!0,size:"small",multiline:!0,minRows:3,placeholder:"Describe the APB",value:Ze,onChange:function(e){return Ue(e.target.value)}})]})]})),o(a,e({sx:{px:3,py:2,display:"flex",justifyContent:"flex-end",gap:1,borderTop:"1px solid #e5e7eb"}},{children:[t(f,e({variant:"outlined",onClick:function(){return Pe(!1)},sx:{textTransform:"none",borderColor:"#d1d5db",color:"#374151"}},{children:"Cancel"})),t(f,e({variant:"contained",onClick:function(){Be(function(e){return n(n([],e,!0),[{section_name:Ne,reason_for_inclusion:Ze,content:""}],!1)}),Pe(!1)},sx:{textTransform:"none",bgcolor:"#5928ed","&:hover":{bgcolor:"#4c1d95"}}},{children:"Save"}))]}))]}))]}))},Z=function(n){var i,l,d,p,h,g=n.block,m=n.onBlockUpdate,x=n.isExtracting,b=n.isExtracted,v=n.onExtractSegments,y=n.isSaving,w=n.isSaved,S=n.onSave,z=n.onBack,C=n.title,R=void 0===C?"FPB Promptemon":C,B=n.categories,F=n.subCategories,L=n.selectedCategoryId,D=n.selectedSubCategoryId,M=n.onCategoryChange,T=n.onSubCategoryChange,V=n.showEditMode,E=void 0===V||V,O=n.showExtractSegments,P=void 0===O||O,j=r(1),Z=j[0],U=j[1],Y=r(!0),q=Y[0],J=Y[1],K=r(""),Q=K[0],X=K[1],$=r(""),ee=$[0],ne=$[1],oe=(null===(i=null==g?void 0:g.members)||void 0===i?void 0:i.map(function(e){if(!b||!e.segments||0===e.segments.length)return e.content||"";var n=e.content||"";return e.segments.forEach(function(e){e.raw_text&&e.segmentized_text&&(n=n.split(e.raw_text).join(e.segmentized_text))}),n}).join("\n\n"))||"";return o(a,e({sx:{width:"100%",height:"100%",display:"flex",flexDirection:"column",bgcolor:"#fff",overflow:"hidden"}},{children:[o(a,e({sx:{px:2.5,py:1.5,borderBottom:"1px solid #e5e7eb",display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#fff",flexShrink:0}},{children:[o(c,e({direction:"row",alignItems:"center",gap:1},{children:[t(s,e({size:"small",sx:{color:"#6b7280"},onClick:z},{children:t(k,{sx:{fontSize:18}})})),t(u,e({sx:{fontSize:14,fontWeight:600,color:"#111827"}},{children:R}))]})),o(a,e({sx:{display:"flex",alignItems:"center",gap:1}},{children:[t(f,e({variant:"contained",size:"small",disabled:!b||y||w,onClick:S,sx:{textTransform:"none",fontSize:"0.78rem",fontWeight:600,bgcolor:"#5928ed",px:2,py:.6,"&:hover":{bgcolor:"#4c1d95"},"&.Mui-disabled":{bgcolor:"#5928ed",color:"#fff",opacity:.4}}},{children:y?"Saving...":w?"Saved ✓":"Save FPB"})),t(s,e({size:"small",sx:{color:"#6b7280"},onClick:z},{children:t(_,{sx:{fontSize:18}})}))]}))]})),o(a,e({sx:{display:"flex",flex:1,overflow:"hidden"}},{children:[t(H,{block:g,isExtracted:b,isSaved:w,showEditMode:E,onBlockUpdate:m,onTagSelect:function(e){X(""),setTimeout(function(){return X(e)},50)},onVariableSelect:function(e){ne(""),setTimeout(function(){return ne(e)},50)},categories:B,subCategories:F,selectedCategoryId:L,selectedSubCategoryId:D,onCategoryChange:M,onSubCategoryChange:T}),o(a,e({sx:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",p:2,gap:1.5}},{children:[o(a,e({sx:{display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0}},{children:[o(c,e({direction:"row",alignItems:"center",gap:1},{children:[o(u,e({sx:{fontSize:13,fontWeight:600,color:"#374151"}},{children:[(null==g?void 0:g.title)||"—"," APBs"]})),o(c,e({direction:"row",alignItems:"center",gap:.5},{children:[t(s,e({size:"small",onClick:function(){return U(function(e){return Math.max(1,e-1)})},disabled:1===Z,sx:{color:"#6b7280",p:.4}},{children:t(I,{sx:{fontSize:16}})})),o(u,e({sx:{fontSize:12.5,color:"#6b7280"}},{children:[Z," of ",(null===(l=null==g?void 0:g.members)||void 0===l?void 0:l.length)||0]})),t(s,e({size:"small",onClick:function(){return U(function(e){var n;return Math.min((null===(n=null==g?void 0:g.members)||void 0===n?void 0:n.length)||0,e+1)})},disabled:Z===((null===(d=null==g?void 0:g.members)||void 0===d?void 0:d.length)||0),sx:{color:"#6b7280",p:.4}},{children:t(W,{sx:{fontSize:16}})}))]}))]})),t(c,e({direction:"row",alignItems:"center",gap:1.5},{children:P&&(b?o(c,e({direction:"row",alignItems:"center",gap:1},{children:[t(u,e({sx:{fontSize:12.5,color:"#6b7280"}},{children:"Show Segments"})),t(a,e({sx:{width:36,height:20,borderRadius:"10px",bgcolor:"#7c3aed",display:"flex",alignItems:"center",px:.3,cursor:"pointer"}},{children:t(a,{sx:{width:14,height:14,borderRadius:"50%",bgcolor:"#fff",ml:"auto"}})}))]})):o(a,e({onClick:v,sx:{display:"flex",alignItems:"center",gap:1,px:2,py:.85,borderRadius:1.5,bgcolor:"#7c3aed",cursor:x?"default":"pointer","&:hover":{bgcolor:"#6d28d9"},userSelect:"none",opacity:x?.7:1}},{children:[t(A,{sx:{fontSize:15,color:"#fff"}}),t(u,e({sx:{fontSize:13,fontWeight:600,color:"#fff"}},{children:x?"Extracting...":"Extract Segments"}))]})))}))]})),o(a,e({sx:{flex:1,minHeight:0,position:"relative"}},{children:[x&&t(a,e({sx:{position:"absolute",top:0,left:0,right:0,bottom:0,bgcolor:"rgba(0,0,0,0.6)",zIndex:10,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:1}},{children:t(u,e({sx:{color:"#fff",fontSize:14,fontWeight:600}},{children:"Extracting segments..."}))})),o(a,e({sx:{border:"1px solid #30363d",borderRadius:1,overflow:"hidden",height:"100%"}},{children:[o(a,e({sx:{px:2,py:1,borderBottom:"1px solid #30363d",display:"flex",alignItems:"center",gap:1,bgcolor:"#161b22",flexShrink:0}},{children:[t(a,{sx:{width:12,height:12,borderRadius:"50%",bgcolor:"#ff5f57"}}),t(a,{sx:{width:12,height:12,borderRadius:"50%",bgcolor:"#febc2e"}}),t(a,{sx:{width:12,height:12,borderRadius:"50%",bgcolor:"#28c840"}}),o(u,e({sx:{ml:1,fontSize:11,color:"#8b949e",fontFamily:"monospace"}},{children:[(null===(h=null===(p=null==g?void 0:g.members)||void 0===p?void 0:p[Z-1])||void 0===h?void 0:h.section_name)||"—",".xml"]})),t(a,{sx:{flex:1}}),t(N,{isDarkMode:q,onChange:J})]})),t(G,{content:oe,selectedTag:Q,highlightVariable:ee,isDarkMode:q,height:"100%",fontSize:14})]}))]}))]}))]}))]}))};export{Z as default};
1
+ import{__assign as e,__spreadArray as n}from"tslib";import{jsxs as o,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState as r,useRef as l,useEffect as d}from"react";import{Box as a,Stack as c,IconButton as s,Typography as u,Button as f,Tooltip as p,Chip as h,TextField as g,Accordion as m,AccordionSummary as x,AccordionDetails as b,Select as v,MenuItem as y,Divider as w,Dialog as S}from"@mui/material";import z from"@mui/icons-material/ExpandMore";import C from"@mui/icons-material/EditOutlined";import _ from"@mui/icons-material/Close";import k from"@mui/icons-material/ArrowBack";import I from"@mui/icons-material/NavigateBefore";import W from"@mui/icons-material/NavigateNext";import R from"@mui/icons-material/InfoOutlined";import A from"@mui/icons-material/AutoFixHighOutlined";import B from"@mui/icons-material/Check";import F from"@mui/icons-material/Add";import L from"@mui/icons-material/DeleteOutline";import D from"@monaco-editor/react";import M from"@mui/icons-material/DarkMode";import T from"@mui/icons-material/LightMode";var V={base:"vs-dark",inherit:!0,rules:[{token:"tag",foreground:"714be3",fontStyle:"bold"},{token:"attribute.name",foreground:"87CEFA"},{token:"attribute.value",foreground:"98FB98"},{token:"variable",foreground:"00FFFF"},{token:"delimiter",foreground:"888888"},{token:"white",foreground:"AAAAAA"}],colors:{"editor.foreground":"#FFFFFF","editor.background":"#030202","editorLineNumber.foreground":"#858585","editorCursor.foreground":"#FFFFFF","editorIndentGuide.background":"#404040","editorIndentGuide.activeBackground":"#707070"}},E={base:"vs",inherit:!0,rules:[{token:"tag",foreground:"5928ED",fontStyle:"bold"},{token:"attribute.name",foreground:"AF00DB"},{token:"attribute.value",foreground:"008000"},{token:"variable",foreground:"B000B0"},{token:"delimiter",foreground:"808080"},{token:"white",foreground:"000000"}],colors:{"editor.foreground":"#000000","editor.background":"#FFFFFF","editorLineNumber.foreground":"#999999","editorCursor.foreground":"#000000","editorIndentGuide.background":"#CCCCCC","editorIndentGuide.activeBackground":"#999999"}},O=function(n){var i=n.description,c=r(!1),s=c[0],f=c[1],p=r(!1),h=p[0],g=p[1],m=l(null);return d(function(){var e=m.current;e&&g(e.scrollHeight>e.clientHeight+1)},[i,s]),o(a,e({sx:{mt:1.5,border:"1px solid #e5e7eb",borderRadius:2,bgcolor:"#fff",display:"flex",flexDirection:"column",px:1.25,py:1}},{children:[t(u,e({ref:m,component:"div",sx:e({fontSize:11,color:"#6b7280",lineHeight:1.5,overflowY:s?"auto":"hidden",maxHeight:s?"calc(1.6em * 5)":"calc(1.6em * 3)",whiteSpace:"normal",display:s?"block":"-webkit-box"},s?{}:{WebkitBoxOrient:"vertical",WebkitLineClamp:3})},{children:i})),h&&t(u,e({component:"span",onClick:function(){return f(function(e){return!e})},sx:{mt:.75,alignSelf:"flex-end",fontSize:10,color:"#7c3aed",cursor:"pointer",fontWeight:500}},{children:s?"View less":"View more"}))]}))},P=function(n){var i=n.value,l=n.onChange,d=n.onDelete,f=r(!1),p=f[0],h=f[1];return o(a,e({sx:{display:"flex",alignItems:"flex-start",gap:1,p:1,border:"1px solid #e5e7eb",borderRadius:"8px",bgcolor:"#fff"}},{children:[t(a,e({sx:{width:18,height:18,borderRadius:"4px",bgcolor:"#f1f5f9",display:"flex",alignItems:"center",justifyContent:"center",fontSize:11,color:"#64748b",flexShrink:0,mt:.1}},{children:"a"})),p?t(g,{autoFocus:!0,value:i,onChange:function(e){return l(e.target.value)},onBlur:function(){return h(!1)},size:"small",fullWidth:!0,multiline:!0,sx:{"& .MuiOutlinedInput-input":{fontSize:12.5}}}):t(u,e({sx:{fontSize:12.5,color:"#374151",lineHeight:1.55,flex:1}},{children:i})),o(c,e({direction:"row",gap:.25,sx:{flexShrink:0}},{children:[t(s,e({size:"small",onClick:function(){return h(!0)},sx:{color:"#6b7280"}},{children:t(C,{sx:{fontSize:14}})})),t(s,e({size:"small",onClick:d,sx:{color:"#dc2626"}},{children:t(L,{sx:{fontSize:14}})}))]}))]}))},j=function(n){var o=n.isDarkMode,i=n.onChange;return t(a,e({onClick:function(){return i(!o)},sx:{width:52,height:24,borderRadius:"12px",bgcolor:o?"#5928ed":"#f0f0f0",border:"1px solid",borderColor:o?"#5928ed":"#d1d5db",display:"flex",alignItems:"center",px:.4,cursor:"pointer",transition:"all 0.2s",justifyContent:o?"flex-end":"flex-start"}},{children:t(a,e({sx:{width:18,height:18,borderRadius:"50%",bgcolor:o?"#1e1e2e":"#f59e0b",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s"}},{children:t(o?M:T,{sx:{fontSize:11,color:"#fff"}})}))}))},N=function(n){var r=n.content,c=n.selectedTag,s=n.highlightVariable,u=n.isDarkMode,f=n.height,p=void 0===f?250:f,h=n.fontSize,g=void 0===h?12:h,m=l(),x=l();return d(function(){if(c&&m.current&&x.current){var e=m.current,n=e.getModel();if(n){for(var o=n.getValue().split("\n"),t=-1,i=0;i<o.length;i++){var r=o[i].match(/<([^\s>\/]+(?:\s[^\s>\/]+)*)/);if(r&&r[1].trim().toLowerCase()===c.toLowerCase()){t=i+1;break}}if(t>0){var l=t,d="</".concat(c.toLowerCase(),">");for(i=t;i<o.length;i++)if(o[i].toLowerCase().includes(d)){l=i+1;break}e.setSelection(new x.current.Selection(t,1,t,1)),e.trigger(null,"editor.unfold",{}),e.revealLineInCenterIfOutsideViewport(t);var a=e.deltaDecorations([],[{range:new x.current.Range(t,1,l,o[l-1].length+1),options:{isWholeLine:!0,className:"promptemon-viewer-highlight",inlineClassName:"promptemon-viewer-highlight"}}]);setTimeout(function(){return e.deltaDecorations(a,[])},2e3)}}}},[c]),d(function(){if(s&&m.current&&x.current){var e=m.current,n=e.getModel();if(n){for(var o=n.getValue().split("\n"),t=[],i=0;i<o.length;i++)for(var r=o[i].indexOf(s);-1!==r;)t.push(new x.current.Range(i+1,r+1,i+1,r+s.length+1)),r=o[i].indexOf(s,r+1);if(0!==t.length){e.revealLineInCenterIfOutsideViewport(t[0].startLineNumber);var l=e.deltaDecorations([],t.map(function(e){return{range:e,options:{inlineClassName:"promptemon-viewer-variable-highlight"}}}));setTimeout(function(){return e.deltaDecorations(l,[])},2e3)}}}},[s]),d(function(){x.current&&x.current.editor.setTheme(u?"promptemonViewerDark":"promptemonViewerLight")},[u]),o(i,{children:[t("style",{children:"\n .promptemon-viewer-highlight { background-color: rgba(89, 40, 237, 0.15); }\n .promptemon-viewer-variable-highlight { background-color: rgba(0, 255, 255, 0.2); border-radius: 2px; }\n "}),o(a,e({sx:{width:"100%",height:p,display:"flex",flexDirection:"column"}},{children:[t(a,{sx:{width:"100%",height:20,bgcolor:u?"#030202":"#fff",borderTopLeftRadius:8,borderTopRightRadius:8}}),t(a,e({sx:{flex:1,minHeight:0,overflow:"hidden"}},{children:t(D,{onMount:function(e,n){m.current=e,x.current=n,n.editor.defineTheme("promptemonViewerDark",V),n.editor.defineTheme("promptemonViewerLight",E),n.editor.setTheme(u?"promptemonViewerDark":"promptemonViewerLight"),n.languages.register({id:"promptemonViewerLang"}),n.languages.setMonarchTokensProvider("promptemonViewerLang",{tokenizer:{root:[[/(<)([a-zA-Z0-9\-]+)(\s*)/,["delimiter","tag","white"],"@tagBody"],[/(<\/)([a-zA-Z0-9\-]+)(\s*)(>)/,["delimiter","tag","white","delimiter"]],[/{{[^}]+}}/,"variable"]],tagBody:[[/[a-zA-Z0-9\:\-]+(?=\=)/,"attribute.name"],[/=/,"delimiter"],[/(".*?"|'.*?')/,"attribute.value"],[/\s+/,"white"],[/(\/?>)/,{token:"delimiter",next:"@pop"}]]}}),n.languages.registerFoldingRangeProvider("promptemonViewerLang",{provideFoldingRanges:function(e){var n=e.getLinesContent(),o=[],t=[];return n.forEach(function(e,n){var i=n+1,r=e.match(/<([a-zA-Z0-9\-]+)(\s[^>]*)?>/),l=e.match(/<\/([a-zA-Z0-9\-]+)>/);if(r&&!e.includes("/>")&&t.push({tag:r[1],start:i}),l)for(var d=l[1],a=t.length-1;a>=0;a--)if(t[a].tag===d){o.push({start:t[a].start,end:i}),t.splice(a,1);break}}),o}})},beforeMount:function(e){e.editor.defineTheme("promptemonViewerDark",V),e.editor.defineTheme("promptemonViewerLight",E),e.editor.setTheme(u?"promptemonViewerDark":"promptemonViewerLight")},theme:u?"promptemonViewerDark":"promptemonViewerLight",value:r,language:"promptemonViewerLang",onChange:function(){},options:{fontSize:g,minimap:{enabled:!1},wordWrap:"on",lineNumbers:"on",readOnly:!0,domReadOnly:!0,scrollBeyondLastLine:!1,padding:{top:4,bottom:12},folding:!0,automaticLayout:!0,scrollbar:{vertical:"visible",horizontal:"visible",verticalScrollbarSize:8}}})})),t(a,{sx:{width:"100%",height:20,bgcolor:u?"#030202":"#fff",borderBottomLeftRadius:8,borderBottomRightRadius:8}})]}))]})},G=function(i){var l,d,k,I,W=i.block,A=i.isExtracted,D=i.isSaved,M=i.showEditMode,T=i.onBlockUpdate,V=i.onTagSelect,E=i.onVariableSelect,j=i.categories,N=i.subCategories,G=i.selectedCategoryId,H=i.selectedSubCategoryId,Z=i.onCategoryChange,U=i.onSubCategoryChange,Y=r(!0),q=Y[0],J=Y[1],K=r(!0),Q=K[0],X=K[1],$=r(!0),ee=$[0],ne=$[1],oe=r(!0),te=oe[0],ie=oe[1],re=r(!1),le=re[0],de=re[1],ae=r(!0),ce=ae[0],se=ae[1],ue=r(!0),fe=ue[0],pe=ue[1],he=r(!1),ge=he[0],me=he[1],xe=r(!1),be=xe[0],ve=xe[1],ye=r(!1),we=ye[0],Se=ye[1],ze=r((null==W?void 0:W.title)||""),Ce=ze[0],_e=ze[1],ke=r((null==W?void 0:W.short_description)||""),Ie=ke[0],We=ke[1],Re=r((null==W?void 0:W.members)||[]),Ae=Re[0],Be=Re[1],Fe=r(Array.isArray(null==W?void 0:W.when_to_apply)?W.when_to_apply:(null==W?void 0:W.when_to_apply)?[W.when_to_apply]:[]),Le=Fe[0],De=Fe[1],Me=r(Array.isArray(null==W?void 0:W.when_not_to_apply)?W.when_not_to_apply:(null==W?void 0:W.when_not_to_apply)?[W.when_not_to_apply]:[]),Te=Me[0],Ve=Me[1],Ee=r(!1),Oe=Ee[0],Pe=Ee[1],je=r(""),Ne=je[0],Ge=je[1],He=r(""),Ze=He[0],Ue=He[1],Ye={boxShadow:"none",border:"1px solid #e5e7eb",borderRadius:"8px !important",mb:1.5,"&:before":{display:"none"},"&.Mui-expanded":{margin:"0 0 12px 0"}},qe={minHeight:44,px:2,borderRadius:2,"&.Mui-expanded":{minHeight:44},"& .MuiAccordionSummary-content":{my:"10px"}};return o(a,e({sx:{width:820,flexShrink:0,display:"flex",flexDirection:"column",overflow:"hidden",borderRight:"1px solid #e5e7eb"}},{children:[o(a,e({sx:{px:2.5,py:2,borderBottom:"1px solid #e5e7eb"}},{children:[o(c,e({direction:"row",alignItems:"center",justifyContent:"space-between"},{children:[o(c,e({direction:"row",alignItems:"center",gap:1,sx:{flex:1,minWidth:0}},{children:[t(p,e({title:"Functional Prompt Block",placement:"top"},{children:t(h,{label:"FPB",size:"small",sx:{bgcolor:"#f1f5f9",color:"#475569",fontWeight:700,fontSize:11,height:22,borderRadius:1}})})),we?t(g,{value:Ce,onChange:function(e){return _e(e.target.value)},size:"small",fullWidth:!0,sx:{"& .MuiOutlinedInput-input":{fontSize:15,fontWeight:700,py:.5}}}):t(u,e({sx:{fontWeight:700,fontSize:15,color:"#111827"}},{children:(null==W?void 0:W.title)||"—"}))]})),we?o(c,e({direction:"row",gap:.5},{children:[t(s,e({size:"small",sx:{color:"#6b7280"},onClick:function(){return Se(!1)}},{children:t(_,{sx:{fontSize:16}})})),t(s,e({size:"small",sx:{color:"#16a34a"},onClick:function(){T(e(e({},W),{title:Ce,short_description:Ie,members:Ae,when_to_apply:Le,when_not_to_apply:Te})),Se(!1)}},{children:t(B,{sx:{fontSize:16}})}))]})):!D&&M&&t(s,e({size:"small",sx:{color:"#6b7280"},onClick:function(){_e((null==W?void 0:W.title)||""),We((null==W?void 0:W.short_description)||""),Be((null==W?void 0:W.members)||[]),De(Array.isArray(null==W?void 0:W.when_to_apply)?W.when_to_apply:(null==W?void 0:W.when_to_apply)?[W.when_to_apply]:[]),Ve(Array.isArray(null==W?void 0:W.when_not_to_apply)?W.when_not_to_apply:(null==W?void 0:W.when_not_to_apply)?[W.when_not_to_apply]:[]),Se(!0)}},{children:t(C,{sx:{fontSize:16}})}))]})),we&&t(u,e({sx:{fontSize:11,color:"#5928ed",mt:.5}},{children:"Editing — changes won't be saved until you confirm"})),we?t(g,{value:Ie,onChange:function(e){return We(e.target.value)},size:"small",fullWidth:!0,multiline:!0,minRows:3,sx:{mt:1.5,"& .MuiOutlinedInput-input":{fontSize:12}}}):t(O,{description:(null==W?void 0:W.short_description)||"—"}),o(a,e({sx:{mt:1.5,border:"0.5px solid #d1d5db",borderRadius:"8px",display:"flex",overflow:"hidden"}},{children:[t(a,e({sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",borderRight:"1px solid #d1d5db",p:.5}},{children:o(c,e({direction:"row",alignItems:"center",gap:1},{children:[t(u,e({sx:{fontSize:10,color:"#87898d"}},{children:"Total APBs :"})),t(u,e({sx:{fontSize:10,fontWeight:700,color:"#5f5f5f"}},{children:(null===(l=null==W?void 0:W.members)||void 0===l?void 0:l.length)||0}))]}))})),t(a,e({sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",p:.5}},{children:o(c,e({direction:"row",alignItems:"center",gap:1},{children:[t(u,e({sx:{fontSize:10,color:"#87898d"}},{children:"Total Lines :"})),t(u,e({sx:{fontSize:10,fontWeight:700,color:"#5f5f5f"}},{children:(null===(d=null==W?void 0:W.members)||void 0===d?void 0:d.reduce(function(e,n){var o,t;return e+((null!==(o=n.end_line)&&void 0!==o?o:0)-(null!==(t=n.start_line)&&void 0!==t?t:0)+1)},0))||0}))]}))}))]}))]})),o(a,e({sx:{flex:1,overflow:"auto",px:2,py:2,"&::-webkit-scrollbar":{width:4},"&::-webkit-scrollbar-thumb":{bgcolor:"#e5e7eb",borderRadius:2}}},{children:[o(m,e({expanded:q,onChange:function(){return J(function(e){return!e})},sx:Ye,disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:18}}),sx:qe},{children:t(u,e({sx:{fontSize:13,fontWeight:600,color:"#374151"}},{children:"Categories"}))})),t(b,e({sx:{pt:0,px:2,pb:2}},{children:o(c,e({gap:1.5},{children:[o(a,{children:[t(u,e({sx:{fontSize:12,color:"#6b7280",mb:.5}},{children:"Category"})),we?t(v,e({fullWidth:!0,size:"small",value:G,onChange:function(e){Z(e.target.value),U("")},sx:{fontSize:13,borderRadius:1.5,"& fieldset":{borderColor:"#e5e7eb"}}},{children:j.map(function(n){return t(y,e({value:n.category_id},{children:n.category_name}),n.category_id)})})):t(g,{fullWidth:!0,size:"small",value:(null===(k=j.find(function(e){return e.category_id===G}))||void 0===k?void 0:k.category_name)||"—",InputProps:{readOnly:!0},sx:{"& .MuiOutlinedInput-root":{fontSize:13,borderRadius:1.5,"& fieldset":{borderColor:"#e5e7eb"}}}})]}),o(a,{children:[t(u,e({sx:{fontSize:12,color:"#6b7280",mb:.5}},{children:"Sub-Category"})),we?t(v,e({fullWidth:!0,size:"small",value:H,onChange:function(e){return U(e.target.value)},disabled:!G,sx:{fontSize:13,borderRadius:1.5,"& fieldset":{borderColor:"#e5e7eb"}}},{children:N.filter(function(e){return e.category_id===G}).map(function(n){return t(y,e({value:n.sub_category_id},{children:n.sub_category_name}),n.sub_category_id)})})):t(g,{fullWidth:!0,size:"small",value:(null===(I=N.find(function(e){return e.sub_category_id===H}))||void 0===I?void 0:I.sub_category_name)||"—",InputProps:{readOnly:!0},sx:{"& .MuiOutlinedInput-root":{fontSize:13,borderRadius:1.5,"& fieldset":{borderColor:"#e5e7eb"}}}})]})]}))}))]})),o(m,e({expanded:Q,onChange:function(){return X(function(e){return!e})},sx:Ye,disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:18}}),sx:qe},{children:t(u,e({sx:{fontSize:13,fontWeight:600,color:"#374151"}},{children:"Atomic Prompt Blocks (APBs)"}))})),o(b,e({sx:{pt:0,px:1,pb:2}},{children:[t(c,e({gap:1},{children:(we?Ae:(null==W?void 0:W.members)||[]).map(function(n,i){return o(a,e({sx:{px:2,py:1,borderRadius:2,bgcolor:"#fff"}},{children:[o(a,e({sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",mb:1,gap:1}},{children:[o(u,e({sx:{fontSize:14,fontWeight:500,color:"#111827"}},{children:[i+1,". ",n.section_name]})),we?t(s,e({size:"small",onClick:function(){return Be(function(e){return e.filter(function(e,n){return n!==i})})},sx:{color:"#dc2626",flexShrink:0}},{children:t(L,{sx:{fontSize:16}})})):t(a,e({onClick:function(){return V(n.section_name.split("_").map(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}).join("_"))},sx:{fontSize:14,color:"#475569",cursor:"pointer",flexShrink:0}},{children:"↗"}))]})),t(u,e({sx:{fontSize:12,lineHeight:1.5,color:"#64748b"}},{children:n.reason_for_inclusion})),A&&(r=n.segments||[],0===r.length?null:t(a,e({sx:{mt:1}},{children:t(a,e({sx:{display:"flex",flexWrap:"wrap",gap:1}},{children:r.map(function(e,n){return t(h,{clickable:!0,onClick:function(){return E(e.segmentized_text)},label:e.segmentized_text,sx:{borderRadius:1,bgcolor:"#eff6ff",color:"#3b82f6",border:"1px dashed #bfdbfe"}},n)})}))}))),t(w,{sx:{mt:2}})]}),i);var r})})),we&&o(a,e({onClick:function(){Ge(""),Ue(""),Pe(!0)},sx:{mt:1,display:"flex",alignItems:"center",justifyContent:"center",gap:.5,py:1,border:"1px dashed #d1d5db",borderRadius:1.5,cursor:"pointer",color:"#5928ed",fontSize:13,fontWeight:600,"&:hover":{bgcolor:"#f5f0ff"}}},{children:[t(F,{sx:{fontSize:16}})," Add APB"]}))]}))]})),o(m,e({expanded:ee,onChange:function(){return ne(function(e){return!e})},sx:Ye,disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:18}}),sx:qe},{children:o(u,e({sx:{fontSize:14,fontWeight:600,color:"#374151",display:"flex",alignItems:"center",flexDirection:"row"}},{children:["Applicability ",t("span",e({style:{color:"#94a3b8",fontWeight:400,fontSize:10,marginLeft:"12px"}},{children:"• When to apply / When not to apply"}))]}))})),o(b,e({sx:{pt:0,px:1.5,pb:1.5}},{children:[o(m,e({expanded:te,onChange:function(){return ie(function(e){return!e})},sx:{boxShadow:"none",border:"1px solid #e5e7eb",borderRadius:"6px !important",mb:1,"&:before":{display:"none"},"&.Mui-expanded":{margin:"0 0 8px 0"}},disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:16}}),sx:e(e({},qe),{bgcolor:"#f9fafb",borderRadius:"6px"})},{children:t(u,e({sx:{fontSize:12.5,fontWeight:500,color:"#374151"}},{children:"When to Apply this FPB"}))})),t(b,e({sx:{pt:.5,px:2,pb:1.5}},{children:o(c,e({gap:.75},{children:[(we?Le:Array.isArray(null==W?void 0:W.when_to_apply)?W.when_to_apply:(null==W?void 0:W.when_to_apply)?[W.when_to_apply]:["— Not yet available"]).map(function(n,i){return we?t(P,{value:n,onChange:function(e){return De(function(n){return n.map(function(n,o){return o===i?e:n})})},onDelete:function(){return De(function(e){return e.filter(function(e,n){return n!==i})})}},i):o(c,e({direction:"row",gap:1,alignItems:"flex-start"},{children:[o(u,e({sx:{fontSize:12,color:"#374151",fontWeight:700,mt:.1}},{children:[i+1,"."]})),t(u,e({sx:{fontSize:12.5,color:"#374151",lineHeight:1.55}},{children:n}))]}),i)}),we&&o(a,e({onClick:function(){return De(function(e){return n(n([],e,!0),[""],!1)})},sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:.5,py:.75,border:"1px dashed #d1d5db",borderRadius:1.5,cursor:"pointer",color:"#5928ed",fontSize:12.5,fontWeight:600,"&:hover":{bgcolor:"#f5f0ff"}}},{children:[t(F,{sx:{fontSize:15}})," Add When to Apply"]}))]}))}))]})),o(m,e({expanded:le,onChange:function(){return de(function(e){return!e})},sx:{boxShadow:"none",border:"1px solid #e5e7eb",borderRadius:"6px !important","&:before":{display:"none"}},disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:16}}),sx:e(e({},qe),{bgcolor:"#f9fafb",borderRadius:"6px"})},{children:t(u,e({sx:{fontSize:12.5,fontWeight:500,color:"#374151"}},{children:"When NOT to Apply this FPB"}))})),t(b,e({sx:{pt:.5,px:2,pb:1.5}},{children:we?o(c,e({gap:.75},{children:[Te.map(function(e,n){return t(P,{value:e,onChange:function(e){return Ve(function(o){return o.map(function(o,t){return t===n?e:o})})},onDelete:function(){return Ve(function(e){return e.filter(function(e,o){return o!==n})})}},n)}),o(a,e({onClick:function(){return Ve(function(e){return n(n([],e,!0),[""],!1)})},sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:.5,py:.75,border:"1px dashed #d1d5db",borderRadius:1.5,cursor:"pointer",color:"#5928ed",fontSize:12.5,fontWeight:600,"&:hover":{bgcolor:"#f5f0ff"}}},{children:[t(F,{sx:{fontSize:15}})," Add When NOT to Apply"]}))]})):Array.isArray(null==W?void 0:W.when_not_to_apply)||(null==W?void 0:W.when_not_to_apply)?t(c,e({gap:.75},{children:(Array.isArray(null==W?void 0:W.when_not_to_apply)?W.when_not_to_apply:[W.when_not_to_apply]).map(function(n,i){return o(c,e({direction:"row",gap:1,alignItems:"flex-start"},{children:[o(u,e({sx:{fontSize:12,color:"#374151",fontWeight:700,mt:.1}},{children:[i+1,"."]})),t(u,e({sx:{fontSize:12.5,color:"#374151",lineHeight:1.55}},{children:n}))]}),i)})})):t(u,e({sx:{fontSize:12.5,color:"#9ca3af",fontStyle:"italic"}},{children:"No conditions defined yet."}))}))]}))]}))]})),o(m,e({expanded:ce,onChange:function(){return se(function(e){return!e})},sx:Ye,disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:18}}),sx:qe},{children:o(u,e({sx:{fontSize:14,fontWeight:600,color:"#374151",display:"flex",alignItems:"center",flexDirection:"row"}},{children:["Specifications ",t("span",e({style:{color:"#94a3b8",fontWeight:400,fontSize:10,marginLeft:"12px"}},{children:"• Strict Rules / Input / Output"}))]}))})),t(b,e({sx:{pt:0,px:1.5,pb:1.5}},{children:[{label:"Guidelines",expanded:fe,setExpanded:pe,content:null==W?void 0:W.additional_guidelines},{label:"Input",expanded:ge,setExpanded:me,content:null},{label:"Output",expanded:be,setExpanded:ve,content:null}].map(function(n,i){var r=n.label,l=n.expanded,d=n.setExpanded,a=n.content;return o(m,e({expanded:l,onChange:function(){return d(function(e){return!e})},sx:{boxShadow:"none",border:"1px solid #e5e7eb",borderRadius:"6px !important",mb:i<2?1:0,"&:before":{display:"none"},"&.Mui-expanded":{margin:i<2?"0 0 8px 0":0}},disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:16}}),sx:e(e({},qe),{bgcolor:"#f9fafb",borderRadius:"6px"})},{children:o(c,e({direction:"row",alignItems:"center",gap:.5},{children:[t(u,e({sx:{fontSize:12.5,fontWeight:500,color:"#374151"}},{children:r})),"Guidelines"!==r&&t(R,{sx:{fontSize:13,color:"#9ca3af"}})]}))})),t(b,e({sx:{pt:.5,px:2,pb:1.5}},{children:t(u,e({sx:{fontSize:12.5,color:a?"#374151":"#9ca3af",fontStyle:a?"normal":"italic"}},{children:a||"No ".concat(r.toLowerCase()," defined yet.")}))}))]}),r)})}))]}))]})),o(S,e({open:Oe,onClose:function(){return Pe(!1)},maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{borderRadius:"12px"}}},{children:[o(a,e({sx:{px:3,py:2,display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e5e7eb"}},{children:[t(u,e({sx:{fontWeight:700,fontSize:"1rem",color:"#111827"}},{children:"Add new APB"})),t(s,e({size:"small",onClick:function(){return Pe(!1)}},{children:t(_,{sx:{fontSize:"1.1rem",color:"#6b7280"}})}))]})),o(a,e({sx:{px:3,py:2.5,display:"flex",flexDirection:"column",gap:2}},{children:[o(a,{children:[t(u,e({sx:{fontSize:13,fontWeight:600,color:"#374151",mb:.75}},{children:"Title"})),t(g,{fullWidth:!0,size:"small",placeholder:"Specify the title of APB",value:Ne,onChange:function(e){return Ge(e.target.value)}})]}),o(a,{children:[t(u,e({sx:{fontSize:13,fontWeight:600,color:"#374151",mb:.75}},{children:"Description"})),t(g,{fullWidth:!0,size:"small",multiline:!0,minRows:3,placeholder:"Describe the APB",value:Ze,onChange:function(e){return Ue(e.target.value)}})]})]})),o(a,e({sx:{px:3,py:2,display:"flex",justifyContent:"flex-end",gap:1,borderTop:"1px solid #e5e7eb"}},{children:[t(f,e({variant:"outlined",onClick:function(){return Pe(!1)},sx:{textTransform:"none",borderColor:"#d1d5db",color:"#374151"}},{children:"Cancel"})),t(f,e({variant:"contained",onClick:function(){Be(function(e){return n(n([],e,!0),[{section_name:Ne,reason_for_inclusion:Ze,content:""}],!1)}),Pe(!1)},sx:{textTransform:"none",bgcolor:"#5928ed","&:hover":{bgcolor:"#4c1d95"}}},{children:"Save"}))]}))]}))]}))},H=function(n){var i,l,d,p,h,g=n.block,m=n.onBlockUpdate,x=n.isExtracting,b=n.isExtracted,v=n.onExtractSegments,y=n.isSaving,w=n.isSaved,S=n.onSave,z=n.onBack,C=n.title,R=void 0===C?"FPB Promptemon":C,B=n.categories,F=n.subCategories,L=n.selectedCategoryId,D=n.selectedSubCategoryId,M=n.onCategoryChange,T=n.onSubCategoryChange,V=n.showEditMode,E=void 0===V||V,O=n.showExtractSegments,P=void 0===O||O,H=r(1),Z=H[0],U=H[1],Y=r(!0),q=Y[0],J=Y[1],K=r(""),Q=K[0],X=K[1],$=r(""),ee=$[0],ne=$[1],oe=(null===(i=null==g?void 0:g.members)||void 0===i?void 0:i.map(function(e){if(!b||!e.segments||0===e.segments.length)return e.content||"";var n=e.content||"";return e.segments.forEach(function(e){e.raw_text&&e.segmentized_text&&(n=n.split(e.raw_text).join(e.segmentized_text))}),n}).join("\n\n"))||"";return o(a,e({sx:{width:"100%",height:"100%",display:"flex",flexDirection:"column",bgcolor:"#fff",overflow:"hidden"}},{children:[o(a,e({sx:{px:2.5,py:1.5,borderBottom:"1px solid #e5e7eb",display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#fff",flexShrink:0}},{children:[o(c,e({direction:"row",alignItems:"center",gap:1},{children:[t(s,e({size:"small",sx:{color:"#6b7280"},onClick:z},{children:t(k,{sx:{fontSize:18}})})),t(u,e({sx:{fontSize:14,fontWeight:600,color:"#111827"}},{children:R}))]})),o(a,e({sx:{display:"flex",alignItems:"center",gap:1}},{children:[t(f,e({variant:"contained",size:"small",disabled:!b||y||w,onClick:S,sx:{textTransform:"none",fontSize:"0.78rem",fontWeight:600,bgcolor:"#5928ed",px:2,py:.6,"&:hover":{bgcolor:"#4c1d95"},"&.Mui-disabled":{bgcolor:"#5928ed",color:"#fff",opacity:.4}}},{children:y?"Saving...":w?"Saved ✓":"Save FPB"})),t(s,e({size:"small",sx:{color:"#6b7280"},onClick:z},{children:t(_,{sx:{fontSize:18}})}))]}))]})),o(a,e({sx:{display:"flex",flex:1,overflow:"hidden"}},{children:[t(G,{block:g,isExtracted:b,isSaved:w,showEditMode:E,onBlockUpdate:m,onTagSelect:function(e){X(""),setTimeout(function(){return X(e)},50)},onVariableSelect:function(e){ne(""),setTimeout(function(){return ne(e)},50)},categories:B,subCategories:F,selectedCategoryId:L,selectedSubCategoryId:D,onCategoryChange:M,onSubCategoryChange:T}),o(a,e({sx:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",p:2,gap:1.5}},{children:[o(a,e({sx:{display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0}},{children:[o(c,e({direction:"row",alignItems:"center",gap:1},{children:[o(u,e({sx:{fontSize:13,fontWeight:600,color:"#374151"}},{children:[(null==g?void 0:g.title)||"—"," APBs"]})),o(c,e({direction:"row",alignItems:"center",gap:.5},{children:[t(s,e({size:"small",onClick:function(){return U(function(e){return Math.max(1,e-1)})},disabled:1===Z,sx:{color:"#6b7280",p:.4}},{children:t(I,{sx:{fontSize:16}})})),o(u,e({sx:{fontSize:12.5,color:"#6b7280"}},{children:[Z," of ",(null===(l=null==g?void 0:g.members)||void 0===l?void 0:l.length)||0]})),t(s,e({size:"small",onClick:function(){return U(function(e){var n;return Math.min((null===(n=null==g?void 0:g.members)||void 0===n?void 0:n.length)||0,e+1)})},disabled:Z===((null===(d=null==g?void 0:g.members)||void 0===d?void 0:d.length)||0),sx:{color:"#6b7280",p:.4}},{children:t(W,{sx:{fontSize:16}})}))]}))]})),t(c,e({direction:"row",alignItems:"center",gap:1.5},{children:P&&(b?o(c,e({direction:"row",alignItems:"center",gap:1},{children:[t(u,e({sx:{fontSize:12.5,color:"#6b7280"}},{children:"Show Segments"})),t(a,e({sx:{width:36,height:20,borderRadius:"10px",bgcolor:"#7c3aed",display:"flex",alignItems:"center",px:.3,cursor:"pointer"}},{children:t(a,{sx:{width:14,height:14,borderRadius:"50%",bgcolor:"#fff",ml:"auto"}})}))]})):o(a,e({onClick:v,sx:{display:"flex",alignItems:"center",gap:1,px:2,py:.85,borderRadius:1.5,bgcolor:"#7c3aed",cursor:x?"default":"pointer","&:hover":{bgcolor:"#6d28d9"},userSelect:"none",opacity:x?.7:1}},{children:[t(A,{sx:{fontSize:15,color:"#fff"}}),t(u,e({sx:{fontSize:13,fontWeight:600,color:"#fff"}},{children:x?"Extracting...":"Extract Segments"}))]})))}))]})),o(a,e({sx:{flex:1,minHeight:0,position:"relative"}},{children:[x&&t(a,e({sx:{position:"absolute",top:0,left:0,right:0,bottom:0,bgcolor:"rgba(0,0,0,0.6)",zIndex:10,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:1}},{children:t(u,e({sx:{color:"#fff",fontSize:14,fontWeight:600}},{children:"Extracting segments..."}))})),o(a,e({sx:{border:"1px solid #30363d",borderRadius:1,overflow:"hidden",height:"100%"}},{children:[o(a,e({sx:{px:2,py:1,borderBottom:"1px solid #30363d",display:"flex",alignItems:"center",gap:1,bgcolor:"#161b22",flexShrink:0}},{children:[t(a,{sx:{width:12,height:12,borderRadius:"50%",bgcolor:"#ff5f57"}}),t(a,{sx:{width:12,height:12,borderRadius:"50%",bgcolor:"#febc2e"}}),t(a,{sx:{width:12,height:12,borderRadius:"50%",bgcolor:"#28c840"}}),o(u,e({sx:{ml:1,fontSize:11,color:"#8b949e",fontFamily:"monospace"}},{children:[(null===(h=null===(p=null==g?void 0:g.members)||void 0===p?void 0:p[Z-1])||void 0===h?void 0:h.section_name)||"—",".xml"]})),t(a,{sx:{flex:1}}),t(j,{isDarkMode:q,onChange:J})]})),t(N,{content:oe,selectedTag:Q,highlightVariable:ee,isDarkMode:q,height:"100%",fontSize:14})]}))]}))]}))]}))]}))};export{H as default};
2
2
  //# sourceMappingURL=PromptemonViewer.js.map
@@ -0,0 +1,2 @@
1
+ import{__assign as e}from"tslib";import{jsxs as n,jsx as i}from"react/jsx-runtime";import{useState as o,useMemo as t}from"react";import{Box as r}from"@mui/system";import{Typography as l,Chip as a,IconButton as c,Accordion as d,AccordionSummary as s,AccordionDetails as h,Divider as f}from"@mui/material";import m from"@mui/icons-material/Close";import u from"@mui/icons-material/ExpandMore";import{LightbulbOutlined as g,ManageSearchOutlined as p,ChatBubbleOutlineOutlined as x}from"@mui/icons-material";import v from"@mui/icons-material/AutoAwesome";import b from"../ChatCitation/ChatCitationRenderer.js";var y=function(e){var n=document.createElement("div");return n.innerHTML=e,Array.from(n.querySelectorAll("li")).map(function(e){return e.innerHTML})},_=function(){return i(r,e({component:"svg",viewBox:"0 0 24 24",sx:{width:14,height:14,fill:"#5928ed"}},{children:i("path",{d:"M12 2a7 7 0 0 0-4 12.74V17a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2v-2.26A7 7 0 0 0 12 2zm-1 19h2v1h-2v-1z"})}))},k=function(k){var S,C=k.open,z=k.onClose,w=k.data,I=o(null),A=I[0],R=I[1],B=t(function(){var e;return A&&w&&null!==(e=w.block_cognitive_citations.find(function(e){return String(e.citation_number)===A}))&&void 0!==e?e:null},[A,w]),W=t(function(){return(null==w?void 0:w.block_cognitive_reasoning_html)?y(w.block_cognitive_reasoning_html):[]},[null==w?void 0:w.block_cognitive_reasoning_html]),D=t(function(){return(null==w?void 0:w.block_cognitive_gap_html)?y(w.block_cognitive_gap_html):[]},[null==w?void 0:w.block_cognitive_gap_html]),M=function(o,t){for(var l,a,c=[],d=/<a[^>]*href="([^"]+)"[^>]*>(.*?)<\/a>/g,s=0,h=0,f=function(){var f=a[1].replace(/^.*\$/,""),m=a[2],u=A===f;a.index>s&&c.push(i("span",{children:o.substring(s,a.index)},"txt-".concat(t,"-").concat(h++))),c.push(n("span",{children:[n("span",e({onClick:function(){return R(function(e){return e===f?null:f})},style:{color:"#2563EB",fontWeight:500,cursor:"pointer",textDecoration:"underline"}},{children:[m,i(x,{sx:{fontSize:"12px",ml:.2}})]})),u&&B&&i(r,e({sx:{maxHeight:"35vh",padding:"6px",overflow:"auto",backgroundColor:"#ffffff",mt:1}},{children:i(b,{showRootContainer:!1,rootContainer:{relevanceScore:null!==(l=null==w?void 0:w.block_cognitive_confidence)&&void 0!==l?l:0,slotStyles:{container:{border:"",paddingLeft:"-20px",color:"black"}}},ruleBookContainer:{title:B.title||B.section_ref||"Rule Book",data:{content:B.content||B.paraphrase||"",highlighted_texts:Array.isArray(B.highlight)?B.highlight:B.highlight?[B.highlight]:[]},slotStyles:{outerContainer:{margin:"0",color:"black",minHeight:"350px"}}},additionalData:{RuleBookDetailedViewVerticallyStacked:!0},reversePanels:!0})}))]},"anchor-".concat(t,"-").concat(f))),s=d.lastIndex};null!==(a=d.exec(o));)f();return s<o.length&&c.push(i("span",{children:o.substring(s)},"txt-end-".concat(t,"-").concat(h++))),c};return C?n(r,e({sx:{width:"min(500px, calc(100vw - 16px))",maxWidth:"calc(100vw - 16px)",maxHeight:"80vh",borderRadius:3,display:"flex",flexDirection:"column",overflow:"hidden",border:"1px solid #e0e0e0",backgroundColor:"#fff"}},{children:[n(r,e({sx:{px:2,py:1,borderBottom:"1px solid #e0e0e0",display:"flex",justifyContent:"space-between",alignItems:"center",flexShrink:0,backgroundColor:"#e9ecfd"}},{children:[n(r,e({display:"flex",alignItems:"center",gap:1},{children:[i(_,{}),i(l,e({fontWeight:500,sx:{fontSize:"0.72rem"}},{children:"Cognitive Decisioning AI"}))]})),n(r,e({display:"flex",alignItems:"center",gap:1},{children:[i(a,{icon:i(v,{sx:{fontSize:12}}),label:"AI Relevance: ".concat(null!==(S=null==w?void 0:w.block_cognitive_confidence)&&void 0!==S?S:0,"%"),size:"small",sx:{fontWeight:500,fontSize:"0.68rem",backgroundColor:"#ffffff",color:"#000000",border:"1px solid #ac93f6",height:20,"& .MuiChip-label":{fontSize:"0.68rem",px:.75}}}),i(c,e({size:"small",onClick:z},{children:i(m,{fontSize:"small"})}))]}))]})),n(r,e({sx:{flex:1,overflowY:"auto",p:.5}},{children:[n(d,e({defaultExpanded:!0,disableGutters:!0,elevation:0},{children:[i(s,e({expandIcon:i(u,{})},{children:n(l,e({sx:{display:"flex",alignItems:"center",gap:.8,fontSize:"0.78rem"},fontWeight:600},{children:[i(r,e({sx:{width:24,height:24,borderRadius:"50%",backgroundColor:"#e9ecfd",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},{children:i(g,{sx:{fontSize:14,color:"#5928ed"}})})),"Decision Making Factors"]}))})),i(h,{children:i(r,e({sx:{padding:0,margin:0}},{children:W.length>0?W.map(function(o,t){return n(r,e({sx:{marginBottom:"6px",display:"flex",gap:1}},{children:[n(l,e({variant:"body2",sx:{fontWeight:500,fontSize:"0.75rem"}},{children:[t+1,"."]})),i(r,e({sx:{flex:1}},{children:i(l,e({variant:"body2",component:"span",sx:{fontSize:"0.75rem"}},{children:M(o,t)}))}))]}),t)}):i(l,e({variant:"body2",color:"gray",sx:{mb:.5,pl:3,fontSize:"0.72rem"}},{children:"No Reasons Found"}))}))})]})),i(f,{}),n(d,e({disableGutters:!0,elevation:0},{children:[i(s,e({expandIcon:i(u,{})},{children:n(l,e({sx:{display:"flex",alignItems:"center",gap:.8,fontSize:"0.78rem"},fontWeight:600},{children:[i(r,e({sx:{width:24,height:24,borderRadius:"50%",backgroundColor:"#e9ecfd",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},{children:i(p,{sx:{fontSize:14,color:"#5928ed"}})})),"Gaps in Decision"]}))})),i(h,{children:i(r,e({sx:{padding:0,margin:0}},{children:D.length>0?D.map(function(o,t){return n(r,e({sx:{marginBottom:"6px",display:"flex",gap:1}},{children:[n(l,e({variant:"body2",sx:{fontWeight:500,fontSize:"0.75rem"}},{children:[t+1,"."]})),i(l,{variant:"body2",component:"span",sx:{fontSize:"0.75rem"},dangerouslySetInnerHTML:{__html:o}})]}),t)}):i(l,e({variant:"body2",color:"gray",sx:{mb:.5,pl:3,fontSize:"0.72rem"}},{children:"No Gaps Found"}))}))})]}))]}))]})):null};export{k as default};
2
+ //# sourceMappingURL=Cognitivereasoningpanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Cognitivereasoningpanel.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{__assign as e,__spreadArray as n}from"tslib";import{jsxs as t,Fragment as r,jsx as i}from"react/jsx-runtime";import a,{useState as o,useCallback as l,useRef as c,useMemo as d,useEffect as s}from"react";import f from"@mui/material/Dialog";import u from"@mui/icons-material/Fullscreen";import h from"@mui/icons-material/CloseFullscreen";var p=170,g=48,y=["#ede9fe","#e0f2fe","#fef3c7","#dcfce7","#ffe4e6","#f0fdf4","#fef9c3","#e0e7ff","#fce7f3","#f1f5f9"],v=["#7c3aed","#0284c7","#b45309","#16a34a","#e11d48","#15803d","#a16207","#4338ca","#db2777","#475569"],x=["⚙","◈","⟐","✦","◎","⬡","◇","⊕","✶","◉"],b=["#a78bfa","#7dd3fc","#fbbf24","#86efac","#fda4af","#6ee7b7","#fde047","#a5b4fc","#f9a8d4","#94a3b8"],m=["linear-gradient(135deg,#7c3aed,#a78bfa)","linear-gradient(135deg,#0284c7,#38bdf8)","linear-gradient(135deg,#b45309,#fbbf24)","linear-gradient(135deg,#16a34a,#86efac)","linear-gradient(135deg,#e11d48,#fda4af)","linear-gradient(135deg,#15803d,#6ee7b7)","linear-gradient(135deg,#a16207,#fde047)","linear-gradient(135deg,#4338ca,#a5b4fc)","linear-gradient(135deg,#db2777,#f9a8d4)","linear-gradient(135deg,#475569,#94a3b8)"];function w(t){var r=Array.isArray(null==t?void 0:t.clusters)?t.clusters:[],i=Array.isArray(null==t?void 0:t.nodes)?t.nodes:[],a=Array.isArray(null==t?void 0:t.edges)?t.edges:[],o=function(e,t,r){var i;void 0===e&&(e=[]),void 0===t&&(t=[]),void 0===r&&(r=[]);var a=Array.isArray(e)?e:[],o=Array.isArray(t)?t:[],l=Array.isArray(r)?r:[],c=a.length;if(0===c)return new Map;var d={};a.forEach(function(e,n){d[e.id]=n});var s={},f={};a.forEach(function(e){s[e.id]=[],f[e.id]=[]}),o.forEach(function(e){s[e.source]&&s[e.source].push(e.target),f[e.target]&&f[e.target].push(e.source)});var u={};a.forEach(function(e){u[e.id]=0});for(var h=0;h<c;h++){for(var p=!1,g=0,y=o;g<y.length;g++){var v=y[g],x=(u[v.source]||0)+1;x>(u[v.target]||0)&&x<c&&(u[v.target]=x,p=!0)}if(!p)break}var b={};l.forEach(function(e,n){b[e.id]=n});var m={};l.forEach(function(e){m[e.id]=[]}),a.forEach(function(e){var n;null===(n=m[e.cluster_id])||void 0===n||n.push(e)}),Object.values(m).forEach(function(e){return e.sort(function(e,n){return(u[e.id]||0)-(u[n.id]||0)})});for(var w=new Float64Array(c),M=new Float64Array(c),k=new Float64Array(c),S=new Float64Array(c),C=function(e){var n=null!==(i=b[e.id])&&void 0!==i?i:0;(m[e.id]||[]).forEach(function(e,t){var r=d[e.id];w[r]=520*n+280,M[r]=200*t+120})},z=0,E=l;z<E.length;z++)C(V=E[z]);for(var A=.0015,F=Math.max.apply(Math,n(n([],a.map(function(e){return u[e.id]||0}),!1),[1],!1)),I=new Float64Array(c),W=0;W<c;W++)I[W]=(u[a[W].id]||0)/F*(200*c*.6)+120;for(var R=0;R<350;R++){var D=Math.max(.015,1-R/350),Y=new Float64Array(c),_=new Float64Array(c);for(W=0;W<c;W++)for(var j=W+1;j<c;j++){var P=(Q=w[W]-w[j])*Q+(U=M[W]-M[j])*U;P<400&&(P=(Q=12*(W-j))*Q+(U=8*(W+j))*U);var B=Q/(O=Math.sqrt(P))*(q=48e4/P),L=U/O*q;Y[W]+=B,_[W]+=L,Y[j]-=B,_[j]-=L}for(var X=0,N=o;X<N.length;X++){v=N[X];var T=d[v.source],H=d[v.target];if(void 0!==T&&void 0!==H){var O,q,Q=w[H]-w[T],U=M[H]-M[T];if(!((O=Math.sqrt(Q*Q+U*U))<1))B=Q/O*(q=.004*(O-380)),L=U/O*q,Y[T]+=B,_[T]+=L,Y[H]-=B,_[H]-=L}}var G={},J={},K={};for(W=0;W<c;W++)G[V=a[W].cluster_id]=(G[V]||0)+w[W],J[V]=(J[V]||0)+M[W],K[V]=(K[V]||0)+1;for(W=0;W<c;W++){var V=a[W].cluster_id;Y[W]+=(G[V]/K[V]-w[W])*A,_[W]+=(J[V]/K[V]-M[W])*A}for(W=0;W<c;W++)_[W]+=.002*(I[W]-M[W]);for(W=0;W<c;W++)k[W]=.84*(k[W]+Y[W])*D,S[W]=.84*(S[W]+_[W])*D,w[W]+=k[W],M[W]+=S[W]}for(h=0;h<40;h++){var Z=!1;for(W=0;W<c;W++)for(j=W+1;j<c;j++){Q=w[W]-w[j],U=M[W]-M[j];var $=270-Math.abs(Q),ee=128-Math.abs(U);if($>0&&ee>0)if(Z=!0,$<ee){var ne=$/2+5;w[W]+=Q>0?ne:-ne,w[j]-=Q>0?ne:-ne}else ne=ee/2+5,M[W]+=U>0?ne:-ne,M[j]-=U>0?ne:-ne}if(!Z)break}var te=1/0,re=1/0;for(W=0;W<c;W++)te=Math.min(te,w[W]),re=Math.min(re,M[W]);var ie=new Map;for(W=0;W<c;W++)ie.set(a[W].id,{x:Math.round(w[W]-te+80),y:Math.round(M[W]-re+80)});return ie}(i,a,r),l=i.map(function(n){var t=o.get(n.id)||{x:0,y:0};return e(e({},n),{x:t.x,y:t.y})}),c={};r.forEach(function(e,n){c[e.id]=n});var d={};r.forEach(function(e){d[e.id]=[]}),l.forEach(function(e){var n;null===(n=d[e.cluster_id])||void 0===n||n.push(e)});var s=36,f=r.map(function(e){var n=d[e.id];if(!n.length)return null;var t=Math.min.apply(Math,n.map(function(e){return e.x})),r=Math.min.apply(Math,n.map(function(e){return e.y})),i=Math.max.apply(Math,n.map(function(e){return e.x+p})),a=Math.max.apply(Math,n.map(function(e){return e.y+g}));return{id:e.id,label:e.label,idx:c[e.id],x:t-s,y:r-s,width:i-t+72,height:a-r+72+22}}).filter(function(e){return null!==e});return{nodes:l.map(function(n){var t;return e(e({},n),{cluster:null!==(t=c[n.cluster_id])&&void 0!==t?t:0})}),edges:a,clusterBounds:f,canvasW:Math.max.apply(Math,l.map(function(e){return e.x+p}))+72,canvasH:Math.max.apply(Math,l.map(function(e){return e.y+g}))+72}}function M(e,n,t){var r=n[e.source],i=n[e.target];if(!r||!i)return"";var a=function(e,n){var t=e.x+85,r=e.y+24,i=n.x+85,a=n.y+24;function o(e,n,t,r){var i=t-e,a=r-n;return Math.abs(a)>.4*Math.abs(i)?a>0?{x:e,y:n+24}:{x:e,y:n-24}:i>0?{x:e+85,y:n}:{x:e-85,y:n}}return{source:o(t,r,i,a),target:o(i,a,t,r)}}(r,i),o=a.source,l=a.target,c=l.x-o.x,d=l.y-o.y,s=Math.sqrt(c*c+d*d);if(s<5)return"M ".concat(o.x," ").concat(o.y," L ").concat(l.x," ").concat(l.y);if(i.y+150<r.y&&i.y<r.y-g){var f=Math.min(r.x,i.x)-110;return"M ".concat(o.x," ").concat(o.y," C ").concat(f," ").concat(o.y,", ").concat(f," ").concat(l.y,", ").concat(l.x," ").concat(l.y)}var u=-d/s,h=c/s;if(t.some(function(n){return n.source===e.target&&n.target===e.source})){var p=e.source<e.target?1:-1,y=Math.max(.18*s,40)*p,v=(o.x+l.x)/2+u*y,x=(o.y+l.y)/2+h*y;return"M ".concat(o.x," ").concat(o.y," Q ").concat(v," ").concat(x," ").concat(l.x," ").concat(l.y)}var b=Math.min(.12*s,55),m=(o.x+l.x)/2+u*b,w=(o.y+l.y)/2+h*b;return"M ".concat(o.x," ").concat(o.y," Q ").concat(m," ").concat(w," ").concat(l.x," ").concat(l.y)}function k(n){var a,f,k=n.data,S=n.onFullscreen,C=n.isFullscreen,z=n.isDarkMode,E=void 0!==z&&z,A=c(null),F=o({x:0,y:0}),I=F[0],W=F[1],R=o(.5),D=R[0],Y=R[1],_=o(!1),j=_[0],P=_[1],B=c({x:0,y:0}),L=c({x:0,y:0}),X=o(null),N=X[0],T=X[1],H=o(null),O=H[0],q=H[1],Q=o(null),U=Q[0],G=Q[1],J=o(null),K=J[0],V=J[1],Z=d(function(){return w(k)},[k]),$=d(function(){var e={};return Z.nodes.forEach(function(n){e[n.id]=n}),e},[Z]),ee=d(function(){var e={};return k.clusters.forEach(function(n,t){e[n.id]=t}),e},[k]),ne=d(function(){return K?new Set(Z.edges.filter(function(e){return e.source===K||e.target===K}).map(function(e){return e.id})):new Set},[K,Z.edges]),te=d(function(){if(!K)return new Set;var e=new Set([K]);return Z.edges.forEach(function(n){n.source===K&&e.add(n.target),n.target===K&&e.add(n.source)}),e},[K,Z.edges]),re=d(function(){return new Date(k.last_analyzed_at).toLocaleString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0,day:"numeric",month:"short",year:"numeric"})},[k.last_analyzed_at]),ie=l(function(n){n.target.closest("[data-edge-hit]")||n.target.closest("[data-node]")||(P(!0),B.current={x:n.clientX,y:n.clientY},L.current=e({},I),n.currentTarget.style.cursor="grabbing")},[I]),ae=l(function(e){j&&W({x:L.current.x+(e.clientX-B.current.x),y:L.current.y+(e.clientY-B.current.y)})},[j]),oe=l(function(){P(!1),A.current&&(A.current.style.cursor="grab")},[]),le=l(function(e){e.preventDefault(),Y(function(n){return Math.min(2.5,Math.max(.2,n-.001*e.deltaY))})},[]);s(function(){var e=A.current;return e&&e.addEventListener("wheel",le,{passive:!1}),function(){return null==e?void 0:e.removeEventListener("wheel",le)}},[le]);var ce={width:32,height:32,border:"none",background:"transparent",borderRadius:8,cursor:"pointer",fontSize:16,color:E?"#cbd5e1":"#475569",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500};return t("div",e({style:{width:"100%",height:"100%",background:E?"#090d16":"#ffffff",fontFamily:"'Inter', -apple-system, BlinkMacSystemFont, sans-serif",position:"relative",overflow:"hidden"}},{children:[t("div",e({style:{position:"absolute",top:0,left:0,right:0,zIndex:20,borderBottom:C?E?"1px solid #1e293b":"1px solid #f1f5f9":"none",background:E?"#090d16":C?"#fff":"transparent"}},{children:[t("div",e({style:{padding:"10px 14px",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[t("div",{children:[C&&i("h2",e({style:{margin:0,fontSize:17,fontWeight:700,color:E?"#f8fafc":"#1e293b"}},{children:"Dependency Graph"})),t("p",e({style:{margin:"2px 0 0",fontSize:12,color:"#94a3b8"}},{children:["Last analyzed: ".concat(re||""," · "),"Click a node or connection to explore details and dependencies."]}))]}),t("div",e({style:{display:"flex",gap:6,alignItems:"center"}},{children:[t("div",e({style:{display:"flex",gap:2,background:E?"#1e293b":"#fff",borderRadius:10,padding:3,boxShadow:E?"0 1px 4px rgba(0,0,0,0.4)":"0 1px 4px rgba(0,0,0,0.08)"}},{children:[i("button",e({onClick:function(){return Y(function(e){return Math.max(.2,e-.15)})},style:ce},{children:"−"})),t("button",e({onClick:function(){Y(.5),W({x:0,y:0})},style:e(e({},ce),{fontSize:11,width:52,fontWeight:600})},{children:[Math.round(100*D)||0,"%"]})),i("button",e({onClick:function(){return Y(function(e){return Math.min(2.5,e+.15)})},style:ce},{children:"+"}))]})),S&&i("div",e({style:{display:"flex",background:E?"#1e293b":"#fff",borderRadius:10,padding:3,boxShadow:E?"0 1px 4px rgba(0,0,0,0.4)":"0 1px 4px rgba(0,0,0,0.08)"}},{children:i("button",e({onClick:S,style:ce},{children:i(C?h:u,{style:{fontSize:16}})}))}))]}))]})),O&&i("div",e({style:{margin:"0 20px 14px",width:"30%",minWidth:280,borderRadius:12,overflow:"hidden",boxShadow:"0 2px 12px rgba(0,0,0,0.07)",border:"1px solid #e2e8f0",animation:"slideDown 0.2s ease-out"}},{children:function(){var n,r,a=O.node,o=null!==(n=ee[a.cluster_id])&&void 0!==n?n:0;return Z.edges.filter(function(e){return e.source===a.id}).length,Z.edges.filter(function(e){return e.target===a.id}).length,t("div",{children:[t("div",e({style:{padding:"10px 14px",background:m[o%m.length||0],color:"#fff",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[t("div",e({style:{display:"flex",alignItems:"center",gap:10}},{children:[i("span",e({style:{width:28,height:28,borderRadius:8,background:"rgba(255,255,255,0.2)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:14}},{children:x[o%x.length||0]})),t("div",{children:[i("div",e({style:{fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",opacity:.75}},{children:(null===(r=k.clusters[o])||void 0===r?void 0:r.label)||"Cluster Name"})),i("div",e({style:{fontSize:14,fontWeight:700,marginTop:1}},{children:a.label||"Cluster Name"}))]})]})),i("button",e({onClick:function(){q(null),V(null)},style:{background:"rgba(255,255,255,0.2)",border:"none",color:"#fff",borderRadius:6,width:24,height:24,cursor:"pointer",fontSize:14,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},{children:"×"}))]})),i("div",e({style:{padding:"10px 14px",fontSize:13,lineHeight:1.6,color:E?"#cbd5e1":"#475569",background:E?"#1e293b":"#fff"}},{children:a.description||"No description available..."}))]})}()}))]})),t("div",e({ref:A,onPointerDown:ie,onPointerMove:ae,onPointerUp:oe,onPointerLeave:oe,onClick:function(){T(null),q(null),V(null)},style:{width:"100%",height:"100%",cursor:j?"grabbing":"grab",position:"relative"}},{children:[i("div",e({style:{transform:"translate(".concat(I.x,"px, ").concat(I.y,"px) scale(").concat(D,")"),transformOrigin:"top left",position:"absolute",top:C?70:50,left:20,transition:j?"none":"transform 0.08s ease-out"}},{children:t("svg",e({width:Z.canvasW,height:Z.canvasH,style:{overflow:"visible"}},{children:[Z.clusterBounds.map(function(n){return t("g",{children:[i("rect",{x:n.x,y:n.y,width:n.width,height:n.height,rx:"16",fill:E?"rgba(30, 41, 59, 0.35)":"none",stroke:E?"#334155":"#e2e8f0",strokeWidth:"1.5",strokeDasharray:"8 4"}),i("text",e({x:n.x+14,y:n.y+n.height-10,fontSize:"11",fill:"#94a3b8",fontFamily:"Inter, sans-serif",fontWeight:"500"},{children:n.label||"Cluster Name"}))]},n.id)}),Z.edges.map(function(n){var a=M(n,$,Z.edges);if(!a)return null;var o=ne.has(n.id),l=(null==N?void 0:N.edge.id)===n.id,c=U===n.id,d=o||l?"#6366f1":c?"#818cf8":E?"#475569":"#cbd5e1",s=o||l?2.5:c?2:1.5;return t("g",e({style:{opacity:!!K&&!o?.1:1,transition:"opacity 0.25s"}},{children:[i("path",{"data-edge-hit":"true",d:a,fill:"none",stroke:"transparent",strokeWidth:18,style:{cursor:"pointer"},onClick:function(e){return function(e,n){e.stopPropagation();var t=A.current.getBoundingClientRect();T({edge:n,screenX:e.clientX-t.left,screenY:e.clientY-t.top}),q(null),V(null)}(e,n)},onMouseEnter:function(){return G(n.id)},onMouseLeave:function(){return G(null)}}),i("path",{d:a,fill:"none",stroke:d,strokeWidth:s,style:{transition:"stroke 0.2s, stroke-width 0.2s",pointerEvents:"none"}}),(o||l)&&t(r,{children:[i("circle",e({r:4,fill:"#6366f1"},{children:i("animateMotion",{dur:"1.8s",repeatCount:"indefinite",path:a})})),i("circle",e({r:6,fill:"#6366f1",opacity:.2},{children:i("animateMotion",{dur:"1.8s",repeatCount:"indefinite",path:a})}))]})]}),n.id)}),Z.nodes.map(function(n){var r,a=K===n.id,o=te.has(n.id),l=!!K&&!o,c=(null!==(r=ee[n.cluster_id])&&void 0!==r?r:0)%b.length,d=b[c||0];return i("g",e({"data-node":"true",onClick:function(e){return function(e,n){e.stopPropagation();var t=A.current.getBoundingClientRect();K===n.id?(V(null),q(null)):(V(n.id),q({node:n,screenX:e.clientX-t.left,screenY:e.clientY-t.top}),T(null))}(e,n)},style:{cursor:"pointer",opacity:l?.15:1,transition:"opacity 0.25s"}},{children:i("foreignObject",e({x:n.x,y:n.y,width:p,height:g},{children:t("div",e({style:{background:E?"#1e293b":"#fff",border:a?"2.5px solid ".concat(d):E?"1.5px solid #334155":"1.5px solid #e2e8f0",borderRadius:10,padding:"8px 14px",fontSize:13,fontWeight:600,color:E?"#f1f5f9":"#334155",fontFamily:"'Inter', sans-serif",display:"flex",alignItems:"center",gap:8,boxShadow:a?"0 0 0 3px ".concat(d,"33, 0 2px 8px rgba(0,0,0,0.4)"):E?"0 2px 6px rgba(0,0,0,0.3)":"0 1px 3px rgba(0,0,0,0.05)",whiteSpace:"nowrap",userSelect:"none",height:46,boxSizing:"border-box",transition:"border 0.2s, box-shadow 0.2s"}},{children:[i("span",e({style:{width:22,height:22,borderRadius:6,background:y[c],display:"flex",alignItems:"center",justifyContent:"center",fontSize:11,flexShrink:0,color:v[c]}},{children:x[c]})),i("span",e({style:{overflow:"hidden",textOverflow:"ellipsis"}},{children:n.label||"Node name"}))]}))}))}),n.id)})]}))})),N&&t("div",e({onClick:function(e){return e.stopPropagation()},style:e(e({position:"absolute"},function(e,n,t,r){if(!A.current)return{};var i=A.current.getBoundingClientRect(),a=e+14,o=n-r/2;return a+t>i.width&&(a=e-t-14),o<8&&(o=8),o+r>i.height&&(o=i.height-r-8),{left:a,top:o}}(N.screenX,N.screenY,320,180)),{width:320,background:"#fff",borderRadius:14,boxShadow:"0 8px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06)",border:"1px solid #e2e8f0",zIndex:30,animation:"popIn 0.18s ease-out",overflow:"hidden"})},{children:[t("div",e({style:{padding:"12px 16px 10px",background:"linear-gradient(135deg, #6366f1, #8b5cf6)",color:"#fff"}},{children:[i("div",e({style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",opacity:.8}},{children:"Edge Reasoning"})),t("div",e({style:{fontSize:13,fontWeight:600,marginTop:4}},{children:[(null===(a=$[N.edge.source])||void 0===a?void 0:a.label)||"Source",i("span",e({style:{opacity:.6,margin:"0 6px"}},{children:"→"})),(null===(f=$[N.edge.target])||void 0===f?void 0:f.label)||"Target"]}))]})),i("div",e({style:{padding:"12px 16px 14px",fontSize:13,lineHeight:1.6,color:"#475569",whiteSpace:"pre-line"}},{children:N.edge.reasoning||"No Reasoning available..."})),i("button",e({onClick:function(){return T(null)},style:{position:"absolute",top:8,right:10,background:"rgba(255,255,255,0.2)",border:"none",color:"#fff",borderRadius:6,width:24,height:24,cursor:"pointer",fontSize:14,display:"flex",alignItems:"center",justifyContent:"center"}},{children:"×"}))]}))]})),i("style",{children:"\n @keyframes popIn { from { opacity:0; transform:scale(0.95) translateY(4px); } to { opacity:1; transform:scale(1) translateY(0); } }\n @keyframes slideDown { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }\n "})]}))}var S=a.memo(function(n){var a=n.data,c=n.isDarkMode,d=void 0!==c&&c,s=n.style,u=o(!1),h=u[0],p=u[1],g=l(function(){p(!0)},[]),y=l(function(){p(!1)},[]);return t(r,{children:[i("div",e({style:e({position:"relative",width:"100%",height:"500px"},s)},{children:i(k,{data:a,onFullscreen:g,isDarkMode:d})})),i(f,e({open:h,onClose:y,maxWidth:!1,PaperProps:{style:{width:"95vw",height:"92vh",maxWidth:"none",borderRadius:12,overflow:"hidden",background:d?"#090d16":"#ffffff"}}},{children:i("div",e({style:{width:"100%",height:"100%",position:"relative"}},{children:i(k,{data:a,onFullscreen:y,isFullscreen:!0,isDarkMode:d})}))}))]})});export{S as default};
2
+ //# sourceMappingURL=DependencyGraph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DependencyGraph.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{__assign as e}from"tslib";import{jsxs as r,Fragment as t,jsx as o}from"react/jsx-runtime";import{useRef as i,useEffect as n}from"react";import{Box as a}from"@mui/material";import d from"@monaco-editor/react";var u={base:"vs-dark",inherit:!0,rules:[{token:"tag",foreground:"714be3",fontStyle:"bold"},{token:"attribute.name",foreground:"87CEFA"},{token:"attribute.value",foreground:"98FB98"},{token:"variable",foreground:"00FFFF"},{token:"delimiter",foreground:"888888"},{token:"white",foreground:"AAAAAA"}],colors:{"editor.foreground":"#FFFFFF","editor.background":"#030202","editorLineNumber.foreground":"#858585","editorCursor.foreground":"#FFFFFF","editorIndentGuide.background":"#404040","editorIndentGuide.activeBackground":"#707070"}},l={base:"vs",inherit:!0,rules:[{token:"tag",foreground:"5928ED",fontStyle:"bold"},{token:"attribute.name",foreground:"AF00DB"},{token:"attribute.value",foreground:"008000"},{token:"variable",foreground:"B000B0"},{token:"delimiter",foreground:"808080"},{token:"white",foreground:"000000"}],colors:{"editor.foreground":"#000000","editor.background":"#FFFFFF","editorLineNumber.foreground":"#999999","editorCursor.foreground":"#000000","editorIndentGuide.background":"#CCCCCC","editorIndentGuide.activeBackground":"#999999"}},g=function(g){var m=g.content,s=g.selectedTag,f=g.highlightVariable,c=g.isDarkMode,h=g.height,p=void 0===h?250:h,b=g.fontSize,v=void 0===b?12:b,w=i(),k=i();return n(function(){if(s&&w.current&&k.current){var e=w.current,r=e.getModel();if(r){for(var t=r.getValue().split("\n"),o=-1,i=0;i<t.length;i++){var n=t[i].match(/<([^\s>\/]+(?:\s[^\s>\/]+)*)/);if(n&&n[1].trim().toLowerCase()===s.toLowerCase()){o=i+1;break}}if(o>0){var a=o,d="</".concat(s.toLowerCase(),">");for(i=o;i<t.length;i++)if(t[i].toLowerCase().includes(d)){a=i+1;break}e.setSelection(new k.current.Selection(o,1,o,1)),e.trigger(null,"editor.unfold",{}),e.revealLineInCenterIfOutsideViewport(o);var u=e.deltaDecorations([],[{range:new k.current.Range(o,1,a,t[a-1].length+1),options:{isWholeLine:!0,className:"promptemon-viewer-highlight",inlineClassName:"promptemon-viewer-highlight"}}]);setTimeout(function(){return e.deltaDecorations(u,[])},2e3)}}}},[s]),n(function(){if(f&&w.current&&k.current){var e=w.current,r=e.getModel();if(r){for(var t=r.getValue().split("\n"),o=[],i=0;i<t.length;i++)for(var n=t[i].indexOf(f);-1!==n;)o.push(new k.current.Range(i+1,n+1,i+1,n+f.length+1)),n=t[i].indexOf(f,n+1);if(0!==o.length){e.revealLineInCenterIfOutsideViewport(o[0].startLineNumber);var a=e.deltaDecorations([],o.map(function(e){return{range:e,options:{inlineClassName:"promptemon-viewer-variable-highlight"}}}));setTimeout(function(){return e.deltaDecorations(a,[])},2e3)}}}},[f]),n(function(){k.current&&k.current.editor.setTheme(c?"promptemonViewerDark":"promptemonViewerLight")},[c]),r(t,{children:[o("style",{children:"\n .promptemon-viewer-highlight { background-color: rgba(89, 40, 237, 0.15); }\n .promptemon-viewer-variable-highlight { background-color: rgba(0, 255, 255, 0.2); border-radius: 2px; }\n "}),r(a,e({sx:{width:"100%",height:p,display:"flex",flexDirection:"column"}},{children:[o(a,{sx:{width:"100%",height:20,bgcolor:c?"#030202":"#fff",borderTopLeftRadius:8,borderTopRightRadius:8}}),o(a,e({sx:{flex:1,minHeight:0,overflow:"hidden"}},{children:o(d,{onMount:function(e,r){w.current=e,k.current=r,r.editor.defineTheme("promptemonViewerDark",u),r.editor.defineTheme("promptemonViewerLight",l),r.editor.setTheme(c?"promptemonViewerDark":"promptemonViewerLight"),r.languages.register({id:"promptemonViewerLang"}),r.languages.setMonarchTokensProvider("promptemonViewerLang",{tokenizer:{root:[[/(<)([a-zA-Z0-9\-]+)(\s*)/,["delimiter","tag","white"],"@tagBody"],[/(<\/)([a-zA-Z0-9\-]+)(\s*)(>)/,["delimiter","tag","white","delimiter"]],[/{{[^}]+}}/,"variable"]],tagBody:[[/[a-zA-Z0-9\:\-]+(?=\=)/,"attribute.name"],[/=/,"delimiter"],[/(".*?"|'.*?')/,"attribute.value"],[/\s+/,"white"],[/(\/?>)/,{token:"delimiter",next:"@pop"}]]}}),r.languages.registerFoldingRangeProvider("promptemonViewerLang",{provideFoldingRanges:function(e){var r=e.getLinesContent(),t=[],o=[];return r.forEach(function(e,r){var i=r+1,n=e.match(/<([a-zA-Z0-9\-]+)(\s[^>]*)?>/),a=e.match(/<\/([a-zA-Z0-9\-]+)>/);if(n&&!e.includes("/>")&&o.push({tag:n[1],start:i}),a)for(var d=a[1],u=o.length-1;u>=0;u--)if(o[u].tag===d){t.push({start:o[u].start,end:i}),o.splice(u,1);break}}),t}})},beforeMount:function(e){e.editor.defineTheme("promptemonViewerDark",u),e.editor.defineTheme("promptemonViewerLight",l),e.editor.setTheme(c?"promptemonViewerDark":"promptemonViewerLight")},theme:c?"promptemonViewerDark":"promptemonViewerLight",value:m,language:"promptemonViewerLang",onChange:function(){},options:{fontSize:v,minimap:{enabled:!1},wordWrap:"on",lineNumbers:"on",readOnly:!0,domReadOnly:!0,scrollBeyondLastLine:!1,padding:{top:4,bottom:12},folding:!0,automaticLayout:!0,scrollbar:{vertical:"visible",horizontal:"visible",verticalScrollbarSize:8}}})})),o(a,{sx:{width:"100%",height:20,bgcolor:c?"#030202":"#fff",borderBottomLeftRadius:8,borderBottomRightRadius:8}})]}))]})};export{g as InternalEditor,g as default};
2
+ //# sourceMappingURL=Internaleditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Internaleditor.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{__rest as e,__assign as n,__awaiter as o,__generator as r}from"tslib";import{jsxs as i,jsx as t,Fragment as a}from"react/jsx-runtime";import l,{useState as d,useMemo as c,useRef as s,useEffect as p}from"react";import u from"react-markdown";import f from"rehype-raw";import{Box as h,Tooltip as g}from"@mui/material";import{Prism as m}from"react-syntax-highlighter";import{oneLight as v}from"react-syntax-highlighter/dist/esm/styles/prism";import{Check as b,ContentCopy as y,ExpandLess as x,ExpandMore as k}from"@mui/icons-material";import S from"@mui/icons-material/ExpandMoreOutlined";import _ from"./Cognitivereasoningpanel.js";var w=function(e){var n,o,r;void 0===e&&(e="");var i=null==e?void 0:e.replace(/\\`/g,"`");return i=null==(i=null==(i=null===(r=null==(i=null===(o=null===(n=null==(i=null==i?void 0:i.replace(/```json\s*([\s\S]*?)```/g,function(e,n){return"<codebasename>".concat(n.trim(),"</codebasename>")}))?void 0:i.replace(/^```.*\n?/,""))||void 0===n?void 0:n.replace(/\n?```$/,""))||void 0===o?void 0:o.trim())?void 0:i.replace(/^```/,""))||void 0===r?void 0:r.replace(/```$/,""))?void 0:i.replace(/<\/summary>/g,"</summary>\n"))?void 0:i.replace(/<details>/g,"\n<details>")},M=function(e){var a=e.text,l=d(!1),c=l[0],s=l[1];return i("button",n({onClick:function(){return o(void 0,void 0,void 0,function(){return r(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,navigator.clipboard.writeText(a)];case 1:return e.sent(),s(!0),setTimeout(function(){return s(!1)},2e3),[3,3];case 2:return e.sent(),[3,3];case 3:return[2]}})})},"aria-label":"Copy code",style:{position:"absolute",top:8,right:8,display:"inline-flex",alignItems:"center",gap:4,padding:"3px 8px",fontSize:"0.68rem",fontWeight:500,fontFamily:"inherit",color:c?"#16a34a":"#6B7280",background:c?"#f0fdf4":"#f3f4f6",border:"1px solid ".concat(c?"#bbf7d0":"#e5e7eb"),borderRadius:6,cursor:"pointer",transition:"all 0.2s",opacity:.85},onMouseEnter:function(e){e.currentTarget.style.opacity="1"},onMouseLeave:function(e){e.currentTarget.style.opacity="0.85"}},{children:[t(c?b:y,{style:{fontSize:13}}),c?"Copied":"Copy"]}))},z=function(o){o.node;var r=e(o,["node"]),a=d(!1),c=a[0],u=a[1],f=s(null),h=l.Children.toArray(r.children),g=h.find(function(e){var n;return null===(n=null==e?void 0:e.props)||void 0===n?void 0:n["data-codebase-name"]}),m=!!g,v=m?g.props["data-codebase-name"]:"",b=h.map(function(e){var n;return"string"==typeof e?e:(null===(n=e.props)||void 0===n?void 0:n.children)||""}).join("").replace(/\*\*/g,"").trim(),y=m?"From ".concat(v," codebase"):b||"Accordion title not found";return p(function(){var e,n=null===(e=f.current)||void 0===e?void 0:e.parentElement;if(n){var o=function(){return u(n.open)};return o(),n.addEventListener("toggle",o),function(){return n.removeEventListener("toggle",o)}}},[]),i("summary",n({ref:f,style:{padding:"8px 12px",listStyleType:"none",cursor:"pointer",fontWeight:600,fontSize:"0.82rem",color:"#6932E2",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,borderRadius:8,background:c?"#f5f3ff":"transparent",transition:"background 0.2s"}},{children:[t("span",{children:y}),t("div",n({style:{display:"flex",alignItems:"center",flexShrink:0,color:"#6932E2"}},{children:t(c?x:k,{sx:{fontSize:"1.1rem"}})}))]}))},C=function(o){var r=o.message,s=o.fontSize,p=o.extraMetaData,b=o.isDarkMode,y=void 0!==b&&b,x=o.style,k=o.sx,C=null!=s?s:"0.88rem",W=y?"#e2e8f0":"#1f2937",R=y?"#f8fafc":"#111827",E=d({open:!1,data:null,activeKey:null}),H=E[0],K=E[1],L=function(){return K({open:!1,data:null,activeKey:null})},T=c(function(){var e=function(e){var n={};return{processed:e.replace(/<!--\s*<ai_reasoning>\s*([\s\S]*?)\s*<\/ai_reasoning>\s*-->/g,function(e,o){try{var r=JSON.parse(o.trim()),i=r.id||"reasoning_".concat(Object.keys(n).length);return n[i]=r,'<aireasoning data-reasoning-key="'.concat(i,'">').concat(i,"</aireasoning>")}catch(e){return console.warn("[ai_reasoning] Failed to parse block:",e),""}}),reasoningMap:n}}(r||"");return{processedMessage:e.processed,inlineReasoningMap:e.reasoningMap}},[r]),j=T.processedMessage,B=T.inlineReasoningMap,F=c(function(){return{aireasoning:function(o){o.node;var r=e(o,["node"])["data-reasoning-key"],a=B[r];if(!a)return null;var l=H.open&&H.activeKey===r;return i("div",n({style:{margin:"6px 0"}},{children:[i("span",n({onClick:function(e){e.stopPropagation();var n=function(e){var n,o,r,i,t,a=[];return(null!==(o=null===(n=e.aiReasoningCitation)||void 0===n?void 0:n.gpt_citation)&&void 0!==o?o:[]).forEach(function(e){var n,o,r,i,t,l,d,c,s,p,u=null!==(o=null===(n=e.customMetadata)||void 0===n?void 0:n.data_sources)&&void 0!==o?o:[],f=null!==(i=null===(r=e.customMetadata)||void 0===r?void 0:r.training_data_title)&&void 0!==i?i:[],h=null!==(l=null===(t=e.customMetadata)||void 0===t?void 0:t.paraphrase)&&void 0!==l?l:[],g=null===(d=u[0])||void 0===d?void 0:d.match(/<highlight>([\s\S]*?)<\/highlight>/),m=g?g[1].trim():null!==(c=u[0])&&void 0!==c?c:"";a.push({citation_number:Number(e.citation_number),section_ref:null!==(s=f[0])&&void 0!==s?s:"",paraphrase:null!==(p=h[0])&&void 0!==p?p:"",highlight:m})}),{block_cognitive_reasoning_html:null!==(r=e.reasoning)&&void 0!==r?r:"",block_cognitive_gap_html:null!==(i=e.Gap)&&void 0!==i?i:"",block_cognitive_confidence:Number(null!==(t=e.decision_strength)&&void 0!==t?t:0),block_cognitive_citations:a}}(a);K(function(e){return e.open&&e.activeKey===r?{open:!1,data:null,activeKey:null}:{open:!0,data:n,activeKey:r}})},style:{display:"inline-flex",alignItems:"center",gap:6,cursor:"pointer",color:y?"#a78bfa":"#6932E2",fontWeight:500,fontSize:C,transition:"all 0.2s",padding:"2px 0"}},{children:[t("span",{children:r}),t("span",n({style:{display:"inline-flex",alignItems:"center",gap:2,border:y?"1px solid #334155":"1px solid #e2e8f0",borderRadius:5,padding:"4px 2px"}},{children:t(S,{sx:{fontSize:"1rem",color:y?"#94a3b8":"#475569",transform:l?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s"}})}))]})),l&&H.data&&t(h,n({component:"div",onClick:function(e){return e.stopPropagation()},sx:{display:"block",width:"fit-content",maxWidth:"100%",mt:1,mb:1,ml:0}},{children:t(_,{open:!0,onClose:L,data:H.data})}))]}))},codebasename:function(e){var o=e.children,r=("string"==typeof o[0]?o[0]:"").trim();return""!==r?i("div",n({"data-codebase-name":r,style:{position:"relative",margin:"12px 0"}},{children:[t(M,{text:String(o).replace(/\n$/,"")}),t(m,n({style:v,language:"json",PreTag:"div",customStyle:{borderRadius:8,padding:"1rem",fontSize:"0.8rem",border:y?"1px solid #334155":"1px solid #e5e7eb",margin:0,lineHeight:1.6}},{children:String(o).replace(/\n$/,"")}))]})):t(a,{})},details:function(o){o.node;var r=e(o,["node"]);return t("details",n({},r,{style:{borderRadius:8,border:y?"1px solid #334155":"1px solid #e9e5f5",backgroundColor:"transparent",margin:"8px 0",overflow:"hidden"}},{children:r.children}))},summary:z,p:function(o){o.node;var r=e(o,["node"]);return t("p",n({style:{wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word",whiteSpace:"normal",overflow:"hidden",display:"block",maxWidth:"100%",fontSize:C,lineHeight:1.7,margin:"4px 0",color:W}},{children:null==r?void 0:r.children}))},strong:function(o){o.node;var r=e(o,["node"]);return t("strong",n({style:{fontWeight:650,color:R}},{children:null==r?void 0:r.children}))},h1:function(o){o.node;var r=e(o,["node"]);return t("h1",n({style:{fontSize:"1.35rem",fontWeight:700,color:R,margin:"20px 0 8px",lineHeight:1.3,letterSpacing:"-0.01em"}},{children:r.children}))},h2:function(o){o.node;var r=e(o,["node"]);return t("h2",n({style:{fontSize:"1.15rem",fontWeight:650,color:R,margin:"16px 0 6px",lineHeight:1.35}},{children:r.children}))},h3:function(o){o.node;var r=e(o,["node"]);return t("h3",n({style:{fontSize:"1rem",fontWeight:600,color:R,margin:"14px 0 4px",lineHeight:1.4}},{children:r.children}))},h4:function(o){o.node;var r=e(o,["node"]);return t("h4",n({style:{fontSize:"0.92rem",fontWeight:600,color:W,margin:"12px 0 4px",lineHeight:1.4}},{children:r.children}))},ol:function(o){o.node;var r=e(o,["node"]);return t("ol",n({style:{listStyleType:"decimal",marginLeft:20,paddingLeft:4,display:"flex",flexDirection:"column",gap:2}},{children:null==r?void 0:r.children}))},ul:function(o){o.node;var r=e(o,["node"]);return t("ul",n({style:{listStyleType:"disc",marginLeft:20,paddingLeft:4,display:"flex",flexDirection:"column",gap:2}},{children:null==r?void 0:r.children}))},li:function(o){o.node;var r=e(o,["node"]);return t("li",n({style:{fontSize:C,lineHeight:1.7,color:W,paddingLeft:4}},{children:r.children}))},blockquote:function(o){o.node;var r=e(o,["node"]);return t("blockquote",n({style:{margin:"12px 0",padding:"8px 16px",borderLeft:"3px solid #8b5cf6",background:y?"#1e1b4b":"#faf5ff",borderRadius:"0 6px 6px 0",color:y?"#cbd5e1":"#4b5563",fontStyle:"italic",fontSize:C,lineHeight:1.65}},{children:r.children}))},hr:function(){return t("hr",{style:{border:"none",height:1,background:y?"linear-gradient(to right, transparent, #334155, transparent)":"linear-gradient(to right, transparent, #d1d5db, transparent)",margin:"16px 0"}})},table:function(o){o.node;var r=e(o,["node"]);return t("div",n({style:{overflowX:"auto",margin:"12px 0",borderRadius:8,border:y?"1px solid #334155":"1px solid #e5e7eb"}},{children:t("table",n({style:{width:"100%",borderCollapse:"collapse",fontSize:"0.8rem",lineHeight:1.5}},{children:r.children}))}))},thead:function(o){o.node;var r=e(o,["node"]);return t("thead",n({style:{background:y?"#1e293b":"#f9fafb",borderBottom:y?"2px solid #334155":"2px solid #e5e7eb"}},{children:r.children}))},th:function(o){o.node;var r=e(o,["node"]);return t("th",n({style:{padding:"8px 12px",textAlign:"left",fontWeight:600,fontSize:"0.76rem",color:y?"#cbd5e1":"#374151",whiteSpace:"nowrap"}},{children:r.children}))},td:function(o){o.node;var r=e(o,["node"]);return t("td",n({style:{padding:"8px 12px",borderTop:y?"1px solid #334155":"1px solid #f3f4f6",color:y?"#94a3b8":"#4b5563",fontSize:"0.8rem"}},{children:r.children}))},a:function(o){var r=o.children;o.node;var l=e(o,["children","node"]),d=l["data-cognitive-reasoning"];if(d&&(null==p?void 0:p[d]))return i(a,{children:[i("span",n({onClick:function(e){e.stopPropagation();var n=function(e){var n,o,r,i,t;if(!e)return null;var a=[];return(null!==(o=null===(n=e.aiReasoningCitation)||void 0===n?void 0:n.gpt_citation)&&void 0!==o?o:[]).forEach(function(e){var n,o,r,i,t,l,d,c,s,p,u=null!==(o=null===(n=e.customMetadata)||void 0===n?void 0:n.data_sources)&&void 0!==o?o:[],f=null!==(i=null===(r=e.customMetadata)||void 0===r?void 0:r.training_data_title)&&void 0!==i?i:[],h=null!==(l=null===(t=e.customMetadata)||void 0===t?void 0:t.paraphrase)&&void 0!==l?l:[],g=null===(d=u[0])||void 0===d?void 0:d.match(/<highlight>([\s\S]*?)<\/highlight>/),m=g?g[1].trim():null!==(c=u[0])&&void 0!==c?c:"";a.push({citation_number:Number(e.citation_number),section_ref:null!==(s=f[0])&&void 0!==s?s:"",paraphrase:null!==(p=h[0])&&void 0!==p?p:"",highlight:m})}),{block_cognitive_reasoning_html:null!==(r=e.Reasoning)&&void 0!==r?r:"",block_cognitive_gap_html:null!==(i=e.Gap)&&void 0!==i?i:"",block_cognitive_confidence:Number(null!==(t=e.Confidence_score)&&void 0!==t?t:0),block_cognitive_citations:a}}(p[d]);K(function(e){return e.open&&e.activeKey===d?{open:!1,data:null,activeKey:null}:{open:!0,data:n,activeKey:d}})},style:{color:y?"#a78bfa":"#6932E2",fontWeight:500,cursor:"pointer",transition:"all 0.2s",padding:"0 2px",position:"relative",display:"flex",alignItems:"center",gap:6,width:"fit-content"}},{children:[r||"",t("span",n({style:{cursor:"pointer",padding:"4px 2px",display:"flex",alignItems:"center",gap:2,border:y?"1px solid #334155":"1px solid #e2e8f0",borderRadius:"5px",width:"fit-content"}},{children:t(S,{sx:{fontSize:"1rem",color:y?"#94a3b8":"#475569",transition:"transform 0.2s"}})}))]})),H.open&&H.activeKey===d&&H.data&&t(h,n({component:"div",onClick:function(e){return e.stopPropagation()},sx:{display:"block",width:"fit-content",maxWidth:"100%",mt:1,mb:1,ml:0}},{children:t(_,{open:!0,onClose:L,data:H.data})}))]});var c=!1;try{c=new URL(null==l?void 0:l.href).protocol.startsWith("http")}catch(e){c=!1}return c?t("a",n({href:null==l?void 0:l.href,style:{color:y?"#a78bfa":"#6932E2",textDecoration:"none",fontWeight:500,borderBottom:y?"1px solid #7c3aed":"1px solid #c4b5fd",transition:"border-color 0.2s, color 0.2s"},target:"_blank",rel:"noopener noreferrer",onMouseEnter:function(e){e.currentTarget.style.borderBottomColor=y?"#a78bfa":"#6932E2"},onMouseLeave:function(e){e.currentTarget.style.borderBottomColor=y?"#7c3aed":"#c4b5fd"}},{children:r})):t("span",{children:r})},sup:function(o){o.node;var r=e(o,["node"]);return t(g,n({title:r.children,placement:"top",arrow:!0},{children:t(h,n({component:"span",sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:16,height:16,borderRadius:"50%",background:y?"#3730a3":"#ede9fe",color:y?"#c084fc":"#7c3aed",fontSize:"0.6rem",fontWeight:700,verticalAlign:"super",cursor:"pointer",userSelect:"none",lineHeight:1,transition:"all 0.2s","&:hover":{background:y?"#6d28d9":"#7c3aed",color:"#fff"}},"aria-label":"Info",role:"button"},{children:"i"}))}))},code:function(e){var o=e.children;return t("code",n({style:{fontFamily:"'JetBrains Mono', 'Fira Code', 'SF Mono', Menlo, monospace",fontSize:"0.82em",color:y?"#e9d5ff":"#9333ea",background:y?"#2e1065":"#faf5ff",padding:"1.5px 5px",borderRadius:4,border:y?"1px solid #581c87":"1px solid #f3e8ff",fontWeight:500}},{children:o}))},pre:function(e){var o=e.children,r=function(e){var n;return"string"==typeof e?e:(null===(n=null==e?void 0:e.props)||void 0===n?void 0:n.children)?(Array.isArray(e.props.children)?e.props.children:[e.props.children]).map(r).join(""):""},a=l.Children.toArray(o).map(r).join("");return i("div",n({style:{position:"relative",margin:"12px 0"}},{children:[t(M,{text:a}),t("pre",n({style:{fontFamily:"'JetBrains Mono', 'Fira Code', 'SF Mono', Menlo, monospace",fontSize:"0.8rem",lineHeight:1.6,color:W,background:y?"#0f172a":"#f9fafb",border:y?"1px solid #334155":"1px solid #e5e7eb",borderRadius:8,padding:"14px 16px",margin:0,overflowX:"auto",whiteSpace:"pre"}},{children:o}))]}))},img:function(o){o.node;var r=e(o,["node"]);return t("img",n({},r,{style:{maxWidth:"100%",height:"auto",borderRadius:8,margin:"8px 0",border:y?"1px solid #334155":"1px solid #e5e7eb"},loading:"lazy"}))}}},[r,C,p,H.activeKey,H.open,B,y,W,R]);return t(h,n({className:"pg-markdown-renderer",style:x,sx:n(n({fontSize:C,lineHeight:1.7,color:W,wordBreak:"break-word",position:"relative"},k),{"& span[style*='color'], & font[color]":y?{color:"#60a5fa !important"}:{},"& a":{color:y?"#a78bfa !important":"#6932E2 !important"},"& strong":{color:y?"#f8fafc !important":"#111827 !important"},"& h1, & h2, & h3, & h4, & h5, & h6":{color:y?"#f1f5f9 !important":"#111827 !important"}})},{children:t(u,n({components:F,rehypePlugins:[f],className:"react-markdown-renderer-with-overrides"},{children:w(j)}))}))};export{C as MarkdownRenderer,C as default};
2
+ //# sourceMappingURL=Markdownrenderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Markdownrenderer.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +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};
2
+ //# sourceMappingURL=Spbanalysispanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Spbanalysispanel.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export{default as CodeCitation}from"./features/CodeCitation/CodeCitation.js";export{default as ProjectAccordian}from"./features/ProjectAccordion/ProjectAccordion.js";export{default as BookCitation}from"./features/BookCitation/BookCitation.js";export{default as Bookemon}from"./features/Bookemon/Bookemon.js";export{PdfEditorCitation as PdfCitation}from"./features/PdfEditorCitation/PdfEditorCitation.js";export{default as CitationRenderer}from"./features/CitationRenderer/CitationRenderer.js";export{default as MarkdownRenderer}from"./features/CitationRenderer/MarkdownRenderer.js";export{DiagnosticSeverity}from"./features/CodeCitation/_components/CodeEditor.js";export{default as PaginatedTable}from"./features/PaginatedTable/PaginatedTable.js";export{default as InternalgptReasoningComponent,default as NonWebReasoningComponent}from"./features/CognitiveInternalgptReasoning/CognitiveInternalgptReasoningComponent.js";export{default as ChatCitation}from"./features/ChatCitation/ChatCitationRenderer.js";export{default as CognitiveDecisioningCard}from"./features/CognitiveDecisioning/CognitiveDecisioningWrapper.js";export{default as PdfViewer}from"./features/PdfViewer/PdfViewer.js";export{default as FaqCitation}from"./features/CognitiveDecisioning/FaqCitation/FaqCitation.js";export{default as ImageCitationContent}from"./features/RequirementAiCitations/ImageCitation/ImageCitationContent.js";export{default as VideoCitationContent}from"./features/RequirementAiCitations/VideoCitation/VideoCitationContent.js";export{default as FileCitationContent}from"./features/RequirementAiCitations/FileCitation/FileCitationContent.js";export{default as WebCitationWithImageContent}from"./features/RequirementAiCitations/WebCitation/WebCitationWithImageContent.js";export{default as MarkdownWithImageCitation}from"./features/MarkdownWithImageCitation/MarkdownWithImageCitation.js";export{default as AiReasoningCitation}from"./features/RequirementAiCitations/AiReasoning/AiReasoningCitation.js";export{default as TableCitationContent}from"./features/TableCitation/TableCitationContent.js";export{default as CitationsViewer}from"./features/CitationViewer/CitationsViewer.js";export{default as ExcelCitation}from"./features/ExcelCitation/ExcelCitations.js";export{default as ScannedDocCitation}from"./features/ScannedDocCitation/ScannedDocCitation.js";export{default as ChatDrawer}from"./features/ChatDrawer/ChatDrawer.js";export{FILE_INGESTION_STATUS,SUMMARY_EXPAND_HEIGHT_NUDGE,TRUNCATE_THRESHOLD}from"./features/ChatDrawer/constants/ChatDrawer.js";export{default as SplitterCitationsComponent}from"./features/SplitterCitations/SplitterCitationsComponent.js";export{SourcesBQCitation,findSourceCitation,parseSourcesBQHref}from"./features/DualCitation/SourceBQDataCompnent.js";export{default as CognitiveCompare}from"./features/CognitiveCompare/CognitiveCompare.js";export{default as CognitiveInternalgptCoreComponent}from"./features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js";export{default as TextualGuideLinesComponent}from"./features/TextualGuidelines/TextualGuideLinesComponent.js";export{default as RuleBookCitationWrapper}from"./features/RulebookCitations/RuleBookCitationWrapper.js";export{IngestionStatusChip,IngestionStatusComponent}from"./features/IngestionStatus/IngestionStatusComponent.js";export{ManageReminders}from"./features/ManageRemainders/ManageReminders.js";export{default as PromptemonBlockViewer}from"./features/PromptemonBlockViewer/PromptemonBlockViewer.js";export{default as PromptemonViewer}from"./features/PromptemonViewer/PromptemonViewer.js";export{default as GptWebCitation}from"./features/GptWebCitation/GptWebCitation.js";export{useOnDemandCitationFetch}from"./hooks/useOnDemandCitationFetch.js";export{default as InstantLearningCitationWrapper}from"./features/InstantLearningCitation/InstantLearningCitationComponent.js";export{default as BPACitationRenderer}from"./features/BPACitationRenderer/BPACitationRenderer.js";export{extractLearnedFromUrl,extractRelevanceScoreFromContent,extractTopicFromContent,getWebCitationImageUrl,mapCitationDataToDisplay,resolveSkeletonVisitUrl,sanitizeExternalUrl}from"./features/GptWebCitation/utils/citationData.utils.js";export{CitationType,allowsGptCitationView,allowsWebCitationView,showsCitationViewToggle}from"./features/GptWebCitation/types.js";
1
+ export{default as CodeCitation}from"./features/CodeCitation/CodeCitation.js";export{default as ProjectAccordian}from"./features/ProjectAccordion/ProjectAccordion.js";export{default as BookCitation}from"./features/BookCitation/BookCitation.js";export{default as Bookemon}from"./features/Bookemon/Bookemon.js";export{PdfEditorCitation as PdfCitation}from"./features/PdfEditorCitation/PdfEditorCitation.js";export{default as CitationRenderer}from"./features/CitationRenderer/CitationRenderer.js";export{default as MarkdownRenderer}from"./features/CitationRenderer/MarkdownRenderer.js";export{DiagnosticSeverity}from"./features/CodeCitation/_components/CodeEditor.js";export{default as PaginatedTable}from"./features/PaginatedTable/PaginatedTable.js";export{default as InternalgptReasoningComponent,default as NonWebReasoningComponent}from"./features/CognitiveInternalgptReasoning/CognitiveInternalgptReasoningComponent.js";export{default as ChatCitation}from"./features/ChatCitation/ChatCitationRenderer.js";export{default as CognitiveDecisioningCard}from"./features/CognitiveDecisioning/CognitiveDecisioningWrapper.js";export{default as PdfViewer}from"./features/PdfViewer/PdfViewer.js";export{default as FaqCitation}from"./features/CognitiveDecisioning/FaqCitation/FaqCitation.js";export{default as ImageCitationContent}from"./features/RequirementAiCitations/ImageCitation/ImageCitationContent.js";export{default as VideoCitationContent}from"./features/RequirementAiCitations/VideoCitation/VideoCitationContent.js";export{default as FileCitationContent}from"./features/RequirementAiCitations/FileCitation/FileCitationContent.js";export{default as WebCitationWithImageContent}from"./features/RequirementAiCitations/WebCitation/WebCitationWithImageContent.js";export{default as MarkdownWithImageCitation}from"./features/MarkdownWithImageCitation/MarkdownWithImageCitation.js";export{default as AiReasoningCitation}from"./features/RequirementAiCitations/AiReasoning/AiReasoningCitation.js";export{default as TableCitationContent}from"./features/TableCitation/TableCitationContent.js";export{default as CitationsViewer}from"./features/CitationViewer/CitationsViewer.js";export{default as ExcelCitation}from"./features/ExcelCitation/ExcelCitations.js";export{default as ScannedDocCitation}from"./features/ScannedDocCitation/ScannedDocCitation.js";export{default as ChatDrawer}from"./features/ChatDrawer/ChatDrawer.js";export{FILE_INGESTION_STATUS,SUMMARY_EXPAND_HEIGHT_NUDGE,TRUNCATE_THRESHOLD}from"./features/ChatDrawer/constants/ChatDrawer.js";export{default as SplitterCitationsComponent}from"./features/SplitterCitations/SplitterCitationsComponent.js";export{SourcesBQCitation,findSourceCitation,parseSourcesBQHref}from"./features/DualCitation/SourceBQDataCompnent.js";export{default as CognitiveCompare}from"./features/CognitiveCompare/CognitiveCompare.js";export{default as CognitiveInternalgptCoreComponent}from"./features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js";export{default as TextualGuideLinesComponent}from"./features/TextualGuidelines/TextualGuideLinesComponent.js";export{default as RuleBookCitationWrapper}from"./features/RulebookCitations/RuleBookCitationWrapper.js";export{IngestionStatusChip,IngestionStatusComponent}from"./features/IngestionStatus/IngestionStatusComponent.js";export{ManageReminders}from"./features/ManageRemainders/ManageReminders.js";export{default as PromptemonBlockViewer}from"./features/PromptemonBlockViewer/PromptemonBlockViewer.js";export{default as PromptemonViewer}from"./features/PromptemonViewer/PromptemonViewer.js";export{default as SPBAnalysisPanel}from"./features/SPBAnalysisPanel/Spbanalysispanel.js";export{default as GptWebCitation}from"./features/GptWebCitation/GptWebCitation.js";export{useOnDemandCitationFetch}from"./hooks/useOnDemandCitationFetch.js";export{default as InstantLearningCitationWrapper}from"./features/InstantLearningCitation/InstantLearningCitationComponent.js";export{default as BPACitationRenderer}from"./features/BPACitationRenderer/BPACitationRenderer.js";export{extractLearnedFromUrl,extractRelevanceScoreFromContent,extractTopicFromContent,getWebCitationImageUrl,mapCitationDataToDisplay,resolveSkeletonVisitUrl,sanitizeExternalUrl}from"./features/GptWebCitation/utils/citationData.utils.js";export{CitationType,allowsGptCitationView,allowsWebCitationView,showsCitationViewToggle}from"./features/GptWebCitation/types.js";
2
2
  //# sourceMappingURL=index.js.map
@@ -1,11 +1,24 @@
1
+ /// <reference types="react" />
1
2
  export interface PromptemonBlockViewerProps {
2
3
  title: string;
3
4
  description?: string;
4
5
  content: string;
5
- height?: number;
6
+ height?: number | string;
6
7
  selectedTag?: string;
7
8
  highlightVariable?: string;
9
+ className?: string;
10
+ style?: React.CSSProperties;
11
+ showThemeToggle?: boolean;
12
+ theme?: "dark" | "light";
13
+ /** Custom editor background color override */
14
+ editorBackgroundColor?: string;
15
+ /** Font size for the Monaco code editor */
16
+ fontSize?: number;
17
+ /** Font size for the title header */
18
+ titleFontSize?: string | number;
19
+ /** Custom styles for the title header */
20
+ titleStyle?: React.CSSProperties;
8
21
  }
9
- declare const PromptemonBlockViewer: ({ title, description, content, height, selectedTag, highlightVariable, }: PromptemonBlockViewerProps) => import("react/jsx-runtime").JSX.Element;
22
+ declare const PromptemonBlockViewer: ({ title, description, content, height, selectedTag, highlightVariable, className, style, showThemeToggle, theme, editorBackgroundColor, fontSize, titleFontSize, titleStyle, }: PromptemonBlockViewerProps) => import("react/jsx-runtime").JSX.Element;
10
23
  export default PromptemonBlockViewer;
11
24
  //# sourceMappingURL=PromptemonBlockViewer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PromptemonBlockViewer.d.ts","sourceRoot":"","sources":["../../../../../src/features/PromptemonBlockViewer/PromptemonBlockViewer.tsx"],"names":[],"mappings":"AAgBA,MAAM,WAAW,0BAA0B;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAwQD,QAAA,MAAM,qBAAqB,6EAOxB,0BAA0B,4CA6G5B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"PromptemonBlockViewer.d.ts","sourceRoot":"","sources":["../../../../../src/features/PromptemonBlockViewer/PromptemonBlockViewer.tsx"],"names":[],"mappings":";AAgBA,MAAM,WAAW,0BAA0B;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACzB,8CAA8C;IAC9C,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qCAAqC;IACrC,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,yCAAyC;IACzC,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CACpC;AAqRD,QAAA,MAAM,qBAAqB,mLAexB,0BAA0B,4CAgI5B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -28,10 +28,19 @@ interface ApiData {
28
28
  nodes: RawNode[];
29
29
  edges: Edge[];
30
30
  }
31
- interface DependencyGraphProps {
31
+ export interface DependencyGraphProps {
32
32
  data: ApiData;
33
+ isDarkMode?: boolean;
34
+ style?: React.CSSProperties | any;
35
+ sx?: any;
33
36
  }
34
- declare function DependencyGraph({ data }: DependencyGraphProps): React.ReactElement;
37
+ export interface DependencyGraphInnerProps {
38
+ data: ApiData;
39
+ onFullscreen?: () => void;
40
+ isFullscreen?: boolean;
41
+ isDarkMode?: boolean;
42
+ }
43
+ declare function DependencyGraph({ data, isDarkMode, style }: DependencyGraphProps): React.ReactElement;
35
44
  declare const _default: React.MemoExoticComponent<typeof DependencyGraph>;
36
45
  export default _default;
37
46
  //# sourceMappingURL=DependencyGraph.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DependencyGraph.d.ts","sourceRoot":"","sources":["../../../../../src/features/SPBAnalysisPanel/DependencyGraph.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAKjF,UAAU,OAAO;IACf,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,UAAU,OAAO;IACf,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,IAAI;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,UAAU,OAAO;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,KAAK,EAAE,IAAI,EAAE,CAAC;CACf;AA8CD,UAAU,oBAAoB;IAC5B,IAAI,EAAE,OAAO,CAAC;CACf;AAmsBD,iBAAS,eAAe,CAAC,EAAE,IAAI,EAAE,EAAE,oBAAoB,GAAG,KAAK,CAAC,YAAY,CAqC3E;;AAED,wBAA2C"}
1
+ {"version":3,"file":"DependencyGraph.d.ts","sourceRoot":"","sources":["../../../../../src/features/SPBAnalysisPanel/DependencyGraph.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAKjF,UAAU,OAAO;IACf,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,UAAU,OAAO;IACf,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,IAAI;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,UAAU,OAAO;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,KAAK,EAAE,IAAI,EAAE,CAAC;CACf;AA8CD,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAClC,EAAE,CAAC,EAAE,GAAG,CAAC;CACV;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAosBD,iBAAS,eAAe,CAAC,EAAE,IAAI,EAAE,UAAkB,EAAE,KAAK,EAAE,EAAE,oBAAoB,GAAG,KAAK,CAAC,YAAY,CAsCtG;;AAED,wBAA2C"}
@@ -4,7 +4,11 @@ export interface MarkdownRendererProps {
4
4
  fontSize?: React.CSSProperties["fontSize"];
5
5
  /** Keyed by the id referenced in `<a data-cognitive-reasoning="key">` anchors */
6
6
  extraMetaData?: Record<string, any> | null;
7
+ /** Whether dark mode is active */
8
+ isDarkMode?: boolean;
9
+ style?: React.CSSProperties | any;
10
+ sx?: any;
7
11
  }
8
- export declare const MarkdownRenderer: ({ message, fontSize, extraMetaData }: MarkdownRendererProps) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const MarkdownRenderer: ({ message, fontSize, extraMetaData, isDarkMode, style, sx }: MarkdownRendererProps) => import("react/jsx-runtime").JSX.Element;
9
13
  export default MarkdownRenderer;
10
14
  //# sourceMappingURL=Markdownrenderer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Markdownrenderer.d.ts","sourceRoot":"","sources":["../../../../../src/features/SPBAnalysisPanel/Markdownrenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAiMpE,MAAM,WAAW,qBAAqB;IAClC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IAC3C,iFAAiF;IACjF,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;CAC9C;AAED,eAAO,MAAM,gBAAgB,yCAA0C,qBAAqB,4CAgO3F,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"Markdownrenderer.d.ts","sourceRoot":"","sources":["../../../../../src/features/SPBAnalysisPanel/Markdownrenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAiMpE,MAAM,WAAW,qBAAqB;IAClC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IAC3C,iFAAiF;IACjF,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IAC3C,kCAAkC;IAClC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAClC,EAAE,CAAC,EAAE,GAAG,CAAC;CACZ;AAED,eAAO,MAAM,gBAAgB,gEAAyE,qBAAqB,4CA0P1H,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  export interface SPBApbReference {
2
3
  apb_name: string;
3
4
  description?: string;
@@ -23,6 +24,62 @@ export interface SPBAdditionalInfo {
23
24
  output_analysis?: string;
24
25
  dependency_graph?: any;
25
26
  }
27
+ export interface SPBAnalysisPanelStyles {
28
+ /** Root container style overrides */
29
+ root?: React.CSSProperties | any;
30
+ /** Header top bar style overrides */
31
+ header?: React.CSSProperties | any;
32
+ /** Header title typography style overrides */
33
+ headerTitle?: React.CSSProperties | any;
34
+ /** Header subtitle typography style overrides */
35
+ headerSubtitle?: React.CSSProperties | any;
36
+ /** Left panel container style overrides */
37
+ leftPanel?: React.CSSProperties | any;
38
+ /** Overview outer container style overrides */
39
+ overviewSection?: React.CSSProperties | any;
40
+ /** Overview header title style overrides */
41
+ overviewTitle?: React.CSSProperties | any;
42
+ /** Overview content box style overrides */
43
+ overviewContent?: React.CSSProperties | any;
44
+ /** Functionality section main accordion style overrides */
45
+ functionalitySection?: React.CSSProperties | any;
46
+ /** Functionality section title style overrides */
47
+ functionalityTitle?: React.CSSProperties | any;
48
+ /** Individual functionality item accordion style overrides */
49
+ functionalityItem?: React.CSSProperties | any;
50
+ /** Applicability section accordion style overrides */
51
+ applicabilitySection?: React.CSSProperties | any;
52
+ /** Applicability section title style overrides */
53
+ applicabilityTitle?: React.CSSProperties | any;
54
+ /** Specifications section accordion style overrides */
55
+ specificationsSection?: React.CSSProperties | any;
56
+ /** Specifications section title style overrides */
57
+ specificationsTitle?: React.CSSProperties | any;
58
+ /** Dependency graph section accordion style overrides */
59
+ dependencyGraphSection?: React.CSSProperties | any;
60
+ /** Dependency graph title style overrides */
61
+ dependencyGraphTitle?: React.CSSProperties | any;
62
+ /** Dependency graph component style overrides */
63
+ dependencyGraph?: React.CSSProperties | any;
64
+ /** Right-side persistent code panel container style overrides */
65
+ codePanel?: React.CSSProperties | any;
66
+ /** Code panel header bar style overrides */
67
+ codePanelHeader?: React.CSSProperties | any;
68
+ /** Code panel title style overrides */
69
+ codePanelTitle?: React.CSSProperties | any;
70
+ /** Monaco internal editor container style overrides */
71
+ editorContainer?: React.CSSProperties | any;
72
+ /** Vertical collapse strip style overrides */
73
+ collapseStrip?: React.CSSProperties | any;
74
+ /** Drag handle pill style overrides */
75
+ dragHandle?: React.CSSProperties | any;
76
+ /** Fullscreen modal paper style overrides */
77
+ fullscreenModal?: React.CSSProperties | any;
78
+ /** Markdown renderer custom style overrides */
79
+ markdownRenderer?: React.CSSProperties | any;
80
+ /** Theme mode flag inside styles object if passed */
81
+ isDarkMode?: boolean;
82
+ }
26
83
  export interface SPBAnalysisPanelProps {
27
84
  /** Full text of the system prompt this SPB analysis is derived from — used for the persistent/fullscreen preview editor */
28
85
  promptContent: string;
@@ -33,7 +90,25 @@ export interface SPBAnalysisPanelProps {
33
90
  spbAdditionalInfo?: SPBAdditionalInfo | null;
34
91
  /** Show the persistent right-side code editor panel. Defaults to true. */
35
92
  showCodePanel?: boolean;
93
+ /** Show the vertical collapse strip and drag handle pill. Defaults to true. */
94
+ showCollapseStrip?: boolean;
95
+ /** Show the Fullscreen button in the code panel header. Defaults to true. */
96
+ showFullscreenButton?: boolean;
97
+ /** Allow and show the Fullscreen preview modal (Dialog). Defaults to true. */
98
+ showFullscreenModal?: boolean;
99
+ /** Show the dark/light theme toggle switch in code panels. Defaults to true. */
100
+ showThemeToggle?: boolean;
101
+ /** Single customizable styles object containing section-specific style overrides for all components down to the core */
102
+ styles?: SPBAnalysisPanelStyles;
103
+ /** Whether dark mode theme is active. Defaults to true. (Can also be set inside `styles.isDarkMode`). */
104
+ isDarkMode?: boolean;
105
+ /** Optional custom CSS class name for the root container */
106
+ className?: string;
107
+ /** Optional custom inline style object for the root container */
108
+ style?: React.CSSProperties;
109
+ /** Optional MUI sx prop overrides for the root container */
110
+ sx?: any;
36
111
  }
37
- declare const SPBAnalysisPanel: ({ promptContent, promptTitle, isLoading, overviewSummary, functionalityOfSPB, spbAdditionalInfo, showCodePanel, }: SPBAnalysisPanelProps) => import("react/jsx-runtime").JSX.Element;
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;
38
113
  export default SPBAnalysisPanel;
39
114
  //# sourceMappingURL=Spbanalysispanel.d.ts.map