@e-llm-studio/instant-learning 0.0.281 → 0.0.283

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 (25) hide show
  1. package/dist/cjs/features/IL-OTJ/_components/ConflictingReasoningCard.js +1 -1
  2. package/dist/cjs/features/IL-OTJ/_components/MarkdownComponents/MarkdownElements.js +1 -1
  3. package/dist/cjs/features/IL-OTJ/_components/atoms/Textarea/Textarea.js +1 -1
  4. package/dist/cjs/features/IL-OTJ/_components/molecules/Condition/ConditionList.js +1 -1
  5. package/dist/cjs/features/IL-OTJ/_components/organisms/ConfigSection/ConfigSection.js +1 -1
  6. package/dist/cjs/features/IL-OTJ/_components/organisms/TextSection/TextSection.js +1 -1
  7. package/dist/cjs/features/IL-OTJ/_components/templates/TrafficManager/CreateRule.js +1 -1
  8. package/dist/features/IL-OTJ/_components/ConflictingReasoningCard.js +1 -1
  9. package/dist/features/IL-OTJ/_components/MarkdownComponents/MarkdownElements.js +1 -1
  10. package/dist/features/IL-OTJ/_components/atoms/Textarea/Textarea.js +1 -1
  11. package/dist/features/IL-OTJ/_components/molecules/Condition/ConditionList.js +1 -1
  12. package/dist/features/IL-OTJ/_components/organisms/ConfigSection/ConfigSection.js +1 -1
  13. package/dist/features/IL-OTJ/_components/organisms/TextSection/TextSection.js +1 -1
  14. package/dist/features/IL-OTJ/_components/templates/TrafficManager/CreateRule.js +1 -1
  15. package/dist/types/src/features/IL-OTJ/ILOTJTest.d.ts.map +1 -1
  16. package/dist/types/src/features/IL-OTJ/_components/ConflictingReasoningCard.d.ts +2 -1
  17. package/dist/types/src/features/IL-OTJ/_components/ConflictingReasoningCard.d.ts.map +1 -1
  18. package/dist/types/src/features/IL-OTJ/_components/MarkdownComponents/MarkdownElements.d.ts.map +1 -1
  19. package/dist/types/src/features/IL-OTJ/_components/atoms/Textarea/Textarea.d.ts +1 -0
  20. package/dist/types/src/features/IL-OTJ/_components/atoms/Textarea/Textarea.d.ts.map +1 -1
  21. package/dist/types/src/features/IL-OTJ/_components/molecules/Condition/ConditionList.d.ts.map +1 -1
  22. package/dist/types/src/features/IL-OTJ/_components/organisms/ConfigSection/ConfigSection.d.ts.map +1 -1
  23. package/dist/types/src/features/IL-OTJ/_components/organisms/TextSection/TextSection.d.ts.map +1 -1
  24. package/dist/types/src/features/IL-OTJ/_components/templates/TrafficManager/CreateRule.d.ts.map +1 -1
  25. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),s=require("lucide-react"),r=require("react-markdown"),t=require("remark-gfm"),o=require("rehype-raw"),a=require("./_svg/CitationLinkSparkleIcon.js"),l=require("./_svg/GapIcon.js"),d=require("./_svg/Lightbulb.js"),c=require("./_svg/ButtonCognitiveIcon.js");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=g(r),x=g(t),f=g(o),u=i.memo(function(r){var t=r.isVisible,o=r.decisionStrength,g=r.reasoning,u=r.gap,_=i.useState({reasoning:!0,gap:!0}),h=_[0],y=_[1],j=i.useMemo(function(){return[f.default]},[]),m=i.useMemo(function(){return[x.default]},[]),b=i.useMemo(function(){return{p:function(i){i.node;var s=e.__rest(i,["node"]);return n.jsx("p",e.__assign({},s,{style:{margin:0}},{children:null==s?void 0:s.children}))},li:function(i){i.node;var s=i.index,r=e.__rest(i,["node","index"]);return n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"flex-start",marginBottom:"6px"}},{children:[n.jsx("span",e.__assign({style:{fontSize:"12px",fontWeight:400,color:"#55585fff",flexShrink:0,minWidth:"18px"}},{children:"number"==typeof s?"".concat(s+1,"."):"•"})),n.jsx("span",e.__assign({style:{fontSize:"12px",color:"#4B5563",lineHeight:"1.5",flex:1}},{children:r.children}))]}))}}},[]);if(!t||!g&&!u&&!o)return null;var v=function(n){y(function(i){var s;return e.__assign(e.__assign({},i),((s={})[n]=!i[n],s))})};return n.jsxs("div",e.__assign({style:{width:"100%",marginTop:"8px",overflow:"hidden",borderRadius:"8px",border:"1.5px solid #cacdfa",backgroundColor:"#FFFFFF",boxShadow:"0 2px 4px -1px rgba(0, 0, 0, 0.05)",fontFamily:'"Plus Jakarta Sans", sans-serif'}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px",backgroundColor:"#f4f2ff",borderBottom:"1px solid #fee2e2"}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[n.jsx(c.ButtonCognitiveIcon,{}),n.jsx("span",e.__assign({style:{fontSize:"13px",fontWeight:600,color:"black"}},{children:"Cognitive Decisioning AI"}))]})),o&&n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",borderRadius:"9999px",border:"1.3px solid #bb97f9ff",backgroundColor:"#FFFFFF",padding:"2px 8px",fontSize:"12px",fontWeight:500,color:"#000",gap:"4px"}},{children:[n.jsx(a.CitationLinkSparkleIcon,{}),"Decision Strength: ",o,"%"]}))]})),g&&n.jsxs("div",e.__assign({style:{borderBottom:u?"1px solid #f3f4f6":"none"}},{children:[n.jsxs("button",e.__assign({onClick:function(){return v("reasoning")},style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"12px 16px",border:"none",background:"none",cursor:"pointer"}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",gap:"12px",alignItems:"center"}},{children:[n.jsx(d.LightbulbIcon,{}),n.jsxs("div",e.__assign({style:{textAlign:"left"}},{children:[n.jsx("h4",e.__assign({style:{margin:0,fontSize:"13px",fontWeight:600,color:"#111827"}},{children:"Why this is a conflict?"})),n.jsx("p",e.__assign({style:{margin:0,fontSize:"11px",color:"#6B7280"}},{children:"Here is why this was picked"}))]}))]})),n.jsx(s.ChevronDownIcon,{size:16,style:{transform:h.reasoning?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s",color:"#9CA3AF"}})]})),h.reasoning&&n.jsx("div",e.__assign({style:{padding:"0 16px 16px 60px",fontSize:"12px",color:"#4B5563",lineHeight:"1.5"}},{children:n.jsx(p.default,e.__assign({components:b,rehypePlugins:j,remarkPlugins:m},{children:g}))}))]})),u&&n.jsxs("div",{children:[n.jsxs("button",e.__assign({onClick:function(){return v("gap")},style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"12px 16px",border:"none",background:"none",cursor:"pointer"}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",gap:"12px",alignItems:"center"}},{children:[n.jsx(l.GapIcon,{}),n.jsxs("div",e.__assign({style:{textAlign:"left"}},{children:[n.jsx("h4",e.__assign({style:{margin:0,fontSize:"13px",fontWeight:600,color:"#111827"}},{children:"Gap"})),n.jsx("p",e.__assign({style:{margin:0,fontSize:"11px",color:"#6B7280"}},{children:"Here is what’s missing or needs clarification"}))]}))]})),n.jsx(s.ChevronDownIcon,{size:16,style:{transform:h.gap?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s",color:"#9CA3AF"}})]})),h.gap&&n.jsx("div",e.__assign({style:{padding:"0 16px 16px 60px",fontSize:"12px",color:"#4B5563",lineHeight:"1.5"}},{children:n.jsx(p.default,e.__assign({components:b,rehypePlugins:j,remarkPlugins:m},{children:u}))}))]})]}))});u.displayName="ConflictReasoningCard",exports.ConflictReasoningCard=u;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),t=require("lucide-react"),s=require("react-markdown"),r=require("remark-gfm"),o=require("rehype-raw"),a=require("./_svg/CitationLinkSparkleIcon.js"),l=require("./_svg/GapIcon.js"),c=require("./_svg/Lightbulb.js"),d=require("./_svg/ButtonCognitiveIcon.js"),g=require("./MarkdownComponents/MarkdownElements.js"),u=require("./CitationLink.js");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var x=p(s),f=p(r),_=p(o),h=i.memo(function(s){var r=s.isVisible,o=s.decisionStrength,p=s.reasoning,h=s.gap,m=s.citations,y=i.useState({reasoning:!0,gap:!0}),j=y[0],b=y[1],v=i.useMemo(function(){return[_.default]},[]),k=i.useMemo(function(){return[f.default]},[]),C=i.useCallback(function(e,n){return console.log("getCitationByNumber called with:",{citationNumber:e,source:n},"and citations :",m),m&&m.find(function(i){return i.customMetaData.citation_number&&"Cognitive Decisioning"!==i.customMetaData.citation_title&&i.customMetaData.source===n&&String(i.customMetaData.citation_number)===String(e)})||null},[m]),S=i.useMemo(function(){return{p:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("p",e.__assign({},t,{style:{margin:0}},{children:null==t?void 0:t.children}))},li:function(i){i.node;var t=i.index,s=e.__rest(i,["node","index"]);return n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"flex-start",marginBottom:"6px"}},{children:[n.jsx("span",e.__assign({style:{fontSize:"12px",fontWeight:400,color:"#55585fff",flexShrink:0,minWidth:"18px"}},{children:"number"==typeof t?"".concat(t+1,"."):"•"})),n.jsx("span",e.__assign({style:{fontSize:"12px",color:"#4B5563",lineHeight:"1.5",flex:1}},{children:s.children}))]}))},a:function(i){i.node;var t=i.href,s=i.children,r=e.__rest(i,["node","href","children"]);if(!t)return n.jsx("a",e.__assign({},r,{children:s}));var o=t.match(/citationNumber=([^&]+)/),a=o?o[1]:null;if(console.log("Processing link:",{match:o,href:t,citationNumber:a}),a){var l=g.getSourceFromUrl(t),c=C(a,l);if(console.log("check source and citation here pls :",l,c),console.log("Found citation for link:",{href:t,citationNumber:a,source:l,citation:c}),c)return n.jsx("span",e.__assign({style:{display:"inline",alignItems:"center",fontSize:"14px !important",gap:"3px",color:"#2563EB",verticalAlign:"middle"}},{children:n.jsx(u.default,{citation:c,linkTitle:s,fontSize:12})}))}return n.jsx("a",e.__assign({href:t,target:"_blank",rel:"noopener noreferrer",style:{color:"#2563EB",textDecoration:"none"}},r,{children:s}))}}},[]);if(!r||!p&&!h&&!o)return null;var I=function(n){b(function(i){var t;return e.__assign(e.__assign({},i),((t={})[n]=!i[n],t))})};return n.jsxs("div",e.__assign({style:{width:"100%",marginTop:"8px",overflow:"hidden",borderRadius:"8px",border:"1.5px solid #cacdfa",backgroundColor:"#FFFFFF",boxShadow:"0 2px 4px -1px rgba(0, 0, 0, 0.05)",fontFamily:'"Plus Jakarta Sans", sans-serif'}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px",backgroundColor:"#f4f2ff",borderBottom:"1px solid #fee2e2"}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[n.jsx(d.ButtonCognitiveIcon,{}),n.jsx("span",e.__assign({style:{fontSize:"13px",fontWeight:600,color:"black"}},{children:"Cognitive Decisioning AI"}))]})),o&&n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",borderRadius:"9999px",border:"1.3px solid #bb97f9ff",backgroundColor:"#FFFFFF",padding:"2px 8px",fontSize:"12px",fontWeight:500,color:"#000",gap:"4px"}},{children:[n.jsx(a.CitationLinkSparkleIcon,{}),"Decision Strength: ",o,"%"]}))]})),p&&n.jsxs("div",e.__assign({style:{borderBottom:h?"1px solid #f3f4f6":"none"}},{children:[n.jsxs("button",e.__assign({onClick:function(){return I("reasoning")},style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"12px 16px",border:"none",background:"none",cursor:"pointer"}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",gap:"12px",alignItems:"center"}},{children:[n.jsx(c.LightbulbIcon,{}),n.jsxs("div",e.__assign({style:{textAlign:"left"}},{children:[n.jsx("h4",e.__assign({style:{margin:0,fontSize:"13px",fontWeight:600,color:"#111827"}},{children:"Why this is a conflict?"})),n.jsx("p",e.__assign({style:{margin:0,fontSize:"11px",color:"#6B7280"}},{children:"Here is why this was picked"}))]}))]})),n.jsx(t.ChevronDownIcon,{size:16,style:{transform:j.reasoning?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s",color:"#9CA3AF"}})]})),j.reasoning&&n.jsx("div",e.__assign({style:{padding:"0 16px 16px 60px",fontSize:"12px",color:"#4B5563",lineHeight:"1.5"}},{children:n.jsx(x.default,e.__assign({components:S,rehypePlugins:v,remarkPlugins:k},{children:p}))}))]})),h&&n.jsxs("div",{children:[n.jsxs("button",e.__assign({onClick:function(){return I("gap")},style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"12px 16px",border:"none",background:"none",cursor:"pointer"}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",gap:"12px",alignItems:"center"}},{children:[n.jsx(l.GapIcon,{}),n.jsxs("div",e.__assign({style:{textAlign:"left"}},{children:[n.jsx("h4",e.__assign({style:{margin:0,fontSize:"13px",fontWeight:600,color:"#111827"}},{children:"Gap"})),n.jsx("p",e.__assign({style:{margin:0,fontSize:"11px",color:"#6B7280"}},{children:"Here is what’s missing or needs clarification"}))]}))]})),n.jsx(t.ChevronDownIcon,{size:16,style:{transform:j.gap?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s",color:"#9CA3AF"}})]})),j.gap&&n.jsx("div",e.__assign({style:{padding:"0 16px 16px 60px",fontSize:"12px",color:"#4B5563",lineHeight:"1.5"}},{children:n.jsx(x.default,e.__assign({components:S,rehypePlugins:v,remarkPlugins:k},{children:h}))}))]})]}))});h.displayName="ConflictReasoningCard",exports.ConflictReasoningCard=h;
2
2
  //# sourceMappingURL=ConflictingReasoningCard.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),i=require("../atoms/SkeletonLoader/SkeletonLoader.js"),r=require("@e-llm-studio/citation"),a=require("../CitationLink.js"),o=require("../../helpers/utils.js"),l=require("../MessageRendering/RuleValidationCard.js"),s=require("./MarkdownSelect.js"),d=require("../CriticalGaps.js"),c=require("../_svg/ButtonCognitiveIcon.js"),u=require("../ViewFormUpdateCard.js"),p=require("../ViewIdentifiedFieldsCard.js");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=g(t),h=function(e,n){var t,i="";if(!(i="string"==typeof n?n:(null===(t=null==n?void 0:n.customMetaData)||void 0===t?void 0:t.content)?n.customMetaData.content:String(n)))return null;var r=new RegExp("<".concat(e,"[^>]*>([\\s\\S]*?)<\\/").concat(e,">"),"i"),a=i.match(r);return a?a[1].replace(/\\n/g,"\n"):null},f=function(e){return e?e.replace(/(\[[^\]]+\]\()([^)]+)(\))/g,function(e,n,t,i){var r=t.replace(/\s/g,"%20");return"".concat(n).concat(r).concat(i)}):""},x={val:"validation_agent",lhs:"lhs",rhs:"rhs"},v=function(e){var n,t=e.match(/[?&]source=([^&?]+)/),i=t?t[1]:"lhs";return null!==(n=x[i])&&void 0!==n?n:i},_=m.default.memo(function(a){var l=a.children;a.cardId;var s=a.isOpen,d=a.isStreamEnd,u=a.handleToggle,p=a.cardMdComponents,g=t.useRef(null);t.useEffect(function(){if(s&&g.current){var e=setTimeout(function(){var e;null===(e=g.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"nearest"})},100);return function(){return clearTimeout(e)}}},[s]);var m=o.extractTextFromChildren(l),x=h("reason",m)||"",v=h("gap",m)||"",_=h("relevance_score",m),S=f(x),y=f(v),k=t.useMemo(function(){return{header:{backgroundColor:"#F5F3FF",padding:"8px 16px"},sectionButton:{paddingLeft:"24px",paddingRight:"24px",paddingBottom:"12px"},textContent:{fontSize:"12px",paddingLeft:"24px",paddingRight:"24px",paddingBottom:"20px"},pill:{gap:"2px",border:"none",backgroundColor:"transparent"}}},[]);return n.jsx("span",e.__assign({style:{display:"inline",marginTop:"3px",marginLeft:"6px",verticalAlign:"middle"}},{children:d?n.jsx(r.CognitiveDecisioningCard,{headerIcon:n.jsx(c.ButtonCognitiveIcon,{}),ref:g,reasoning:S,gap:y,score:_,mdComponents:p,isOpen:s,onToggle:u,styles:k}):n.jsx(i.Skeleton,{width:"2.2rem",height:"1.2rem"})}))}),S=m.default.memo(function(r){var c,u=r.className,p=r.children,g=r.openCardIds,h=r.citations,f=r.handleToggleState,x=r.isStreamEnd,v=r.isLastMessage,S=r.handleStream,y=r.onGapValidation,k=r.isGapsSubmitted,C=r.onViewComparison,w=r.onTypeResponseClick,j=r.onComparisonLinkClick,b=r.isGlobalEditActive,T=e.__rest(r,["className","children","openCardIds","citations","handleToggleState","isStreamEnd","isLastMessage","handleStream","onGapValidation","isGapsSubmitted","onViewComparison","onTypeResponseClick","onComparisonLinkClick","isGlobalEditActive"]),M=t.useCallback(function(e){return h&&h.find(function(n){return n.customMetaData.citation_number&&"Cognitive Decisioning"!==n.customMetaData.citation_title&&String(n.customMetaData.citation_number)===String(e)})||null},[h]),F=t.useMemo(function(){return{img:function(t){t.node;var i=e.__rest(t,["node"]);return n.jsx("img",e.__assign({},i,{style:{height:"100%",width:"100%",objectFit:"contain"},alt:(null==i?void 0:i.alt)||"",className:"w-full sm:max-w-lg md:max-w-2xl lg:max-w-4xl mx-auto"}))},p:function(t){t.node;var i=e.__rest(t,["node"]);return n.jsx("p",e.__assign({},i,{style:{margin:0}},{children:null==i?void 0:i.children}))},code:function(t){t.node;var i=e.__rest(t,["node"]);return n.jsx("span",e.__assign({},i,{style:{maxWidth:"100%",wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word",whiteSpace:"normal",overflow:"hidden",display:"inline-flex",fontSize:"1rem",lineHeight:"1.625rem"}},{children:null==i?void 0:i.children}))},ol:function(t){t.node;var i=e.__rest(t,["node"]);return n.jsx("ol",e.__assign({},i,{style:{display:"flex",flexDirection:"column",gap:"1rem",listStyle:"decimal",paddingLeft:"2.5rem"}},{children:null==i?void 0:i.children}))},ul:function(t){t.node;var i=e.__rest(t,["node"]);return n.jsx("ol",e.__assign({},i,{style:{paddingLeft:"1.25rem",listStyleType:"decimal"}}))},li:function(t){t.node;var i=e.__rest(t,["node"]);return n.jsx("li",e.__assign({},i,{style:{marginBottom:"4px",listStyle:"decimal"}},{children:i.children}))},a:function(t){var i=t.href,r=t.children,o=e.__rest(t,["href","children"]);if(!i)return n.jsx("a",e.__assign({},o,{children:r}));var l=i||"",s=l;try{s=decodeURIComponent(l)}catch(e){console.error("Error decoding href",e)}if(s.includes("citation_type=comparison")){var d="",c="",u=s.match(/variant_id=([^?&]+)/);u&&(d=u[1]);var p=s.match(/field_name=([^&]+)/);return p&&(c=p[1]),n.jsx("button",e.__assign({type:"button",onClick:function(e){e.preventDefault(),e.stopPropagation(),console.log("Rule Comparison Triggered:",{variantId:d,fieldName:c}),j&&j(d,c)},style:{background:"#EFF6FF",border:"1px solid #BFDBFE",borderRadius:"6px",padding:"2px 8px",color:"#2563EB",cursor:"pointer",fontSize:"13px",fontWeight:500,display:"inline-flex",alignItems:"center",margin:"0 4px",verticalAlign:"baseline",transition:"background-color 0.2s ease",textDecoration:"none"},title:"View Comparison"},{children:r}))}var g=s.match(/citationNumber=([^&]+)/);if(g&&a.default){var m=M(g[1]);if(m)return n.jsx(a.default,{citation:m,linkTitle:r,fontSize:12})}return n.jsx("a",e.__assign({href:l,target:"_blank",rel:"noopener noreferrer",className:"md-link inline-flex items-center gap-1 text-purple-700 hover:underline",style:{color:"#7C3AED"}},o,{children:r}))}}},[M]);if("cognitive-card-trigger"===u){var E=T["data-card-id"],D=g.has(E);return n.jsx(_,e.__assign({cardId:E,isOpen:D,isStreamEnd:x,handleToggle:function(){return f(E,!D,"card")},cardMdComponents:F},{children:p}))}if("rule-validation-card-trigger"===u){console.log("🎯 rule-validation-card-trigger div rendered, isStreamEnd:",x);var I=T,R=function(e){return e?e.replace(/&quot;/g,'"').replace(/&#039;/g,"'").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&"):""};return!x&&v?(console.log("Rendering Rule Validation Skeleton for:",I["data-title"]),n.jsxs("div",e.__assign({style:{border:"1px solid #E2E8F0",backgroundColor:"#FFF",borderRadius:"12px",padding:"16px",display:"flex",flexDirection:"column",gap:"12px",marginTop:"8px",marginBottom:"8px"}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},{children:[n.jsx(i.Skeleton,{variant:"text",width:140,height:28}),n.jsx(i.Skeleton,{variant:"text",width:100,height:28})]})),n.jsx(i.Skeleton,{variant:"title",width:"50%",height:20}),n.jsx(i.Skeleton,{variant:"text",width:"90%",height:16}),n.jsx(i.Skeleton,{variant:"text",width:"60%",height:16}),n.jsx(i.Skeleton,{variant:"text",width:120,height:40})]}))):n.jsx(l.default,{validationType:"duplicate"===I["data-type"]?"duplicate":"similar"===I["data-type"]?"similar":"conflicting",decisionStrength:I["data-decision-strength"]||I.dataDecisionStrength,title:R(I["data-title"]||I.dataTitle),tier:R(I["data-tier"]||I.dataTier),descriptionText:R(I["data-description"]||I.dataDescription),reasoningNode:p,onViewComparison:C||function(){},disabled:!v||!!b})}if("markdown-select-trigger"===u){I=T;var L=(null===(c=m.default.Children.map(p,function(e){var n;if("select-option-item"===(null===(n=null==e?void 0:e.props)||void 0===n?void 0:n.className)){var t=o.extractTextFromChildren(e.props.children),i=function(e,n){var t=new RegExp("<".concat(e,">([\\s\\S]*?)<\\/").concat(e,">"),"i"),i=n.match(t);return i?i[1].trim():null},r=i("reason",t),a=i("gap",t),l=i("relevance_score",t),s=t.replace(/<ai_reasoning>[\s\S]*?<\/ai_reasoning>/gi,"").replace(/<[^>]+>[\s\S]*?<\/[^>]+>/gi,"").replace(/\s+/g," ").trim();return{id:e.props["data-id"],label:s,cd:!(!r&&!a),reasoning:r,gap:a,score:l}}return null}))||void 0===c?void 0:c.filter(Boolean))||[];return n.jsx(s.MarkdownSelect,{type:I["data-type"],options:L,selectedIds:[],disabled:!x||!v||!!b,citations:h,onTypeResponseClick:w,onProceed:function(e,n){console.log("Proceeding with label:",n),S&&S(new KeyboardEvent("keydown",{key:"Enter"}),!1,n)}})}if("critical-gaps-trigger"===u){var N=T["data-payload"];I=void 0;try{I=JSON.parse(N)}catch(e){return console.error("Failed to parse critical gaps payload",e),null}return!x&&v?n.jsxs("div",e.__assign({style:{border:"1px solid #E2E8F0",backgroundColor:"#FFF",borderRadius:"12px",padding:"16px",display:"flex",flexDirection:"column",gap:"12px",marginTop:"8px",marginBottom:"8px"}},{children:[n.jsx(i.Skeleton,{variant:"title",width:"40%",height:20}),n.jsx(i.Skeleton,{variant:"text",width:"80%",height:16}),n.jsx(i.Skeleton,{variant:"text",width:"70%",height:16}),n.jsx(i.Skeleton,{variant:"text",width:120,height:40})]})):n.jsx(d.CriticalGaps,{data:I,isLastMessage:v,onValidationChange:y,isSubmitted:k,citations:h,onTypeResponseClick:w,isGlobalEditActive:b})}return n.jsx("div",e.__assign({className:u},T,{children:p}))}),y=m.default.memo(function(i){var r=i.className,o=i.children,l=i.openCardIds,s=i.citations,d=i.handleToggleState,c=i.isStreamEnd;i.onTypeResponseClick;var g=i.onComparisonLinkClick,m=e.__rest(i,["className","children","openCardIds","citations","handleToggleState","isStreamEnd","onTypeResponseClick","onComparisonLinkClick"]),h=t.useCallback(function(e,n){return s&&s.find(function(t){return t.customMetaData.citation_number&&"Cognitive Decisioning"!==t.customMetaData.citation_title&&t.customMetaData.source===n&&String(t.customMetaData.citation_number)===String(e)})||null},[s]),f=t.useMemo(function(){return{img:function(t){t.node;var i=e.__rest(t,["node"]);return n.jsx("img",e.__assign({},i,{style:{height:"100%",width:"100%",objectFit:"contain"},alt:(null==i?void 0:i.alt)||"",className:"w-full sm:max-w-lg md:max-w-2xl lg:max-w-4xl mx-auto"}))},p:function(t){t.node;var i=e.__rest(t,["node"]);return n.jsx("p",e.__assign({},i,{style:{margin:0}},{children:null==i?void 0:i.children}))},code:function(t){t.node;var i=e.__rest(t,["node"]);return n.jsx("span",e.__assign({},i,{style:{maxWidth:"100%",wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word",whiteSpace:"normal",overflow:"hidden",display:"inline-flex",fontSize:"1rem",lineHeight:"1.625rem"}},{children:null==i?void 0:i.children}))},ol:function(t){t.node;var i=e.__rest(t,["node"]);return n.jsx("ol",e.__assign({},i,{style:{display:"flex",flexDirection:"column",gap:"1rem",listStyle:"decimal",paddingLeft:"2.5rem"}},{children:null==i?void 0:i.children}))},ul:function(t){t.node;var i=e.__rest(t,["node"]);return n.jsx("ol",e.__assign({},i,{style:{paddingLeft:"1.25rem",listStyleType:"decimal"}}))},li:function(t){t.node;var i=e.__rest(t,["node"]);return n.jsx("li",e.__assign({},i,{style:{marginBottom:"4px",listStyle:"decimal"}},{children:i.children}))},a:function(t){var i=t.href,r=t.children,o=e.__rest(t,["href","children"]);if(!i)return n.jsx("a",e.__assign({},o,{children:r}));var l=i||"",s=l;try{s=decodeURIComponent(l)}catch(e){console.error("Error decoding href",e)}if(s.includes("citation_type=comparison")){var d="",c="",u=s.match(/variant_id=([^?&]+)/);u&&(d=u[1]);var p=s.match(/field_name=([^&]+)/);return p&&(c=p[1]),n.jsxs("button",e.__assign({type:"button",onClick:function(e){e.preventDefault(),e.stopPropagation(),console.log("Rule Comparison Triggered (span):",{variantId:d,fieldName:c}),g&&g(d,c)},style:{background:"none",border:"none",outline:"none",borderRadius:"6px",padding:"1x 4px",color:"#0F172A",cursor:"pointer",fontSize:"13px",fontWeight:500,display:"inline-flex",alignItems:"center",gap:"2px",margin:"0 1 px",verticalAlign:"baseline",textDecoration:"none",boxShadow:"none",WebkitAppearance:"none",MozAppearance:"none"},title:"View Comparison"},{children:[r,n.jsx("svg",e.__assign({width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:n.jsx("path",{d:"M10.2082 8.67708H2.0415M2.0415 8.67708L4.08317 6.63542M2.0415 8.67708L4.08317 10.7188M2.0415 3.57292H10.2082M10.2082 3.57292L8.1665 1.53125M10.2082 3.57292L8.1665 5.61458",stroke:"#0F172A",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})}))]}))}var m=s.match(/citationNumber=([^&]+)/);if(m&&a.default){var f=v(s),x=h(m[1],f);if(x)return n.jsx(a.default,{citation:x,linkTitle:r,fontSize:12})}return n.jsx("a",e.__assign({href:l,target:"_blank",rel:"noopener noreferrer",className:"md-link inline-flex items-center gap-1 text-purple-700 hover:underline",style:{color:"#7C3AED"}},o,{children:r}))}}},[h]);if("cognitive-card-trigger"===r){var x=m["data-card-id"],S=l.has(x);return n.jsx(_,e.__assign({cardId:x,isOpen:S,isStreamEnd:c,handleToggle:function(){return d(x,!S,"card")},cardMdComponents:f},{children:o}))}if("view-form-update-trigger"===r){var y=m["data-payload"],k=void 0;try{k=JSON.parse(y)}catch(e){return null}return n.jsx(u.ViewFormUpdateCard,{data:k,openCardIds:l,handleToggleState:d,isStreamEnd:c,cardMdComponents:f})}if("view-identified-fields-trigger"===r){y=m["data-payload"],k=void 0;try{k=JSON.parse(y)}catch(e){return null}return n.jsx(p.ViewIdentifiedFieldsCard,{data:k,openCardIds:l,handleToggleState:d,isStreamEnd:c,cardMdComponents:f})}return n.jsx("span",e.__assign({className:r},m,{children:o}))}),k=m.default.memo(function(t){var i=t.href,r=t.children,o=t.chatSize,l=t.openCitationIds,s=t.getCitationByNumber,d=t.handleToggleState,c=e.__rest(t,["href","children","chatSize","openCitationIds","getCitationByNumber","handleToggleState"]);if(!i)return n.jsx("a",e.__assign({},c,{children:r}));var u=i.match(/citationNumber=([^&]+)/),p=u?u[1]:null,g=i.match(/uiUniqueId=([^&]+)/),m=g?g[1]:null;if(p){var h=s(p,v(i));if(h){var f=m?"citation-ui-".concat(m):"citation-".concat(h.id||p),x=l.has(f);return n.jsx(a.default,{citation:h,linkTitle:r,chatSize:o,isOpen:x,onToggle:function(){return d(f,!x,"citation")}},f)}}return n.jsx("a",e.__assign({href:i,target:"_blank",style:{color:"inherit",textDecoration:"none"},rel:"noopener noreferrer",className:"md-link inline-flex items-center gap-1 text-purple-700 hover:underline"},c,{children:r}))});exports.MarkdownDivRenderer=S,exports.MarkdownLinkRenderer=k,exports.MarkdownSpanRenderer=y,exports.getSourceFromUrl=v;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),i=require("../atoms/SkeletonLoader/SkeletonLoader.js"),r=require("@e-llm-studio/citation"),a=require("../CitationLink.js"),o=require("../../helpers/utils.js"),l=require("../MessageRendering/RuleValidationCard.js"),s=require("./MarkdownSelect.js"),d=require("../CriticalGaps.js"),c=require("../_svg/ButtonCognitiveIcon.js"),u=require("../ViewFormUpdateCard.js"),p=require("../ViewIdentifiedFieldsCard.js");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=g(t),h=function(e,n){var t,i="";if(!(i="string"==typeof n?n:(null===(t=null==n?void 0:n.customMetaData)||void 0===t?void 0:t.content)?n.customMetaData.content:String(n)))return null;var r=new RegExp("<".concat(e,"[^>]*>([\\s\\S]*?)<\\/").concat(e,">"),"i"),a=i.match(r);return a?a[1].replace(/\\n/g,"\n"):null},f=function(e){return e?e.replace(/(\[[^\]]+\]\()([^)]+)(\))/g,function(e,n,t,i){var r=t.replace(/\s/g,"%20");return"".concat(n).concat(r).concat(i)}):""},x={val:"validation_agent",validate_wta_wnta:"validate_wta_wnta",lhs:"lhs",rhs:"rhs"},v=function(e){var n,t=e.match(/[?&]source=([^&?]+)/),i=t?t[1]:"lhs";return null!==(n=x[i])&&void 0!==n?n:i},_=m.default.memo(function(a){var l=a.children;a.cardId;var s=a.isOpen,d=a.isStreamEnd,u=a.handleToggle,p=a.cardMdComponents,g=t.useRef(null);t.useEffect(function(){if(s&&g.current){var e=setTimeout(function(){var e;null===(e=g.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"nearest"})},100);return function(){return clearTimeout(e)}}},[s]);var m=o.extractTextFromChildren(l),x=h("reason",m)||"",v=h("gap",m)||"",_=h("relevance_score",m),S=f(x),y=f(v),k=t.useMemo(function(){return{header:{backgroundColor:"#F5F3FF",padding:"8px 16px"},sectionButton:{paddingLeft:"24px",paddingRight:"24px",paddingBottom:"12px"},textContent:{fontSize:"12px",paddingLeft:"24px",paddingRight:"24px",paddingBottom:"20px"},pill:{gap:"2px",border:"none",backgroundColor:"transparent"}}},[]);return n.jsx("span",e.__assign({style:{display:"inline",marginTop:"3px",marginLeft:"6px",verticalAlign:"middle"}},{children:d?n.jsx(r.CognitiveDecisioningCard,{headerIcon:n.jsx(c.ButtonCognitiveIcon,{}),ref:g,reasoning:S,gap:y,score:_,mdComponents:p,isOpen:s,onToggle:u,styles:k}):n.jsx(i.Skeleton,{width:"2.2rem",height:"1.2rem"})}))}),S=m.default.memo(function(r){var c,u=r.className,p=r.children,g=r.openCardIds,h=r.citations,f=r.handleToggleState,x=r.isStreamEnd,v=r.isLastMessage,S=r.handleStream,y=r.onGapValidation,k=r.isGapsSubmitted,w=r.onViewComparison,C=r.onTypeResponseClick,j=r.onComparisonLinkClick,b=r.isGlobalEditActive,T=e.__rest(r,["className","children","openCardIds","citations","handleToggleState","isStreamEnd","isLastMessage","handleStream","onGapValidation","isGapsSubmitted","onViewComparison","onTypeResponseClick","onComparisonLinkClick","isGlobalEditActive"]),M=t.useCallback(function(e){return h&&h.find(function(n){return n.customMetaData.citation_number&&"Cognitive Decisioning"!==n.customMetaData.citation_title&&String(n.customMetaData.citation_number)===String(e)})||null},[h]),F=t.useMemo(function(){return{img:function(t){t.node;var i=e.__rest(t,["node"]);return n.jsx("img",e.__assign({},i,{style:{height:"100%",width:"100%",objectFit:"contain"},alt:(null==i?void 0:i.alt)||"",className:"w-full sm:max-w-lg md:max-w-2xl lg:max-w-4xl mx-auto"}))},p:function(t){t.node;var i=e.__rest(t,["node"]);return n.jsx("p",e.__assign({},i,{style:{margin:0}},{children:null==i?void 0:i.children}))},code:function(t){t.node;var i=e.__rest(t,["node"]);return n.jsx("span",e.__assign({},i,{style:{maxWidth:"100%",wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word",whiteSpace:"normal",overflow:"hidden",display:"inline-flex",fontSize:"1rem",lineHeight:"1.625rem"}},{children:null==i?void 0:i.children}))},ol:function(t){t.node;var i=e.__rest(t,["node"]);return n.jsx("ol",e.__assign({},i,{style:{display:"flex",flexDirection:"column",gap:"1rem",listStyle:"decimal",paddingLeft:"2.5rem"}},{children:null==i?void 0:i.children}))},ul:function(t){t.node;var i=e.__rest(t,["node"]);return n.jsx("ol",e.__assign({},i,{style:{paddingLeft:"1.25rem",listStyleType:"decimal"}}))},li:function(t){t.node;var i=e.__rest(t,["node"]);return n.jsx("li",e.__assign({},i,{style:{marginBottom:"4px",listStyle:"decimal"}},{children:i.children}))},a:function(t){var i=t.href,r=t.children,o=e.__rest(t,["href","children"]);if(!i)return n.jsx("a",e.__assign({},o,{children:r}));var l=i||"",s=l;try{s=decodeURIComponent(l)}catch(e){console.error("Error decoding href",e)}if(s.includes("citation_type=comparison")){var d="",c="",u=s.match(/variant_id=([^?&]+)/);u&&(d=u[1]);var p=s.match(/field_name=([^&]+)/);return p&&(c=p[1]),n.jsx("button",e.__assign({type:"button",onClick:function(e){e.preventDefault(),e.stopPropagation(),console.log("Rule Comparison Triggered:",{variantId:d,fieldName:c}),j&&j(d,c)},style:{background:"#EFF6FF",border:"1px solid #BFDBFE",borderRadius:"6px",padding:"2px 8px",color:"#2563EB",cursor:"pointer",fontSize:"13px",fontWeight:500,display:"inline-flex",alignItems:"center",margin:"0 4px",verticalAlign:"baseline",transition:"background-color 0.2s ease",textDecoration:"none"},title:"View Comparison"},{children:r}))}var g=s.match(/citationNumber=([^&]+)/);if(g&&a.default){var m=M(g[1]);if(m)return n.jsx(a.default,{citation:m,linkTitle:r,fontSize:12})}return n.jsx("a",e.__assign({href:l,target:"_blank",rel:"noopener noreferrer",className:"md-link inline-flex items-center gap-1 text-purple-700 hover:underline",style:{color:"#7C3AED"}},o,{children:r}))}}},[M]);if("cognitive-card-trigger"===u){var E=T["data-card-id"],D=g.has(E);return n.jsx(_,e.__assign({cardId:E,isOpen:D,isStreamEnd:x,handleToggle:function(){return f(E,!D,"card")},cardMdComponents:F},{children:p}))}if("rule-validation-card-trigger"===u){console.log("🎯 rule-validation-card-trigger div rendered, isStreamEnd:",x);var I=T,R=function(e){return e?e.replace(/&quot;/g,'"').replace(/&#039;/g,"'").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&"):""};return!x&&v?(console.log("Rendering Rule Validation Skeleton for:",I["data-title"]),n.jsxs("div",e.__assign({style:{border:"1px solid #E2E8F0",backgroundColor:"#FFF",borderRadius:"12px",padding:"16px",display:"flex",flexDirection:"column",gap:"12px",marginTop:"8px",marginBottom:"8px"}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},{children:[n.jsx(i.Skeleton,{variant:"text",width:140,height:28}),n.jsx(i.Skeleton,{variant:"text",width:100,height:28})]})),n.jsx(i.Skeleton,{variant:"title",width:"50%",height:20}),n.jsx(i.Skeleton,{variant:"text",width:"90%",height:16}),n.jsx(i.Skeleton,{variant:"text",width:"60%",height:16}),n.jsx(i.Skeleton,{variant:"text",width:120,height:40})]}))):n.jsx(l.default,{validationType:"duplicate"===I["data-type"]?"duplicate":"similar"===I["data-type"]?"similar":"conflicting",decisionStrength:I["data-decision-strength"]||I.dataDecisionStrength,title:R(I["data-title"]||I.dataTitle),tier:R(I["data-tier"]||I.dataTier),descriptionText:R(I["data-description"]||I.dataDescription),reasoningNode:p,onViewComparison:w||function(){},disabled:!v||!!b})}if("markdown-select-trigger"===u){I=T;var L=(null===(c=m.default.Children.map(p,function(e){var n;if("select-option-item"===(null===(n=null==e?void 0:e.props)||void 0===n?void 0:n.className)){var t=o.extractTextFromChildren(e.props.children),i=function(e,n){var t=new RegExp("<".concat(e,">([\\s\\S]*?)<\\/").concat(e,">"),"i"),i=n.match(t);return i?i[1].trim():null},r=i("reason",t),a=i("gap",t),l=i("relevance_score",t),s=t.replace(/<ai_reasoning>[\s\S]*?<\/ai_reasoning>/gi,"").replace(/<[^>]+>[\s\S]*?<\/[^>]+>/gi,"").replace(/\s+/g," ").trim();return{id:e.props["data-id"],label:s,cd:!(!r&&!a),reasoning:r,gap:a,score:l}}return null}))||void 0===c?void 0:c.filter(Boolean))||[];return n.jsx(s.MarkdownSelect,{type:I["data-type"],options:L,selectedIds:[],disabled:!x||!v||!!b,citations:h,onTypeResponseClick:C,onProceed:function(e,n){console.log("Proceeding with label:",n),S&&S(new KeyboardEvent("keydown",{key:"Enter"}),!1,n)}})}if("critical-gaps-trigger"===u){var N=T["data-payload"];I=void 0;try{I=JSON.parse(N)}catch(e){return console.error("Failed to parse critical gaps payload",e),null}return!x&&v?n.jsxs("div",e.__assign({style:{border:"1px solid #E2E8F0",backgroundColor:"#FFF",borderRadius:"12px",padding:"16px",display:"flex",flexDirection:"column",gap:"12px",marginTop:"8px",marginBottom:"8px"}},{children:[n.jsx(i.Skeleton,{variant:"title",width:"40%",height:20}),n.jsx(i.Skeleton,{variant:"text",width:"80%",height:16}),n.jsx(i.Skeleton,{variant:"text",width:"70%",height:16}),n.jsx(i.Skeleton,{variant:"text",width:120,height:40})]})):n.jsx(d.CriticalGaps,{data:I,isLastMessage:v,onValidationChange:y,isSubmitted:k,citations:h,onTypeResponseClick:C,isGlobalEditActive:b})}return n.jsx("div",e.__assign({className:u},T,{children:p}))}),y=m.default.memo(function(i){var r=i.className,o=i.children,l=i.openCardIds,s=i.citations,d=i.handleToggleState,c=i.isStreamEnd;i.onTypeResponseClick;var g=i.onComparisonLinkClick,m=e.__rest(i,["className","children","openCardIds","citations","handleToggleState","isStreamEnd","onTypeResponseClick","onComparisonLinkClick"]),h=t.useCallback(function(e,n){return s&&s.find(function(t){return t.customMetaData.citation_number&&"Cognitive Decisioning"!==t.customMetaData.citation_title&&t.customMetaData.source===n&&String(t.customMetaData.citation_number)===String(e)})||null},[s]),f=t.useMemo(function(){return{img:function(t){t.node;var i=e.__rest(t,["node"]);return n.jsx("img",e.__assign({},i,{style:{height:"100%",width:"100%",objectFit:"contain"},alt:(null==i?void 0:i.alt)||"",className:"w-full sm:max-w-lg md:max-w-2xl lg:max-w-4xl mx-auto"}))},p:function(t){t.node;var i=e.__rest(t,["node"]);return n.jsx("p",e.__assign({},i,{style:{margin:0}},{children:null==i?void 0:i.children}))},code:function(t){t.node;var i=e.__rest(t,["node"]);return n.jsx("span",e.__assign({},i,{style:{maxWidth:"100%",wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word",whiteSpace:"normal",overflow:"hidden",display:"inline-flex",fontSize:"1rem",lineHeight:"1.625rem"}},{children:null==i?void 0:i.children}))},ol:function(t){t.node;var i=e.__rest(t,["node"]);return n.jsx("ol",e.__assign({},i,{style:{display:"flex",flexDirection:"column",gap:"1rem",listStyle:"decimal",paddingLeft:"2.5rem"}},{children:null==i?void 0:i.children}))},ul:function(t){t.node;var i=e.__rest(t,["node"]);return n.jsx("ol",e.__assign({},i,{style:{paddingLeft:"1.25rem",listStyleType:"decimal"}}))},li:function(t){t.node;var i=e.__rest(t,["node"]);return n.jsx("li",e.__assign({},i,{style:{marginBottom:"4px",listStyle:"decimal"}},{children:i.children}))},a:function(t){var i=t.href,r=t.children,o=e.__rest(t,["href","children"]);if(!i)return n.jsx("a",e.__assign({},o,{children:r}));var l=i||"",s=l;try{s=decodeURIComponent(l)}catch(e){console.error("Error decoding href",e)}if(s.includes("citation_type=comparison")){var d="",c="",u=s.match(/variant_id=([^?&]+)/);u&&(d=u[1]);var p=s.match(/field_name=([^&]+)/);return p&&(c=p[1]),n.jsxs("button",e.__assign({type:"button",onClick:function(e){e.preventDefault(),e.stopPropagation(),console.log("Rule Comparison Triggered (span):",{variantId:d,fieldName:c}),g&&g(d,c)},style:{background:"none",border:"none",outline:"none",borderRadius:"6px",padding:"1x 4px",color:"#0F172A",cursor:"pointer",fontSize:"13px",fontWeight:500,display:"inline-flex",alignItems:"center",gap:"2px",margin:"0 1 px",verticalAlign:"baseline",textDecoration:"none",boxShadow:"none",WebkitAppearance:"none",MozAppearance:"none"},title:"View Comparison"},{children:[r,n.jsx("svg",e.__assign({width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:n.jsx("path",{d:"M10.2082 8.67708H2.0415M2.0415 8.67708L4.08317 6.63542M2.0415 8.67708L4.08317 10.7188M2.0415 3.57292H10.2082M10.2082 3.57292L8.1665 1.53125M10.2082 3.57292L8.1665 5.61458",stroke:"#0F172A",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})}))]}))}var m=s.match(/citationNumber=([^&]+)/);if(m&&a.default){var f=v(s),x=h(m[1],f);if(x)return n.jsx(a.default,{citation:x,linkTitle:r,fontSize:12})}return n.jsx("a",e.__assign({href:l,target:"_blank",rel:"noopener noreferrer",className:"md-link inline-flex items-center gap-1 text-purple-700 hover:underline",style:{color:"#7C3AED"}},o,{children:r}))}}},[h]);if("cognitive-card-trigger"===r){var x=m["data-card-id"],S=l.has(x);return n.jsx(_,e.__assign({cardId:x,isOpen:S,isStreamEnd:c,handleToggle:function(){return d(x,!S,"card")},cardMdComponents:f},{children:o}))}if("view-form-update-trigger"===r){var y=m["data-payload"],k=void 0;try{k=JSON.parse(y)}catch(e){return null}return n.jsx(u.ViewFormUpdateCard,{data:k,openCardIds:l,handleToggleState:d,isStreamEnd:c,cardMdComponents:f})}if("view-identified-fields-trigger"===r){y=m["data-payload"],k=void 0;try{k=JSON.parse(y)}catch(e){return null}return n.jsx(p.ViewIdentifiedFieldsCard,{data:k,openCardIds:l,handleToggleState:d,isStreamEnd:c,cardMdComponents:f})}return n.jsx("span",e.__assign({className:r},m,{children:o}))}),k=m.default.memo(function(t){var i=t.href,r=t.children,o=t.chatSize,l=t.openCitationIds,s=t.getCitationByNumber,d=t.handleToggleState,c=e.__rest(t,["href","children","chatSize","openCitationIds","getCitationByNumber","handleToggleState"]);if(!i)return n.jsx("a",e.__assign({},c,{children:r}));var u=i.match(/citationNumber=([^&]+)/),p=u?u[1]:null,g=i.match(/uiUniqueId=([^&]+)/),m=g?g[1]:null;if(p){var h=s(p,v(i));if(h){var f=m?"citation-ui-".concat(m):"citation-".concat(h.id||p),x=l.has(f);return n.jsx(a.default,{citation:h,linkTitle:r,chatSize:o,isOpen:x,onToggle:function(){return d(f,!x,"citation")}},f)}}return n.jsx("a",e.__assign({href:i,target:"_blank",style:{color:"inherit",textDecoration:"none"},rel:"noopener noreferrer",className:"md-link inline-flex items-center gap-1 text-purple-700 hover:underline"},c,{children:r}))});exports.MarkdownDivRenderer=S,exports.MarkdownLinkRenderer=k,exports.MarkdownSpanRenderer=y,exports.getSourceFromUrl=v;
2
2
  //# sourceMappingURL=MarkdownElements.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),r=require("../../_svg/CognitiveDecisioning.js"),o=require("lucide-react"),t=require("../../TooltipComponent.js"),s=require("../../ConflictingReasoningCard.js"),a=i.forwardRef(function(a,l){var c=a.rows,d=void 0===c?1:c,p=a.placeholder,x=a.value,u=a.onChange,g=a.onFocus,f=a.isHighlighted,h=void 0!==f&&f,v=a.customClass,b=a.showNumber,y=a.numberIndex,_=a.isReadOnly,j=void 0!==_&&_,C=a.isOpen,w=void 0!==C&&C,m=a.onToggle,k=a.showCognitiveIcon,z=void 0!==k&&k,I=a.cognitiveIcon,R=a.tooltipDescription,S=a.isConflicting,T=a.conflictMsg,D=a.conflictingReasoning,E=a.decisionStrength,q=a.conflictingGap,F=a.errorMessage,M=a.inputReadOnly,O=void 0!==M&&M,H=function(){return I||n.jsx(r.default,{})},L=i.useRef(null),N=i.useCallback(function(e){e.style.height="auto",e.style.height="".concat(e.scrollHeight,"px")},[]);i.useEffect(function(){var e=function(){L.current&&N(L.current)};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[N]);var A=i.useCallback(function(e){L.current=e,l&&("function"==typeof l?l(e):l.current=e),e&&N(e)},[l,N]);return n.jsxs("div",e.__assign({style:{width:"100%"}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",width:"100%",border:"1px solid ".concat(S||F?"#ef4444":h?"#2563EB":"#ccc"),borderRadius:"0.5rem",backgroundColor:j?"#f9fafb":"white",opacity:j?.8:1,cursor:j?"not-allowed":"text",pointerEvents:"auto",transition:"all 0.3s ease-in-out",overflow:"hidden",boxShadow:S&&h?"0 0 20px 3px rgba(239, 68, 68, 0.45)":h?"\n 0 0 12px 3px rgba(37, 99, 235, 0.3),\n -6px 0 10px rgba(37, 99, 235, 0.2),\n 6px 0 10px rgba(37, 99, 235, 0.2)\n ":"none"},onMouseEnter:function(e){h||S||j||(e.currentTarget.style.border="1px solid black"),j&&(e.currentTarget.style.cursor="not-allowed")},onMouseLeave:function(e){h||S||j||(e.currentTarget.style.border="1px solid #ccc")}},{children:[n.jsx("div",e.__assign({style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},{children:S&&T&&n.jsx("div",e.__assign({style:{padding:"12px 12px 0 12px"}},{children:n.jsxs("div",e.__assign({style:{display:"inline-flex",alignItems:"center",gap:"6px",backgroundColor:"#FFE9E980",padding:"4px 10px",borderRadius:"16px",color:"#b91c1c",fontSize:"12px",fontWeight:500}},{children:[n.jsx(o.AlertTriangle,{size:14,strokeWidth:2}),T]}))}))})),n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"flex-start"}},{children:[b&&void 0!==y&&n.jsxs("span",e.__assign({style:{fontSize:"14px",padding:"12px 0",width:"40px",textAlign:"center",color:"#666"}},{children:[y,"."]})),n.jsx("textarea",{ref:A,rows:d,placeholder:p,className:"textarea ".concat(v),value:x,onChange:u,onFocus:g,readOnly:O,style:{border:"none",background:"transparent",flex:1,padding:"12px 12px 12px 12px",fontFamily:"inherit",fontSize:"14px",color:"#101828",resize:"both",width:"100%",boxSizing:"border-box",maxHeight:"200px",overflowY:"auto",outline:"none",display:"block",margin:"0 auto",alignSelf:"center",cursor:O?"default":"text"},onInput:function(e){return N(e.target)}}),S&&D&&n.jsx(t.default,e.__assign({description:"View Conflict Details"},{children:n.jsxs("button",e.__assign({onClick:function(e){e.preventDefault(),null==m||m()},style:{display:"flex",alignItems:"center",gap:"4px",padding:"4px 8px",border:"none",backgroundColor:"transparent",borderRadius:"4px",margin:"8px",cursor:"pointer",flexShrink:0}},{children:[H(),w?n.jsx(o.ChevronUpIcon,{size:14}):n.jsx(o.ChevronDownIcon,{size:14})]}))})),z&&!S&&n.jsx(t.default,e.__assign({description:null!=R?R:""},{children:n.jsxs("button",e.__assign({onClick:function(e){e.preventDefault(),null==m||m()},style:{display:"flex",alignItems:"center",gap:"4px",padding:"4px 8px",border:"none",backgroundColor:"transparent",borderRadius:"4px",margin:"8px",cursor:"pointer",flexShrink:0}},{children:[H(),w?n.jsx(o.ChevronUpIcon,{size:14}):n.jsx(o.ChevronDownIcon,{size:14})]}))}))]}))]})),S&&w&&n.jsx("div",e.__assign({style:{marginTop:"8px"}},{children:n.jsx(s.ConflictReasoningCard,{isVisible:!0,decisionStrength:E,reasoning:D,gap:q})})),F&&n.jsx("div",e.__assign({style:{color:"#ef4444",fontSize:"12px",marginTop:"4px"}},{children:F}))]}))});a.displayName="Textarea",exports.Textarea=a;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),r=require("../../_svg/CognitiveDecisioning.js"),t=require("lucide-react"),o=require("../../TooltipComponent.js"),s=require("../../ConflictingReasoningCard.js"),a=i.forwardRef(function(a,l){var c=a.rows,d=void 0===c?1:c,p=a.placeholder,x=a.value,u=a.onChange,g=a.onFocus,f=a.isHighlighted,h=void 0!==f&&f,v=a.customClass,b=a.showNumber,y=a.numberIndex,_=a.isReadOnly,j=void 0!==_&&_,C=a.isOpen,w=void 0!==C&&C,m=a.onToggle,k=a.showCognitiveIcon,z=void 0!==k&&k,I=a.cognitiveIcon,R=a.tooltipDescription,S=a.isConflicting,T=a.conflictMsg,D=a.conflictingReasoning,E=a.decisionStrength,q=a.conflictingGap,F=a.errorMessage,M=a.inputReadOnly,O=void 0!==M&&M,H=a.citations,L=void 0===H?[]:H,N=function(){return I||n.jsx(r.default,{})},A=i.useRef(null),U=i.useCallback(function(e){e.style.height="auto",e.style.height="".concat(e.scrollHeight,"px")},[]);i.useEffect(function(){var e=function(){A.current&&U(A.current)};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[U]);var V=i.useCallback(function(e){A.current=e,l&&("function"==typeof l?l(e):l.current=e),e&&U(e)},[l,U]);return n.jsxs("div",e.__assign({style:{width:"100%"}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",width:"100%",border:"1px solid ".concat(S||F?"#ef4444":h?"#2563EB":"#ccc"),borderRadius:"0.5rem",backgroundColor:j?"#f9fafb":"white",opacity:j?.8:1,cursor:j?"not-allowed":"text",pointerEvents:"auto",transition:"all 0.3s ease-in-out",overflow:"hidden",boxShadow:S&&h?"0 0 20px 3px rgba(239, 68, 68, 0.45)":h?"\n 0 0 12px 3px rgba(37, 99, 235, 0.3),\n -6px 0 10px rgba(37, 99, 235, 0.2),\n 6px 0 10px rgba(37, 99, 235, 0.2)\n ":"none"},onMouseEnter:function(e){h||S||j||(e.currentTarget.style.border="1px solid black"),j&&(e.currentTarget.style.cursor="not-allowed")},onMouseLeave:function(e){h||S||j||(e.currentTarget.style.border="1px solid #ccc")}},{children:[n.jsx("div",e.__assign({style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},{children:S&&T&&n.jsx("div",e.__assign({style:{padding:"12px 12px 0 12px"}},{children:n.jsxs("div",e.__assign({style:{display:"inline-flex",alignItems:"center",gap:"6px",backgroundColor:"#FFE9E980",padding:"4px 10px",borderRadius:"16px",color:"#b91c1c",fontSize:"12px",fontWeight:500}},{children:[n.jsx(t.AlertTriangle,{size:14,strokeWidth:2}),T]}))}))})),n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"flex-start"}},{children:[b&&void 0!==y&&n.jsxs("span",e.__assign({style:{fontSize:"14px",padding:"12px 0",width:"40px",textAlign:"center",color:"#666"}},{children:[y,"."]})),n.jsx("textarea",{ref:V,rows:d,placeholder:p,className:"textarea ".concat(v),value:x,onChange:u,onFocus:g,readOnly:O,style:{border:"none",background:"transparent",flex:1,padding:"12px 12px 12px 12px",fontFamily:"inherit",fontSize:"14px",color:"#101828",resize:"both",width:"100%",boxSizing:"border-box",maxHeight:"200px",overflowY:"auto",outline:"none",display:"block",margin:"0 auto",alignSelf:"center",cursor:O?"default":"text"},onInput:function(e){return U(e.target)}}),S&&D&&n.jsx(o.default,e.__assign({description:"View Conflict Details"},{children:n.jsxs("button",e.__assign({onClick:function(e){e.preventDefault(),null==m||m()},style:{display:"flex",alignItems:"center",gap:"4px",padding:"4px 8px",border:"none",backgroundColor:"transparent",borderRadius:"4px",margin:"8px",cursor:"pointer",flexShrink:0}},{children:[N(),w?n.jsx(t.ChevronUpIcon,{size:14}):n.jsx(t.ChevronDownIcon,{size:14})]}))})),z&&!S&&n.jsx(o.default,e.__assign({description:null!=R?R:""},{children:n.jsxs("button",e.__assign({onClick:function(e){e.preventDefault(),null==m||m()},style:{display:"flex",alignItems:"center",gap:"4px",padding:"4px 8px",border:"none",backgroundColor:"transparent",borderRadius:"4px",margin:"8px",cursor:"pointer",flexShrink:0}},{children:[N(),w?n.jsx(t.ChevronUpIcon,{size:14}):n.jsx(t.ChevronDownIcon,{size:14})]}))}))]}))]})),S&&w&&n.jsx("div",e.__assign({style:{marginTop:"8px"}},{children:n.jsx(s.ConflictReasoningCard,{isVisible:!0,decisionStrength:E,reasoning:D,gap:q,citations:L})})),F&&n.jsx("div",e.__assign({style:{color:"#ef4444",fontSize:"12px",marginTop:"4px"}},{children:F}))]}))});a.displayName="Textarea",exports.Textarea=a;
2
2
  //# sourceMappingURL=Textarea.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),t=require("react/jsx-runtime"),i=require("lucide-react"),e=require("react"),o=require("../../atoms/Button/Button.js"),c=require("../../atoms/Textarea/Textarea.js"),a=require("../../InputDataReasoningCard.js"),s=require("../../TooltipComponent.js"),r=require("../../_svg/ButtonCognitiveIcon.js");exports.ConditionList=function(l){var d=l.idPrefix,u=l.items,g=l.onAdd,f=l.onRemove;l.onEdit;var v=l.index,x=l.tierKey,_=l.readOnly,p=void 0!==_&&_,m=l.placeholder,h=void 0===m?"Enter your condition":m,j=l.addLabel,y=void 0===j?"Add Condition":j,C=l.showAddButton,b=void 0===C||C;l.isHighlighted;var S=l.highlightedIds;l.footer;var N=l.tooltipDescription,E=l.citations,I=void 0===E?[]:E,w=l.setSendMessageInChat,A=l.fieldName,T=l.isAiStreaming,k=void 0!==T&&T,R=l.activeEditId,B=l.setActiveEditId,O=l.pendingEditId;l.setPendingEditId;var q=e.useState({}),z=q[0],L=q[1],D=e.useState(null),M=D[0],P=D[1],V=e.useState(null),K=V[0],F=V[1],H=e.useState(null),W=H[0],G=H[1],U=e.useRef(k),X=e.useRef(new Map),J=e.useRef(u);e.useEffect(function(){U.current&&!k&&null!==W&&G(null),U.current=k},[k,W]);e.useEffect(function(){var t=J.current,i=u.filter(function(n){return!t.find(function(t){return t.id===n.id})});if(i.length>0){var e=i[i.length-1],o="".concat(d,"-").concat(x,"-").concat(v,"-").concat(e.id);e.text&&""!==e.text.trim()||(B&&B(o),L(function(t){var i;return n.__assign(n.__assign({},t),((i={})[e.id]="",i))}),P(e.id))}J.current=u},[u,x,v,B,d]),e.useEffect(function(){if(M){var n=X.current.get(M);if(n){n.focus();var t=n.value.length;n.setSelectionRange(t,t)}P(null)}},[M,u]);var Q=e.useCallback(function(n){n&&(n.style.height="auto",n.style.height="".concat(n.scrollHeight,"px"))},[]),Y=Object.values(z).some(function(n){return!n||""===n.trim()}),Z=u.filter(function(n){return n.text&&""!==n.text.trim()}),$=new Set(Z.map(function(n){return n.text.trim()})).size!==Z.length,nn=Y||$||null!==R||k;return t.jsxs("div",n.__assign({className:"condition-wrapper"},{children:[u.map(function(e,l){var g,_,m,j,y,C,b,E="".concat(d,"-").concat(x,"-").concat(v,"-").concat(e.id),T=e.id in z,q=null!==R&&R!==E,D=(null==S?void 0:S.has(e.id))&&!k,M=!!e.conflict,V=(null===(g=e.conflict)||void 0===g?void 0:g.reason)||(M?"Conflicting":null),H=Array.isArray(null===(_=e.conflict)||void 0===_?void 0:_.conflicting_reasoning)?e.conflict.conflicting_reasoning.map(function(n){return"- ".concat(n)}).join("\n"):(null===(m=e.conflict)||void 0===m?void 0:m.conflicting_reasoning)||null,W=(null===(j=e.conflict)||void 0===j?void 0:j.decision_strength)||null,U=Array.isArray(null===(y=e.conflict)||void 0===y?void 0:y.conflicting_gap)?e.conflict.conflicting_gap.map(function(n){return"- ".concat(n)}).join("\n"):(null===(C=e.conflict)||void 0===C?void 0:C.conflicting_gap)||null,J=!!e.reasoning,Y=K===e.id,Z=T?null!==(b=z[e.id])&&void 0!==b?b:"":e.text,$=p||k||!T;return t.jsxs("div",n.__assign({className:"condition-row-container","data-edit-id":E,style:{marginBottom:J&&Y?"16px":"8px"}},{children:[t.jsxs("div",n.__assign({className:"condition-item ".concat(M?"border-red-500":""," ").concat(T?"is-editing":""),style:{opacity:k&&!T?.5:1,pointerEvents:"auto"}},{children:[t.jsx("div",n.__assign({className:"condition-left"},{children:t.jsx(c.Textarea,{ref:function(n){n?(X.current.set(e.id,n),Q(n)):X.current.delete(e.id)},rows:1,placeholder:h,value:Z,onChange:function(t){T&&L(function(i){var o;return n.__assign(n.__assign({},i),((o={})[e.id]=t.target.value,o))})},showNumber:!0,numberIndex:l+1,isReadOnly:p||k,inputReadOnly:$,isOpen:Y&&!T,onToggle:function(){return n=e.id,void F(function(t){return t===n?null:n});var n},showCognitiveIcon:J&&!T&&!M,cognitiveIcon:t.jsx(r.ButtonCognitiveIcon,{}),tooltipDescription:N,isConflicting:M,conflictMsg:V,conflictingReasoning:H,isHighlighted:D,decisionStrength:W,conflictingGap:U})})),!p&&t.jsx("div",n.__assign({className:"action-buttons"},{children:T?t.jsx("div",n.__assign({className:"action-buttons-inline"},{children:t.jsxs(t.Fragment,{children:[t.jsx(s.default,n.__assign({description:"Apply"},{children:t.jsx(o.Button,n.__assign({onClick:function(){return function(t){var i,e=null!==(i=z[t.id])&&void 0!==i?i:"";if(e.trim()&&!u.some(function(n){return n.id!==t.id&&n.text.trim()===e.trim()})){if(e===t.text)return L(function(i){var e=n.__assign({},i);return delete e[t.id],e}),void(B&&B(null));var o=!t.text||""===t.text.trim();if(w){var c="sk-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),a="string"==typeof A&&""!==A.trim()?A:"field",s=o?"Add ".concat(a," to ").concat(e):"Update ".concat(a," with ").concat(e);console.log('[ConditionList] Sending message for "'.concat(a,'"'),{draftValue:e,globalFormValue:t.text,action:o?"add":"update",message:"__SKELETON__:".concat(c,":").concat(s)}),G(t.id),w("__SKELETON__:".concat(c,":").concat(s))}L(function(i){var e=n.__assign({},i);return delete e[t.id],e}),B&&B(null)}}(e)},className:"btn-apply",icon:t.jsx(i.Check,{size:20,strokeWidth:2.5})},{children:"Apply"}))})),t.jsx(s.default,n.__assign({description:"Cancel"},{children:t.jsx(o.Button,{onClick:function(){return function(t){var i=""===t.text||void 0===t.text;L(function(i){var e=n.__assign({},i);return delete e[t.id],e}),B&&B(null),i&&f(x,v,t.id)}(e)},className:"btn-cancel-inline",icon:t.jsx(i.X,{size:20,strokeWidth:2.5})})}))]})})):t.jsxs("div",n.__assign({className:"action-buttons"},{children:[t.jsx(s.default,n.__assign({description:q?"Save active edits first":"Edit this condition"},{children:t.jsx(o.Button,{onClick:function(){return function(t){var i="".concat(d,"-").concat(x,"-").concat(v,"-").concat(t.id);R&&R!==i||(B&&B(i),L(function(i){var e;return n.__assign(n.__assign({},i),((e={})[t.id]=t.text,e))}),P(t.id))}(e)},className:"btn-icon btn-edit",icon:t.jsx(i.Pencil,{size:18}),disabled:k||q})})),t.jsx(s.default,n.__assign({description:q?"Save active edits first":"Delete this condition"},{children:t.jsx(o.Button,{onClick:function(){return function(t){var i,e="".concat(d,"-").concat(x,"-").concat(v,"-").concat(t.id);if(R===e&&B&&B(null),L(function(i){var e=n.__assign({},i);return delete e[t.id],e}),null===(i=t.text)||void 0===i?void 0:i.trim()){if(w){var o="sk-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),c="string"==typeof A&&""!==A.trim()?A:"field";console.log('[ConditionList] Sending message for "'.concat(c,'"'),{draftValue:null,globalFormValue:t.text,action:"remove",message:"__SKELETON__:".concat(o,":Remove ").concat(c," ").concat(t.text)}),G(t.id),w("__SKELETON__:".concat(o,":Remove ").concat(c," ").concat(t.text))}f(x,v,t.id)}else f(x,v,t.id)}(e)},className:"btn-icon btn-delete",icon:t.jsx(i.Trash2,{size:18}),disabled:k||q})}))]}))}))]})),O===E&&T&&t.jsxs("div",n.__assign({style:{display:"flex",alignItems:"center",gap:"6px",marginTop:"8px"}},{children:[t.jsx(i.AlertTriangle,{style:{color:"#C2410C"}}),t.jsx("div",n.__assign({style:{display:"flex",color:"#C2410C",fontSize:"13px",paddingTop:"8px",alignItems:"center"}},{children:"Pending - Changes not applied yet. Apply or discard them to continue."}))]})),J&&!M&&t.jsx("div",n.__assign({style:{maxHeight:Y?"1000px":"0",overflow:"hidden",transition:"all 0.3s ease-in-out",marginTop:Y?"1.5px":"0"}},{children:t.jsx(a.InputDataReasoningCard,{isVisible:Y,citation:e.reasoning,citations:I,fieldName:"Condition ".concat(l+1),fieldValue:e.text})}))]}),e.id)}),null!==W&&k&&t.jsxs(t.Fragment,{children:[t.jsx("style",{children:"\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),t.jsxs("div",n.__assign({style:{display:"flex",alignItems:"center",justifyContent:"flex-start",padding:"4px 0 12px 12px",color:"#141414ff",fontSize:"13px",fontWeight:500,fontStyle:"italic"}},{children:[t.jsx(i.Loader2Icon,{style:{marginRight:8,animation:"spin 1s linear infinite"}}),"Checking the correctness of your updated condition..."]}))]}),0===u.length&&t.jsx("div",n.__assign({style:{display:"flex",alignItems:"center",color:"#bbb",fontSize:"14px",height:"40px",marginBottom:"8px"}},{children:"No items to show"})),b&&!p&&t.jsxs("div",n.__assign({className:"condition-add ".concat(nn?"disabled":""),onClick:function(){return!nn&&g()},role:"button",style:{opacity:nn?.5:1,cursor:nn?"not-allowed":"pointer"}},{children:[t.jsx(i.Plus,{size:20,className:"condition-add-icon"}),t.jsx("span",n.__assign({className:"condition-add-text"},{children:y}))]}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),i=require("react/jsx-runtime"),t=require("lucide-react"),e=require("react"),o=require("../../atoms/Button/Button.js"),s=require("../../atoms/Textarea/Textarea.js"),c=require("../../InputDataReasoningCard.js"),a=require("../../TooltipComponent.js"),r=require("../../_svg/ButtonCognitiveIcon.js");exports.ConditionList=function(l){var d=l.idPrefix,u=l.items,f=l.onAdd,g=l.onRemove;l.onEdit;var v=l.index,x=l.tierKey,p=l.readOnly,_=void 0!==p&&p,h=l.placeholder,m=void 0===h?"Enter your condition":h,j=l.addLabel,y=void 0===j?"Add Condition":j,C=l.showAddButton,b=void 0===C||C;l.isHighlighted;var N=l.highlightedIds;l.footer;var S=l.tooltipDescription,I=l.citations,E=void 0===I?[]:I,w=l.setSendMessageInChat,A=l.fieldName,k=l.isAiStreaming,R=void 0!==k&&k,T=l.activeEditId,B=l.setActiveEditId,q=l.pendingEditId;l.setPendingEditId;var z=e.useState({}),O=z[0],D=z[1],M=e.useState(null),P=M[0],L=M[1],H=e.useState(null),K=H[0],W=H[1],F=e.useState(null),V=F[0],G=F[1],U=e.useRef(R),X=e.useRef(new Map),J=e.useRef(u);e.useEffect(function(){U.current&&!R&&null!==V&&G(null),U.current=R},[R,V]);e.useEffect(function(){var i=J.current,t=u.filter(function(n){return!i.find(function(i){return i.id===n.id})});if(t.length>0){var e=t[t.length-1],o="".concat(d,"-").concat(x,"-").concat(v,"-").concat(e.id);e.text&&""!==e.text.trim()||(B&&B(o),D(function(i){var t;return n.__assign(n.__assign({},i),((t={})[e.id]="",t))}),L(e.id))}J.current=u},[u,x,v,B,d]),e.useEffect(function(){if(P){var n=X.current.get(P);if(n){n.focus();var i=n.value.length;n.setSelectionRange(i,i)}L(null)}},[P,u]);var Q=e.useCallback(function(n){n&&(n.style.height="auto",n.style.height="".concat(n.scrollHeight,"px"))},[]),Y=Object.values(O).some(function(n){return!n||""===n.trim()}),Z=u.filter(function(n){return n.text&&""!==n.text.trim()}),$=new Set(Z.map(function(n){return n.text.trim()})).size!==Z.length,nn=Y||$||null!==T||R;return i.jsxs("div",n.__assign({className:"condition-wrapper"},{children:[u.map(function(e,l){var f,p,h,j,y,C,b;if(e.id===V&&R)return null;var I="".concat(d,"-").concat(x,"-").concat(v,"-").concat(e.id),k=e.id in O,z=null!==T&&T!==I,M=(null==N?void 0:N.has(e.id))&&!R,P=!!e.conflict,H=(null===(f=e.conflict)||void 0===f?void 0:f.reason)||(P?"Conflicting":null),F=Array.isArray(null===(p=e.conflict)||void 0===p?void 0:p.conflicting_reasoning)?e.conflict.conflicting_reasoning.map(function(n){return"- ".concat(n)}).join("\n"):(null===(h=e.conflict)||void 0===h?void 0:h.conflicting_reasoning)||null,U=(null===(j=e.conflict)||void 0===j?void 0:j.decision_strength)||null,J=Array.isArray(null===(y=e.conflict)||void 0===y?void 0:y.conflicting_gap)?e.conflict.conflicting_gap.map(function(n){return"- ".concat(n)}).join("\n"):(null===(C=e.conflict)||void 0===C?void 0:C.conflicting_gap)||null,Y=!!e.reasoning,Z=K===e.id,$=k?null!==(b=O[e.id])&&void 0!==b?b:"":e.text,nn=_||R||!k;return i.jsxs("div",n.__assign({className:"condition-row-container","data-edit-id":I,style:{marginBottom:Y&&Z?"16px":"8px"}},{children:[i.jsxs("div",n.__assign({className:"condition-item ".concat(P?"border-red-500":""," ").concat(k?"is-editing":""),style:{opacity:R&&!k?.5:1,pointerEvents:"auto"}},{children:[i.jsx("div",n.__assign({className:"condition-left"},{children:i.jsx(s.Textarea,{ref:function(n){n?(X.current.set(e.id,n),Q(n)):X.current.delete(e.id)},rows:1,placeholder:m,value:$,onChange:function(i){k&&D(function(t){var o;return n.__assign(n.__assign({},t),((o={})[e.id]=i.target.value,o))})},showNumber:!0,numberIndex:l+1,isReadOnly:_||R,inputReadOnly:nn,isOpen:Z&&!k,onToggle:function(){return n=e.id,void W(function(i){return i===n?null:n});var n},showCognitiveIcon:Y&&!k&&!P,cognitiveIcon:i.jsx(r.ButtonCognitiveIcon,{}),tooltipDescription:S,isConflicting:P,conflictMsg:H,conflictingReasoning:F,isHighlighted:M,decisionStrength:U,conflictingGap:J,citations:E})})),!_&&i.jsx("div",n.__assign({className:"action-buttons"},{children:k?i.jsx("div",n.__assign({className:"action-buttons-inline"},{children:i.jsxs(i.Fragment,{children:[i.jsx(a.default,n.__assign({description:"Apply"},{children:i.jsx(o.Button,n.__assign({onClick:function(){return function(i){var t,e=null!==(t=O[i.id])&&void 0!==t?t:"";if(e.trim()&&!u.some(function(n){return n.id!==i.id&&n.text.trim()===e.trim()})){if(e===i.text)return D(function(t){var e=n.__assign({},t);return delete e[i.id],e}),void(B&&B(null));var o=!i.text||""===i.text.trim();if(w){var s="sk-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),c="string"==typeof A&&""!==A.trim()?A:"field",a=o?"Add ".concat(c," to ").concat(e):"Update ".concat(c," with ").concat(e);G(i.id),w("__SKELETON__:".concat(s,":").concat(a))}D(function(t){var e=n.__assign({},t);return delete e[i.id],e}),B&&B(null)}}(e)},className:"btn-apply",icon:i.jsx(t.Check,{size:20,strokeWidth:2.5})},{children:"Apply"}))})),i.jsx(a.default,n.__assign({description:"Cancel"},{children:i.jsx(o.Button,{onClick:function(){return function(i){var t=""===i.text||void 0===i.text;D(function(t){var e=n.__assign({},t);return delete e[i.id],e}),B&&B(null),t&&g(x,v,i.id)}(e)},className:"btn-cancel-inline",icon:i.jsx(t.X,{size:20,strokeWidth:2.5})})}))]})})):i.jsxs("div",n.__assign({className:"action-buttons"},{children:[i.jsx(a.default,n.__assign({description:z?"Save active edits first":"Edit this condition"},{children:i.jsx(o.Button,{onClick:function(){return function(i){var t="".concat(d,"-").concat(x,"-").concat(v,"-").concat(i.id);T&&T!==t||(B&&B(t),D(function(t){var e;return n.__assign(n.__assign({},t),((e={})[i.id]=i.text,e))}),L(i.id))}(e)},className:"btn-icon btn-edit",icon:i.jsx(t.Pencil,{size:18}),disabled:R||z})})),i.jsx(a.default,n.__assign({description:z?"Save active edits first":"Delete this condition"},{children:i.jsx(o.Button,{onClick:function(){return function(i){var t,e="".concat(d,"-").concat(x,"-").concat(v,"-").concat(i.id);if(T===e&&B&&B(null),D(function(t){var e=n.__assign({},t);return delete e[i.id],e}),null===(t=i.text)||void 0===t?void 0:t.trim()){if(w){var o="sk-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),s="string"==typeof A&&""!==A.trim()?A:"field";G(i.id),w("__SKELETON__:".concat(o,":Remove ").concat(s," ").concat(i.text))}}else g(x,v,i.id)}(e)},className:"btn-icon btn-delete",icon:i.jsx(t.Trash2,{size:18}),disabled:R||z})}))]}))}))]})),q===I&&k&&i.jsxs("div",n.__assign({style:{display:"flex",alignItems:"center",gap:"6px",marginTop:"8px"}},{children:[i.jsx(t.AlertTriangle,{style:{color:"#C2410C"}}),i.jsx("div",n.__assign({style:{display:"flex",color:"#C2410C",fontSize:"13px",paddingTop:"8px",alignItems:"center"}},{children:"Pending - Changes not applied yet. Apply or discard them to continue."}))]})),Y&&!P&&i.jsx("div",n.__assign({style:{maxHeight:Z?"1000px":"0",overflow:"hidden",transition:"all 0.3s ease-in-out",marginTop:Z?"1.5px":"0"}},{children:i.jsx(c.InputDataReasoningCard,{isVisible:Z,citation:e.reasoning,citations:E,fieldName:"Condition ".concat(l+1),fieldValue:e.text})}))]}),e.id)}),null!==V&&R&&i.jsxs(i.Fragment,{children:[i.jsx("style",{children:"\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),i.jsxs("div",n.__assign({style:{display:"flex",alignItems:"center",justifyContent:"flex-start",padding:"4px 0 12px 12px",color:"#141414ff",fontSize:"13px",fontWeight:500,fontStyle:"italic"}},{children:[i.jsx(t.Loader2Icon,{style:{marginRight:8,animation:"spin 1s linear infinite"}}),"Checking the correctness of your updated condition..."]}))]}),0===u.length&&i.jsx("div",n.__assign({style:{display:"flex",alignItems:"center",color:"#bbb",fontSize:"14px",height:"40px",marginBottom:"8px"}},{children:"No items to show"})),b&&!_&&i.jsxs("div",n.__assign({className:"condition-add ".concat(nn?"disabled":""),onClick:function(){return!nn&&f()},role:"button",style:{opacity:nn?.5:1,cursor:nn?"not-allowed":"pointer"}},{children:[i.jsx(t.Plus,{size:20,className:"condition-add-icon"}),i.jsx("span",n.__assign({className:"condition-add-text"},{children:y}))]}))]}))};
2
2
  //# sourceMappingURL=ConditionList.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),e=require("react/jsx-runtime"),i=require("../../molecules/Sections/SectionWrapper.js"),t=require("../../molecules/SeperationRow/SeparationRow.js"),s=require("../../atoms/Toggle/Toggle.js"),a=require("lucide-react"),o=require("react");exports.ConfigSection=function(r){var l=r.separationItems,c=void 0===l?[]:l,d=r.toggles,g=void 0===d?[]:d;r.onConfigChange;var u=r.highlights,p=void 0===u?{}:u,f=r.index,_=r.openSections,x=r.readOnly,h=void 0!==x&&x,b=r.setOpenSections,m=r.activeEditId,y=r.setActiveEditId,S=r.pendingEditId,j=r.setPendingEditId,v=r.isAiStreaming,C=r.setSendMessageInChat,k=r.id,I=n.__rest(r,["separationItems","toggles","onConfigChange","highlights","index","openSections","readOnly","setOpenSections","activeEditId","setActiveEditId","pendingEditId","setPendingEditId","isAiStreaming","setSendMessageInChat","id"]),E=k||"config-section-".concat(null!=f?f:0),T=m===E,w=!!m&&m!==E,O=o.useState(null),q=O[0],z=O[1],A=o.useState(null),R=A[0],D=A[1],P=o.useState(!1),W=P[0],N=P[1],M=o.useRef(v),L="\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n ";o.useEffect(function(){M.current&&!v&&W&&N(!1),M.current=v},[v,W]);var F=h||!T||W,H=e.jsxs("div",n.__assign({style:{display:"flex",alignItems:"center"}},{children:[!h&&!T&&!W&&e.jsx("button",n.__assign({title:w?"Save active edits first":"Edit Configuration",onClick:function(e){e.stopPropagation(),w?j&&j(null!=m?m:null):(z(c.map(function(e){return n.__assign({},e)})),D(g.map(function(e){return n.__assign({},e)})),y&&y(E),b&&_&&!_.has(E)&&b(function(n){var e=new Set(n);return e.add(E),e}))},style:n.__assign(n.__assign({},{display:"flex",alignItems:"center",justifyContent:"center",padding:"6px 8px",border:"1px solid #e5e7eb",borderRadius:"8px",cursor:"pointer",backgroundColor:"#ffffff",color:"#6b7280"}),{opacity:w?.5:1,cursor:w?"not-allowed":"pointer",border:"none",background:"transparent"})},{children:e.jsx(a.Pencil,{size:16})})),W&&v&&e.jsxs(e.Fragment,{children:[e.jsx("style",{children:L}),e.jsx(a.Loader2Icon,{size:16,style:{animation:"spin 1s linear infinite",color:"#6b7280"}})]})]}));return e.jsx("div",n.__assign({"data-edit-id":E},{children:e.jsxs(i.SectionWrapper,n.__assign({},I,{id:E,collapsible:!0,defaultOpen:!1,openSections:_,setOpenSections:b,headerActions:H},{children:[e.jsxs("div",n.__assign({className:"config-content-grid",style:{opacity:F&&!h?.6:1,transition:"opacity 0.2s"}},{children:[(q||c).map(function(i,s){return e.jsx(t.SeparationRow,{label:"".concat(i.label," Separation"),isEnabled:i.enabled,duration:i.global_min_separation_seconds,onToggle:function(){return function(e){T&&!W&&z(function(i){return i?i.map(function(i){return i.key===e.key?n.__assign(n.__assign({},i),{enabled:!i.enabled}):i}):null})}(i)},onDurationChange:function(e){return function(e,i){T&&!W&&z(function(t){return t?t.map(function(t){return t.key===e.key?n.__assign(n.__assign({},t),{global_min_separation_seconds:i}):t}):null})}(i,e)},isHighlighted:p["config_".concat(i.key)],isDisabled:F},i.key)}),(R||g).map(function(i,t){return e.jsx("div",n.__assign({className:"separation-row-container"},{children:e.jsxs("div",n.__assign({className:"separation-header-row"},{children:[e.jsx("div",n.__assign({className:"separation-label"},{children:i.label})),e.jsx(s.Toggle,{isEnabled:i.enabled,onToggle:function(){return function(e){T&&!W&&D(function(i){return i?i.map(function(i){return i.key===e.key?n.__assign(n.__assign({},i),{enabled:!i.enabled}):i}):null})}(i)},isDisabled:F})]}))}),i.key)})]})),W&&v&&e.jsxs(e.Fragment,{children:[e.jsx("style",{children:L}),e.jsxs("div",n.__assign({style:{display:"flex",alignItems:"center",padding:"4px 0 12px 12px",color:"#141414ff",fontSize:"13px",fontWeight:500,fontStyle:"italic",marginTop:"8px"}},{children:[e.jsx(a.Loader2Icon,{style:{marginRight:8,animation:"spin 1s linear infinite"}}),"Checking the correctness of your Configuration..."]}))]}),T&&!W&&e.jsxs("div",n.__assign({style:{display:"flex",flexDirection:"column",marginTop:"12px"}},{children:[e.jsxs("div",n.__assign({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[e.jsx("button",n.__assign({onClick:function(){z(null),D(null),y&&y(null)},style:{background:"none",border:"none",color:"#6b7280",fontSize:"14px",fontWeight:"500",cursor:"pointer",padding:"0"}},{children:"Discard Changes"})),e.jsxs("button",n.__assign({onClick:function(){if(q&&R){var n=q.filter(function(n,e){var i=c[e];return!i||n.enabled!==i.enabled||n.global_min_separation_seconds!==i.global_min_separation_seconds}),e=R.filter(function(n,e){var i=g[e];return!i||n.enabled!==i.enabled});if(0===n.length&&0===e.length)return z(null),D(null),void(y&&y(null));if(C){var i="sk-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),t=[];n.length>0&&t.push("Enable ".concat(n.map(function(n){return"".concat(n.label," (").concat(n.global_min_separation_seconds,"min)")}).join(", "))),e.length>0&&t.push("enable ".concat(e.map(function(n){return"".concat(n.label," (").concat(n.enabled,")")}).join(", ")));var s="__SKELETON__:".concat(i,":Update Configuration - ").concat(t.join("; "));console.log("[ConfigSection] Sending message",{draftSeparation:q,draftToggles:R,globalSeparation:c,globalToggles:g,message:s}),C(s)}N(!0),z(null),D(null),y&&y(null)}else y&&y(null)},style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 16px",borderRadius:"12px",border:"none",backgroundColor:"#2563eb",color:"#ffffff",fontSize:"14px",fontWeight:"500",cursor:"pointer",boxShadow:"0 1px 2px rgba(0,0,0,0.05)"}},{children:[e.jsx(a.Check,{size:18,strokeWidth:2.5,color:"#ffffff"}),"Save Changes"]}))]})),S===E&&e.jsxs("div",n.__assign({style:{display:"flex",alignItems:"center",gap:"6px",marginTop:"8px"}},{children:[e.jsx(a.AlertTriangle,{style:{color:"#C2410C"}}),e.jsx("div",n.__assign({style:{color:"#C2410C",fontSize:"13px",paddingTop:"8px"}},{children:"Pending - Changes not applied yet. Apply or discard them to continue."}))]}))]}))]}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),e=require("react/jsx-runtime"),i=require("../../molecules/Sections/SectionWrapper.js"),t=require("../../molecules/SeperationRow/SeparationRow.js"),s=require("../../atoms/Toggle/Toggle.js"),a=require("lucide-react"),o=require("react");exports.ConfigSection=function(r){var l=r.separationItems,c=void 0===l?[]:l,d=r.toggles,g=void 0===d?[]:d;r.onConfigChange;var u=r.highlights,p=void 0===u?{}:u,f=r.index,_=r.openSections,x=r.readOnly,h=void 0!==x&&x,b=r.setOpenSections,m=r.activeEditId,y=r.setActiveEditId,j=r.pendingEditId,v=r.setPendingEditId,S=r.isAiStreaming,C=r.setSendMessageInChat,k=r.id,I=n.__rest(r,["separationItems","toggles","onConfigChange","highlights","index","openSections","readOnly","setOpenSections","activeEditId","setActiveEditId","pendingEditId","setPendingEditId","isAiStreaming","setSendMessageInChat","id"]),E=k||"config-section-".concat(null!=f?f:0),T=m===E,w=!!m&&m!==E,O=o.useState(null),q=O[0],z=O[1],A=o.useState(null),R=A[0],D=A[1],P=o.useState(!1),W=P[0],N=P[1],M=o.useRef(S),L="\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n ";o.useEffect(function(){M.current&&!S&&W&&N(!1),M.current=S},[S,W]);var F=h||!T||W,H=e.jsxs("div",n.__assign({style:{display:"flex",alignItems:"center"}},{children:[!h&&!T&&!W&&e.jsx("button",n.__assign({title:w?"Save active edits first":"Edit Configuration",onClick:function(e){e.stopPropagation(),w?v&&v(null!=m?m:null):(z(c.map(function(e){return n.__assign({},e)})),D(g.map(function(e){return n.__assign({},e)})),y&&y(E),b&&_&&!_.has(E)&&b(function(n){var e=new Set(n);return e.add(E),e}))},style:n.__assign(n.__assign({},{display:"flex",alignItems:"center",justifyContent:"center",padding:"6px 8px",border:"1px solid #e5e7eb",borderRadius:"8px",cursor:"pointer",backgroundColor:"#ffffff",color:"#6b7280"}),{opacity:w?.5:1,cursor:w?"not-allowed":"pointer",border:"none",background:"transparent"})},{children:e.jsx(a.Pencil,{size:16})})),W&&S&&e.jsxs(e.Fragment,{children:[e.jsx("style",{children:L}),e.jsx(a.Loader2Icon,{size:16,style:{animation:"spin 1s linear infinite",color:"#6b7280"}})]})]}));return e.jsx("div",n.__assign({"data-edit-id":E},{children:e.jsxs(i.SectionWrapper,n.__assign({},I,{id:E,collapsible:!0,defaultOpen:!1,openSections:_,setOpenSections:b,headerActions:H},{children:[e.jsxs("div",n.__assign({className:"config-content-grid",style:{opacity:F&&!h?.6:1,transition:"opacity 0.2s"}},{children:[(q||c).map(function(i,s){return e.jsx(t.SeparationRow,{label:"".concat(i.label," Separation"),isEnabled:i.enabled,duration:i.global_min_separation_seconds,onToggle:function(){return function(e){T&&!W&&z(function(i){return i?i.map(function(i){return i.key===e.key?n.__assign(n.__assign({},i),{enabled:!i.enabled}):i}):null})}(i)},onDurationChange:function(e){return function(e,i){T&&!W&&z(function(t){return t?t.map(function(t){return t.key===e.key?n.__assign(n.__assign({},t),{global_min_separation_seconds:i}):t}):null})}(i,e)},isHighlighted:p["config_".concat(i.key)],isDisabled:F},i.key)}),(R||g).map(function(i,t){return e.jsx("div",n.__assign({className:"separation-row-container"},{children:e.jsxs("div",n.__assign({className:"separation-header-row"},{children:[e.jsx("div",n.__assign({className:"separation-label"},{children:i.label})),e.jsx(s.Toggle,{isEnabled:i.enabled,onToggle:function(){return function(e){T&&!W&&D(function(i){return i?i.map(function(i){return i.key===e.key?n.__assign(n.__assign({},i),{enabled:!i.enabled}):i}):null})}(i)},isDisabled:F})]}))}),i.key)})]})),W&&S&&e.jsxs(e.Fragment,{children:[e.jsx("style",{children:L}),e.jsxs("div",n.__assign({style:{display:"flex",alignItems:"center",padding:"4px 0 12px 12px",color:"#141414ff",fontSize:"13px",fontWeight:500,fontStyle:"italic",marginTop:"8px"}},{children:[e.jsx(a.Loader2Icon,{style:{marginRight:8,animation:"spin 1s linear infinite"}}),"Checking the correctness of your Configuration..."]}))]}),T&&!W&&e.jsxs("div",n.__assign({style:{display:"flex",flexDirection:"column",marginTop:"12px"}},{children:[e.jsxs("div",n.__assign({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[e.jsx("button",n.__assign({onClick:function(){z(null),D(null),y&&y(null)},style:{background:"none",border:"none",color:"#6b7280",fontSize:"14px",fontWeight:"500",cursor:"pointer",padding:"0"}},{children:"Discard Changes"})),e.jsxs("button",n.__assign({onClick:function(){if(q&&R){var n=q.filter(function(n,e){var i=c[e];return!i||n.enabled!==i.enabled||n.global_min_separation_seconds!==i.global_min_separation_seconds}),e=R.filter(function(n,e){var i=g[e];return!i||n.enabled!==i.enabled});if(0===n.length&&0===e.length)return z(null),D(null),void(y&&y(null));if(C){var i="sk-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),t=[];n.length>0&&t.push("Enable ".concat(n.map(function(n){return"".concat(n.label," (").concat(n.global_min_separation_seconds,"min)")}).join(", "))),e.length>0&&t.push("enable ".concat(e.map(function(n){return"".concat(n.label," (").concat(n.enabled,")")}).join(", ")));var s="__SKELETON__:".concat(i,":Update Configuration - ").concat(t.join("; "));C(s)}N(!0),z(null),D(null),y&&y(null)}else y&&y(null)},style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 16px",borderRadius:"12px",border:"none",backgroundColor:"#2563eb",color:"#ffffff",fontSize:"14px",fontWeight:"500",cursor:"pointer",boxShadow:"0 1px 2px rgba(0,0,0,0.05)"}},{children:[e.jsx(a.Check,{size:18,strokeWidth:2.5,color:"#ffffff"}),"Save Changes"]}))]})),j===E&&e.jsxs("div",n.__assign({style:{display:"flex",alignItems:"center",gap:"6px",marginTop:"8px"}},{children:[e.jsx(a.AlertTriangle,{style:{color:"#C2410C"}}),e.jsx("div",n.__assign({style:{color:"#C2410C",fontSize:"13px",paddingTop:"8px"}},{children:"Pending - Changes not applied yet. Apply or discard them to continue."}))]}))]}))]}))}))};
2
2
  //# sourceMappingURL=ConfigSection.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("../../molecules/Sections/SectionWrapper.js"),n=require("../../atoms/Textarea/Textarea.js"),s=require("../../_svg/ButtonCognitiveIcon.js"),r=require("react"),o=require("lucide-react");exports.TextSection=function(l){var a=l.rows,d=l.value,c=l.errorMessage,g=l.onChange,p=l.placeholder,u=l.title,x=l.isHighlighted,h=l.isOpen,f=l.readOnly,_=l.showCognitiveIcon,m=l.onToggle,y=l.tooltipDescription,v=l.enableInlineEdit,j=l.setSendMessageInChat,C=l.isAiStreaming,I=l.fieldName,E=l.id,S=l.activeEditId,b=l.setActiveEditId,w=l.pendingEditId;l.setPendingEditId;var T=e.__rest(l,["rows","value","errorMessage","onChange","placeholder","title","isHighlighted","isOpen","readOnly","showCognitiveIcon","onToggle","tooltipDescription","enableInlineEdit","setSendMessageInChat","isAiStreaming","fieldName","id","activeEditId","setActiveEditId","pendingEditId","setPendingEditId"]),k=r.useState(null),O=k[0],A=k[1],q=r.useState(!1),M=q[0],D=q[1],R=r.useRef(C);r.useEffect(function(){R.current&&!C&&M&&D(!1),R.current=C},[C,M]);var W=null!==O,z=!!S&&S!==E&&v,N=f||C||v&&!W,P=i.jsx("div",e.__assign({style:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"}},{children:i.jsx("span",{children:u})})),B={display:"flex",alignItems:"center",justifyContent:"center",padding:"8px",border:"1px solid #e5e7eb",borderRadius:"8px",cursor:"pointer",width:"36px",height:"36px",backgroundColor:"#ffffff"};return i.jsxs(t.SectionWrapper,e.__assign({},T,{readOnly:f,title:P,customStyles:{margin:"0 0.2rem 0.2rem 0.2rem"}},{children:[i.jsxs("div",e.__assign({className:"textarea-wrapper",style:{display:"flex",alignItems:"flex-start",gap:"8px",width:"100%"},"data-edit-id":E},{children:[i.jsx("div",e.__assign({style:{flex:1,minWidth:0}},{children:i.jsx(n.Textarea,{cognitiveIcon:i.jsx(s.ButtonCognitiveIcon,{}),rows:a,placeholder:p,value:W?O:d,onChange:function(e){W?A(e.target.value):g&&g(e.target.value)},isHighlighted:x,isOpen:h,isReadOnly:f||C,inputReadOnly:N,onToggle:m,showCognitiveIcon:_,tooltipDescription:y,errorMessage:c})})),v&&!f&&i.jsx("div",e.__assign({style:{display:"flex",flexDirection:"row",gap:"8px",marginTop:"0px"}},{children:W?i.jsxs(i.Fragment,{children:[i.jsxs("button",e.__assign({title:"Apply",onClick:function(){if(null!==O){if(O===(null!=d?d:""))return A(null),void(b&&b(null));if(j){var e="sk-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),i=I||"Description",t=O&&""!==O.trim()?"Update ".concat(i," with ").concat(O):"Remove ".concat(i);console.log('[TextSection] Sending message for "'.concat(i,'"'),{draftValue:O,globalFormValue:d,message:"__SKELETON__:".concat(e,":").concat(t)}),D(!0),j("__SKELETON__:".concat(e,":").concat(t))}A(null),b&&b(null)}},style:e.__assign(e.__assign({},B),{backgroundColor:"#2563EB",color:"white",width:"auto",padding:"8px 12px"})},{children:[i.jsx(o.Check,{size:20,strokeWidth:2.5})," Apply"]})),i.jsx("button",e.__assign({title:"Cancel",onClick:function(){A(null),b&&b(null)},style:e.__assign(e.__assign({},B),{borderColor:"#E3E8E9",color:"#dc2626"})},{children:i.jsx(o.X,{size:20,strokeWidth:2.5})}))]}):i.jsx("button",e.__assign({title:z?"Save active edits first":"Edit",onClick:function(){S&&S!==E||(b&&b(E),A(null!=d?d:""))},disabled:C||z,style:e.__assign(e.__assign({},B),{color:"#6b7280",cursor:C||z?"not-allowed":"pointer",opacity:C||z?.5:1})},{children:i.jsx(o.Pencil,{size:20})}))}))]})),w===E&&W&&i.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"6px",marginTop:"8px"}},{children:[i.jsx(o.AlertTriangle,{style:{color:"#C2410C"}}),i.jsx("div",e.__assign({style:{display:"flex",color:"#C2410C",fontSize:"13px",paddingTop:"8px",alignItems:"center"}},{children:"Pending - Changes not applied yet. Apply or discard them to continue."}))]})),M&&C&&v&&!f&&i.jsxs(i.Fragment,{children:[i.jsx("style",{children:"\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),i.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",justifyContent:"flex-start",padding:"4px 0 12px 12px",color:"#141414ff",fontSize:"13px",fontWeight:500,fontStyle:"italic",marginTop:"8px"}},{children:[i.jsx(o.Loader2Icon,{style:{marginRight:8,animation:"spin 1s linear infinite"}}),"Checking the correctness of your ",I||"description","..."]}))]})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("../../molecules/Sections/SectionWrapper.js"),n=require("../../atoms/Textarea/Textarea.js"),s=require("../../_svg/ButtonCognitiveIcon.js"),r=require("react"),l=require("lucide-react");exports.TextSection=function(o){var a=o.rows,d=o.value,c=o.errorMessage,g=o.onChange,p=o.placeholder,u=o.title,x=o.isHighlighted,h=o.isOpen,f=o.readOnly,_=o.showCognitiveIcon,y=o.onToggle,m=o.tooltipDescription,v=o.enableInlineEdit,j=o.setSendMessageInChat,C=o.isAiStreaming,I=o.fieldName,E=o.id,w=o.activeEditId,S=o.setActiveEditId,b=o.pendingEditId;o.setPendingEditId;var T=e.__rest(o,["rows","value","errorMessage","onChange","placeholder","title","isHighlighted","isOpen","readOnly","showCognitiveIcon","onToggle","tooltipDescription","enableInlineEdit","setSendMessageInChat","isAiStreaming","fieldName","id","activeEditId","setActiveEditId","pendingEditId","setPendingEditId"]),k=r.useState(null),O=k[0],A=k[1],q=r.useState(!1),M=q[0],D=q[1],R=r.useRef(C);r.useEffect(function(){R.current&&!C&&M&&D(!1),R.current=C},[C,M]);var W=null!==O,z=!!w&&w!==E&&v,P=f||C||v&&!W,N=i.jsx("div",e.__assign({style:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"}},{children:i.jsx("span",{children:u})})),B={display:"flex",alignItems:"center",justifyContent:"center",padding:"8px",border:"1px solid #e5e7eb",borderRadius:"8px",cursor:"pointer",width:"36px",height:"36px",backgroundColor:"#ffffff"};return i.jsxs(t.SectionWrapper,e.__assign({},T,{readOnly:f,title:N,customStyles:{margin:"0 0.2rem 0.2rem 0.2rem"}},{children:[i.jsxs("div",e.__assign({className:"textarea-wrapper",style:{display:"flex",alignItems:"flex-start",gap:"8px",width:"100%"},"data-edit-id":E},{children:[i.jsx("div",e.__assign({style:{flex:1,minWidth:0}},{children:i.jsx(n.Textarea,{cognitiveIcon:i.jsx(s.ButtonCognitiveIcon,{}),rows:a,placeholder:p,value:W?O:d,onChange:function(e){W?A(e.target.value):g&&g(e.target.value)},isHighlighted:x,isOpen:h,isReadOnly:f||C,inputReadOnly:P,onToggle:y,showCognitiveIcon:_,tooltipDescription:m,errorMessage:c})})),v&&!f&&i.jsx("div",e.__assign({style:{display:"flex",flexDirection:"row",gap:"8px",marginTop:"0px"}},{children:W?i.jsxs(i.Fragment,{children:[i.jsxs("button",e.__assign({title:"Apply",onClick:function(){if(null!==O){if(O===(null!=d?d:""))return A(null),void(S&&S(null));if(j){var e="sk-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),i=I||"Description",t=O&&""!==O.trim()?"Update ".concat(i," with ").concat(O):"Remove ".concat(i);D(!0),j("__SKELETON__:".concat(e,":").concat(t))}A(null),S&&S(null)}},style:e.__assign(e.__assign({},B),{backgroundColor:"#2563EB",color:"white",width:"auto",padding:"8px 12px"})},{children:[i.jsx(l.Check,{size:20,strokeWidth:2.5})," Apply"]})),i.jsx("button",e.__assign({title:"Cancel",onClick:function(){A(null),S&&S(null)},style:e.__assign(e.__assign({},B),{borderColor:"#E3E8E9",color:"#dc2626"})},{children:i.jsx(l.X,{size:20,strokeWidth:2.5})}))]}):i.jsx("button",e.__assign({title:z?"Save active edits first":"Edit",onClick:function(){w&&w!==E||(S&&S(E),A(null!=d?d:""))},disabled:C||z,style:e.__assign(e.__assign({},B),{color:"#6b7280",cursor:C||z?"not-allowed":"pointer",opacity:C||z?.5:1})},{children:i.jsx(l.Pencil,{size:20})}))}))]})),b===E&&W&&i.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"6px",marginTop:"8px"}},{children:[i.jsx(l.AlertTriangle,{style:{color:"#C2410C"}}),i.jsx("div",e.__assign({style:{display:"flex",color:"#C2410C",fontSize:"13px",paddingTop:"8px",alignItems:"center"}},{children:"Pending - Changes not applied yet. Apply or discard them to continue."}))]})),M&&C&&v&&!f&&i.jsxs(i.Fragment,{children:[i.jsx("style",{children:"\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),i.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",justifyContent:"flex-start",padding:"4px 0 12px 12px",color:"#141414ff",fontSize:"13px",fontWeight:500,fontStyle:"italic",marginTop:"8px"}},{children:[i.jsx(l.Loader2Icon,{style:{marginRight:8,animation:"spin 1s linear infinite"}}),"Checking the correctness of your ",I||"description","..."]}))]})]}))};
2
2
  //# sourceMappingURL=TextSection.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),e=require("react/jsx-runtime"),n=require("react"),t=require("../../InputDataReasoningCard.js"),o=require("../../organisms/ConditionSection/ConditionSection.js"),l=require("../../organisms/ConfigSection/ConfigSection.js"),a=require("../../organisms/ScopeSection/ScopeSection.js"),r=require("../../organisms/TextSection/TextSection.js"),s=require("../../AccordianSection.js"),d=require("../../_svg/ButtonCognitiveIcon.js"),c=require("lucide-react");function u(i){return i&&"object"==typeof i&&"default"in i?i:{default:i}}var v=u(n),p=function(n){var t=n.children,o=n.onAddVariant,l=n.isDisabled,a=v.default.Children.toArray(t);return e.jsxs("div",i.__assign({style:{display:"flex",flexDirection:"column",alignItems:"flex-start"}},{children:[a.map(function(i,n){return e.jsxs(v.default.Fragment,{children:[i,e.jsx("div",{style:{width:"2px",height:"20px",backgroundColor:"#E2E8F0",marginLeft:"30px"}})]},n)}),e.jsx("div",i.__assign({onClick:l?void 0:o,style:{padding:"8px 16px",border:"1px solid #E2E8F0",borderRadius:"8px",color:l?"#94a3b8":"#475569",fontSize:"14px",fontWeight:"500",cursor:l?"not-allowed":"pointer",backgroundColor:l?"#f8fafc":"#FFFFFF",opacity:l?.7:1,userSelect:"none",transition:"all 0.2s ease"}},{children:"Add Variant"}))]}))};exports.CreateRule=function(u){var g,f,h,x,_,y,m,S,T,C,D,I=u.state,A=u.handlers,b=u.uiState,j=(null==b?void 0:b.highlights)||new Map,E=j.get("global_0")||{},O=n.useState({}),w=O[0],R=O[1],V=n.useState(null),W=V[0],N=V[1],q="rule-setup"===(null==b?void 0:b.activeEditId),k=v.default.useRef(new Map),M=n.useState(null),F=M[0],B=M[1],L=n.useState(null),P=L[0],z=L[1],H=n.useState(!1),K=H[0],U=H[1],$=v.default.useRef(null==b?void 0:b.isAiStreaming);n.useEffect(function(){$.current&&!(null==b?void 0:b.isAiStreaming)&&K&&U(!1),$.current=null==b?void 0:b.isAiStreaming},[null==b?void 0:b.isAiStreaming,K]);var J=function(){var i;B(null),z(null),null===(i=null==b?void 0:b.setActiveEditId)||void 0===i||i.call(b,null)},Z=function(){var i,e,n=null!=F?F:I.ruleTitle,t=null!=P?P:I.scopeData,o=n!==I.ruleTitle,l=JSON.stringify(t)!==JSON.stringify(I.scopeData);if(!o&&!l)return B(null),z(null),void(null===(i=null==b?void 0:b.setActiveEditId)||void 0===i||i.call(b,null));if(null==b?void 0:b.setSendMessageInChat){var a="sk-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),r=[];if(o&&r.push((null==n?void 0:n.trim())?"Title with ".concat(n):"No Title"),l){var s=null==t?void 0:t.tiers,d=s&&s.length>0?"tiers: ".concat(s.join(", ")):"No Tier Selected";r.push(d)}var c=r.join(" and ");console.log("[RuleSetup] Sending message",{draftTitle:n,draftScope:t,globalTitle:I.ruleTitle,globalScope:I.scopeData,message:"__SKELETON__:".concat(a,":Update Rule Setup ").concat(c)}),b.setSendMessageInChat("__SKELETON__:".concat(a,":Update Rule Setup ").concat(c))}U(!0),B(null),z(null),null===(e=null==b?void 0:b.setActiveEditId)||void 0===e||e.call(b,null)},G=v.default.useRef(null==b?void 0:b.defaultVariantOpen),Q=v.default.useRef(I.variantsByTier);v.default.useEffect(function(){var i,e,n,t,o=null,l=!1;if(G.current!==(null==b?void 0:b.defaultVariantOpen)&&(l=!0,G.current=null==b?void 0:b.defaultVariantOpen),I.variantsByTier,Q.current,l){if(null==(null==b?void 0:b.defaultVariantOpen)||(null==b?void 0:b.defaultVariantOpen)<0)return N(null),void(Q.current=I.variantsByTier);null===(e=null===(i=null==b?void 0:b.tierOptions)||void 0===i?void 0:i.filter(function(i){var e,n;return null===(n=null===(e=I.scopeData)||void 0===e?void 0:e.tiers)||void 0===n?void 0:n.includes(i)}))||void 0===e||e.forEach(function(i){var e,n=i.toLowerCase().replace(/ /g,"_");((null===(e=I.variantsByTier)||void 0===e?void 0:e[n])||[]).forEach(function(i,e){(null==b?void 0:b.defaultVariantOpen)===e&&(o="".concat(n,"-variant-").concat(e)),(null==b?void 0:b.autoScrollVariantIndex)===e&&(o="".concat(n,"-variant-").concat(e))})}),o&&N(o)}null===W&&(null==b?void 0:b.defaultVariantOpen)>=0&&(null===(t=null===(n=null==b?void 0:b.tierOptions)||void 0===n?void 0:n.filter(function(i){var e,n;return null===(n=null===(e=I.scopeData)||void 0===e?void 0:e.tiers)||void 0===n?void 0:n.includes(i)}))||void 0===t||t.forEach(function(i){var e,n=i.toLowerCase().replace(/ /g,"_");((null===(e=I.variantsByTier)||void 0===e?void 0:e[n])||[])[b.defaultVariantOpen]&&N("".concat(n,"-variant-").concat(b.defaultVariantOpen))})),Q.current=I.variantsByTier},[I.variantsByTier,null==b?void 0:b.defaultVariantOpen,null===(g=I.scopeData)||void 0===g?void 0:g.tiers,null==b?void 0:b.tierOptions,null==b?void 0:b.autoScrollVariantIndex]);var X=function(e){R(function(n){var t;return i.__assign(i.__assign({},n),((t={})[e]=!n[e],t))})},Y=function(i){var e,n,t,o=i.split("_"),l=o[o.length-1],a=/^\d+$/.test(l)?o.slice(0,-1).join("_"):i,r=null===(e=I.fieldCitations)||void 0===e?void 0:e[a];if(Array.isArray(r)&&r.length>0)return r;var s=null===(n=I.fieldCitations)||void 0===n?void 0:n[i];return Array.isArray(s)&&s.length>0?s:null!==(t=I.citations)&&void 0!==t?t:[]},ii={marginTop:"-17px",position:"relative",zIndex:1};v.default.useCallback(function(i){i&&requestAnimationFrame(function(){setTimeout(function(){i.scrollIntoView({behavior:"smooth",block:"center"})},300)})},[]),n.useEffect(function(){var i,e;null!=(null==b?void 0:b.autoScrollVariantIndex)&&(null===(e=null===(i=null==b?void 0:b.tierOptions)||void 0===i?void 0:i.filter(function(i){var e,n;return null===(n=null===(e=I.scopeData)||void 0===e?void 0:e.tiers)||void 0===n?void 0:n.includes(i)}))||void 0===e||e.forEach(function(i){var e=i.toLowerCase().replace(/ /g,"_"),n="".concat(e,"-variant-").concat(b.autoScrollVariantIndex),t=k.current.get(n);t&&requestAnimationFrame(function(){setTimeout(function(){t.scrollIntoView({behavior:"smooth",block:"center"})},300)})}))},[null==b?void 0:b.scrollTrigger]),console.log("CreateRule state:",I),console.log("CreateRule uiState:",b);var ei=function(i){return i?i.replace(/_/g," ").replace(/([a-zA-Z])(\d)/g,"$1 $2").replace(/\b\w/g,function(i){return i.toUpperCase()}):"Variant 1"},ni=!!(null==b?void 0:b.activeEditId);return e.jsxs("div",i.__assign({className:"traffic-manager-template"},{children:[e.jsx("div",i.__assign({"data-edit-id":"rule-setup"},{children:e.jsx(s.default,i.__assign({title:{type:"other",label:(null==b?void 0:b.setupLabel)||"Rule Setup"},actionButtons:function(n,t){if(q)return null;var o=!!(null==b?void 0:b.activeEditId)&&"rule-setup"!==b.activeEditId;return e.jsx("div",i.__assign({style:{position:"relative",display:"flex",flexDirection:"column"}},{children:e.jsx("button",i.__assign({title:o?"Save active edits first":"Edit",onClick:function(e){e.stopPropagation(),o?(null==b?void 0:b.setPendingEditId)&&b.setPendingEditId(b.activeEditId||null):(!function(){var e,n;(null==b?void 0:b.activeEditId)&&"rule-setup"!==b.activeEditId||(null===(e=null==b?void 0:b.setActiveEditId)||void 0===e||e.call(b,"rule-setup"),B(null!==(n=I.ruleTitle)&&void 0!==n?n:""),z(I.scopeData?i.__assign({},I.scopeData):{}))}(),(null==b?void 0:b.setPendingEditId)&&b.setPendingEditId(null),n||t())},disabled:K,style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",padding:"6px 8px",border:"1px solid #e5e7eb",borderRadius:"8px",cursor:K?"not-allowed":"pointer",backgroundColor:"#ffffff",color:"#6b7280",opacity:K?.5:1}},{children:e.jsx(c.Pencil,{size:14})}))}))},footerData:{ruleTitle:I.ruleTitle,stations:[I.scopeData.station],tiers:null===(f=I.scopeData)||void 0===f?void 0:f.tiers},defaultOpen:"Create"===(null==b?void 0:b.usedFor),readOnly:"Create"!==(null==b?void 0:b.usedFor),isAiStreaming:null==b?void 0:b.isAiStreaming,editFlow:"Edit"===(null==b?void 0:b.usedFor)},{children:e.jsxs("div",i.__assign({style:{display:"flex",flexDirection:"column",gap:"12px"}},{children:[K&&(null==b?void 0:b.isAiStreaming)&&e.jsxs("div",i.__assign({style:{display:"flex",alignItems:"center",color:"#141414ff",fontSize:"13px",fontWeight:500,fontStyle:"italic",marginBottom:"8px",paddingLeft:"4px"}},{children:[e.jsx(c.Loader2Icon,{size:16,style:{marginRight:8,animation:"spin 1s linear infinite"}},"loader"),"Checking the correctness of your Rule Setup..."]})),e.jsx(r.TextSection,i.__assign({id:"rule-title",title:b.ruleTitle||"Rule Title",rows:1,placeholder:"Enter a short, descriptive title for the learning",required:!0,value:q&&null!==F?F:I.ruleTitle,onChange:function(i){return q?B(i):A.setRuleTitle(i)},readOnly:(null==b?void 0:b.isAiStreaming)||!q,isOpen:w.ruleTitle,onToggle:function(){return X("ruleTitle")},isHighlighted:E.ruleTitle||!1,showCognitiveIcon:I.citation.ruleTitle,tooltipDescription:"Why this Title?",errorMessage:null===(h=b.validationErrors)||void 0===h?void 0:h.ruleTitle},b)),I.citation.ruleTitle&&e.jsx("div",i.__assign({style:ii},{children:e.jsx(t.InputDataReasoningCard,{isVisible:w.ruleTitle,citation:I.citation.ruleTitle,citations:Y("ruleTitle"),fieldName:"Rule Title",fieldValue:I.ruleTitle})})),e.jsx(a.ScopeSection,i.__assign({id:"scope",title:"",required:!1,scopeData:q&&null!==P?P:I.scopeData,onScopeChange:function(e,n){q?z(function(t){var o;return i.__assign(i.__assign({},null!=t?t:I.scopeData),((o={})[e]=n,o))}):A.onScopeChange(e,n)},tierLabel:"Which tiers should this learning apply to?",stationLabel:"Which scope should this learning belong to?",highlights:E,isOpen:w.scopeData,onToggle:function(){return X("scopeData")},showCognitiveIcon:I.citation.scopeData,cognitiveIcon:e.jsx(d.ButtonCognitiveIcon,{}),tooltipDescription:"Why this Scope?",errorMessage:(null===(x=b.validationErrors)||void 0===x?void 0:x.station)||(null===(_=b.validationErrors)||void 0===_?void 0:_.tiers),stationErrorMessage:null===(y=b.validationErrors)||void 0===y?void 0:y.station,tierErrorMessage:null===(m=b.validationErrors)||void 0===m?void 0:m.tiers,readOnly:(null==b?void 0:b.isAiStreaming)||!q},b)),I.citation.scopeData&&e.jsx("div",i.__assign({style:ii},{children:e.jsx(t.InputDataReasoningCard,{isVisible:w.scopeData,citation:I.citation.scopeData,citations:Y("scopeData"),fieldName:"Scope",fieldValue:null===(T=null===(S=I.scopeData)||void 0===S?void 0:S.tiers)||void 0===T?void 0:T.join(", ")})})),q?e.jsxs("div",i.__assign({style:{display:"flex",flexDirection:"column",alignItems:"flex-start"}},{children:[e.jsxs("div",i.__assign({style:{display:"flex",justifyContent:"flex-start",alignItems:"center",gap:"16px"}},{children:[e.jsx("button",i.__assign({onClick:J,style:{background:"none",border:"none",color:"#6b7280",fontSize:"14px",fontWeight:"500",cursor:"pointer",padding:"0"}},{children:"Discard Changes"})),e.jsxs("button",i.__assign({onClick:Z,style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 16px",borderRadius:"12px",border:"none",backgroundColor:"#2563eb",color:"#ffffff",fontSize:"14px",fontWeight:"500",cursor:"pointer",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.05)"}},{children:[e.jsx(c.Check,{size:18,strokeWidth:2.5,color:"#ffffff"}),"Save Changes"]}))]})),"rule-setup"===(null==b?void 0:b.pendingEditId)&&e.jsxs("div",i.__assign({style:{display:"flex",alignItems:"center",gap:"6px",marginTop:"8px"}},{children:[e.jsx(c.AlertTriangle,{style:{color:"#C2410C"}}),e.jsx("div",i.__assign({style:{display:"flex",color:"#C2410C",fontSize:"13px",paddingTop:"8px",alignItems:"center"}},{children:"Pending - Changes not applied yet. Apply or discard them to continue."}))]}))]})):null]}))}))})),null===(D=null===(C=null==b?void 0:b.tierOptions)||void 0===C?void 0:C.filter(function(i){var e,n;return null===(n=null===(e=I.scopeData)||void 0===e?void 0:e.tiers)||void 0===n?void 0:n.includes(i)}))||void 0===D?void 0:D.map(function(n,a,d){var c,u,v,g,f=n.toLowerCase().replace(/ /g,"_"),h=(null===(c=I.variantsByTier)||void 0===c?void 0:c[f])||[],x=h.length,_=!1;if(1===x){var y=h[0],m=!(null===(u=null==y?void 0:y.ruleDescription)||void 0===u?void 0:u.trim()),S=(null===(v=null==y?void 0:y.whenToApplyConditions)||void 0===v?void 0:v.some(function(i){return(null==i?void 0:i.text)&&""!==i.text.trim()}))||!1,T=(null===(g=null==y?void 0:y.whenNotToApplyConditions)||void 0===g?void 0:g.some(function(i){return(null==i?void 0:i.text)&&""!==i.text.trim()}))||!1;m&&!S&&!T&&(_=!0)}var C=_?void 0:"".concat(x," ").concat(1===x?"variant":"variants"," configured for this tier"),D=!((null==b?void 0:b.defaultTierOpen)>=0)||a===b.defaultTierOpen;return console.log("Rendering tier : ",n),e.jsx(s.default,i.__assign({variant:"tier-header",title:{type:"other",label:n},subtitle:C,defaultOpen:D,footerData:{description:"Variants for ".concat(n)}},{children:e.jsx(p,i.__assign({onAddVariant:function(){var i;return null===(i=A.addNewVariant)||void 0===i?void 0:i.call(A,f)},isDisabled:null==b?void 0:b.isAiStreaming},{children:h.map(function(n,a){var d,c,u,v,p,g,h,x,_,y,m,S=n.variantType||"default",T="".concat(f,"-variant-").concat(a),C=!0===n.is_variant,D="default"===S||"default_variant"===S;(null==b?void 0:b.defaultVariantOpen)>=0&&b.defaultVariantOpen;var E="".concat(f,"_").concat(a),O=j.get(E)||{},R=(null===(c=null===(d=b.separationItemsByTier)||void 0===d?void 0:d[f])||void 0===c?void 0:c.get(a))||[],V=(null===(v=null===(u=b.togglesByTier)||void 0===u?void 0:u[f])||void 0===v?void 0:v.get(a))||[];(null==b?void 0:b.autoScrollVariantIndex)===a||n.is_variant,console.log("Rendering ".concat(f," variant ").concat(a,":"),n),console.log("Rendering Variant : ",n),console.log("Open Accordion ID:",W,"Current Variant ID:",T);var q=null===(p=null==b?void 0:b.activeEditId)||void 0===p?void 0:p.startsWith("condition-wta-".concat(f,"-").concat(a)),M=null===(g=null==b?void 0:b.activeEditId)||void 0===g?void 0:g.startsWith("condition-wnta-".concat(f,"-").concat(a));return e.jsx("div",i.__assign({ref:function(i){i?k.current.set(T,i):k.current.delete(T)},style:{width:"100%"}},{children:e.jsx(s.default,i.__assign({title:{type:D?"default":"variant",label:ei(S),number:a+1,isNewVariant:C,isDefault:n.isDefault,isModified:n.isModified},defaultOpen:!0,expanded:W===T,onToggle:function(){var i,e=W===T;console.log("is closing:",e),N(e?null:T),null===(i=null==b?void 0:b.setActiveVariantAccordionIndex)||void 0===i||i.call(b,e?null:a)},variant:"rule-behavior",footerData:{ruleTitle:S,description:n.ruleDescription||""}},{children:e.jsxs("div",i.__assign({style:{display:"flex",flexDirection:"column",gap:"12px"}},{children:[e.jsx(r.TextSection,i.__assign({id:"rule-description-".concat(f,"-").concat(a),title:b.ruleDescriptionTitle||"Rule Description",rows:2,placeholder:"Explain the learning behaviour",required:!0,readOnly:n.isReadOnly||(null==b?void 0:b.isAiStreaming)||ni&&(null==b?void 0:b.activeEditId)!=="rule-description-".concat(f,"-").concat(a),value:n.ruleDescription||"",onChange:function(i){return A.setRuleDescription(f,a,i)},isOpen:w["ruleDescription-".concat(f)],onToggle:function(){return X("ruleDescription-".concat(f))},isHighlighted:O.ruleDescription||!1,showCognitiveIcon:null===(h=I.citation)||void 0===h?void 0:h["ruleDescription_".concat(f)],tooltipDescription:"Why this Description?",errorMessage:null===(x=b.validationErrors)||void 0===x?void 0:x["ruleDescription-".concat(f,"-").concat(a)],enableInlineEdit:!0,setSendMessageInChat:null==b?void 0:b.setSendMessageInChat,isAiStreaming:null==b?void 0:b.isAiStreaming,fieldName:"Rule Description"},b)),(null===(_=I.citation)||void 0===_?void 0:_["ruleDescription_".concat(f)])&&e.jsx("div",i.__assign({style:ii},{children:e.jsx(t.InputDataReasoningCard,{isVisible:w["ruleDescription-".concat(f)],citation:I.citation["ruleDescription_".concat(f)],citations:Y("ruleDescription_".concat(f,"_").concat(a)),fieldName:"Rule Description",fieldValue:n.ruleDescription})})),e.jsx(o.ConditionSection,i.__assign({id:"when-to-apply-".concat(f,"-").concat(a),idPrefix:"condition-wta",title:b.whenToApplyTitle||"When to apply",required:!0,dividerRequired:!0,readOnly:n.isReadOnly||(null==b?void 0:b.isAiStreaming)||ni&&!q,conditions:n.whenToApplyConditions||[],onAdd:function(){return A.addWhenToApply(f,a)},onRemove:function(i,e,n){return A.removeWhenToApply(i,e,n)},onEdit:function(i,e,n,t){return A.editWhenToApply(i,e,n,t)},index:a,tierKey:f,isHighlighted:O.wta||!1,highlightedIds:null==b?void 0:b.highlightedIds,tooltipDescription:"Why this Condition?",citations:Y("whenToApply_".concat(f,"_").concat(a)),bordered:!0,addLabel:"Add When to apply",isAiStreaming:b.isAiStreaming,errorMessage:(null===(y=b.validationErrors)||void 0===y?void 0:y["whenToApply-".concat(f,"-").concat(a)])||(null==b?void 0:b.conflictReason)},b)),e.jsx(o.ConditionSection,i.__assign({id:"when-not-to-apply-".concat(f,"-").concat(a),idPrefix:"condition-wnta",title:b.whenNotToApplyTitle||"When NOT to apply",required:!1,dividerRequired:!0,readOnly:n.isReadOnly||(null==b?void 0:b.isAiStreaming)||ni&&!M,conditions:n.whenNotToApplyConditions||[],onAdd:function(){return A.addWhenNotToApply(f,a)},onRemove:function(i,e,n){return A.removeWhenNotToApply(i,e,n)},onEdit:function(i,e,n,t){return A.editWhenNotToApply(i,e,n,t)},index:a,tierKey:f,isHighlighted:O.wnta||!1,highlightedIds:null==b?void 0:b.highlightedIds,tooltipDescription:"Why this Condition?",citations:Y("whenNotToApply_".concat(f,"_").concat(a)),bordered:!0,addLabel:"Add When NOT to apply",isAiStreaming:b.isAiStreaming},b)),e.jsx(l.ConfigSection,i.__assign({id:"config-".concat(f,"-").concat(a),title:b.configTitle||"Configuration",required:!1,highlights:O,bordered:!0,readOnly:n.isReadOnly||(null==b?void 0:b.isAiStreaming)||ni&&(null==b?void 0:b.activeEditId)!=="config-".concat(f,"-").concat(a),onConfigChange:function(i,e){return A.onConfigChange(f,a,i,e)},separationItems:R,toggles:V,index:a},b)),(null===(m=n.reasoning)||void 0===m?void 0:m.configData)&&e.jsx("div",i.__assign({style:ii},{children:e.jsx(t.InputDataReasoningCard,{citation:n.reasoning.configData,citations:Y("configData_".concat(f,"_").concat(a)),fieldName:"Configuration",fieldValue:"Proposed Configuration"})}))]}))}),T)}),"".concat(f,"-variant-").concat(a))})}))}),"tier-".concat(a))})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),e=require("react/jsx-runtime"),n=require("react"),t=require("../../InputDataReasoningCard.js"),o=require("../../organisms/ConditionSection/ConditionSection.js"),l=require("../../organisms/ConfigSection/ConfigSection.js"),a=require("../../organisms/ScopeSection/ScopeSection.js"),r=require("../../organisms/TextSection/TextSection.js"),d=require("../../AccordianSection.js"),s=require("../../_svg/ButtonCognitiveIcon.js"),c=require("lucide-react");function u(i){return i&&"object"==typeof i&&"default"in i?i:{default:i}}var v=u(n),p=function(n){var t=n.children,o=n.onAddVariant,l=n.isDisabled,a=v.default.Children.toArray(t);return e.jsxs("div",i.__assign({style:{display:"flex",flexDirection:"column",alignItems:"flex-start"}},{children:[a.map(function(i,n){return e.jsxs(v.default.Fragment,{children:[i,e.jsx("div",{style:{width:"2px",height:"20px",backgroundColor:"#E2E8F0",marginLeft:"30px"}})]},n)}),e.jsx("div",i.__assign({onClick:l?void 0:o,style:{padding:"8px 16px",border:"1px solid #E2E8F0",borderRadius:"8px",color:l?"#94a3b8":"#475569",fontSize:"14px",fontWeight:"500",cursor:l?"not-allowed":"pointer",backgroundColor:l?"#f8fafc":"#FFFFFF",opacity:l?.7:1,userSelect:"none",transition:"all 0.2s ease"}},{children:"Add Variant"}))]}))};exports.CreateRule=function(u){var g,f,h,x,y,_,m,S,T,C,D,I=u.state,A=u.handlers,j=u.uiState,b=(null==j?void 0:j.highlights)||new Map,E=b.get("global_0")||{},O=n.useState({}),w=O[0],R=O[1],V=n.useState(null),W=V[0],N=V[1],q="rule-setup"===(null==j?void 0:j.activeEditId),M=v.default.useRef(new Map),k=n.useState(null),F=k[0],B=k[1],L=n.useState(null),P=L[0],z=L[1],H=n.useState(!1),K=H[0],$=H[1],J=v.default.useRef(null==j?void 0:j.isAiStreaming);n.useEffect(function(){J.current&&!(null==j?void 0:j.isAiStreaming)&&K&&$(!1),J.current=null==j?void 0:j.isAiStreaming},[null==j?void 0:j.isAiStreaming,K]);var U=function(){var i;B(null),z(null),null===(i=null==j?void 0:j.setActiveEditId)||void 0===i||i.call(j,null)},Z=function(){var i,e,n=null!=F?F:I.ruleTitle,t=null!=P?P:I.scopeData,o=n!==I.ruleTitle,l=JSON.stringify(t)!==JSON.stringify(I.scopeData);if(!o&&!l)return B(null),z(null),void(null===(i=null==j?void 0:j.setActiveEditId)||void 0===i||i.call(j,null));if(null==j?void 0:j.setSendMessageInChat){var a="sk-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),r=[];if(o&&r.push((null==n?void 0:n.trim())?"Title with ".concat(n):"No Title"),l){var d=null==t?void 0:t.tiers,s=d&&d.length>0?"tiers: ".concat(d.join(", ")):"No Tier Selected";r.push(s)}var c=r.join(" and ");j.setSendMessageInChat("__SKELETON__:".concat(a,":Update Rule Setup ").concat(c))}$(!0),B(null),z(null),null===(e=null==j?void 0:j.setActiveEditId)||void 0===e||e.call(j,null)},G=v.default.useRef(null==j?void 0:j.defaultVariantOpen),Q=v.default.useRef(I.variantsByTier);v.default.useEffect(function(){var i,e,n,t,o=null,l=!1;if(G.current!==(null==j?void 0:j.defaultVariantOpen)&&(l=!0,G.current=null==j?void 0:j.defaultVariantOpen),l){if(null==(null==j?void 0:j.defaultVariantOpen)||(null==j?void 0:j.defaultVariantOpen)<0)return N(null),void(Q.current=I.variantsByTier);null===(e=null===(i=null==j?void 0:j.tierOptions)||void 0===i?void 0:i.filter(function(i){var e,n;return null===(n=null===(e=I.scopeData)||void 0===e?void 0:e.tiers)||void 0===n?void 0:n.includes(i)}))||void 0===e||e.forEach(function(i){var e,n=i.toLowerCase().replace(/ /g,"_");((null===(e=I.variantsByTier)||void 0===e?void 0:e[n])||[]).forEach(function(i,e){(null==j?void 0:j.defaultVariantOpen)===e&&(o="".concat(n,"-variant-").concat(e)),(null==j?void 0:j.autoScrollVariantIndex)===e&&(o="".concat(n,"-variant-").concat(e))})}),o&&N(o)}null===W&&(null==j?void 0:j.defaultVariantOpen)>=0&&(null===(t=null===(n=null==j?void 0:j.tierOptions)||void 0===n?void 0:n.filter(function(i){var e,n;return null===(n=null===(e=I.scopeData)||void 0===e?void 0:e.tiers)||void 0===n?void 0:n.includes(i)}))||void 0===t||t.forEach(function(i){var e,n=i.toLowerCase().replace(/ /g,"_");((null===(e=I.variantsByTier)||void 0===e?void 0:e[n])||[])[j.defaultVariantOpen]&&N("".concat(n,"-variant-").concat(j.defaultVariantOpen))})),Q.current=I.variantsByTier},[I.variantsByTier,null==j?void 0:j.defaultVariantOpen,null===(g=I.scopeData)||void 0===g?void 0:g.tiers,null==j?void 0:j.tierOptions,null==j?void 0:j.autoScrollVariantIndex]);var X=function(e){R(function(n){var t;return i.__assign(i.__assign({},n),((t={})[e]=!n[e],t))})},Y=function(i){var e,n,t,o=i.split("_"),l=o[o.length-1],a=/^\d+$/.test(l)?o.slice(0,-1).join("_"):i,r=null===(e=I.fieldCitations)||void 0===e?void 0:e[a];if(Array.isArray(r)&&r.length>0)return r;var d=null===(n=I.fieldCitations)||void 0===n?void 0:n[i];return Array.isArray(d)&&d.length>0?d:null!==(t=I.citations)&&void 0!==t?t:[]},ii={marginTop:"-17px",position:"relative",zIndex:1};n.useEffect(function(){var i,e;null!=(null==j?void 0:j.autoScrollVariantIndex)&&(null===(e=null===(i=null==j?void 0:j.tierOptions)||void 0===i?void 0:i.filter(function(i){var e,n;return null===(n=null===(e=I.scopeData)||void 0===e?void 0:e.tiers)||void 0===n?void 0:n.includes(i)}))||void 0===e||e.forEach(function(i){var e=i.toLowerCase().replace(/ /g,"_"),n="".concat(e,"-variant-").concat(j.autoScrollVariantIndex),t=M.current.get(n);t&&requestAnimationFrame(function(){setTimeout(function(){t.scrollIntoView({behavior:"smooth",block:"center"})},300)})}))},[null==j?void 0:j.scrollTrigger]),console.log("CreateRule state:",I),console.log("CreateRule uiState:",j);var ei=function(i){return i?i.replace(/_/g," ").replace(/([a-zA-Z])(\d)/g,"$1 $2").replace(/\b\w/g,function(i){return i.toUpperCase()}):"Variant 1"},ni=!!(null==j?void 0:j.activeEditId);return e.jsxs("div",i.__assign({className:"traffic-manager-template"},{children:[e.jsx("div",i.__assign({"data-edit-id":"rule-setup"},{children:e.jsx(d.default,i.__assign({title:{type:"other",label:(null==j?void 0:j.setupLabel)||"Rule Setup"},actionButtons:function(n,t){if(q)return null;var o=!!(null==j?void 0:j.activeEditId)&&"rule-setup"!==j.activeEditId;return e.jsx("div",i.__assign({style:{position:"relative",display:"flex",flexDirection:"column"}},{children:e.jsx("button",i.__assign({title:o?"Save active edits first":"Edit",onClick:function(e){e.stopPropagation(),o?(null==j?void 0:j.setPendingEditId)&&j.setPendingEditId(j.activeEditId||null):(!function(){var e,n;(null==j?void 0:j.activeEditId)&&"rule-setup"!==j.activeEditId||(null===(e=null==j?void 0:j.setActiveEditId)||void 0===e||e.call(j,"rule-setup"),B(null!==(n=I.ruleTitle)&&void 0!==n?n:""),z(I.scopeData?i.__assign({},I.scopeData):{}))}(),(null==j?void 0:j.setPendingEditId)&&j.setPendingEditId(null),n||t())},disabled:K,style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",padding:"6px 8px",border:"1px solid #e5e7eb",borderRadius:"8px",cursor:K?"not-allowed":"pointer",backgroundColor:"#ffffff",color:"#6b7280",opacity:K?.5:1}},{children:e.jsx(c.Pencil,{size:14})}))}))},footerData:{ruleTitle:I.ruleTitle,stations:[I.scopeData.station],tiers:null===(f=I.scopeData)||void 0===f?void 0:f.tiers},defaultOpen:"Create"===(null==j?void 0:j.usedFor),readOnly:"Create"!==(null==j?void 0:j.usedFor),isAiStreaming:null==j?void 0:j.isAiStreaming,editFlow:"Edit"===(null==j?void 0:j.usedFor)},{children:e.jsxs("div",i.__assign({style:{display:"flex",flexDirection:"column",gap:"12px"}},{children:[K&&(null==j?void 0:j.isAiStreaming)&&e.jsxs("div",i.__assign({style:{display:"flex",alignItems:"center",color:"#141414ff",fontSize:"13px",fontWeight:500,fontStyle:"italic",marginBottom:"8px",paddingLeft:"4px"}},{children:[e.jsx(c.Loader2Icon,{size:16,style:{marginRight:8,animation:"spin 1s linear infinite"}},"loader"),"Checking the correctness of your Rule Setup..."]})),e.jsx(r.TextSection,i.__assign({id:"rule-title",title:j.ruleTitle||"Rule Title",rows:1,placeholder:"Enter a short, descriptive title for the learning",required:!0,value:q&&null!==F?F:I.ruleTitle,onChange:function(i){return q?B(i):A.setRuleTitle(i)},readOnly:(null==j?void 0:j.isAiStreaming)||!q,isOpen:w.ruleTitle,onToggle:function(){return X("ruleTitle")},isHighlighted:E.ruleTitle||!1,showCognitiveIcon:I.citation.ruleTitle,tooltipDescription:"Why this Title?",errorMessage:null===(h=j.validationErrors)||void 0===h?void 0:h.ruleTitle},j)),I.citation.ruleTitle&&e.jsx("div",i.__assign({style:ii},{children:e.jsx(t.InputDataReasoningCard,{isVisible:w.ruleTitle,citation:I.citation.ruleTitle,citations:Y("ruleTitle"),fieldName:"Rule Title",fieldValue:I.ruleTitle})})),e.jsx(a.ScopeSection,i.__assign({id:"scope",title:"",required:!1,scopeData:q&&null!==P?P:I.scopeData,onScopeChange:function(e,n){q?z(function(t){var o;return i.__assign(i.__assign({},null!=t?t:I.scopeData),((o={})[e]=n,o))}):A.onScopeChange(e,n)},tierLabel:"Which tiers should this learning apply to?",stationLabel:"Which scope should this learning belong to?",highlights:E,isOpen:w.scopeData,onToggle:function(){return X("scopeData")},showCognitiveIcon:I.citation.scopeData,cognitiveIcon:e.jsx(s.ButtonCognitiveIcon,{}),tooltipDescription:"Why this Scope?",errorMessage:(null===(x=j.validationErrors)||void 0===x?void 0:x.station)||(null===(y=j.validationErrors)||void 0===y?void 0:y.tiers),stationErrorMessage:null===(_=j.validationErrors)||void 0===_?void 0:_.station,tierErrorMessage:null===(m=j.validationErrors)||void 0===m?void 0:m.tiers,readOnly:(null==j?void 0:j.isAiStreaming)||!q},j)),I.citation.scopeData&&e.jsx("div",i.__assign({style:ii},{children:e.jsx(t.InputDataReasoningCard,{isVisible:w.scopeData,citation:I.citation.scopeData,citations:Y("scopeData"),fieldName:"Scope",fieldValue:null===(T=null===(S=I.scopeData)||void 0===S?void 0:S.tiers)||void 0===T?void 0:T.join(", ")})})),q?e.jsxs("div",i.__assign({style:{display:"flex",flexDirection:"column",alignItems:"flex-start"}},{children:[e.jsxs("div",i.__assign({style:{display:"flex",justifyContent:"flex-start",alignItems:"center",gap:"16px"}},{children:[e.jsx("button",i.__assign({onClick:U,style:{background:"none",border:"none",color:"#6b7280",fontSize:"14px",fontWeight:"500",cursor:"pointer",padding:"0"}},{children:"Discard Changes"})),e.jsxs("button",i.__assign({onClick:Z,style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 16px",borderRadius:"12px",border:"none",backgroundColor:"#2563eb",color:"#ffffff",fontSize:"14px",fontWeight:"500",cursor:"pointer",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.05)"}},{children:[e.jsx(c.Check,{size:18,strokeWidth:2.5,color:"#ffffff"}),"Save Changes"]}))]})),"rule-setup"===(null==j?void 0:j.pendingEditId)&&e.jsxs("div",i.__assign({style:{display:"flex",alignItems:"center",gap:"6px",marginTop:"8px"}},{children:[e.jsx(c.AlertTriangle,{style:{color:"#C2410C"}}),e.jsx("div",i.__assign({style:{display:"flex",color:"#C2410C",fontSize:"13px",paddingTop:"8px",alignItems:"center"}},{children:"Pending - Changes not applied yet. Apply or discard them to continue."}))]}))]})):null]}))}))})),null===(D=null===(C=null==j?void 0:j.tierOptions)||void 0===C?void 0:C.filter(function(i){var e,n;return null===(n=null===(e=I.scopeData)||void 0===e?void 0:e.tiers)||void 0===n?void 0:n.includes(i)}))||void 0===D?void 0:D.map(function(n,a,s){var c,u,v,g,f=n.toLowerCase().replace(/ /g,"_"),h=(null===(c=I.variantsByTier)||void 0===c?void 0:c[f])||[],x=h.length,y=!1;if(1===x){var _=h[0],m=!(null===(u=null==_?void 0:_.ruleDescription)||void 0===u?void 0:u.trim()),S=(null===(v=null==_?void 0:_.whenToApplyConditions)||void 0===v?void 0:v.some(function(i){return(null==i?void 0:i.text)&&""!==i.text.trim()}))||!1,T=(null===(g=null==_?void 0:_.whenNotToApplyConditions)||void 0===g?void 0:g.some(function(i){return(null==i?void 0:i.text)&&""!==i.text.trim()}))||!1;m&&!S&&!T&&(y=!0)}var C=y?void 0:"".concat(x," ").concat(1===x?"variant":"variants"," configured for this tier"),D=!((null==j?void 0:j.defaultTierOpen)>=0)||a===j.defaultTierOpen;return console.log("Rendering tier : ",n),e.jsx(d.default,i.__assign({variant:"tier-header",title:{type:"other",label:n},subtitle:C,defaultOpen:D,footerData:{description:"Variants for ".concat(n)}},{children:e.jsx(p,i.__assign({onAddVariant:function(){var i;return null===(i=A.addNewVariant)||void 0===i?void 0:i.call(A,f)},isDisabled:null==j?void 0:j.isAiStreaming},{children:h.map(function(n,a){var s,c,u,v,p,g,h,x,y,_,m,S=n.variantType||"default",T="".concat(f,"-variant-").concat(a),C=!0===n.is_variant,D="default"===S||"default_variant"===S;(null==j?void 0:j.defaultVariantOpen)>=0&&j.defaultVariantOpen;var E="".concat(f,"_").concat(a),O=b.get(E)||{},R=(null===(c=null===(s=j.separationItemsByTier)||void 0===s?void 0:s[f])||void 0===c?void 0:c.get(a))||[],V=(null===(v=null===(u=j.togglesByTier)||void 0===u?void 0:u[f])||void 0===v?void 0:v.get(a))||[];(null==j?void 0:j.autoScrollVariantIndex)===a||n.is_variant,console.log("Rendering ".concat(f," variant ").concat(a,":"),n),console.log("Rendering Variant : ",n),console.log("Open Accordion ID:",W,"Current Variant ID:",T);var q=null===(p=null==j?void 0:j.activeEditId)||void 0===p?void 0:p.startsWith("condition-wta-".concat(f,"-").concat(a)),k=null===(g=null==j?void 0:j.activeEditId)||void 0===g?void 0:g.startsWith("condition-wnta-".concat(f,"-").concat(a));return e.jsx("div",i.__assign({ref:function(i){i?M.current.set(T,i):M.current.delete(T)},style:{width:"100%"}},{children:e.jsx(d.default,i.__assign({title:{type:D?"default":"variant",label:ei(S),number:a+1,isNewVariant:C,isDefault:n.isDefault,isModified:n.isModified},defaultOpen:!0,expanded:W===T,onToggle:function(){var i,e=W===T;console.log("is closing:",e),N(e?null:T),null===(i=null==j?void 0:j.setActiveVariantAccordionIndex)||void 0===i||i.call(j,e?null:a)},variant:"rule-behavior",footerData:{ruleTitle:S,description:n.ruleDescription||""}},{children:e.jsxs("div",i.__assign({style:{display:"flex",flexDirection:"column",gap:"12px"}},{children:[e.jsx(r.TextSection,i.__assign({id:"rule-description-".concat(f,"-").concat(a),title:j.ruleDescriptionTitle||"Rule Description",rows:2,placeholder:"Explain the learning behaviour",required:!0,readOnly:n.isReadOnly||(null==j?void 0:j.isAiStreaming)||ni&&(null==j?void 0:j.activeEditId)!=="rule-description-".concat(f,"-").concat(a),value:n.ruleDescription||"",onChange:function(i){return A.setRuleDescription(f,a,i)},isOpen:w["ruleDescription-".concat(f)],onToggle:function(){return X("ruleDescription-".concat(f))},isHighlighted:O.ruleDescription||!1,showCognitiveIcon:null===(h=I.citation)||void 0===h?void 0:h["ruleDescription_".concat(f)],tooltipDescription:"Why this Description?",errorMessage:null===(x=j.validationErrors)||void 0===x?void 0:x["ruleDescription-".concat(f,"-").concat(a)],enableInlineEdit:!0,setSendMessageInChat:null==j?void 0:j.setSendMessageInChat,isAiStreaming:null==j?void 0:j.isAiStreaming,fieldName:"Rule Description"},j)),(null===(y=I.citation)||void 0===y?void 0:y["ruleDescription_".concat(f)])&&e.jsx("div",i.__assign({style:ii},{children:e.jsx(t.InputDataReasoningCard,{isVisible:w["ruleDescription-".concat(f)],citation:I.citation["ruleDescription_".concat(f)],citations:Y("ruleDescription_".concat(f,"_").concat(a)),fieldName:"Rule Description",fieldValue:n.ruleDescription})})),e.jsx(o.ConditionSection,i.__assign({id:"when-to-apply-".concat(f,"-").concat(a),idPrefix:"condition-wta",title:j.whenToApplyTitle||"When to apply",required:!0,dividerRequired:!0,readOnly:n.isReadOnly||(null==j?void 0:j.isAiStreaming)||ni&&!q,conditions:n.whenToApplyConditions||[],onAdd:function(){return A.addWhenToApply(f,a)},onRemove:function(i,e,n){return A.removeWhenToApply(i,e,n)},onEdit:function(i,e,n,t){return A.editWhenToApply(i,e,n,t)},index:a,tierKey:f,isHighlighted:O.wta||!1,highlightedIds:null==j?void 0:j.highlightedIds,tooltipDescription:"Why this Condition?",citations:Y("whenToApply_".concat(f,"_").concat(a)),bordered:!0,addLabel:"Add When to apply",isAiStreaming:j.isAiStreaming,errorMessage:(null===(_=j.validationErrors)||void 0===_?void 0:_["whenToApply-".concat(f,"-").concat(a)])||(null==j?void 0:j.conflictReason)},j)),e.jsx(o.ConditionSection,i.__assign({id:"when-not-to-apply-".concat(f,"-").concat(a),idPrefix:"condition-wnta",title:j.whenNotToApplyTitle||"When NOT to apply",required:!1,dividerRequired:!0,readOnly:n.isReadOnly||(null==j?void 0:j.isAiStreaming)||ni&&!k,conditions:n.whenNotToApplyConditions||[],onAdd:function(){return A.addWhenNotToApply(f,a)},onRemove:function(i,e,n){return A.removeWhenNotToApply(i,e,n)},onEdit:function(i,e,n,t){return A.editWhenNotToApply(i,e,n,t)},index:a,tierKey:f,isHighlighted:O.wnta||!1,highlightedIds:null==j?void 0:j.highlightedIds,tooltipDescription:"Why this Condition?",citations:Y("whenNotToApply_".concat(f,"_").concat(a)),bordered:!0,addLabel:"Add When NOT to apply",isAiStreaming:j.isAiStreaming},j)),e.jsx(l.ConfigSection,i.__assign({id:"config-".concat(f,"-").concat(a),title:j.configTitle||"Configuration",required:!1,highlights:O,bordered:!0,readOnly:n.isReadOnly||(null==j?void 0:j.isAiStreaming)||ni&&(null==j?void 0:j.activeEditId)!=="config-".concat(f,"-").concat(a),onConfigChange:function(i,e){return A.onConfigChange(f,a,i,e)},separationItems:R,toggles:V,index:a},j)),(null===(m=n.reasoning)||void 0===m?void 0:m.configData)&&e.jsx("div",i.__assign({style:ii},{children:e.jsx(t.InputDataReasoningCard,{citation:n.reasoning.configData,citations:Y("configData_".concat(f,"_").concat(a)),fieldName:"Configuration",fieldValue:"Proposed Configuration"})}))]}))}),T)}),"".concat(f,"-variant-").concat(a))})}))}),"tier-".concat(a))})]}))};
2
2
  //# sourceMappingURL=CreateRule.js.map
@@ -1,2 +1,2 @@
1
- import{__rest as e,__assign as n}from"tslib";import{jsx as i,jsxs as r}from"react/jsx-runtime";import{memo as t,useState as o,useMemo as l}from"react";import{ChevronDownIcon as s}from"lucide-react";import a from"react-markdown";import d from"remark-gfm";import p from"rehype-raw";import{CitationLinkSparkleIcon as c}from"./_svg/CitationLinkSparkleIcon.js";import{GapIcon as f}from"./_svg/GapIcon.js";import{LightbulbIcon as g}from"./_svg/Lightbulb.js";import{ButtonCognitiveIcon as x}from"./_svg/ButtonCognitiveIcon.js";var m=t(function(t){var m=t.isVisible,h=t.decisionStrength,u=t.reasoning,y=t.gap,b=o({reasoning:!0,gap:!0}),v=b[0],k=b[1],S=l(function(){return[p]},[]),C=l(function(){return[d]},[]),F=l(function(){return{p:function(r){r.node;var t=e(r,["node"]);return i("p",n({},t,{style:{margin:0}},{children:null==t?void 0:t.children}))},li:function(t){t.node;var o=t.index,l=e(t,["node","index"]);return r("div",n({style:{display:"flex",alignItems:"flex-start",marginBottom:"6px"}},{children:[i("span",n({style:{fontSize:"12px",fontWeight:400,color:"#55585fff",flexShrink:0,minWidth:"18px"}},{children:"number"==typeof o?"".concat(o+1,"."):"•"})),i("span",n({style:{fontSize:"12px",color:"#4B5563",lineHeight:"1.5",flex:1}},{children:l.children}))]}))}}},[]);if(!m||!u&&!y&&!h)return null;var w=function(e){k(function(i){var r;return n(n({},i),((r={})[e]=!i[e],r))})};return r("div",n({style:{width:"100%",marginTop:"8px",overflow:"hidden",borderRadius:"8px",border:"1.5px solid #cacdfa",backgroundColor:"#FFFFFF",boxShadow:"0 2px 4px -1px rgba(0, 0, 0, 0.05)",fontFamily:'"Plus Jakarta Sans", sans-serif'}},{children:[r("div",n({style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px",backgroundColor:"#f4f2ff",borderBottom:"1px solid #fee2e2"}},{children:[r("div",n({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[i(x,{}),i("span",n({style:{fontSize:"13px",fontWeight:600,color:"black"}},{children:"Cognitive Decisioning AI"}))]})),h&&r("div",n({style:{display:"flex",alignItems:"center",borderRadius:"9999px",border:"1.3px solid #bb97f9ff",backgroundColor:"#FFFFFF",padding:"2px 8px",fontSize:"12px",fontWeight:500,color:"#000",gap:"4px"}},{children:[i(c,{}),"Decision Strength: ",h,"%"]}))]})),u&&r("div",n({style:{borderBottom:y?"1px solid #f3f4f6":"none"}},{children:[r("button",n({onClick:function(){return w("reasoning")},style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"12px 16px",border:"none",background:"none",cursor:"pointer"}},{children:[r("div",n({style:{display:"flex",gap:"12px",alignItems:"center"}},{children:[i(g,{}),r("div",n({style:{textAlign:"left"}},{children:[i("h4",n({style:{margin:0,fontSize:"13px",fontWeight:600,color:"#111827"}},{children:"Why this is a conflict?"})),i("p",n({style:{margin:0,fontSize:"11px",color:"#6B7280"}},{children:"Here is why this was picked"}))]}))]})),i(s,{size:16,style:{transform:v.reasoning?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s",color:"#9CA3AF"}})]})),v.reasoning&&i("div",n({style:{padding:"0 16px 16px 60px",fontSize:"12px",color:"#4B5563",lineHeight:"1.5"}},{children:i(a,n({components:F,rehypePlugins:S,remarkPlugins:C},{children:u}))}))]})),y&&r("div",{children:[r("button",n({onClick:function(){return w("gap")},style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"12px 16px",border:"none",background:"none",cursor:"pointer"}},{children:[r("div",n({style:{display:"flex",gap:"12px",alignItems:"center"}},{children:[i(f,{}),r("div",n({style:{textAlign:"left"}},{children:[i("h4",n({style:{margin:0,fontSize:"13px",fontWeight:600,color:"#111827"}},{children:"Gap"})),i("p",n({style:{margin:0,fontSize:"11px",color:"#6B7280"}},{children:"Here is what’s missing or needs clarification"}))]}))]})),i(s,{size:16,style:{transform:v.gap?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s",color:"#9CA3AF"}})]})),v.gap&&i("div",n({style:{padding:"0 16px 16px 60px",fontSize:"12px",color:"#4B5563",lineHeight:"1.5"}},{children:i(a,n({components:F,rehypePlugins:S,remarkPlugins:C},{children:y}))}))]})]}))});m.displayName="ConflictReasoningCard";export{m as ConflictReasoningCard};
1
+ import{__rest as e,__assign as n}from"tslib";import{jsx as i,jsxs as t}from"react/jsx-runtime";import{memo as r,useState as o,useMemo as l,useCallback as a}from"react";import{ChevronDownIcon as s}from"lucide-react";import c from"react-markdown";import d from"remark-gfm";import p from"rehype-raw";import{CitationLinkSparkleIcon as f}from"./_svg/CitationLinkSparkleIcon.js";import{GapIcon as g}from"./_svg/GapIcon.js";import{LightbulbIcon as m}from"./_svg/Lightbulb.js";import{ButtonCognitiveIcon as u}from"./_svg/ButtonCognitiveIcon.js";import{getSourceFromUrl as h}from"./MarkdownComponents/MarkdownElements.js";import x from"./CitationLink.js";var y=r(function(r){var y=r.isVisible,b=r.decisionStrength,v=r.reasoning,k=r.gap,S=r.citations,C=o({reasoning:!0,gap:!0}),w=C[0],F=C[1],z=l(function(){return[p]},[]),I=l(function(){return[d]},[]),B=a(function(e,n){return console.log("getCitationByNumber called with:",{citationNumber:e,source:n},"and citations :",S),S&&S.find(function(i){return i.customMetaData.citation_number&&"Cognitive Decisioning"!==i.customMetaData.citation_title&&i.customMetaData.source===n&&String(i.customMetaData.citation_number)===String(e)})||null},[S]),j=l(function(){return{p:function(t){t.node;var r=e(t,["node"]);return i("p",n({},r,{style:{margin:0}},{children:null==r?void 0:r.children}))},li:function(r){r.node;var o=r.index,l=e(r,["node","index"]);return t("div",n({style:{display:"flex",alignItems:"flex-start",marginBottom:"6px"}},{children:[i("span",n({style:{fontSize:"12px",fontWeight:400,color:"#55585fff",flexShrink:0,minWidth:"18px"}},{children:"number"==typeof o?"".concat(o+1,"."):"•"})),i("span",n({style:{fontSize:"12px",color:"#4B5563",lineHeight:"1.5",flex:1}},{children:l.children}))]}))},a:function(t){t.node;var r=t.href,o=t.children,l=e(t,["node","href","children"]);if(!r)return i("a",n({},l,{children:o}));var a=r.match(/citationNumber=([^&]+)/),s=a?a[1]:null;if(console.log("Processing link:",{match:a,href:r,citationNumber:s}),s){var c=h(r),d=B(s,c);if(console.log("check source and citation here pls :",c,d),console.log("Found citation for link:",{href:r,citationNumber:s,source:c,citation:d}),d)return i("span",n({style:{display:"inline",alignItems:"center",fontSize:"14px !important",gap:"3px",color:"#2563EB",verticalAlign:"middle"}},{children:i(x,{citation:d,linkTitle:o,fontSize:12})}))}return i("a",n({href:r,target:"_blank",rel:"noopener noreferrer",style:{color:"#2563EB",textDecoration:"none"}},l,{children:o}))}}},[]);if(!y||!v&&!k&&!b)return null;var A=function(e){F(function(i){var t;return n(n({},i),((t={})[e]=!i[e],t))})};return t("div",n({style:{width:"100%",marginTop:"8px",overflow:"hidden",borderRadius:"8px",border:"1.5px solid #cacdfa",backgroundColor:"#FFFFFF",boxShadow:"0 2px 4px -1px rgba(0, 0, 0, 0.05)",fontFamily:'"Plus Jakarta Sans", sans-serif'}},{children:[t("div",n({style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px",backgroundColor:"#f4f2ff",borderBottom:"1px solid #fee2e2"}},{children:[t("div",n({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[i(u,{}),i("span",n({style:{fontSize:"13px",fontWeight:600,color:"black"}},{children:"Cognitive Decisioning AI"}))]})),b&&t("div",n({style:{display:"flex",alignItems:"center",borderRadius:"9999px",border:"1.3px solid #bb97f9ff",backgroundColor:"#FFFFFF",padding:"2px 8px",fontSize:"12px",fontWeight:500,color:"#000",gap:"4px"}},{children:[i(f,{}),"Decision Strength: ",b,"%"]}))]})),v&&t("div",n({style:{borderBottom:k?"1px solid #f3f4f6":"none"}},{children:[t("button",n({onClick:function(){return A("reasoning")},style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"12px 16px",border:"none",background:"none",cursor:"pointer"}},{children:[t("div",n({style:{display:"flex",gap:"12px",alignItems:"center"}},{children:[i(m,{}),t("div",n({style:{textAlign:"left"}},{children:[i("h4",n({style:{margin:0,fontSize:"13px",fontWeight:600,color:"#111827"}},{children:"Why this is a conflict?"})),i("p",n({style:{margin:0,fontSize:"11px",color:"#6B7280"}},{children:"Here is why this was picked"}))]}))]})),i(s,{size:16,style:{transform:w.reasoning?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s",color:"#9CA3AF"}})]})),w.reasoning&&i("div",n({style:{padding:"0 16px 16px 60px",fontSize:"12px",color:"#4B5563",lineHeight:"1.5"}},{children:i(c,n({components:j,rehypePlugins:z,remarkPlugins:I},{children:v}))}))]})),k&&t("div",{children:[t("button",n({onClick:function(){return A("gap")},style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"12px 16px",border:"none",background:"none",cursor:"pointer"}},{children:[t("div",n({style:{display:"flex",gap:"12px",alignItems:"center"}},{children:[i(g,{}),t("div",n({style:{textAlign:"left"}},{children:[i("h4",n({style:{margin:0,fontSize:"13px",fontWeight:600,color:"#111827"}},{children:"Gap"})),i("p",n({style:{margin:0,fontSize:"11px",color:"#6B7280"}},{children:"Here is what’s missing or needs clarification"}))]}))]})),i(s,{size:16,style:{transform:w.gap?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s",color:"#9CA3AF"}})]})),w.gap&&i("div",n({style:{padding:"0 16px 16px 60px",fontSize:"12px",color:"#4B5563",lineHeight:"1.5"}},{children:i(c,n({components:j,rehypePlugins:z,remarkPlugins:I},{children:k}))}))]})]}))});y.displayName="ConflictReasoningCard";export{y as ConflictReasoningCard};
2
2
  //# sourceMappingURL=ConflictingReasoningCard.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e,__rest as n}from"tslib";import{jsx as t,jsxs as i}from"react/jsx-runtime";import r,{useRef as a,useEffect as o,useMemo as l,useCallback as d}from"react";import{Skeleton as c}from"../atoms/SkeletonLoader/SkeletonLoader.js";import{CognitiveDecisioningCard as s}from"@e-llm-studio/citation";import p from"../CitationLink.js";import{extractTextFromChildren as u}from"../../helpers/utils.js";import m from"../MessageRendering/RuleValidationCard.js";import{MarkdownSelect as g}from"./MarkdownSelect.js";import{CriticalGaps as h}from"../CriticalGaps.js";import{ButtonCognitiveIcon as f}from"../_svg/ButtonCognitiveIcon.js";import{ViewFormUpdateCard as v}from"../ViewFormUpdateCard.js";import{ViewIdentifiedFieldsCard as x}from"../ViewIdentifiedFieldsCard.js";var y=function(e,n){var t,i="";if(!(i="string"==typeof n?n:(null===(t=null==n?void 0:n.customMetaData)||void 0===t?void 0:t.content)?n.customMetaData.content:String(n)))return null;var r=new RegExp("<".concat(e,"[^>]*>([\\s\\S]*?)<\\/").concat(e,">"),"i"),a=i.match(r);return a?a[1].replace(/\\n/g,"\n"):null},w=function(e){return e?e.replace(/(\[[^\]]+\]\()([^)]+)(\))/g,function(e,n,t,i){var r=t.replace(/\s/g,"%20");return"".concat(n).concat(r).concat(i)}):""},S={val:"validation_agent",lhs:"lhs",rhs:"rhs"},b=function(e){var n,t=e.match(/[?&]source=([^&?]+)/),i=t?t[1]:"lhs";return null!==(n=S[i])&&void 0!==n?n:i},C=r.memo(function(n){var i=n.children;n.cardId;var r=n.isOpen,d=n.isStreamEnd,p=n.handleToggle,m=n.cardMdComponents,g=a(null);o(function(){if(r&&g.current){var e=setTimeout(function(){var e;null===(e=g.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"nearest"})},100);return function(){return clearTimeout(e)}}},[r]);var h=u(i),v=y("reason",h)||"",x=y("gap",h)||"",S=y("relevance_score",h),b=w(v),C=w(x),k=l(function(){return{header:{backgroundColor:"#F5F3FF",padding:"8px 16px"},sectionButton:{paddingLeft:"24px",paddingRight:"24px",paddingBottom:"12px"},textContent:{fontSize:"12px",paddingLeft:"24px",paddingRight:"24px",paddingBottom:"20px"},pill:{gap:"2px",border:"none",backgroundColor:"transparent"}}},[]);return t("span",e({style:{display:"inline",marginTop:"3px",marginLeft:"6px",verticalAlign:"middle"}},{children:d?t(s,{headerIcon:t(f,{}),ref:g,reasoning:b,gap:C,score:S,mdComponents:m,isOpen:r,onToggle:p,styles:k}):t(c,{width:"2.2rem",height:"1.2rem"})}))}),k=r.memo(function(a){var o,s=a.className,f=a.children,v=a.openCardIds,x=a.citations,y=a.handleToggleState,w=a.isStreamEnd,S=a.isLastMessage,b=a.handleStream,k=a.onGapValidation,T=a.isGapsSubmitted,E=a.onViewComparison,M=a.onTypeResponseClick,D=a.onComparisonLinkClick,F=a.isGlobalEditActive,I=n(a,["className","children","openCardIds","citations","handleToggleState","isStreamEnd","isLastMessage","handleStream","onGapValidation","isGapsSubmitted","onViewComparison","onTypeResponseClick","onComparisonLinkClick","isGlobalEditActive"]),L=d(function(e){return x&&x.find(function(n){return n.customMetaData.citation_number&&"Cognitive Decisioning"!==n.customMetaData.citation_title&&String(n.customMetaData.citation_number)===String(e)})||null},[x]),N=l(function(){return{img:function(i){i.node;var r=n(i,["node"]);return t("img",e({},r,{style:{height:"100%",width:"100%",objectFit:"contain"},alt:(null==r?void 0:r.alt)||"",className:"w-full sm:max-w-lg md:max-w-2xl lg:max-w-4xl mx-auto"}))},p:function(i){i.node;var r=n(i,["node"]);return t("p",e({},r,{style:{margin:0}},{children:null==r?void 0:r.children}))},code:function(i){i.node;var r=n(i,["node"]);return t("span",e({},r,{style:{maxWidth:"100%",wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word",whiteSpace:"normal",overflow:"hidden",display:"inline-flex",fontSize:"1rem",lineHeight:"1.625rem"}},{children:null==r?void 0:r.children}))},ol:function(i){i.node;var r=n(i,["node"]);return t("ol",e({},r,{style:{display:"flex",flexDirection:"column",gap:"1rem",listStyle:"decimal",paddingLeft:"2.5rem"}},{children:null==r?void 0:r.children}))},ul:function(i){i.node;var r=n(i,["node"]);return t("ol",e({},r,{style:{paddingLeft:"1.25rem",listStyleType:"decimal"}}))},li:function(i){i.node;var r=n(i,["node"]);return t("li",e({},r,{style:{marginBottom:"4px",listStyle:"decimal"}},{children:r.children}))},a:function(i){var r=i.href,a=i.children,o=n(i,["href","children"]);if(!r)return t("a",e({},o,{children:a}));var l=r||"",d=l;try{d=decodeURIComponent(l)}catch(e){console.error("Error decoding href",e)}if(d.includes("citation_type=comparison")){var c="",s="",u=d.match(/variant_id=([^?&]+)/);u&&(c=u[1]);var m=d.match(/field_name=([^&]+)/);return m&&(s=m[1]),t("button",e({type:"button",onClick:function(e){e.preventDefault(),e.stopPropagation(),console.log("Rule Comparison Triggered:",{variantId:c,fieldName:s}),D&&D(c,s)},style:{background:"#EFF6FF",border:"1px solid #BFDBFE",borderRadius:"6px",padding:"2px 8px",color:"#2563EB",cursor:"pointer",fontSize:"13px",fontWeight:500,display:"inline-flex",alignItems:"center",margin:"0 4px",verticalAlign:"baseline",transition:"background-color 0.2s ease",textDecoration:"none"},title:"View Comparison"},{children:a}))}var g=d.match(/citationNumber=([^&]+)/);if(g&&p){var h=L(g[1]);if(h)return t(p,{citation:h,linkTitle:a,fontSize:12})}return t("a",e({href:l,target:"_blank",rel:"noopener noreferrer",className:"md-link inline-flex items-center gap-1 text-purple-700 hover:underline",style:{color:"#7C3AED"}},o,{children:a}))}}},[L]);if("cognitive-card-trigger"===s){var R=I["data-card-id"],_=v.has(R);return t(C,e({cardId:R,isOpen:_,isStreamEnd:w,handleToggle:function(){return y(R,!_,"card")},cardMdComponents:N},{children:f}))}if("rule-validation-card-trigger"===s){console.log("🎯 rule-validation-card-trigger div rendered, isStreamEnd:",w);var B=I,j=function(e){return e?e.replace(/&quot;/g,'"').replace(/&#039;/g,"'").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&"):""};return!w&&S?(console.log("Rendering Rule Validation Skeleton for:",B["data-title"]),i("div",e({style:{border:"1px solid #E2E8F0",backgroundColor:"#FFF",borderRadius:"12px",padding:"16px",display:"flex",flexDirection:"column",gap:"12px",marginTop:"8px",marginBottom:"8px"}},{children:[i("div",e({style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},{children:[t(c,{variant:"text",width:140,height:28}),t(c,{variant:"text",width:100,height:28})]})),t(c,{variant:"title",width:"50%",height:20}),t(c,{variant:"text",width:"90%",height:16}),t(c,{variant:"text",width:"60%",height:16}),t(c,{variant:"text",width:120,height:40})]}))):t(m,{validationType:"duplicate"===B["data-type"]?"duplicate":"similar"===B["data-type"]?"similar":"conflicting",decisionStrength:B["data-decision-strength"]||B.dataDecisionStrength,title:j(B["data-title"]||B.dataTitle),tier:j(B["data-tier"]||B.dataTier),descriptionText:j(B["data-description"]||B.dataDescription),reasoningNode:f,onViewComparison:E||function(){},disabled:!S||!!F})}if("markdown-select-trigger"===s){B=I;var V=(null===(o=r.Children.map(f,function(e){var n;if("select-option-item"===(null===(n=null==e?void 0:e.props)||void 0===n?void 0:n.className)){var t=u(e.props.children),i=function(e,n){var t=new RegExp("<".concat(e,">([\\s\\S]*?)<\\/").concat(e,">"),"i"),i=n.match(t);return i?i[1].trim():null},r=i("reason",t),a=i("gap",t),o=i("relevance_score",t),l=t.replace(/<ai_reasoning>[\s\S]*?<\/ai_reasoning>/gi,"").replace(/<[^>]+>[\s\S]*?<\/[^>]+>/gi,"").replace(/\s+/g," ").trim();return{id:e.props["data-id"],label:l,cd:!(!r&&!a),reasoning:r,gap:a,score:o}}return null}))||void 0===o?void 0:o.filter(Boolean))||[];return t(g,{type:B["data-type"],options:V,selectedIds:[],disabled:!w||!S||!!F,citations:x,onTypeResponseClick:M,onProceed:function(e,n){console.log("Proceeding with label:",n),b&&b(new KeyboardEvent("keydown",{key:"Enter"}),!1,n)}})}if("critical-gaps-trigger"===s){var A=I["data-payload"];B=void 0;try{B=JSON.parse(A)}catch(e){return console.error("Failed to parse critical gaps payload",e),null}return!w&&S?i("div",e({style:{border:"1px solid #E2E8F0",backgroundColor:"#FFF",borderRadius:"12px",padding:"16px",display:"flex",flexDirection:"column",gap:"12px",marginTop:"8px",marginBottom:"8px"}},{children:[t(c,{variant:"title",width:"40%",height:20}),t(c,{variant:"text",width:"80%",height:16}),t(c,{variant:"text",width:"70%",height:16}),t(c,{variant:"text",width:120,height:40})]})):t(h,{data:B,isLastMessage:S,onValidationChange:k,isSubmitted:T,citations:x,onTypeResponseClick:M,isGlobalEditActive:F})}return t("div",e({className:s},I,{children:f}))}),T=r.memo(function(r){var a=r.className,o=r.children,c=r.openCardIds,s=r.citations,u=r.handleToggleState,m=r.isStreamEnd;r.onTypeResponseClick;var g=r.onComparisonLinkClick,h=n(r,["className","children","openCardIds","citations","handleToggleState","isStreamEnd","onTypeResponseClick","onComparisonLinkClick"]),f=d(function(e,n){return s&&s.find(function(t){return t.customMetaData.citation_number&&"Cognitive Decisioning"!==t.customMetaData.citation_title&&t.customMetaData.source===n&&String(t.customMetaData.citation_number)===String(e)})||null},[s]),y=l(function(){return{img:function(i){i.node;var r=n(i,["node"]);return t("img",e({},r,{style:{height:"100%",width:"100%",objectFit:"contain"},alt:(null==r?void 0:r.alt)||"",className:"w-full sm:max-w-lg md:max-w-2xl lg:max-w-4xl mx-auto"}))},p:function(i){i.node;var r=n(i,["node"]);return t("p",e({},r,{style:{margin:0}},{children:null==r?void 0:r.children}))},code:function(i){i.node;var r=n(i,["node"]);return t("span",e({},r,{style:{maxWidth:"100%",wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word",whiteSpace:"normal",overflow:"hidden",display:"inline-flex",fontSize:"1rem",lineHeight:"1.625rem"}},{children:null==r?void 0:r.children}))},ol:function(i){i.node;var r=n(i,["node"]);return t("ol",e({},r,{style:{display:"flex",flexDirection:"column",gap:"1rem",listStyle:"decimal",paddingLeft:"2.5rem"}},{children:null==r?void 0:r.children}))},ul:function(i){i.node;var r=n(i,["node"]);return t("ol",e({},r,{style:{paddingLeft:"1.25rem",listStyleType:"decimal"}}))},li:function(i){i.node;var r=n(i,["node"]);return t("li",e({},r,{style:{marginBottom:"4px",listStyle:"decimal"}},{children:r.children}))},a:function(r){var a=r.href,o=r.children,l=n(r,["href","children"]);if(!a)return t("a",e({},l,{children:o}));var d=a||"",c=d;try{c=decodeURIComponent(d)}catch(e){console.error("Error decoding href",e)}if(c.includes("citation_type=comparison")){var s="",u="",m=c.match(/variant_id=([^?&]+)/);m&&(s=m[1]);var h=c.match(/field_name=([^&]+)/);return h&&(u=h[1]),i("button",e({type:"button",onClick:function(e){e.preventDefault(),e.stopPropagation(),console.log("Rule Comparison Triggered (span):",{variantId:s,fieldName:u}),g&&g(s,u)},style:{background:"none",border:"none",outline:"none",borderRadius:"6px",padding:"1x 4px",color:"#0F172A",cursor:"pointer",fontSize:"13px",fontWeight:500,display:"inline-flex",alignItems:"center",gap:"2px",margin:"0 1 px",verticalAlign:"baseline",textDecoration:"none",boxShadow:"none",WebkitAppearance:"none",MozAppearance:"none"},title:"View Comparison"},{children:[o,t("svg",e({width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:t("path",{d:"M10.2082 8.67708H2.0415M2.0415 8.67708L4.08317 6.63542M2.0415 8.67708L4.08317 10.7188M2.0415 3.57292H10.2082M10.2082 3.57292L8.1665 1.53125M10.2082 3.57292L8.1665 5.61458",stroke:"#0F172A",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})}))]}))}var v=c.match(/citationNumber=([^&]+)/);if(v&&p){var x=b(c),y=f(v[1],x);if(y)return t(p,{citation:y,linkTitle:o,fontSize:12})}return t("a",e({href:d,target:"_blank",rel:"noopener noreferrer",className:"md-link inline-flex items-center gap-1 text-purple-700 hover:underline",style:{color:"#7C3AED"}},l,{children:o}))}}},[f]);if("cognitive-card-trigger"===a){var w=h["data-card-id"],S=c.has(w);return t(C,e({cardId:w,isOpen:S,isStreamEnd:m,handleToggle:function(){return u(w,!S,"card")},cardMdComponents:y},{children:o}))}if("view-form-update-trigger"===a){var k=h["data-payload"],T=void 0;try{T=JSON.parse(k)}catch(e){return null}return t(v,{data:T,openCardIds:c,handleToggleState:u,isStreamEnd:m,cardMdComponents:y})}if("view-identified-fields-trigger"===a){k=h["data-payload"],T=void 0;try{T=JSON.parse(k)}catch(e){return null}return t(x,{data:T,openCardIds:c,handleToggleState:u,isStreamEnd:m,cardMdComponents:y})}return t("span",e({className:a},h,{children:o}))}),E=r.memo(function(i){var r=i.href,a=i.children,o=i.chatSize,l=i.openCitationIds,d=i.getCitationByNumber,c=i.handleToggleState,s=n(i,["href","children","chatSize","openCitationIds","getCitationByNumber","handleToggleState"]);if(!r)return t("a",e({},s,{children:a}));var u=r.match(/citationNumber=([^&]+)/),m=u?u[1]:null,g=r.match(/uiUniqueId=([^&]+)/),h=g?g[1]:null;if(m){var f=d(m,b(r));if(f){var v=h?"citation-ui-".concat(h):"citation-".concat(f.id||m),x=l.has(v);return t(p,{citation:f,linkTitle:a,chatSize:o,isOpen:x,onToggle:function(){return c(v,!x,"citation")}},v)}}return t("a",e({href:r,target:"_blank",style:{color:"inherit",textDecoration:"none"},rel:"noopener noreferrer",className:"md-link inline-flex items-center gap-1 text-purple-700 hover:underline"},s,{children:a}))});export{k as MarkdownDivRenderer,E as MarkdownLinkRenderer,T as MarkdownSpanRenderer,b as getSourceFromUrl};
1
+ import{__assign as e,__rest as n}from"tslib";import{jsx as t,jsxs as i}from"react/jsx-runtime";import r,{useRef as a,useEffect as o,useMemo as l,useCallback as d}from"react";import{Skeleton as c}from"../atoms/SkeletonLoader/SkeletonLoader.js";import{CognitiveDecisioningCard as s}from"@e-llm-studio/citation";import p from"../CitationLink.js";import{extractTextFromChildren as u}from"../../helpers/utils.js";import m from"../MessageRendering/RuleValidationCard.js";import{MarkdownSelect as g}from"./MarkdownSelect.js";import{CriticalGaps as h}from"../CriticalGaps.js";import{ButtonCognitiveIcon as f}from"../_svg/ButtonCognitiveIcon.js";import{ViewFormUpdateCard as v}from"../ViewFormUpdateCard.js";import{ViewIdentifiedFieldsCard as x}from"../ViewIdentifiedFieldsCard.js";var y=function(e,n){var t,i="";if(!(i="string"==typeof n?n:(null===(t=null==n?void 0:n.customMetaData)||void 0===t?void 0:t.content)?n.customMetaData.content:String(n)))return null;var r=new RegExp("<".concat(e,"[^>]*>([\\s\\S]*?)<\\/").concat(e,">"),"i"),a=i.match(r);return a?a[1].replace(/\\n/g,"\n"):null},w=function(e){return e?e.replace(/(\[[^\]]+\]\()([^)]+)(\))/g,function(e,n,t,i){var r=t.replace(/\s/g,"%20");return"".concat(n).concat(r).concat(i)}):""},S={val:"validation_agent",validate_wta_wnta:"validate_wta_wnta",lhs:"lhs",rhs:"rhs"},b=function(e){var n,t=e.match(/[?&]source=([^&?]+)/),i=t?t[1]:"lhs";return null!==(n=S[i])&&void 0!==n?n:i},C=r.memo(function(n){var i=n.children;n.cardId;var r=n.isOpen,d=n.isStreamEnd,p=n.handleToggle,m=n.cardMdComponents,g=a(null);o(function(){if(r&&g.current){var e=setTimeout(function(){var e;null===(e=g.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"nearest"})},100);return function(){return clearTimeout(e)}}},[r]);var h=u(i),v=y("reason",h)||"",x=y("gap",h)||"",S=y("relevance_score",h),b=w(v),C=w(x),k=l(function(){return{header:{backgroundColor:"#F5F3FF",padding:"8px 16px"},sectionButton:{paddingLeft:"24px",paddingRight:"24px",paddingBottom:"12px"},textContent:{fontSize:"12px",paddingLeft:"24px",paddingRight:"24px",paddingBottom:"20px"},pill:{gap:"2px",border:"none",backgroundColor:"transparent"}}},[]);return t("span",e({style:{display:"inline",marginTop:"3px",marginLeft:"6px",verticalAlign:"middle"}},{children:d?t(s,{headerIcon:t(f,{}),ref:g,reasoning:b,gap:C,score:S,mdComponents:m,isOpen:r,onToggle:p,styles:k}):t(c,{width:"2.2rem",height:"1.2rem"})}))}),k=r.memo(function(a){var o,s=a.className,f=a.children,v=a.openCardIds,x=a.citations,y=a.handleToggleState,w=a.isStreamEnd,S=a.isLastMessage,b=a.handleStream,k=a.onGapValidation,T=a.isGapsSubmitted,E=a.onViewComparison,M=a.onTypeResponseClick,D=a.onComparisonLinkClick,F=a.isGlobalEditActive,_=n(a,["className","children","openCardIds","citations","handleToggleState","isStreamEnd","isLastMessage","handleStream","onGapValidation","isGapsSubmitted","onViewComparison","onTypeResponseClick","onComparisonLinkClick","isGlobalEditActive"]),I=d(function(e){return x&&x.find(function(n){return n.customMetaData.citation_number&&"Cognitive Decisioning"!==n.customMetaData.citation_title&&String(n.customMetaData.citation_number)===String(e)})||null},[x]),L=l(function(){return{img:function(i){i.node;var r=n(i,["node"]);return t("img",e({},r,{style:{height:"100%",width:"100%",objectFit:"contain"},alt:(null==r?void 0:r.alt)||"",className:"w-full sm:max-w-lg md:max-w-2xl lg:max-w-4xl mx-auto"}))},p:function(i){i.node;var r=n(i,["node"]);return t("p",e({},r,{style:{margin:0}},{children:null==r?void 0:r.children}))},code:function(i){i.node;var r=n(i,["node"]);return t("span",e({},r,{style:{maxWidth:"100%",wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word",whiteSpace:"normal",overflow:"hidden",display:"inline-flex",fontSize:"1rem",lineHeight:"1.625rem"}},{children:null==r?void 0:r.children}))},ol:function(i){i.node;var r=n(i,["node"]);return t("ol",e({},r,{style:{display:"flex",flexDirection:"column",gap:"1rem",listStyle:"decimal",paddingLeft:"2.5rem"}},{children:null==r?void 0:r.children}))},ul:function(i){i.node;var r=n(i,["node"]);return t("ol",e({},r,{style:{paddingLeft:"1.25rem",listStyleType:"decimal"}}))},li:function(i){i.node;var r=n(i,["node"]);return t("li",e({},r,{style:{marginBottom:"4px",listStyle:"decimal"}},{children:r.children}))},a:function(i){var r=i.href,a=i.children,o=n(i,["href","children"]);if(!r)return t("a",e({},o,{children:a}));var l=r||"",d=l;try{d=decodeURIComponent(l)}catch(e){console.error("Error decoding href",e)}if(d.includes("citation_type=comparison")){var c="",s="",u=d.match(/variant_id=([^?&]+)/);u&&(c=u[1]);var m=d.match(/field_name=([^&]+)/);return m&&(s=m[1]),t("button",e({type:"button",onClick:function(e){e.preventDefault(),e.stopPropagation(),console.log("Rule Comparison Triggered:",{variantId:c,fieldName:s}),D&&D(c,s)},style:{background:"#EFF6FF",border:"1px solid #BFDBFE",borderRadius:"6px",padding:"2px 8px",color:"#2563EB",cursor:"pointer",fontSize:"13px",fontWeight:500,display:"inline-flex",alignItems:"center",margin:"0 4px",verticalAlign:"baseline",transition:"background-color 0.2s ease",textDecoration:"none"},title:"View Comparison"},{children:a}))}var g=d.match(/citationNumber=([^&]+)/);if(g&&p){var h=I(g[1]);if(h)return t(p,{citation:h,linkTitle:a,fontSize:12})}return t("a",e({href:l,target:"_blank",rel:"noopener noreferrer",className:"md-link inline-flex items-center gap-1 text-purple-700 hover:underline",style:{color:"#7C3AED"}},o,{children:a}))}}},[I]);if("cognitive-card-trigger"===s){var N=_["data-card-id"],R=v.has(N);return t(C,e({cardId:N,isOpen:R,isStreamEnd:w,handleToggle:function(){return y(N,!R,"card")},cardMdComponents:L},{children:f}))}if("rule-validation-card-trigger"===s){console.log("🎯 rule-validation-card-trigger div rendered, isStreamEnd:",w);var B=_,j=function(e){return e?e.replace(/&quot;/g,'"').replace(/&#039;/g,"'").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&"):""};return!w&&S?(console.log("Rendering Rule Validation Skeleton for:",B["data-title"]),i("div",e({style:{border:"1px solid #E2E8F0",backgroundColor:"#FFF",borderRadius:"12px",padding:"16px",display:"flex",flexDirection:"column",gap:"12px",marginTop:"8px",marginBottom:"8px"}},{children:[i("div",e({style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},{children:[t(c,{variant:"text",width:140,height:28}),t(c,{variant:"text",width:100,height:28})]})),t(c,{variant:"title",width:"50%",height:20}),t(c,{variant:"text",width:"90%",height:16}),t(c,{variant:"text",width:"60%",height:16}),t(c,{variant:"text",width:120,height:40})]}))):t(m,{validationType:"duplicate"===B["data-type"]?"duplicate":"similar"===B["data-type"]?"similar":"conflicting",decisionStrength:B["data-decision-strength"]||B.dataDecisionStrength,title:j(B["data-title"]||B.dataTitle),tier:j(B["data-tier"]||B.dataTier),descriptionText:j(B["data-description"]||B.dataDescription),reasoningNode:f,onViewComparison:E||function(){},disabled:!S||!!F})}if("markdown-select-trigger"===s){B=_;var V=(null===(o=r.Children.map(f,function(e){var n;if("select-option-item"===(null===(n=null==e?void 0:e.props)||void 0===n?void 0:n.className)){var t=u(e.props.children),i=function(e,n){var t=new RegExp("<".concat(e,">([\\s\\S]*?)<\\/").concat(e,">"),"i"),i=n.match(t);return i?i[1].trim():null},r=i("reason",t),a=i("gap",t),o=i("relevance_score",t),l=t.replace(/<ai_reasoning>[\s\S]*?<\/ai_reasoning>/gi,"").replace(/<[^>]+>[\s\S]*?<\/[^>]+>/gi,"").replace(/\s+/g," ").trim();return{id:e.props["data-id"],label:l,cd:!(!r&&!a),reasoning:r,gap:a,score:o}}return null}))||void 0===o?void 0:o.filter(Boolean))||[];return t(g,{type:B["data-type"],options:V,selectedIds:[],disabled:!w||!S||!!F,citations:x,onTypeResponseClick:M,onProceed:function(e,n){console.log("Proceeding with label:",n),b&&b(new KeyboardEvent("keydown",{key:"Enter"}),!1,n)}})}if("critical-gaps-trigger"===s){var A=_["data-payload"];B=void 0;try{B=JSON.parse(A)}catch(e){return console.error("Failed to parse critical gaps payload",e),null}return!w&&S?i("div",e({style:{border:"1px solid #E2E8F0",backgroundColor:"#FFF",borderRadius:"12px",padding:"16px",display:"flex",flexDirection:"column",gap:"12px",marginTop:"8px",marginBottom:"8px"}},{children:[t(c,{variant:"title",width:"40%",height:20}),t(c,{variant:"text",width:"80%",height:16}),t(c,{variant:"text",width:"70%",height:16}),t(c,{variant:"text",width:120,height:40})]})):t(h,{data:B,isLastMessage:S,onValidationChange:k,isSubmitted:T,citations:x,onTypeResponseClick:M,isGlobalEditActive:F})}return t("div",e({className:s},_,{children:f}))}),T=r.memo(function(r){var a=r.className,o=r.children,c=r.openCardIds,s=r.citations,u=r.handleToggleState,m=r.isStreamEnd;r.onTypeResponseClick;var g=r.onComparisonLinkClick,h=n(r,["className","children","openCardIds","citations","handleToggleState","isStreamEnd","onTypeResponseClick","onComparisonLinkClick"]),f=d(function(e,n){return s&&s.find(function(t){return t.customMetaData.citation_number&&"Cognitive Decisioning"!==t.customMetaData.citation_title&&t.customMetaData.source===n&&String(t.customMetaData.citation_number)===String(e)})||null},[s]),y=l(function(){return{img:function(i){i.node;var r=n(i,["node"]);return t("img",e({},r,{style:{height:"100%",width:"100%",objectFit:"contain"},alt:(null==r?void 0:r.alt)||"",className:"w-full sm:max-w-lg md:max-w-2xl lg:max-w-4xl mx-auto"}))},p:function(i){i.node;var r=n(i,["node"]);return t("p",e({},r,{style:{margin:0}},{children:null==r?void 0:r.children}))},code:function(i){i.node;var r=n(i,["node"]);return t("span",e({},r,{style:{maxWidth:"100%",wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word",whiteSpace:"normal",overflow:"hidden",display:"inline-flex",fontSize:"1rem",lineHeight:"1.625rem"}},{children:null==r?void 0:r.children}))},ol:function(i){i.node;var r=n(i,["node"]);return t("ol",e({},r,{style:{display:"flex",flexDirection:"column",gap:"1rem",listStyle:"decimal",paddingLeft:"2.5rem"}},{children:null==r?void 0:r.children}))},ul:function(i){i.node;var r=n(i,["node"]);return t("ol",e({},r,{style:{paddingLeft:"1.25rem",listStyleType:"decimal"}}))},li:function(i){i.node;var r=n(i,["node"]);return t("li",e({},r,{style:{marginBottom:"4px",listStyle:"decimal"}},{children:r.children}))},a:function(r){var a=r.href,o=r.children,l=n(r,["href","children"]);if(!a)return t("a",e({},l,{children:o}));var d=a||"",c=d;try{c=decodeURIComponent(d)}catch(e){console.error("Error decoding href",e)}if(c.includes("citation_type=comparison")){var s="",u="",m=c.match(/variant_id=([^?&]+)/);m&&(s=m[1]);var h=c.match(/field_name=([^&]+)/);return h&&(u=h[1]),i("button",e({type:"button",onClick:function(e){e.preventDefault(),e.stopPropagation(),console.log("Rule Comparison Triggered (span):",{variantId:s,fieldName:u}),g&&g(s,u)},style:{background:"none",border:"none",outline:"none",borderRadius:"6px",padding:"1x 4px",color:"#0F172A",cursor:"pointer",fontSize:"13px",fontWeight:500,display:"inline-flex",alignItems:"center",gap:"2px",margin:"0 1 px",verticalAlign:"baseline",textDecoration:"none",boxShadow:"none",WebkitAppearance:"none",MozAppearance:"none"},title:"View Comparison"},{children:[o,t("svg",e({width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:t("path",{d:"M10.2082 8.67708H2.0415M2.0415 8.67708L4.08317 6.63542M2.0415 8.67708L4.08317 10.7188M2.0415 3.57292H10.2082M10.2082 3.57292L8.1665 1.53125M10.2082 3.57292L8.1665 5.61458",stroke:"#0F172A",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})}))]}))}var v=c.match(/citationNumber=([^&]+)/);if(v&&p){var x=b(c),y=f(v[1],x);if(y)return t(p,{citation:y,linkTitle:o,fontSize:12})}return t("a",e({href:d,target:"_blank",rel:"noopener noreferrer",className:"md-link inline-flex items-center gap-1 text-purple-700 hover:underline",style:{color:"#7C3AED"}},l,{children:o}))}}},[f]);if("cognitive-card-trigger"===a){var w=h["data-card-id"],S=c.has(w);return t(C,e({cardId:w,isOpen:S,isStreamEnd:m,handleToggle:function(){return u(w,!S,"card")},cardMdComponents:y},{children:o}))}if("view-form-update-trigger"===a){var k=h["data-payload"],T=void 0;try{T=JSON.parse(k)}catch(e){return null}return t(v,{data:T,openCardIds:c,handleToggleState:u,isStreamEnd:m,cardMdComponents:y})}if("view-identified-fields-trigger"===a){k=h["data-payload"],T=void 0;try{T=JSON.parse(k)}catch(e){return null}return t(x,{data:T,openCardIds:c,handleToggleState:u,isStreamEnd:m,cardMdComponents:y})}return t("span",e({className:a},h,{children:o}))}),E=r.memo(function(i){var r=i.href,a=i.children,o=i.chatSize,l=i.openCitationIds,d=i.getCitationByNumber,c=i.handleToggleState,s=n(i,["href","children","chatSize","openCitationIds","getCitationByNumber","handleToggleState"]);if(!r)return t("a",e({},s,{children:a}));var u=r.match(/citationNumber=([^&]+)/),m=u?u[1]:null,g=r.match(/uiUniqueId=([^&]+)/),h=g?g[1]:null;if(m){var f=d(m,b(r));if(f){var v=h?"citation-ui-".concat(h):"citation-".concat(f.id||m),x=l.has(v);return t(p,{citation:f,linkTitle:a,chatSize:o,isOpen:x,onToggle:function(){return c(v,!x,"citation")}},v)}}return t("a",e({href:r,target:"_blank",style:{color:"inherit",textDecoration:"none"},rel:"noopener noreferrer",className:"md-link inline-flex items-center gap-1 text-purple-700 hover:underline"},s,{children:a}))});export{k as MarkdownDivRenderer,E as MarkdownLinkRenderer,T as MarkdownSpanRenderer,b as getSourceFromUrl};
2
2
  //# sourceMappingURL=MarkdownElements.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsxs as n,jsx as i}from"react/jsx-runtime";import{forwardRef as o,useRef as r,useCallback as t,useEffect as l}from"react";import a from"../../_svg/CognitiveDecisioning.js";import{AlertTriangle as c,ChevronUpIcon as s,ChevronDownIcon as d}from"lucide-react";import p from"../../TooltipComponent.js";import{ConflictReasoningCard as u}from"../../ConflictingReasoningCard.js";var x=o(function(o,x){var g=o.rows,f=void 0===g?1:g,h=o.placeholder,m=o.value,b=o.onChange,v=o.onFocus,y=o.isHighlighted,w=void 0!==y&&y,C=o.customClass,k=o.showNumber,z=o.numberIndex,S=o.isReadOnly,I=void 0!==S&&S,R=o.isOpen,T=void 0!==R&&R,E=o.onToggle,D=o.showCognitiveIcon,j=void 0!==D&&D,F=o.cognitiveIcon,M=o.tooltipDescription,O=o.isConflicting,H=o.conflictMsg,L=o.conflictingReasoning,N=o.decisionStrength,V=o.conflictingGap,W=o.errorMessage,A=o.inputReadOnly,B=void 0!==A&&A,G=function(){return F||i(a,{})},Y=r(null),_=t(function(e){e.style.height="auto",e.style.height="".concat(e.scrollHeight,"px")},[]);l(function(){var e=function(){Y.current&&_(Y.current)};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[_]);var q=t(function(e){Y.current=e,x&&("function"==typeof x?x(e):x.current=e),e&&_(e)},[x,_]);return n("div",e({style:{width:"100%"}},{children:[n("div",e({style:{display:"flex",flexDirection:"column",width:"100%",border:"1px solid ".concat(O||W?"#ef4444":w?"#2563EB":"#ccc"),borderRadius:"0.5rem",backgroundColor:I?"#f9fafb":"white",opacity:I?.8:1,cursor:I?"not-allowed":"text",pointerEvents:"auto",transition:"all 0.3s ease-in-out",overflow:"hidden",boxShadow:O&&w?"0 0 20px 3px rgba(239, 68, 68, 0.45)":w?"\n 0 0 12px 3px rgba(37, 99, 235, 0.3),\n -6px 0 10px rgba(37, 99, 235, 0.2),\n 6px 0 10px rgba(37, 99, 235, 0.2)\n ":"none"},onMouseEnter:function(e){w||O||I||(e.currentTarget.style.border="1px solid black"),I&&(e.currentTarget.style.cursor="not-allowed")},onMouseLeave:function(e){w||O||I||(e.currentTarget.style.border="1px solid #ccc")}},{children:[i("div",e({style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},{children:O&&H&&i("div",e({style:{padding:"12px 12px 0 12px"}},{children:n("div",e({style:{display:"inline-flex",alignItems:"center",gap:"6px",backgroundColor:"#FFE9E980",padding:"4px 10px",borderRadius:"16px",color:"#b91c1c",fontSize:"12px",fontWeight:500}},{children:[i(c,{size:14,strokeWidth:2}),H]}))}))})),n("div",e({style:{display:"flex",alignItems:"flex-start"}},{children:[k&&void 0!==z&&n("span",e({style:{fontSize:"14px",padding:"12px 0",width:"40px",textAlign:"center",color:"#666"}},{children:[z,"."]})),i("textarea",{ref:q,rows:f,placeholder:h,className:"textarea ".concat(C),value:m,onChange:b,onFocus:v,readOnly:B,style:{border:"none",background:"transparent",flex:1,padding:"12px 12px 12px 12px",fontFamily:"inherit",fontSize:"14px",color:"#101828",resize:"both",width:"100%",boxSizing:"border-box",maxHeight:"200px",overflowY:"auto",outline:"none",display:"block",margin:"0 auto",alignSelf:"center",cursor:B?"default":"text"},onInput:function(e){return _(e.target)}}),O&&L&&i(p,e({description:"View Conflict Details"},{children:n("button",e({onClick:function(e){e.preventDefault(),null==E||E()},style:{display:"flex",alignItems:"center",gap:"4px",padding:"4px 8px",border:"none",backgroundColor:"transparent",borderRadius:"4px",margin:"8px",cursor:"pointer",flexShrink:0}},{children:[G(),i(T?s:d,{size:14})]}))})),j&&!O&&i(p,e({description:null!=M?M:""},{children:n("button",e({onClick:function(e){e.preventDefault(),null==E||E()},style:{display:"flex",alignItems:"center",gap:"4px",padding:"4px 8px",border:"none",backgroundColor:"transparent",borderRadius:"4px",margin:"8px",cursor:"pointer",flexShrink:0}},{children:[G(),i(T?s:d,{size:14})]}))}))]}))]})),O&&T&&i("div",e({style:{marginTop:"8px"}},{children:i(u,{isVisible:!0,decisionStrength:N,reasoning:L,gap:V})})),W&&i("div",e({style:{color:"#ef4444",fontSize:"12px",marginTop:"4px"}},{children:W}))]}))});x.displayName="Textarea";export{x as Textarea};
1
+ import{__assign as e}from"tslib";import{jsxs as n,jsx as i}from"react/jsx-runtime";import{forwardRef as o,useRef as t,useCallback as r,useEffect as l}from"react";import a from"../../_svg/CognitiveDecisioning.js";import{AlertTriangle as c,ChevronUpIcon as s,ChevronDownIcon as d}from"lucide-react";import p from"../../TooltipComponent.js";import{ConflictReasoningCard as u}from"../../ConflictingReasoningCard.js";var x=o(function(o,x){var g=o.rows,f=void 0===g?1:g,h=o.placeholder,m=o.value,b=o.onChange,v=o.onFocus,y=o.isHighlighted,w=void 0!==y&&y,C=o.customClass,k=o.showNumber,z=o.numberIndex,S=o.isReadOnly,I=void 0!==S&&S,R=o.isOpen,T=void 0!==R&&R,E=o.onToggle,D=o.showCognitiveIcon,j=void 0!==D&&D,F=o.cognitiveIcon,M=o.tooltipDescription,O=o.isConflicting,H=o.conflictMsg,L=o.conflictingReasoning,N=o.decisionStrength,V=o.conflictingGap,W=o.errorMessage,A=o.inputReadOnly,B=void 0!==A&&A,G=o.citations,Y=void 0===G?[]:G,_=function(){return F||i(a,{})},q=t(null),J=r(function(e){e.style.height="auto",e.style.height="".concat(e.scrollHeight,"px")},[]);l(function(){var e=function(){q.current&&J(q.current)};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[J]);var K=r(function(e){q.current=e,x&&("function"==typeof x?x(e):x.current=e),e&&J(e)},[x,J]);return n("div",e({style:{width:"100%"}},{children:[n("div",e({style:{display:"flex",flexDirection:"column",width:"100%",border:"1px solid ".concat(O||W?"#ef4444":w?"#2563EB":"#ccc"),borderRadius:"0.5rem",backgroundColor:I?"#f9fafb":"white",opacity:I?.8:1,cursor:I?"not-allowed":"text",pointerEvents:"auto",transition:"all 0.3s ease-in-out",overflow:"hidden",boxShadow:O&&w?"0 0 20px 3px rgba(239, 68, 68, 0.45)":w?"\n 0 0 12px 3px rgba(37, 99, 235, 0.3),\n -6px 0 10px rgba(37, 99, 235, 0.2),\n 6px 0 10px rgba(37, 99, 235, 0.2)\n ":"none"},onMouseEnter:function(e){w||O||I||(e.currentTarget.style.border="1px solid black"),I&&(e.currentTarget.style.cursor="not-allowed")},onMouseLeave:function(e){w||O||I||(e.currentTarget.style.border="1px solid #ccc")}},{children:[i("div",e({style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},{children:O&&H&&i("div",e({style:{padding:"12px 12px 0 12px"}},{children:n("div",e({style:{display:"inline-flex",alignItems:"center",gap:"6px",backgroundColor:"#FFE9E980",padding:"4px 10px",borderRadius:"16px",color:"#b91c1c",fontSize:"12px",fontWeight:500}},{children:[i(c,{size:14,strokeWidth:2}),H]}))}))})),n("div",e({style:{display:"flex",alignItems:"flex-start"}},{children:[k&&void 0!==z&&n("span",e({style:{fontSize:"14px",padding:"12px 0",width:"40px",textAlign:"center",color:"#666"}},{children:[z,"."]})),i("textarea",{ref:K,rows:f,placeholder:h,className:"textarea ".concat(C),value:m,onChange:b,onFocus:v,readOnly:B,style:{border:"none",background:"transparent",flex:1,padding:"12px 12px 12px 12px",fontFamily:"inherit",fontSize:"14px",color:"#101828",resize:"both",width:"100%",boxSizing:"border-box",maxHeight:"200px",overflowY:"auto",outline:"none",display:"block",margin:"0 auto",alignSelf:"center",cursor:B?"default":"text"},onInput:function(e){return J(e.target)}}),O&&L&&i(p,e({description:"View Conflict Details"},{children:n("button",e({onClick:function(e){e.preventDefault(),null==E||E()},style:{display:"flex",alignItems:"center",gap:"4px",padding:"4px 8px",border:"none",backgroundColor:"transparent",borderRadius:"4px",margin:"8px",cursor:"pointer",flexShrink:0}},{children:[_(),i(T?s:d,{size:14})]}))})),j&&!O&&i(p,e({description:null!=M?M:""},{children:n("button",e({onClick:function(e){e.preventDefault(),null==E||E()},style:{display:"flex",alignItems:"center",gap:"4px",padding:"4px 8px",border:"none",backgroundColor:"transparent",borderRadius:"4px",margin:"8px",cursor:"pointer",flexShrink:0}},{children:[_(),i(T?s:d,{size:14})]}))}))]}))]})),O&&T&&i("div",e({style:{marginTop:"8px"}},{children:i(u,{isVisible:!0,decisionStrength:N,reasoning:L,gap:V,citations:Y})})),W&&i("div",e({style:{color:"#ef4444",fontSize:"12px",marginTop:"4px"}},{children:W}))]}))});x.displayName="Textarea";export{x as Textarea};
2
2
  //# sourceMappingURL=Textarea.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as n}from"tslib";import{jsxs as t,jsx as i,Fragment as e}from"react/jsx-runtime";import{Check as o,X as c,Pencil as r,Trash2 as a,AlertTriangle as l,Loader2Icon as d,Plus as s}from"lucide-react";import{useState as u,useRef as f,useEffect as m,useCallback as g}from"react";import{Button as v}from"../../atoms/Button/Button.js";import{Textarea as p}from"../../atoms/Textarea/Textarea.js";import{InputDataReasoningCard as h}from"../../InputDataReasoningCard.js";import x from"../../TooltipComponent.js";import{ButtonCognitiveIcon as y}from"../../_svg/ButtonCognitiveIcon.js";var b=function(b){var C=b.idPrefix,_=b.items,N=b.onAdd,S=b.onRemove;b.onEdit;var E=b.index,I=b.tierKey,w=b.readOnly,A=void 0!==w&&w,k=b.placeholder,T=void 0===k?"Enter your condition":k,j=b.addLabel,z=void 0===j?"Add Condition":j,O=b.showAddButton,R=void 0===O||O;b.isHighlighted;var L=b.highlightedIds;b.footer;var B=b.tooltipDescription,D=b.citations,V=void 0===D?[]:D,K=b.setSendMessageInChat,M=b.fieldName,H=b.isAiStreaming,P=void 0!==H&&H,W=b.activeEditId,F=b.setActiveEditId,G=b.pendingEditId;b.setPendingEditId;var U=u({}),q=U[0],J=U[1],Q=u(null),X=Q[0],Y=Q[1],Z=u(null),$=Z[0],nn=Z[1],tn=u(null),en=tn[0],on=tn[1],cn=f(P),rn=f(new Map),an=f(_);m(function(){cn.current&&!P&&null!==en&&on(null),cn.current=P},[P,en]);m(function(){var t=an.current,i=_.filter(function(n){return!t.find(function(t){return t.id===n.id})});if(i.length>0){var e=i[i.length-1],o="".concat(C,"-").concat(I,"-").concat(E,"-").concat(e.id);e.text&&""!==e.text.trim()||(F&&F(o),J(function(t){var i;return n(n({},t),((i={})[e.id]="",i))}),Y(e.id))}an.current=_},[_,I,E,F,C]),m(function(){if(X){var n=rn.current.get(X);if(n){n.focus();var t=n.value.length;n.setSelectionRange(t,t)}Y(null)}},[X,_]);var ln=g(function(n){n&&(n.style.height="auto",n.style.height="".concat(n.scrollHeight,"px"))},[]),dn=Object.values(q).some(function(n){return!n||""===n.trim()}),sn=_.filter(function(n){return n.text&&""!==n.text.trim()}),un=new Set(sn.map(function(n){return n.text.trim()})).size!==sn.length,fn=dn||un||null!==W||P;return t("div",n({className:"condition-wrapper"},{children:[_.map(function(d,s){var u,f,m,g,b,N,w,k="".concat(C,"-").concat(I,"-").concat(E,"-").concat(d.id),j=d.id in q,z=null!==W&&W!==k,O=(null==L?void 0:L.has(d.id))&&!P,R=!!d.conflict,D=(null===(u=d.conflict)||void 0===u?void 0:u.reason)||(R?"Conflicting":null),H=Array.isArray(null===(f=d.conflict)||void 0===f?void 0:f.conflicting_reasoning)?d.conflict.conflicting_reasoning.map(function(n){return"- ".concat(n)}).join("\n"):(null===(m=d.conflict)||void 0===m?void 0:m.conflicting_reasoning)||null,U=(null===(g=d.conflict)||void 0===g?void 0:g.decision_strength)||null,Q=Array.isArray(null===(b=d.conflict)||void 0===b?void 0:b.conflicting_gap)?d.conflict.conflicting_gap.map(function(n){return"- ".concat(n)}).join("\n"):(null===(N=d.conflict)||void 0===N?void 0:N.conflicting_gap)||null,X=!!d.reasoning,Z=$===d.id,tn=j?null!==(w=q[d.id])&&void 0!==w?w:"":d.text,en=A||P||!j;return t("div",n({className:"condition-row-container","data-edit-id":k,style:{marginBottom:X&&Z?"16px":"8px"}},{children:[t("div",n({className:"condition-item ".concat(R?"border-red-500":""," ").concat(j?"is-editing":""),style:{opacity:P&&!j?.5:1,pointerEvents:"auto"}},{children:[i("div",n({className:"condition-left"},{children:i(p,{ref:function(n){n?(rn.current.set(d.id,n),ln(n)):rn.current.delete(d.id)},rows:1,placeholder:T,value:tn,onChange:function(t){j&&J(function(i){var e;return n(n({},i),((e={})[d.id]=t.target.value,e))})},showNumber:!0,numberIndex:s+1,isReadOnly:A||P,inputReadOnly:en,isOpen:Z&&!j,onToggle:function(){return n=d.id,void nn(function(t){return t===n?null:n});var n},showCognitiveIcon:X&&!j&&!R,cognitiveIcon:i(y,{}),tooltipDescription:B,isConflicting:R,conflictMsg:D,conflictingReasoning:H,isHighlighted:O,decisionStrength:U,conflictingGap:Q})})),!A&&i("div",n({className:"action-buttons"},{children:j?i("div",n({className:"action-buttons-inline"},{children:t(e,{children:[i(x,n({description:"Apply"},{children:i(v,n({onClick:function(){return function(t){var i,e=null!==(i=q[t.id])&&void 0!==i?i:"";if(e.trim()&&!_.some(function(n){return n.id!==t.id&&n.text.trim()===e.trim()})){if(e===t.text)return J(function(i){var e=n({},i);return delete e[t.id],e}),void(F&&F(null));var o=!t.text||""===t.text.trim();if(K){var c="sk-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),r="string"==typeof M&&""!==M.trim()?M:"field",a=o?"Add ".concat(r," to ").concat(e):"Update ".concat(r," with ").concat(e);console.log('[ConditionList] Sending message for "'.concat(r,'"'),{draftValue:e,globalFormValue:t.text,action:o?"add":"update",message:"__SKELETON__:".concat(c,":").concat(a)}),on(t.id),K("__SKELETON__:".concat(c,":").concat(a))}J(function(i){var e=n({},i);return delete e[t.id],e}),F&&F(null)}}(d)},className:"btn-apply",icon:i(o,{size:20,strokeWidth:2.5})},{children:"Apply"}))})),i(x,n({description:"Cancel"},{children:i(v,{onClick:function(){return function(t){var i=""===t.text||void 0===t.text;J(function(i){var e=n({},i);return delete e[t.id],e}),F&&F(null),i&&S(I,E,t.id)}(d)},className:"btn-cancel-inline",icon:i(c,{size:20,strokeWidth:2.5})})}))]})})):t("div",n({className:"action-buttons"},{children:[i(x,n({description:z?"Save active edits first":"Edit this condition"},{children:i(v,{onClick:function(){return function(t){var i="".concat(C,"-").concat(I,"-").concat(E,"-").concat(t.id);W&&W!==i||(F&&F(i),J(function(i){var e;return n(n({},i),((e={})[t.id]=t.text,e))}),Y(t.id))}(d)},className:"btn-icon btn-edit",icon:i(r,{size:18}),disabled:P||z})})),i(x,n({description:z?"Save active edits first":"Delete this condition"},{children:i(v,{onClick:function(){return function(t){var i,e="".concat(C,"-").concat(I,"-").concat(E,"-").concat(t.id);if(W===e&&F&&F(null),J(function(i){var e=n({},i);return delete e[t.id],e}),null===(i=t.text)||void 0===i?void 0:i.trim()){if(K){var o="sk-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),c="string"==typeof M&&""!==M.trim()?M:"field";console.log('[ConditionList] Sending message for "'.concat(c,'"'),{draftValue:null,globalFormValue:t.text,action:"remove",message:"__SKELETON__:".concat(o,":Remove ").concat(c," ").concat(t.text)}),on(t.id),K("__SKELETON__:".concat(o,":Remove ").concat(c," ").concat(t.text))}S(I,E,t.id)}else S(I,E,t.id)}(d)},className:"btn-icon btn-delete",icon:i(a,{size:18}),disabled:P||z})}))]}))}))]})),G===k&&j&&t("div",n({style:{display:"flex",alignItems:"center",gap:"6px",marginTop:"8px"}},{children:[i(l,{style:{color:"#C2410C"}}),i("div",n({style:{display:"flex",color:"#C2410C",fontSize:"13px",paddingTop:"8px",alignItems:"center"}},{children:"Pending - Changes not applied yet. Apply or discard them to continue."}))]})),X&&!R&&i("div",n({style:{maxHeight:Z?"1000px":"0",overflow:"hidden",transition:"all 0.3s ease-in-out",marginTop:Z?"1.5px":"0"}},{children:i(h,{isVisible:Z,citation:d.reasoning,citations:V,fieldName:"Condition ".concat(s+1),fieldValue:d.text})}))]}),d.id)}),null!==en&&P&&t(e,{children:[i("style",{children:"\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),t("div",n({style:{display:"flex",alignItems:"center",justifyContent:"flex-start",padding:"4px 0 12px 12px",color:"#141414ff",fontSize:"13px",fontWeight:500,fontStyle:"italic"}},{children:[i(d,{style:{marginRight:8,animation:"spin 1s linear infinite"}}),"Checking the correctness of your updated condition..."]}))]}),0===_.length&&i("div",n({style:{display:"flex",alignItems:"center",color:"#bbb",fontSize:"14px",height:"40px",marginBottom:"8px"}},{children:"No items to show"})),R&&!A&&t("div",n({className:"condition-add ".concat(fn?"disabled":""),onClick:function(){return!fn&&N()},role:"button",style:{opacity:fn?.5:1,cursor:fn?"not-allowed":"pointer"}},{children:[i(s,{size:20,className:"condition-add-icon"}),i("span",n({className:"condition-add-text"},{children:z}))]}))]}))};export{b as ConditionList};
1
+ import{__assign as n}from"tslib";import{jsxs as t,jsx as i,Fragment as e}from"react/jsx-runtime";import{Check as o,X as c,Pencil as r,Trash2 as l,AlertTriangle as a,Loader2Icon as d,Plus as s}from"lucide-react";import{useState as u,useRef as f,useEffect as v,useCallback as p}from"react";import{Button as m}from"../../atoms/Button/Button.js";import{Textarea as g}from"../../atoms/Textarea/Textarea.js";import{InputDataReasoningCard as h}from"../../InputDataReasoningCard.js";import x from"../../TooltipComponent.js";import{ButtonCognitiveIcon as y}from"../../_svg/ButtonCognitiveIcon.js";var b=function(b){var C=b.idPrefix,N=b.items,_=b.onAdd,I=b.onRemove;b.onEdit;var S=b.index,w=b.tierKey,A=b.readOnly,E=void 0!==A&&A,k=b.placeholder,j=void 0===k?"Enter your condition":k,z=b.addLabel,T=void 0===z?"Add Condition":z,R=b.showAddButton,O=void 0===R||R;b.isHighlighted;var B=b.highlightedIds;b.footer;var D=b.tooltipDescription,M=b.citations,H=void 0===M?[]:M,K=b.setSendMessageInChat,L=b.fieldName,P=b.isAiStreaming,W=void 0!==P&&P,V=b.activeEditId,G=b.setActiveEditId,U=b.pendingEditId;b.setPendingEditId;var q=u({}),F=q[0],J=q[1],Q=u(null),X=Q[0],Y=Q[1],Z=u(null),$=Z[0],nn=Z[1],tn=u(null),en=tn[0],on=tn[1],cn=f(W),rn=f(new Map),ln=f(N);v(function(){cn.current&&!W&&null!==en&&on(null),cn.current=W},[W,en]);v(function(){var t=ln.current,i=N.filter(function(n){return!t.find(function(t){return t.id===n.id})});if(i.length>0){var e=i[i.length-1],o="".concat(C,"-").concat(w,"-").concat(S,"-").concat(e.id);e.text&&""!==e.text.trim()||(G&&G(o),J(function(t){var i;return n(n({},t),((i={})[e.id]="",i))}),Y(e.id))}ln.current=N},[N,w,S,G,C]),v(function(){if(X){var n=rn.current.get(X);if(n){n.focus();var t=n.value.length;n.setSelectionRange(t,t)}Y(null)}},[X,N]);var an=p(function(n){n&&(n.style.height="auto",n.style.height="".concat(n.scrollHeight,"px"))},[]),dn=Object.values(F).some(function(n){return!n||""===n.trim()}),sn=N.filter(function(n){return n.text&&""!==n.text.trim()}),un=new Set(sn.map(function(n){return n.text.trim()})).size!==sn.length,fn=dn||un||null!==V||W;return t("div",n({className:"condition-wrapper"},{children:[N.map(function(d,s){var u,f,v,p,b,_,A;if(d.id===en&&W)return null;var k="".concat(C,"-").concat(w,"-").concat(S,"-").concat(d.id),z=d.id in F,T=null!==V&&V!==k,R=(null==B?void 0:B.has(d.id))&&!W,O=!!d.conflict,M=(null===(u=d.conflict)||void 0===u?void 0:u.reason)||(O?"Conflicting":null),P=Array.isArray(null===(f=d.conflict)||void 0===f?void 0:f.conflicting_reasoning)?d.conflict.conflicting_reasoning.map(function(n){return"- ".concat(n)}).join("\n"):(null===(v=d.conflict)||void 0===v?void 0:v.conflicting_reasoning)||null,q=(null===(p=d.conflict)||void 0===p?void 0:p.decision_strength)||null,Q=Array.isArray(null===(b=d.conflict)||void 0===b?void 0:b.conflicting_gap)?d.conflict.conflicting_gap.map(function(n){return"- ".concat(n)}).join("\n"):(null===(_=d.conflict)||void 0===_?void 0:_.conflicting_gap)||null,X=!!d.reasoning,Z=$===d.id,tn=z?null!==(A=F[d.id])&&void 0!==A?A:"":d.text,cn=E||W||!z;return t("div",n({className:"condition-row-container","data-edit-id":k,style:{marginBottom:X&&Z?"16px":"8px"}},{children:[t("div",n({className:"condition-item ".concat(O?"border-red-500":""," ").concat(z?"is-editing":""),style:{opacity:W&&!z?.5:1,pointerEvents:"auto"}},{children:[i("div",n({className:"condition-left"},{children:i(g,{ref:function(n){n?(rn.current.set(d.id,n),an(n)):rn.current.delete(d.id)},rows:1,placeholder:j,value:tn,onChange:function(t){z&&J(function(i){var e;return n(n({},i),((e={})[d.id]=t.target.value,e))})},showNumber:!0,numberIndex:s+1,isReadOnly:E||W,inputReadOnly:cn,isOpen:Z&&!z,onToggle:function(){return n=d.id,void nn(function(t){return t===n?null:n});var n},showCognitiveIcon:X&&!z&&!O,cognitiveIcon:i(y,{}),tooltipDescription:D,isConflicting:O,conflictMsg:M,conflictingReasoning:P,isHighlighted:R,decisionStrength:q,conflictingGap:Q,citations:H})})),!E&&i("div",n({className:"action-buttons"},{children:z?i("div",n({className:"action-buttons-inline"},{children:t(e,{children:[i(x,n({description:"Apply"},{children:i(m,n({onClick:function(){return function(t){var i,e=null!==(i=F[t.id])&&void 0!==i?i:"";if(e.trim()&&!N.some(function(n){return n.id!==t.id&&n.text.trim()===e.trim()})){if(e===t.text)return J(function(i){var e=n({},i);return delete e[t.id],e}),void(G&&G(null));var o=!t.text||""===t.text.trim();if(K){var c="sk-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),r="string"==typeof L&&""!==L.trim()?L:"field",l=o?"Add ".concat(r," to ").concat(e):"Update ".concat(r," with ").concat(e);on(t.id),K("__SKELETON__:".concat(c,":").concat(l))}J(function(i){var e=n({},i);return delete e[t.id],e}),G&&G(null)}}(d)},className:"btn-apply",icon:i(o,{size:20,strokeWidth:2.5})},{children:"Apply"}))})),i(x,n({description:"Cancel"},{children:i(m,{onClick:function(){return function(t){var i=""===t.text||void 0===t.text;J(function(i){var e=n({},i);return delete e[t.id],e}),G&&G(null),i&&I(w,S,t.id)}(d)},className:"btn-cancel-inline",icon:i(c,{size:20,strokeWidth:2.5})})}))]})})):t("div",n({className:"action-buttons"},{children:[i(x,n({description:T?"Save active edits first":"Edit this condition"},{children:i(m,{onClick:function(){return function(t){var i="".concat(C,"-").concat(w,"-").concat(S,"-").concat(t.id);V&&V!==i||(G&&G(i),J(function(i){var e;return n(n({},i),((e={})[t.id]=t.text,e))}),Y(t.id))}(d)},className:"btn-icon btn-edit",icon:i(r,{size:18}),disabled:W||T})})),i(x,n({description:T?"Save active edits first":"Delete this condition"},{children:i(m,{onClick:function(){return function(t){var i,e="".concat(C,"-").concat(w,"-").concat(S,"-").concat(t.id);if(V===e&&G&&G(null),J(function(i){var e=n({},i);return delete e[t.id],e}),null===(i=t.text)||void 0===i?void 0:i.trim()){if(K){var o="sk-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),c="string"==typeof L&&""!==L.trim()?L:"field";on(t.id),K("__SKELETON__:".concat(o,":Remove ").concat(c," ").concat(t.text))}}else I(w,S,t.id)}(d)},className:"btn-icon btn-delete",icon:i(l,{size:18}),disabled:W||T})}))]}))}))]})),U===k&&z&&t("div",n({style:{display:"flex",alignItems:"center",gap:"6px",marginTop:"8px"}},{children:[i(a,{style:{color:"#C2410C"}}),i("div",n({style:{display:"flex",color:"#C2410C",fontSize:"13px",paddingTop:"8px",alignItems:"center"}},{children:"Pending - Changes not applied yet. Apply or discard them to continue."}))]})),X&&!O&&i("div",n({style:{maxHeight:Z?"1000px":"0",overflow:"hidden",transition:"all 0.3s ease-in-out",marginTop:Z?"1.5px":"0"}},{children:i(h,{isVisible:Z,citation:d.reasoning,citations:H,fieldName:"Condition ".concat(s+1),fieldValue:d.text})}))]}),d.id)}),null!==en&&W&&t(e,{children:[i("style",{children:"\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),t("div",n({style:{display:"flex",alignItems:"center",justifyContent:"flex-start",padding:"4px 0 12px 12px",color:"#141414ff",fontSize:"13px",fontWeight:500,fontStyle:"italic"}},{children:[i(d,{style:{marginRight:8,animation:"spin 1s linear infinite"}}),"Checking the correctness of your updated condition..."]}))]}),0===N.length&&i("div",n({style:{display:"flex",alignItems:"center",color:"#bbb",fontSize:"14px",height:"40px",marginBottom:"8px"}},{children:"No items to show"})),O&&!E&&t("div",n({className:"condition-add ".concat(fn?"disabled":""),onClick:function(){return!fn&&_()},role:"button",style:{opacity:fn?.5:1,cursor:fn?"not-allowed":"pointer"}},{children:[i(s,{size:20,className:"condition-add-icon"}),i("span",n({className:"condition-add-text"},{children:T}))]}))]}))};export{b as ConditionList};
2
2
  //# sourceMappingURL=ConditionList.js.map
@@ -1,2 +1,2 @@
1
- import{__rest as n,__assign as e}from"tslib";import{jsxs as i,jsx as t,Fragment as o}from"react/jsx-runtime";import{SectionWrapper as r}from"../../molecules/Sections/SectionWrapper.js";import{SeparationRow as a}from"../../molecules/SeperationRow/SeparationRow.js";import{Toggle as l}from"../../atoms/Toggle/Toggle.js";import{Pencil as c,Loader2Icon as s,Check as d,AlertTriangle as p}from"lucide-react";import{useState as f,useRef as u,useEffect as g}from"react";var m=function(m){var h=m.separationItems,b=void 0===h?[]:h,y=m.toggles,x=void 0===y?[]:y;m.onConfigChange;var v=m.highlights,S=void 0===v?{}:v,C=m.index,k=m.openSections,_=m.readOnly,I=void 0!==_&&_,E=m.setOpenSections,T=m.activeEditId,j=m.setActiveEditId,w=m.pendingEditId,z=m.setPendingEditId,O=m.isAiStreaming,A=m.setSendMessageInChat,D=m.id,N=n(m,["separationItems","toggles","onConfigChange","highlights","index","openSections","readOnly","setOpenSections","activeEditId","setActiveEditId","pendingEditId","setPendingEditId","isAiStreaming","setSendMessageInChat","id"]),R=D||"config-section-".concat(null!=C?C:0),W=T===R,P=!!T&&T!==R,M=f(null),H=M[0],K=M[1],L=f(null),U=L[0],q=L[1],B=f(!1),F=B[0],G=B[1],J=u(O),Q="\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n ";g(function(){J.current&&!O&&F&&G(!1),J.current=O},[O,F]);var V=I||!W||F,X=i("div",e({style:{display:"flex",alignItems:"center"}},{children:[!I&&!W&&!F&&t("button",e({title:P?"Save active edits first":"Edit Configuration",onClick:function(n){n.stopPropagation(),P?z&&z(null!=T?T:null):(K(b.map(function(n){return e({},n)})),q(x.map(function(n){return e({},n)})),j&&j(R),E&&k&&!k.has(R)&&E(function(n){var e=new Set(n);return e.add(R),e}))},style:e(e({},{display:"flex",alignItems:"center",justifyContent:"center",padding:"6px 8px",border:"1px solid #e5e7eb",borderRadius:"8px",cursor:"pointer",backgroundColor:"#ffffff",color:"#6b7280"}),{opacity:P?.5:1,cursor:P?"not-allowed":"pointer",border:"none",background:"transparent"})},{children:t(c,{size:16})})),F&&O&&i(o,{children:[t("style",{children:Q}),t(s,{size:16,style:{animation:"spin 1s linear infinite",color:"#6b7280"}})]})]}));return t("div",e({"data-edit-id":R},{children:i(r,e({},N,{id:R,collapsible:!0,defaultOpen:!1,openSections:k,setOpenSections:E,headerActions:X},{children:[i("div",e({className:"config-content-grid",style:{opacity:V&&!I?.6:1,transition:"opacity 0.2s"}},{children:[(H||b).map(function(n,i){return t(a,{label:"".concat(n.label," Separation"),isEnabled:n.enabled,duration:n.global_min_separation_seconds,onToggle:function(){return function(n){W&&!F&&K(function(i){return i?i.map(function(i){return i.key===n.key?e(e({},i),{enabled:!i.enabled}):i}):null})}(n)},onDurationChange:function(i){return function(n,i){W&&!F&&K(function(t){return t?t.map(function(t){return t.key===n.key?e(e({},t),{global_min_separation_seconds:i}):t}):null})}(n,i)},isHighlighted:S["config_".concat(n.key)],isDisabled:V},n.key)}),(U||x).map(function(n,o){return t("div",e({className:"separation-row-container"},{children:i("div",e({className:"separation-header-row"},{children:[t("div",e({className:"separation-label"},{children:n.label})),t(l,{isEnabled:n.enabled,onToggle:function(){return function(n){W&&!F&&q(function(i){return i?i.map(function(i){return i.key===n.key?e(e({},i),{enabled:!i.enabled}):i}):null})}(n)},isDisabled:V})]}))}),n.key)})]})),F&&O&&i(o,{children:[t("style",{children:Q}),i("div",e({style:{display:"flex",alignItems:"center",padding:"4px 0 12px 12px",color:"#141414ff",fontSize:"13px",fontWeight:500,fontStyle:"italic",marginTop:"8px"}},{children:[t(s,{style:{marginRight:8,animation:"spin 1s linear infinite"}}),"Checking the correctness of your Configuration..."]}))]}),W&&!F&&i("div",e({style:{display:"flex",flexDirection:"column",marginTop:"12px"}},{children:[i("div",e({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[t("button",e({onClick:function(){K(null),q(null),j&&j(null)},style:{background:"none",border:"none",color:"#6b7280",fontSize:"14px",fontWeight:"500",cursor:"pointer",padding:"0"}},{children:"Discard Changes"})),i("button",e({onClick:function(){if(H&&U){var n=H.filter(function(n,e){var i=b[e];return!i||n.enabled!==i.enabled||n.global_min_separation_seconds!==i.global_min_separation_seconds}),e=U.filter(function(n,e){var i=x[e];return!i||n.enabled!==i.enabled});if(0===n.length&&0===e.length)return K(null),q(null),void(j&&j(null));if(A){var i="sk-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),t=[];n.length>0&&t.push("Enable ".concat(n.map(function(n){return"".concat(n.label," (").concat(n.global_min_separation_seconds,"min)")}).join(", "))),e.length>0&&t.push("enable ".concat(e.map(function(n){return"".concat(n.label," (").concat(n.enabled,")")}).join(", ")));var o="__SKELETON__:".concat(i,":Update Configuration - ").concat(t.join("; "));console.log("[ConfigSection] Sending message",{draftSeparation:H,draftToggles:U,globalSeparation:b,globalToggles:x,message:o}),A(o)}G(!0),K(null),q(null),j&&j(null)}else j&&j(null)},style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 16px",borderRadius:"12px",border:"none",backgroundColor:"#2563eb",color:"#ffffff",fontSize:"14px",fontWeight:"500",cursor:"pointer",boxShadow:"0 1px 2px rgba(0,0,0,0.05)"}},{children:[t(d,{size:18,strokeWidth:2.5,color:"#ffffff"}),"Save Changes"]}))]})),w===R&&i("div",e({style:{display:"flex",alignItems:"center",gap:"6px",marginTop:"8px"}},{children:[t(p,{style:{color:"#C2410C"}}),t("div",e({style:{color:"#C2410C",fontSize:"13px",paddingTop:"8px"}},{children:"Pending - Changes not applied yet. Apply or discard them to continue."}))]}))]}))]}))}))};export{m as ConfigSection};
1
+ import{__rest as n,__assign as e}from"tslib";import{jsxs as i,jsx as t,Fragment as o}from"react/jsx-runtime";import{SectionWrapper as r}from"../../molecules/Sections/SectionWrapper.js";import{SeparationRow as a}from"../../molecules/SeperationRow/SeparationRow.js";import{Toggle as l}from"../../atoms/Toggle/Toggle.js";import{Pencil as c,Loader2Icon as s,Check as d,AlertTriangle as p}from"lucide-react";import{useState as u,useRef as f,useEffect as g}from"react";var m=function(m){var h=m.separationItems,b=void 0===h?[]:h,y=m.toggles,x=void 0===y?[]:y;m.onConfigChange;var v=m.highlights,S=void 0===v?{}:v,C=m.index,k=m.openSections,_=m.readOnly,I=void 0!==_&&_,E=m.setOpenSections,T=m.activeEditId,j=m.setActiveEditId,w=m.pendingEditId,z=m.setPendingEditId,O=m.isAiStreaming,A=m.setSendMessageInChat,D=m.id,N=n(m,["separationItems","toggles","onConfigChange","highlights","index","openSections","readOnly","setOpenSections","activeEditId","setActiveEditId","pendingEditId","setPendingEditId","isAiStreaming","setSendMessageInChat","id"]),R=D||"config-section-".concat(null!=C?C:0),W=T===R,P=!!T&&T!==R,M=u(null),H=M[0],K=M[1],L=u(null),U=L[0],q=L[1],B=u(!1),F=B[0],G=B[1],J=f(O),Q="\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n ";g(function(){J.current&&!O&&F&&G(!1),J.current=O},[O,F]);var V=I||!W||F,X=i("div",e({style:{display:"flex",alignItems:"center"}},{children:[!I&&!W&&!F&&t("button",e({title:P?"Save active edits first":"Edit Configuration",onClick:function(n){n.stopPropagation(),P?z&&z(null!=T?T:null):(K(b.map(function(n){return e({},n)})),q(x.map(function(n){return e({},n)})),j&&j(R),E&&k&&!k.has(R)&&E(function(n){var e=new Set(n);return e.add(R),e}))},style:e(e({},{display:"flex",alignItems:"center",justifyContent:"center",padding:"6px 8px",border:"1px solid #e5e7eb",borderRadius:"8px",cursor:"pointer",backgroundColor:"#ffffff",color:"#6b7280"}),{opacity:P?.5:1,cursor:P?"not-allowed":"pointer",border:"none",background:"transparent"})},{children:t(c,{size:16})})),F&&O&&i(o,{children:[t("style",{children:Q}),t(s,{size:16,style:{animation:"spin 1s linear infinite",color:"#6b7280"}})]})]}));return t("div",e({"data-edit-id":R},{children:i(r,e({},N,{id:R,collapsible:!0,defaultOpen:!1,openSections:k,setOpenSections:E,headerActions:X},{children:[i("div",e({className:"config-content-grid",style:{opacity:V&&!I?.6:1,transition:"opacity 0.2s"}},{children:[(H||b).map(function(n,i){return t(a,{label:"".concat(n.label," Separation"),isEnabled:n.enabled,duration:n.global_min_separation_seconds,onToggle:function(){return function(n){W&&!F&&K(function(i){return i?i.map(function(i){return i.key===n.key?e(e({},i),{enabled:!i.enabled}):i}):null})}(n)},onDurationChange:function(i){return function(n,i){W&&!F&&K(function(t){return t?t.map(function(t){return t.key===n.key?e(e({},t),{global_min_separation_seconds:i}):t}):null})}(n,i)},isHighlighted:S["config_".concat(n.key)],isDisabled:V},n.key)}),(U||x).map(function(n,o){return t("div",e({className:"separation-row-container"},{children:i("div",e({className:"separation-header-row"},{children:[t("div",e({className:"separation-label"},{children:n.label})),t(l,{isEnabled:n.enabled,onToggle:function(){return function(n){W&&!F&&q(function(i){return i?i.map(function(i){return i.key===n.key?e(e({},i),{enabled:!i.enabled}):i}):null})}(n)},isDisabled:V})]}))}),n.key)})]})),F&&O&&i(o,{children:[t("style",{children:Q}),i("div",e({style:{display:"flex",alignItems:"center",padding:"4px 0 12px 12px",color:"#141414ff",fontSize:"13px",fontWeight:500,fontStyle:"italic",marginTop:"8px"}},{children:[t(s,{style:{marginRight:8,animation:"spin 1s linear infinite"}}),"Checking the correctness of your Configuration..."]}))]}),W&&!F&&i("div",e({style:{display:"flex",flexDirection:"column",marginTop:"12px"}},{children:[i("div",e({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[t("button",e({onClick:function(){K(null),q(null),j&&j(null)},style:{background:"none",border:"none",color:"#6b7280",fontSize:"14px",fontWeight:"500",cursor:"pointer",padding:"0"}},{children:"Discard Changes"})),i("button",e({onClick:function(){if(H&&U){var n=H.filter(function(n,e){var i=b[e];return!i||n.enabled!==i.enabled||n.global_min_separation_seconds!==i.global_min_separation_seconds}),e=U.filter(function(n,e){var i=x[e];return!i||n.enabled!==i.enabled});if(0===n.length&&0===e.length)return K(null),q(null),void(j&&j(null));if(A){var i="sk-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),t=[];n.length>0&&t.push("Enable ".concat(n.map(function(n){return"".concat(n.label," (").concat(n.global_min_separation_seconds,"min)")}).join(", "))),e.length>0&&t.push("enable ".concat(e.map(function(n){return"".concat(n.label," (").concat(n.enabled,")")}).join(", ")));var o="__SKELETON__:".concat(i,":Update Configuration - ").concat(t.join("; "));A(o)}G(!0),K(null),q(null),j&&j(null)}else j&&j(null)},style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 16px",borderRadius:"12px",border:"none",backgroundColor:"#2563eb",color:"#ffffff",fontSize:"14px",fontWeight:"500",cursor:"pointer",boxShadow:"0 1px 2px rgba(0,0,0,0.05)"}},{children:[t(d,{size:18,strokeWidth:2.5,color:"#ffffff"}),"Save Changes"]}))]})),w===R&&i("div",e({style:{display:"flex",alignItems:"center",gap:"6px",marginTop:"8px"}},{children:[t(p,{style:{color:"#C2410C"}}),t("div",e({style:{color:"#C2410C",fontSize:"13px",paddingTop:"8px"}},{children:"Pending - Changes not applied yet. Apply or discard them to continue."}))]}))]}))]}))}))};export{m as ConfigSection};
2
2
  //# sourceMappingURL=ConfigSection.js.map
@@ -1,2 +1,2 @@
1
- import{__rest as e,__assign as t}from"tslib";import{jsx as i,jsxs as n,Fragment as o}from"react/jsx-runtime";import{SectionWrapper as l}from"../../molecules/Sections/SectionWrapper.js";import{Textarea as r}from"../../atoms/Textarea/Textarea.js";import{ButtonCognitiveIcon as a}from"../../_svg/ButtonCognitiveIcon.js";import{useState as d,useRef as s,useEffect as c}from"react";import{Check as p,X as g,Pencil as f,AlertTriangle as h,Loader2Icon as m}from"lucide-react";var u=function(u){var y=u.rows,x=u.value,v=u.errorMessage,C=u.onChange,I=u.placeholder,E=u.title,w=u.isHighlighted,b=u.isOpen,S=u.readOnly,T=u.showCognitiveIcon,k=u.onToggle,O=u.tooltipDescription,_=u.enableInlineEdit,j=u.setSendMessageInChat,A=u.isAiStreaming,D=u.fieldName,M=u.id,z=u.activeEditId,N=u.setActiveEditId,R=u.pendingEditId;u.setPendingEditId;var W=e(u,["rows","value","errorMessage","onChange","placeholder","title","isHighlighted","isOpen","readOnly","showCognitiveIcon","onToggle","tooltipDescription","enableInlineEdit","setSendMessageInChat","isAiStreaming","fieldName","id","activeEditId","setActiveEditId","pendingEditId","setPendingEditId"]),H=d(null),P=H[0],B=H[1],K=d(!1),L=K[0],V=K[1],F=s(A);c(function(){F.current&&!A&&L&&V(!1),F.current=A},[A,L]);var U=null!==P,q=!!z&&z!==M&&_,G=S||A||_&&!U,J=i("div",t({style:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"}},{children:i("span",{children:E})})),Q={display:"flex",alignItems:"center",justifyContent:"center",padding:"8px",border:"1px solid #e5e7eb",borderRadius:"8px",cursor:"pointer",width:"36px",height:"36px",backgroundColor:"#ffffff"};return n(l,t({},W,{readOnly:S,title:J,customStyles:{margin:"0 0.2rem 0.2rem 0.2rem"}},{children:[n("div",t({className:"textarea-wrapper",style:{display:"flex",alignItems:"flex-start",gap:"8px",width:"100%"},"data-edit-id":M},{children:[i("div",t({style:{flex:1,minWidth:0}},{children:i(r,{cognitiveIcon:i(a,{}),rows:y,placeholder:I,value:U?P:x,onChange:function(e){U?B(e.target.value):C&&C(e.target.value)},isHighlighted:w,isOpen:b,isReadOnly:S||A,inputReadOnly:G,onToggle:k,showCognitiveIcon:T,tooltipDescription:O,errorMessage:v})})),_&&!S&&i("div",t({style:{display:"flex",flexDirection:"row",gap:"8px",marginTop:"0px"}},{children:U?n(o,{children:[n("button",t({title:"Apply",onClick:function(){if(null!==P){if(P===(null!=x?x:""))return B(null),void(N&&N(null));if(j){var e="sk-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),t=D||"Description",i=P&&""!==P.trim()?"Update ".concat(t," with ").concat(P):"Remove ".concat(t);console.log('[TextSection] Sending message for "'.concat(t,'"'),{draftValue:P,globalFormValue:x,message:"__SKELETON__:".concat(e,":").concat(i)}),V(!0),j("__SKELETON__:".concat(e,":").concat(i))}B(null),N&&N(null)}},style:t(t({},Q),{backgroundColor:"#2563EB",color:"white",width:"auto",padding:"8px 12px"})},{children:[i(p,{size:20,strokeWidth:2.5})," Apply"]})),i("button",t({title:"Cancel",onClick:function(){B(null),N&&N(null)},style:t(t({},Q),{borderColor:"#E3E8E9",color:"#dc2626"})},{children:i(g,{size:20,strokeWidth:2.5})}))]}):i("button",t({title:q?"Save active edits first":"Edit",onClick:function(){z&&z!==M||(N&&N(M),B(null!=x?x:""))},disabled:A||q,style:t(t({},Q),{color:"#6b7280",cursor:A||q?"not-allowed":"pointer",opacity:A||q?.5:1})},{children:i(f,{size:20})}))}))]})),R===M&&U&&n("div",t({style:{display:"flex",alignItems:"center",gap:"6px",marginTop:"8px"}},{children:[i(h,{style:{color:"#C2410C"}}),i("div",t({style:{display:"flex",color:"#C2410C",fontSize:"13px",paddingTop:"8px",alignItems:"center"}},{children:"Pending - Changes not applied yet. Apply or discard them to continue."}))]})),L&&A&&_&&!S&&n(o,{children:[i("style",{children:"\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),n("div",t({style:{display:"flex",alignItems:"center",justifyContent:"flex-start",padding:"4px 0 12px 12px",color:"#141414ff",fontSize:"13px",fontWeight:500,fontStyle:"italic",marginTop:"8px"}},{children:[i(m,{style:{marginRight:8,animation:"spin 1s linear infinite"}}),"Checking the correctness of your ",D||"description","..."]}))]})]}))};export{u as TextSection};
1
+ import{__rest as e,__assign as t}from"tslib";import{jsx as i,jsxs as n,Fragment as o}from"react/jsx-runtime";import{SectionWrapper as l}from"../../molecules/Sections/SectionWrapper.js";import{Textarea as r}from"../../atoms/Textarea/Textarea.js";import{ButtonCognitiveIcon as a}from"../../_svg/ButtonCognitiveIcon.js";import{useState as d,useRef as s,useEffect as c}from"react";import{Check as p,X as g,Pencil as f,AlertTriangle as h,Loader2Icon as m}from"lucide-react";var u=function(u){var y=u.rows,x=u.value,v=u.errorMessage,C=u.onChange,I=u.placeholder,w=u.title,E=u.isHighlighted,b=u.isOpen,S=u.readOnly,k=u.showCognitiveIcon,T=u.onToggle,O=u.tooltipDescription,j=u.enableInlineEdit,A=u.setSendMessageInChat,D=u.isAiStreaming,M=u.fieldName,z=u.id,R=u.activeEditId,W=u.setActiveEditId,_=u.pendingEditId;u.setPendingEditId;var N=e(u,["rows","value","errorMessage","onChange","placeholder","title","isHighlighted","isOpen","readOnly","showCognitiveIcon","onToggle","tooltipDescription","enableInlineEdit","setSendMessageInChat","isAiStreaming","fieldName","id","activeEditId","setActiveEditId","pendingEditId","setPendingEditId"]),H=d(null),P=H[0],B=H[1],K=d(!1),L=K[0],U=K[1],q=s(D);c(function(){q.current&&!D&&L&&U(!1),q.current=D},[D,L]);var F=null!==P,G=!!R&&R!==z&&j,J=S||D||j&&!F,Q=i("div",t({style:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"}},{children:i("span",{children:w})})),V={display:"flex",alignItems:"center",justifyContent:"center",padding:"8px",border:"1px solid #e5e7eb",borderRadius:"8px",cursor:"pointer",width:"36px",height:"36px",backgroundColor:"#ffffff"};return n(l,t({},N,{readOnly:S,title:Q,customStyles:{margin:"0 0.2rem 0.2rem 0.2rem"}},{children:[n("div",t({className:"textarea-wrapper",style:{display:"flex",alignItems:"flex-start",gap:"8px",width:"100%"},"data-edit-id":z},{children:[i("div",t({style:{flex:1,minWidth:0}},{children:i(r,{cognitiveIcon:i(a,{}),rows:y,placeholder:I,value:F?P:x,onChange:function(e){F?B(e.target.value):C&&C(e.target.value)},isHighlighted:E,isOpen:b,isReadOnly:S||D,inputReadOnly:J,onToggle:T,showCognitiveIcon:k,tooltipDescription:O,errorMessage:v})})),j&&!S&&i("div",t({style:{display:"flex",flexDirection:"row",gap:"8px",marginTop:"0px"}},{children:F?n(o,{children:[n("button",t({title:"Apply",onClick:function(){if(null!==P){if(P===(null!=x?x:""))return B(null),void(W&&W(null));if(A){var e="sk-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),t=M||"Description",i=P&&""!==P.trim()?"Update ".concat(t," with ").concat(P):"Remove ".concat(t);U(!0),A("__SKELETON__:".concat(e,":").concat(i))}B(null),W&&W(null)}},style:t(t({},V),{backgroundColor:"#2563EB",color:"white",width:"auto",padding:"8px 12px"})},{children:[i(p,{size:20,strokeWidth:2.5})," Apply"]})),i("button",t({title:"Cancel",onClick:function(){B(null),W&&W(null)},style:t(t({},V),{borderColor:"#E3E8E9",color:"#dc2626"})},{children:i(g,{size:20,strokeWidth:2.5})}))]}):i("button",t({title:G?"Save active edits first":"Edit",onClick:function(){R&&R!==z||(W&&W(z),B(null!=x?x:""))},disabled:D||G,style:t(t({},V),{color:"#6b7280",cursor:D||G?"not-allowed":"pointer",opacity:D||G?.5:1})},{children:i(f,{size:20})}))}))]})),_===z&&F&&n("div",t({style:{display:"flex",alignItems:"center",gap:"6px",marginTop:"8px"}},{children:[i(h,{style:{color:"#C2410C"}}),i("div",t({style:{display:"flex",color:"#C2410C",fontSize:"13px",paddingTop:"8px",alignItems:"center"}},{children:"Pending - Changes not applied yet. Apply or discard them to continue."}))]})),L&&D&&j&&!S&&n(o,{children:[i("style",{children:"\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),n("div",t({style:{display:"flex",alignItems:"center",justifyContent:"flex-start",padding:"4px 0 12px 12px",color:"#141414ff",fontSize:"13px",fontWeight:500,fontStyle:"italic",marginTop:"8px"}},{children:[i(m,{style:{marginRight:8,animation:"spin 1s linear infinite"}}),"Checking the correctness of your ",M||"description","..."]}))]})]}))};export{u as TextSection};
2
2
  //# sourceMappingURL=TextSection.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as i}from"tslib";import{jsxs as e,jsx as n}from"react/jsx-runtime";import t,{useState as o,useEffect as l}from"react";import{InputDataReasoningCard as r}from"../../InputDataReasoningCard.js";import{ConditionSection as a}from"../../organisms/ConditionSection/ConditionSection.js";import{ConfigSection as d}from"../../organisms/ConfigSection/ConfigSection.js";import{ScopeSection as c}from"../../organisms/ScopeSection/ScopeSection.js";import{TextSection as u}from"../../organisms/TextSection/TextSection.js";import s from"../../AccordianSection.js";import{ButtonCognitiveIcon as v}from"../../_svg/ButtonCognitiveIcon.js";import{Loader2Icon as p,Pencil as f,Check as g,AlertTriangle as h}from"lucide-react";var m=function(o){var l=o.children,r=o.onAddVariant,a=o.isDisabled,d=t.Children.toArray(l);return e("div",i({style:{display:"flex",flexDirection:"column",alignItems:"flex-start"}},{children:[d.map(function(i,o){return e(t.Fragment,{children:[i,n("div",{style:{width:"2px",height:"20px",backgroundColor:"#E2E8F0",marginLeft:"30px"}})]},o)}),n("div",i({onClick:a?void 0:r,style:{padding:"8px 16px",border:"1px solid #E2E8F0",borderRadius:"8px",color:a?"#94a3b8":"#475569",fontSize:"14px",fontWeight:"500",cursor:a?"not-allowed":"pointer",backgroundColor:a?"#f8fafc":"#FFFFFF",opacity:a?.7:1,userSelect:"none",transition:"all 0.2s ease"}},{children:"Add Variant"}))]}))},y=function(y){var T,x,S,D,C,A,I,b,E,O,w,V=y.state,R=y.handlers,_=y.uiState,W=(null==_?void 0:_.highlights)||new Map,N=W.get("global_0")||{},k=o({}),F=k[0],M=k[1],j=o(null),B=j[0],L=j[1],q="rule-setup"===(null==_?void 0:_.activeEditId),z=t.useRef(new Map),P=o(null),H=P[0],K=P[1],U=o(null),$=U[0],J=U[1],Z=o(!1),G=Z[0],Q=Z[1],X=t.useRef(null==_?void 0:_.isAiStreaming);l(function(){X.current&&!(null==_?void 0:_.isAiStreaming)&&G&&Q(!1),X.current=null==_?void 0:_.isAiStreaming},[null==_?void 0:_.isAiStreaming,G]);var Y=function(){var i;K(null),J(null),null===(i=null==_?void 0:_.setActiveEditId)||void 0===i||i.call(_,null)},ii=function(){var i,e,n=null!=H?H:V.ruleTitle,t=null!=$?$:V.scopeData,o=n!==V.ruleTitle,l=JSON.stringify(t)!==JSON.stringify(V.scopeData);if(!o&&!l)return K(null),J(null),void(null===(i=null==_?void 0:_.setActiveEditId)||void 0===i||i.call(_,null));if(null==_?void 0:_.setSendMessageInChat){var r="sk-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),a=[];if(o&&a.push((null==n?void 0:n.trim())?"Title with ".concat(n):"No Title"),l){var d=null==t?void 0:t.tiers,c=d&&d.length>0?"tiers: ".concat(d.join(", ")):"No Tier Selected";a.push(c)}var u=a.join(" and ");console.log("[RuleSetup] Sending message",{draftTitle:n,draftScope:t,globalTitle:V.ruleTitle,globalScope:V.scopeData,message:"__SKELETON__:".concat(r,":Update Rule Setup ").concat(u)}),_.setSendMessageInChat("__SKELETON__:".concat(r,":Update Rule Setup ").concat(u))}Q(!0),K(null),J(null),null===(e=null==_?void 0:_.setActiveEditId)||void 0===e||e.call(_,null)},ei=t.useRef(null==_?void 0:_.defaultVariantOpen),ni=t.useRef(V.variantsByTier);t.useEffect(function(){var i,e,n,t,o=null,l=!1;if(ei.current!==(null==_?void 0:_.defaultVariantOpen)&&(l=!0,ei.current=null==_?void 0:_.defaultVariantOpen),V.variantsByTier,ni.current,l){if(null==(null==_?void 0:_.defaultVariantOpen)||(null==_?void 0:_.defaultVariantOpen)<0)return L(null),void(ni.current=V.variantsByTier);null===(e=null===(i=null==_?void 0:_.tierOptions)||void 0===i?void 0:i.filter(function(i){var e,n;return null===(n=null===(e=V.scopeData)||void 0===e?void 0:e.tiers)||void 0===n?void 0:n.includes(i)}))||void 0===e||e.forEach(function(i){var e,n=i.toLowerCase().replace(/ /g,"_");((null===(e=V.variantsByTier)||void 0===e?void 0:e[n])||[]).forEach(function(i,e){(null==_?void 0:_.defaultVariantOpen)===e&&(o="".concat(n,"-variant-").concat(e)),(null==_?void 0:_.autoScrollVariantIndex)===e&&(o="".concat(n,"-variant-").concat(e))})}),o&&L(o)}null===B&&(null==_?void 0:_.defaultVariantOpen)>=0&&(null===(t=null===(n=null==_?void 0:_.tierOptions)||void 0===n?void 0:n.filter(function(i){var e,n;return null===(n=null===(e=V.scopeData)||void 0===e?void 0:e.tiers)||void 0===n?void 0:n.includes(i)}))||void 0===t||t.forEach(function(i){var e,n=i.toLowerCase().replace(/ /g,"_");((null===(e=V.variantsByTier)||void 0===e?void 0:e[n])||[])[_.defaultVariantOpen]&&L("".concat(n,"-variant-").concat(_.defaultVariantOpen))})),ni.current=V.variantsByTier},[V.variantsByTier,null==_?void 0:_.defaultVariantOpen,null===(T=V.scopeData)||void 0===T?void 0:T.tiers,null==_?void 0:_.tierOptions,null==_?void 0:_.autoScrollVariantIndex]);var ti=function(e){M(function(n){var t;return i(i({},n),((t={})[e]=!n[e],t))})},oi=function(i){var e,n,t,o=i.split("_"),l=o[o.length-1],r=/^\d+$/.test(l)?o.slice(0,-1).join("_"):i,a=null===(e=V.fieldCitations)||void 0===e?void 0:e[r];if(Array.isArray(a)&&a.length>0)return a;var d=null===(n=V.fieldCitations)||void 0===n?void 0:n[i];return Array.isArray(d)&&d.length>0?d:null!==(t=V.citations)&&void 0!==t?t:[]},li={marginTop:"-17px",position:"relative",zIndex:1};t.useCallback(function(i){i&&requestAnimationFrame(function(){setTimeout(function(){i.scrollIntoView({behavior:"smooth",block:"center"})},300)})},[]),l(function(){var i,e;null!=(null==_?void 0:_.autoScrollVariantIndex)&&(null===(e=null===(i=null==_?void 0:_.tierOptions)||void 0===i?void 0:i.filter(function(i){var e,n;return null===(n=null===(e=V.scopeData)||void 0===e?void 0:e.tiers)||void 0===n?void 0:n.includes(i)}))||void 0===e||e.forEach(function(i){var e=i.toLowerCase().replace(/ /g,"_"),n="".concat(e,"-variant-").concat(_.autoScrollVariantIndex),t=z.current.get(n);t&&requestAnimationFrame(function(){setTimeout(function(){t.scrollIntoView({behavior:"smooth",block:"center"})},300)})}))},[null==_?void 0:_.scrollTrigger]),console.log("CreateRule state:",V),console.log("CreateRule uiState:",_);var ri=function(i){return i?i.replace(/_/g," ").replace(/([a-zA-Z])(\d)/g,"$1 $2").replace(/\b\w/g,function(i){return i.toUpperCase()}):"Variant 1"},ai=!!(null==_?void 0:_.activeEditId);return e("div",i({className:"traffic-manager-template"},{children:[n("div",i({"data-edit-id":"rule-setup"},{children:n(s,i({title:{type:"other",label:(null==_?void 0:_.setupLabel)||"Rule Setup"},actionButtons:function(e,t){if(q)return null;var o=!!(null==_?void 0:_.activeEditId)&&"rule-setup"!==_.activeEditId;return n("div",i({style:{position:"relative",display:"flex",flexDirection:"column"}},{children:n("button",i({title:o?"Save active edits first":"Edit",onClick:function(n){n.stopPropagation(),o?(null==_?void 0:_.setPendingEditId)&&_.setPendingEditId(_.activeEditId||null):(!function(){var e,n;(null==_?void 0:_.activeEditId)&&"rule-setup"!==_.activeEditId||(null===(e=null==_?void 0:_.setActiveEditId)||void 0===e||e.call(_,"rule-setup"),K(null!==(n=V.ruleTitle)&&void 0!==n?n:""),J(V.scopeData?i({},V.scopeData):{}))}(),(null==_?void 0:_.setPendingEditId)&&_.setPendingEditId(null),e||t())},disabled:G,style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",padding:"6px 8px",border:"1px solid #e5e7eb",borderRadius:"8px",cursor:G?"not-allowed":"pointer",backgroundColor:"#ffffff",color:"#6b7280",opacity:G?.5:1}},{children:n(f,{size:14})}))}))},footerData:{ruleTitle:V.ruleTitle,stations:[V.scopeData.station],tiers:null===(x=V.scopeData)||void 0===x?void 0:x.tiers},defaultOpen:"Create"===(null==_?void 0:_.usedFor),readOnly:"Create"!==(null==_?void 0:_.usedFor),isAiStreaming:null==_?void 0:_.isAiStreaming,editFlow:"Edit"===(null==_?void 0:_.usedFor)},{children:e("div",i({style:{display:"flex",flexDirection:"column",gap:"12px"}},{children:[G&&(null==_?void 0:_.isAiStreaming)&&e("div",i({style:{display:"flex",alignItems:"center",color:"#141414ff",fontSize:"13px",fontWeight:500,fontStyle:"italic",marginBottom:"8px",paddingLeft:"4px"}},{children:[n(p,{size:16,style:{marginRight:8,animation:"spin 1s linear infinite"}},"loader"),"Checking the correctness of your Rule Setup..."]})),n(u,i({id:"rule-title",title:_.ruleTitle||"Rule Title",rows:1,placeholder:"Enter a short, descriptive title for the learning",required:!0,value:q&&null!==H?H:V.ruleTitle,onChange:function(i){return q?K(i):R.setRuleTitle(i)},readOnly:(null==_?void 0:_.isAiStreaming)||!q,isOpen:F.ruleTitle,onToggle:function(){return ti("ruleTitle")},isHighlighted:N.ruleTitle||!1,showCognitiveIcon:V.citation.ruleTitle,tooltipDescription:"Why this Title?",errorMessage:null===(S=_.validationErrors)||void 0===S?void 0:S.ruleTitle},_)),V.citation.ruleTitle&&n("div",i({style:li},{children:n(r,{isVisible:F.ruleTitle,citation:V.citation.ruleTitle,citations:oi("ruleTitle"),fieldName:"Rule Title",fieldValue:V.ruleTitle})})),n(c,i({id:"scope",title:"",required:!1,scopeData:q&&null!==$?$:V.scopeData,onScopeChange:function(e,n){q?J(function(t){var o;return i(i({},null!=t?t:V.scopeData),((o={})[e]=n,o))}):R.onScopeChange(e,n)},tierLabel:"Which tiers should this learning apply to?",stationLabel:"Which scope should this learning belong to?",highlights:N,isOpen:F.scopeData,onToggle:function(){return ti("scopeData")},showCognitiveIcon:V.citation.scopeData,cognitiveIcon:n(v,{}),tooltipDescription:"Why this Scope?",errorMessage:(null===(D=_.validationErrors)||void 0===D?void 0:D.station)||(null===(C=_.validationErrors)||void 0===C?void 0:C.tiers),stationErrorMessage:null===(A=_.validationErrors)||void 0===A?void 0:A.station,tierErrorMessage:null===(I=_.validationErrors)||void 0===I?void 0:I.tiers,readOnly:(null==_?void 0:_.isAiStreaming)||!q},_)),V.citation.scopeData&&n("div",i({style:li},{children:n(r,{isVisible:F.scopeData,citation:V.citation.scopeData,citations:oi("scopeData"),fieldName:"Scope",fieldValue:null===(E=null===(b=V.scopeData)||void 0===b?void 0:b.tiers)||void 0===E?void 0:E.join(", ")})})),q?e("div",i({style:{display:"flex",flexDirection:"column",alignItems:"flex-start"}},{children:[e("div",i({style:{display:"flex",justifyContent:"flex-start",alignItems:"center",gap:"16px"}},{children:[n("button",i({onClick:Y,style:{background:"none",border:"none",color:"#6b7280",fontSize:"14px",fontWeight:"500",cursor:"pointer",padding:"0"}},{children:"Discard Changes"})),e("button",i({onClick:ii,style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 16px",borderRadius:"12px",border:"none",backgroundColor:"#2563eb",color:"#ffffff",fontSize:"14px",fontWeight:"500",cursor:"pointer",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.05)"}},{children:[n(g,{size:18,strokeWidth:2.5,color:"#ffffff"}),"Save Changes"]}))]})),"rule-setup"===(null==_?void 0:_.pendingEditId)&&e("div",i({style:{display:"flex",alignItems:"center",gap:"6px",marginTop:"8px"}},{children:[n(h,{style:{color:"#C2410C"}}),n("div",i({style:{display:"flex",color:"#C2410C",fontSize:"13px",paddingTop:"8px",alignItems:"center"}},{children:"Pending - Changes not applied yet. Apply or discard them to continue."}))]}))]})):null]}))}))})),null===(w=null===(O=null==_?void 0:_.tierOptions)||void 0===O?void 0:O.filter(function(i){var e,n;return null===(n=null===(e=V.scopeData)||void 0===e?void 0:e.tiers)||void 0===n?void 0:n.includes(i)}))||void 0===w?void 0:w.map(function(t,o,l){var c,v,p,f,g=t.toLowerCase().replace(/ /g,"_"),h=(null===(c=V.variantsByTier)||void 0===c?void 0:c[g])||[],y=h.length,T=!1;if(1===y){var x=h[0],S=!(null===(v=null==x?void 0:x.ruleDescription)||void 0===v?void 0:v.trim()),D=(null===(p=null==x?void 0:x.whenToApplyConditions)||void 0===p?void 0:p.some(function(i){return(null==i?void 0:i.text)&&""!==i.text.trim()}))||!1,C=(null===(f=null==x?void 0:x.whenNotToApplyConditions)||void 0===f?void 0:f.some(function(i){return(null==i?void 0:i.text)&&""!==i.text.trim()}))||!1;S&&!D&&!C&&(T=!0)}var A=T?void 0:"".concat(y," ").concat(1===y?"variant":"variants"," configured for this tier"),I=!((null==_?void 0:_.defaultTierOpen)>=0)||o===_.defaultTierOpen;return console.log("Rendering tier : ",t),n(s,i({variant:"tier-header",title:{type:"other",label:t},subtitle:A,defaultOpen:I,footerData:{description:"Variants for ".concat(t)}},{children:n(m,i({onAddVariant:function(){var i;return null===(i=R.addNewVariant)||void 0===i?void 0:i.call(R,g)},isDisabled:null==_?void 0:_.isAiStreaming},{children:h.map(function(t,o){var l,c,v,p,f,h,m,y,T,x,S,D=t.variantType||"default",C="".concat(g,"-variant-").concat(o),A=!0===t.is_variant,I="default"===D||"default_variant"===D;(null==_?void 0:_.defaultVariantOpen)>=0&&_.defaultVariantOpen;var b="".concat(g,"_").concat(o),E=W.get(b)||{},O=(null===(c=null===(l=_.separationItemsByTier)||void 0===l?void 0:l[g])||void 0===c?void 0:c.get(o))||[],w=(null===(p=null===(v=_.togglesByTier)||void 0===v?void 0:v[g])||void 0===p?void 0:p.get(o))||[];(null==_?void 0:_.autoScrollVariantIndex)===o||t.is_variant,console.log("Rendering ".concat(g," variant ").concat(o,":"),t),console.log("Rendering Variant : ",t),console.log("Open Accordion ID:",B,"Current Variant ID:",C);var N=null===(f=null==_?void 0:_.activeEditId)||void 0===f?void 0:f.startsWith("condition-wta-".concat(g,"-").concat(o)),k=null===(h=null==_?void 0:_.activeEditId)||void 0===h?void 0:h.startsWith("condition-wnta-".concat(g,"-").concat(o));return n("div",i({ref:function(i){i?z.current.set(C,i):z.current.delete(C)},style:{width:"100%"}},{children:n(s,i({title:{type:I?"default":"variant",label:ri(D),number:o+1,isNewVariant:A,isDefault:t.isDefault,isModified:t.isModified},defaultOpen:!0,expanded:B===C,onToggle:function(){var i,e=B===C;console.log("is closing:",e),L(e?null:C),null===(i=null==_?void 0:_.setActiveVariantAccordionIndex)||void 0===i||i.call(_,e?null:o)},variant:"rule-behavior",footerData:{ruleTitle:D,description:t.ruleDescription||""}},{children:e("div",i({style:{display:"flex",flexDirection:"column",gap:"12px"}},{children:[n(u,i({id:"rule-description-".concat(g,"-").concat(o),title:_.ruleDescriptionTitle||"Rule Description",rows:2,placeholder:"Explain the learning behaviour",required:!0,readOnly:t.isReadOnly||(null==_?void 0:_.isAiStreaming)||ai&&(null==_?void 0:_.activeEditId)!=="rule-description-".concat(g,"-").concat(o),value:t.ruleDescription||"",onChange:function(i){return R.setRuleDescription(g,o,i)},isOpen:F["ruleDescription-".concat(g)],onToggle:function(){return ti("ruleDescription-".concat(g))},isHighlighted:E.ruleDescription||!1,showCognitiveIcon:null===(m=V.citation)||void 0===m?void 0:m["ruleDescription_".concat(g)],tooltipDescription:"Why this Description?",errorMessage:null===(y=_.validationErrors)||void 0===y?void 0:y["ruleDescription-".concat(g,"-").concat(o)],enableInlineEdit:!0,setSendMessageInChat:null==_?void 0:_.setSendMessageInChat,isAiStreaming:null==_?void 0:_.isAiStreaming,fieldName:"Rule Description"},_)),(null===(T=V.citation)||void 0===T?void 0:T["ruleDescription_".concat(g)])&&n("div",i({style:li},{children:n(r,{isVisible:F["ruleDescription-".concat(g)],citation:V.citation["ruleDescription_".concat(g)],citations:oi("ruleDescription_".concat(g,"_").concat(o)),fieldName:"Rule Description",fieldValue:t.ruleDescription})})),n(a,i({id:"when-to-apply-".concat(g,"-").concat(o),idPrefix:"condition-wta",title:_.whenToApplyTitle||"When to apply",required:!0,dividerRequired:!0,readOnly:t.isReadOnly||(null==_?void 0:_.isAiStreaming)||ai&&!N,conditions:t.whenToApplyConditions||[],onAdd:function(){return R.addWhenToApply(g,o)},onRemove:function(i,e,n){return R.removeWhenToApply(i,e,n)},onEdit:function(i,e,n,t){return R.editWhenToApply(i,e,n,t)},index:o,tierKey:g,isHighlighted:E.wta||!1,highlightedIds:null==_?void 0:_.highlightedIds,tooltipDescription:"Why this Condition?",citations:oi("whenToApply_".concat(g,"_").concat(o)),bordered:!0,addLabel:"Add When to apply",isAiStreaming:_.isAiStreaming,errorMessage:(null===(x=_.validationErrors)||void 0===x?void 0:x["whenToApply-".concat(g,"-").concat(o)])||(null==_?void 0:_.conflictReason)},_)),n(a,i({id:"when-not-to-apply-".concat(g,"-").concat(o),idPrefix:"condition-wnta",title:_.whenNotToApplyTitle||"When NOT to apply",required:!1,dividerRequired:!0,readOnly:t.isReadOnly||(null==_?void 0:_.isAiStreaming)||ai&&!k,conditions:t.whenNotToApplyConditions||[],onAdd:function(){return R.addWhenNotToApply(g,o)},onRemove:function(i,e,n){return R.removeWhenNotToApply(i,e,n)},onEdit:function(i,e,n,t){return R.editWhenNotToApply(i,e,n,t)},index:o,tierKey:g,isHighlighted:E.wnta||!1,highlightedIds:null==_?void 0:_.highlightedIds,tooltipDescription:"Why this Condition?",citations:oi("whenNotToApply_".concat(g,"_").concat(o)),bordered:!0,addLabel:"Add When NOT to apply",isAiStreaming:_.isAiStreaming},_)),n(d,i({id:"config-".concat(g,"-").concat(o),title:_.configTitle||"Configuration",required:!1,highlights:E,bordered:!0,readOnly:t.isReadOnly||(null==_?void 0:_.isAiStreaming)||ai&&(null==_?void 0:_.activeEditId)!=="config-".concat(g,"-").concat(o),onConfigChange:function(i,e){return R.onConfigChange(g,o,i,e)},separationItems:O,toggles:w,index:o},_)),(null===(S=t.reasoning)||void 0===S?void 0:S.configData)&&n("div",i({style:li},{children:n(r,{citation:t.reasoning.configData,citations:oi("configData_".concat(g,"_").concat(o)),fieldName:"Configuration",fieldValue:"Proposed Configuration"})}))]}))}),C)}),"".concat(g,"-variant-").concat(o))})}))}),"tier-".concat(o))})]}))};export{y as CreateRule};
1
+ import{__assign as i}from"tslib";import{jsxs as n,jsx as e}from"react/jsx-runtime";import t,{useState as o,useEffect as l}from"react";import{InputDataReasoningCard as r}from"../../InputDataReasoningCard.js";import{ConditionSection as a}from"../../organisms/ConditionSection/ConditionSection.js";import{ConfigSection as d}from"../../organisms/ConfigSection/ConfigSection.js";import{ScopeSection as c}from"../../organisms/ScopeSection/ScopeSection.js";import{TextSection as u}from"../../organisms/TextSection/TextSection.js";import s from"../../AccordianSection.js";import{ButtonCognitiveIcon as v}from"../../_svg/ButtonCognitiveIcon.js";import{Loader2Icon as p,Pencil as f,Check as g,AlertTriangle as h}from"lucide-react";var y=function(o){var l=o.children,r=o.onAddVariant,a=o.isDisabled,d=t.Children.toArray(l);return n("div",i({style:{display:"flex",flexDirection:"column",alignItems:"flex-start"}},{children:[d.map(function(i,o){return n(t.Fragment,{children:[i,e("div",{style:{width:"2px",height:"20px",backgroundColor:"#E2E8F0",marginLeft:"30px"}})]},o)}),e("div",i({onClick:a?void 0:r,style:{padding:"8px 16px",border:"1px solid #E2E8F0",borderRadius:"8px",color:a?"#94a3b8":"#475569",fontSize:"14px",fontWeight:"500",cursor:a?"not-allowed":"pointer",backgroundColor:a?"#f8fafc":"#FFFFFF",opacity:a?.7:1,userSelect:"none",transition:"all 0.2s ease"}},{children:"Add Variant"}))]}))},m=function(m){var x,T,D,S,C,A,I,b,E,O,w,V=m.state,R=m.handlers,_=m.uiState,W=(null==_?void 0:_.highlights)||new Map,N=W.get("global_0")||{},M=o({}),j=M[0],F=M[1],k=o(null),B=k[0],L=k[1],z="rule-setup"===(null==_?void 0:_.activeEditId),q=t.useRef(new Map),P=o(null),H=P[0],K=P[1],$=o(null),J=$[0],U=$[1],Z=o(!1),G=Z[0],Q=Z[1],X=t.useRef(null==_?void 0:_.isAiStreaming);l(function(){X.current&&!(null==_?void 0:_.isAiStreaming)&&G&&Q(!1),X.current=null==_?void 0:_.isAiStreaming},[null==_?void 0:_.isAiStreaming,G]);var Y=function(){var i;K(null),U(null),null===(i=null==_?void 0:_.setActiveEditId)||void 0===i||i.call(_,null)},ii=function(){var i,n,e=null!=H?H:V.ruleTitle,t=null!=J?J:V.scopeData,o=e!==V.ruleTitle,l=JSON.stringify(t)!==JSON.stringify(V.scopeData);if(!o&&!l)return K(null),U(null),void(null===(i=null==_?void 0:_.setActiveEditId)||void 0===i||i.call(_,null));if(null==_?void 0:_.setSendMessageInChat){var r="sk-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),a=[];if(o&&a.push((null==e?void 0:e.trim())?"Title with ".concat(e):"No Title"),l){var d=null==t?void 0:t.tiers,c=d&&d.length>0?"tiers: ".concat(d.join(", ")):"No Tier Selected";a.push(c)}var u=a.join(" and ");_.setSendMessageInChat("__SKELETON__:".concat(r,":Update Rule Setup ").concat(u))}Q(!0),K(null),U(null),null===(n=null==_?void 0:_.setActiveEditId)||void 0===n||n.call(_,null)},ni=t.useRef(null==_?void 0:_.defaultVariantOpen),ei=t.useRef(V.variantsByTier);t.useEffect(function(){var i,n,e,t,o=null,l=!1;if(ni.current!==(null==_?void 0:_.defaultVariantOpen)&&(l=!0,ni.current=null==_?void 0:_.defaultVariantOpen),l){if(null==(null==_?void 0:_.defaultVariantOpen)||(null==_?void 0:_.defaultVariantOpen)<0)return L(null),void(ei.current=V.variantsByTier);null===(n=null===(i=null==_?void 0:_.tierOptions)||void 0===i?void 0:i.filter(function(i){var n,e;return null===(e=null===(n=V.scopeData)||void 0===n?void 0:n.tiers)||void 0===e?void 0:e.includes(i)}))||void 0===n||n.forEach(function(i){var n,e=i.toLowerCase().replace(/ /g,"_");((null===(n=V.variantsByTier)||void 0===n?void 0:n[e])||[]).forEach(function(i,n){(null==_?void 0:_.defaultVariantOpen)===n&&(o="".concat(e,"-variant-").concat(n)),(null==_?void 0:_.autoScrollVariantIndex)===n&&(o="".concat(e,"-variant-").concat(n))})}),o&&L(o)}null===B&&(null==_?void 0:_.defaultVariantOpen)>=0&&(null===(t=null===(e=null==_?void 0:_.tierOptions)||void 0===e?void 0:e.filter(function(i){var n,e;return null===(e=null===(n=V.scopeData)||void 0===n?void 0:n.tiers)||void 0===e?void 0:e.includes(i)}))||void 0===t||t.forEach(function(i){var n,e=i.toLowerCase().replace(/ /g,"_");((null===(n=V.variantsByTier)||void 0===n?void 0:n[e])||[])[_.defaultVariantOpen]&&L("".concat(e,"-variant-").concat(_.defaultVariantOpen))})),ei.current=V.variantsByTier},[V.variantsByTier,null==_?void 0:_.defaultVariantOpen,null===(x=V.scopeData)||void 0===x?void 0:x.tiers,null==_?void 0:_.tierOptions,null==_?void 0:_.autoScrollVariantIndex]);var ti=function(n){F(function(e){var t;return i(i({},e),((t={})[n]=!e[n],t))})},oi=function(i){var n,e,t,o=i.split("_"),l=o[o.length-1],r=/^\d+$/.test(l)?o.slice(0,-1).join("_"):i,a=null===(n=V.fieldCitations)||void 0===n?void 0:n[r];if(Array.isArray(a)&&a.length>0)return a;var d=null===(e=V.fieldCitations)||void 0===e?void 0:e[i];return Array.isArray(d)&&d.length>0?d:null!==(t=V.citations)&&void 0!==t?t:[]},li={marginTop:"-17px",position:"relative",zIndex:1};l(function(){var i,n;null!=(null==_?void 0:_.autoScrollVariantIndex)&&(null===(n=null===(i=null==_?void 0:_.tierOptions)||void 0===i?void 0:i.filter(function(i){var n,e;return null===(e=null===(n=V.scopeData)||void 0===n?void 0:n.tiers)||void 0===e?void 0:e.includes(i)}))||void 0===n||n.forEach(function(i){var n=i.toLowerCase().replace(/ /g,"_"),e="".concat(n,"-variant-").concat(_.autoScrollVariantIndex),t=q.current.get(e);t&&requestAnimationFrame(function(){setTimeout(function(){t.scrollIntoView({behavior:"smooth",block:"center"})},300)})}))},[null==_?void 0:_.scrollTrigger]),console.log("CreateRule state:",V),console.log("CreateRule uiState:",_);var ri=function(i){return i?i.replace(/_/g," ").replace(/([a-zA-Z])(\d)/g,"$1 $2").replace(/\b\w/g,function(i){return i.toUpperCase()}):"Variant 1"},ai=!!(null==_?void 0:_.activeEditId);return n("div",i({className:"traffic-manager-template"},{children:[e("div",i({"data-edit-id":"rule-setup"},{children:e(s,i({title:{type:"other",label:(null==_?void 0:_.setupLabel)||"Rule Setup"},actionButtons:function(n,t){if(z)return null;var o=!!(null==_?void 0:_.activeEditId)&&"rule-setup"!==_.activeEditId;return e("div",i({style:{position:"relative",display:"flex",flexDirection:"column"}},{children:e("button",i({title:o?"Save active edits first":"Edit",onClick:function(e){e.stopPropagation(),o?(null==_?void 0:_.setPendingEditId)&&_.setPendingEditId(_.activeEditId||null):(!function(){var n,e;(null==_?void 0:_.activeEditId)&&"rule-setup"!==_.activeEditId||(null===(n=null==_?void 0:_.setActiveEditId)||void 0===n||n.call(_,"rule-setup"),K(null!==(e=V.ruleTitle)&&void 0!==e?e:""),U(V.scopeData?i({},V.scopeData):{}))}(),(null==_?void 0:_.setPendingEditId)&&_.setPendingEditId(null),n||t())},disabled:G,style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",padding:"6px 8px",border:"1px solid #e5e7eb",borderRadius:"8px",cursor:G?"not-allowed":"pointer",backgroundColor:"#ffffff",color:"#6b7280",opacity:G?.5:1}},{children:e(f,{size:14})}))}))},footerData:{ruleTitle:V.ruleTitle,stations:[V.scopeData.station],tiers:null===(T=V.scopeData)||void 0===T?void 0:T.tiers},defaultOpen:"Create"===(null==_?void 0:_.usedFor),readOnly:"Create"!==(null==_?void 0:_.usedFor),isAiStreaming:null==_?void 0:_.isAiStreaming,editFlow:"Edit"===(null==_?void 0:_.usedFor)},{children:n("div",i({style:{display:"flex",flexDirection:"column",gap:"12px"}},{children:[G&&(null==_?void 0:_.isAiStreaming)&&n("div",i({style:{display:"flex",alignItems:"center",color:"#141414ff",fontSize:"13px",fontWeight:500,fontStyle:"italic",marginBottom:"8px",paddingLeft:"4px"}},{children:[e(p,{size:16,style:{marginRight:8,animation:"spin 1s linear infinite"}},"loader"),"Checking the correctness of your Rule Setup..."]})),e(u,i({id:"rule-title",title:_.ruleTitle||"Rule Title",rows:1,placeholder:"Enter a short, descriptive title for the learning",required:!0,value:z&&null!==H?H:V.ruleTitle,onChange:function(i){return z?K(i):R.setRuleTitle(i)},readOnly:(null==_?void 0:_.isAiStreaming)||!z,isOpen:j.ruleTitle,onToggle:function(){return ti("ruleTitle")},isHighlighted:N.ruleTitle||!1,showCognitiveIcon:V.citation.ruleTitle,tooltipDescription:"Why this Title?",errorMessage:null===(D=_.validationErrors)||void 0===D?void 0:D.ruleTitle},_)),V.citation.ruleTitle&&e("div",i({style:li},{children:e(r,{isVisible:j.ruleTitle,citation:V.citation.ruleTitle,citations:oi("ruleTitle"),fieldName:"Rule Title",fieldValue:V.ruleTitle})})),e(c,i({id:"scope",title:"",required:!1,scopeData:z&&null!==J?J:V.scopeData,onScopeChange:function(n,e){z?U(function(t){var o;return i(i({},null!=t?t:V.scopeData),((o={})[n]=e,o))}):R.onScopeChange(n,e)},tierLabel:"Which tiers should this learning apply to?",stationLabel:"Which scope should this learning belong to?",highlights:N,isOpen:j.scopeData,onToggle:function(){return ti("scopeData")},showCognitiveIcon:V.citation.scopeData,cognitiveIcon:e(v,{}),tooltipDescription:"Why this Scope?",errorMessage:(null===(S=_.validationErrors)||void 0===S?void 0:S.station)||(null===(C=_.validationErrors)||void 0===C?void 0:C.tiers),stationErrorMessage:null===(A=_.validationErrors)||void 0===A?void 0:A.station,tierErrorMessage:null===(I=_.validationErrors)||void 0===I?void 0:I.tiers,readOnly:(null==_?void 0:_.isAiStreaming)||!z},_)),V.citation.scopeData&&e("div",i({style:li},{children:e(r,{isVisible:j.scopeData,citation:V.citation.scopeData,citations:oi("scopeData"),fieldName:"Scope",fieldValue:null===(E=null===(b=V.scopeData)||void 0===b?void 0:b.tiers)||void 0===E?void 0:E.join(", ")})})),z?n("div",i({style:{display:"flex",flexDirection:"column",alignItems:"flex-start"}},{children:[n("div",i({style:{display:"flex",justifyContent:"flex-start",alignItems:"center",gap:"16px"}},{children:[e("button",i({onClick:Y,style:{background:"none",border:"none",color:"#6b7280",fontSize:"14px",fontWeight:"500",cursor:"pointer",padding:"0"}},{children:"Discard Changes"})),n("button",i({onClick:ii,style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 16px",borderRadius:"12px",border:"none",backgroundColor:"#2563eb",color:"#ffffff",fontSize:"14px",fontWeight:"500",cursor:"pointer",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.05)"}},{children:[e(g,{size:18,strokeWidth:2.5,color:"#ffffff"}),"Save Changes"]}))]})),"rule-setup"===(null==_?void 0:_.pendingEditId)&&n("div",i({style:{display:"flex",alignItems:"center",gap:"6px",marginTop:"8px"}},{children:[e(h,{style:{color:"#C2410C"}}),e("div",i({style:{display:"flex",color:"#C2410C",fontSize:"13px",paddingTop:"8px",alignItems:"center"}},{children:"Pending - Changes not applied yet. Apply or discard them to continue."}))]}))]})):null]}))}))})),null===(w=null===(O=null==_?void 0:_.tierOptions)||void 0===O?void 0:O.filter(function(i){var n,e;return null===(e=null===(n=V.scopeData)||void 0===n?void 0:n.tiers)||void 0===e?void 0:e.includes(i)}))||void 0===w?void 0:w.map(function(t,o,l){var c,v,p,f,g=t.toLowerCase().replace(/ /g,"_"),h=(null===(c=V.variantsByTier)||void 0===c?void 0:c[g])||[],m=h.length,x=!1;if(1===m){var T=h[0],D=!(null===(v=null==T?void 0:T.ruleDescription)||void 0===v?void 0:v.trim()),S=(null===(p=null==T?void 0:T.whenToApplyConditions)||void 0===p?void 0:p.some(function(i){return(null==i?void 0:i.text)&&""!==i.text.trim()}))||!1,C=(null===(f=null==T?void 0:T.whenNotToApplyConditions)||void 0===f?void 0:f.some(function(i){return(null==i?void 0:i.text)&&""!==i.text.trim()}))||!1;D&&!S&&!C&&(x=!0)}var A=x?void 0:"".concat(m," ").concat(1===m?"variant":"variants"," configured for this tier"),I=!((null==_?void 0:_.defaultTierOpen)>=0)||o===_.defaultTierOpen;return console.log("Rendering tier : ",t),e(s,i({variant:"tier-header",title:{type:"other",label:t},subtitle:A,defaultOpen:I,footerData:{description:"Variants for ".concat(t)}},{children:e(y,i({onAddVariant:function(){var i;return null===(i=R.addNewVariant)||void 0===i?void 0:i.call(R,g)},isDisabled:null==_?void 0:_.isAiStreaming},{children:h.map(function(t,o){var l,c,v,p,f,h,y,m,x,T,D,S=t.variantType||"default",C="".concat(g,"-variant-").concat(o),A=!0===t.is_variant,I="default"===S||"default_variant"===S;(null==_?void 0:_.defaultVariantOpen)>=0&&_.defaultVariantOpen;var b="".concat(g,"_").concat(o),E=W.get(b)||{},O=(null===(c=null===(l=_.separationItemsByTier)||void 0===l?void 0:l[g])||void 0===c?void 0:c.get(o))||[],w=(null===(p=null===(v=_.togglesByTier)||void 0===v?void 0:v[g])||void 0===p?void 0:p.get(o))||[];(null==_?void 0:_.autoScrollVariantIndex)===o||t.is_variant,console.log("Rendering ".concat(g," variant ").concat(o,":"),t),console.log("Rendering Variant : ",t),console.log("Open Accordion ID:",B,"Current Variant ID:",C);var N=null===(f=null==_?void 0:_.activeEditId)||void 0===f?void 0:f.startsWith("condition-wta-".concat(g,"-").concat(o)),M=null===(h=null==_?void 0:_.activeEditId)||void 0===h?void 0:h.startsWith("condition-wnta-".concat(g,"-").concat(o));return e("div",i({ref:function(i){i?q.current.set(C,i):q.current.delete(C)},style:{width:"100%"}},{children:e(s,i({title:{type:I?"default":"variant",label:ri(S),number:o+1,isNewVariant:A,isDefault:t.isDefault,isModified:t.isModified},defaultOpen:!0,expanded:B===C,onToggle:function(){var i,n=B===C;console.log("is closing:",n),L(n?null:C),null===(i=null==_?void 0:_.setActiveVariantAccordionIndex)||void 0===i||i.call(_,n?null:o)},variant:"rule-behavior",footerData:{ruleTitle:S,description:t.ruleDescription||""}},{children:n("div",i({style:{display:"flex",flexDirection:"column",gap:"12px"}},{children:[e(u,i({id:"rule-description-".concat(g,"-").concat(o),title:_.ruleDescriptionTitle||"Rule Description",rows:2,placeholder:"Explain the learning behaviour",required:!0,readOnly:t.isReadOnly||(null==_?void 0:_.isAiStreaming)||ai&&(null==_?void 0:_.activeEditId)!=="rule-description-".concat(g,"-").concat(o),value:t.ruleDescription||"",onChange:function(i){return R.setRuleDescription(g,o,i)},isOpen:j["ruleDescription-".concat(g)],onToggle:function(){return ti("ruleDescription-".concat(g))},isHighlighted:E.ruleDescription||!1,showCognitiveIcon:null===(y=V.citation)||void 0===y?void 0:y["ruleDescription_".concat(g)],tooltipDescription:"Why this Description?",errorMessage:null===(m=_.validationErrors)||void 0===m?void 0:m["ruleDescription-".concat(g,"-").concat(o)],enableInlineEdit:!0,setSendMessageInChat:null==_?void 0:_.setSendMessageInChat,isAiStreaming:null==_?void 0:_.isAiStreaming,fieldName:"Rule Description"},_)),(null===(x=V.citation)||void 0===x?void 0:x["ruleDescription_".concat(g)])&&e("div",i({style:li},{children:e(r,{isVisible:j["ruleDescription-".concat(g)],citation:V.citation["ruleDescription_".concat(g)],citations:oi("ruleDescription_".concat(g,"_").concat(o)),fieldName:"Rule Description",fieldValue:t.ruleDescription})})),e(a,i({id:"when-to-apply-".concat(g,"-").concat(o),idPrefix:"condition-wta",title:_.whenToApplyTitle||"When to apply",required:!0,dividerRequired:!0,readOnly:t.isReadOnly||(null==_?void 0:_.isAiStreaming)||ai&&!N,conditions:t.whenToApplyConditions||[],onAdd:function(){return R.addWhenToApply(g,o)},onRemove:function(i,n,e){return R.removeWhenToApply(i,n,e)},onEdit:function(i,n,e,t){return R.editWhenToApply(i,n,e,t)},index:o,tierKey:g,isHighlighted:E.wta||!1,highlightedIds:null==_?void 0:_.highlightedIds,tooltipDescription:"Why this Condition?",citations:oi("whenToApply_".concat(g,"_").concat(o)),bordered:!0,addLabel:"Add When to apply",isAiStreaming:_.isAiStreaming,errorMessage:(null===(T=_.validationErrors)||void 0===T?void 0:T["whenToApply-".concat(g,"-").concat(o)])||(null==_?void 0:_.conflictReason)},_)),e(a,i({id:"when-not-to-apply-".concat(g,"-").concat(o),idPrefix:"condition-wnta",title:_.whenNotToApplyTitle||"When NOT to apply",required:!1,dividerRequired:!0,readOnly:t.isReadOnly||(null==_?void 0:_.isAiStreaming)||ai&&!M,conditions:t.whenNotToApplyConditions||[],onAdd:function(){return R.addWhenNotToApply(g,o)},onRemove:function(i,n,e){return R.removeWhenNotToApply(i,n,e)},onEdit:function(i,n,e,t){return R.editWhenNotToApply(i,n,e,t)},index:o,tierKey:g,isHighlighted:E.wnta||!1,highlightedIds:null==_?void 0:_.highlightedIds,tooltipDescription:"Why this Condition?",citations:oi("whenNotToApply_".concat(g,"_").concat(o)),bordered:!0,addLabel:"Add When NOT to apply",isAiStreaming:_.isAiStreaming},_)),e(d,i({id:"config-".concat(g,"-").concat(o),title:_.configTitle||"Configuration",required:!1,highlights:E,bordered:!0,readOnly:t.isReadOnly||(null==_?void 0:_.isAiStreaming)||ai&&(null==_?void 0:_.activeEditId)!=="config-".concat(g,"-").concat(o),onConfigChange:function(i,n){return R.onConfigChange(g,o,i,n)},separationItems:O,toggles:w,index:o},_)),(null===(D=t.reasoning)||void 0===D?void 0:D.configData)&&e("div",i({style:li},{children:e(r,{citation:t.reasoning.configData,citations:oi("configData_".concat(g,"_").concat(o)),fieldName:"Configuration",fieldValue:"Proposed Configuration"})}))]}))}),C)}),"".concat(g,"-variant-").concat(o))})}))}),"tier-".concat(o))})]}))};export{m as CreateRule};
2
2
  //# sourceMappingURL=CreateRule.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ILOTJTest.d.ts","sourceRoot":"","sources":["../../../../../src/features/IL-OTJ/ILOTJTest.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAKjF,OAAO,EAA2E,oBAAoB,EAAuB,MAAM,iBAAiB,CAAC;AAWrJ,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;AAEzE,UAAU,UAAU;CACnB;AAKD,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAKD,eAAO,MAAM,cAAc,YAAmB,qBAAqB,iBASlE,CAAC;AAEF,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAq0EnC,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"ILOTJTest.d.ts","sourceRoot":"","sources":["../../../../../src/features/IL-OTJ/ILOTJTest.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAKjF,OAAO,EAA2E,oBAAoB,EAAuB,MAAM,iBAAiB,CAAC;AAWrJ,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;AAEzE,UAAU,UAAU;CACnB;AAKD,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAKD,eAAO,MAAM,cAAc,YAAmB,qBAAqB,iBASlE,CAAC;AAEF,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAqzEnC,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -4,7 +4,8 @@ interface ConflictReasoningCardProps {
4
4
  decisionStrength?: string | null;
5
5
  reasoning?: string | null;
6
6
  gap?: string | null;
7
+ citations?: any[];
7
8
  }
8
- export declare const ConflictReasoningCard: React.MemoExoticComponent<({ isVisible, decisionStrength, reasoning, gap }: ConflictReasoningCardProps) => import("react/jsx-runtime").JSX.Element | null>;
9
+ export declare const ConflictReasoningCard: React.MemoExoticComponent<({ isVisible, decisionStrength, reasoning, gap, citations }: ConflictReasoningCardProps) => import("react/jsx-runtime").JSX.Element | null>;
9
10
  export {};
10
11
  //# sourceMappingURL=ConflictingReasoningCard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConflictingReasoningCard.d.ts","sourceRoot":"","sources":["../../../../../../src/features/IL-OTJ/_components/ConflictingReasoningCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkC,MAAM,OAAO,CAAC;AAWvD,UAAU,0BAA0B;IAClC,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,qBAAqB,8EAK/B,0BAA0B,oDAuI3B,CAAC"}
1
+ {"version":3,"file":"ConflictingReasoningCard.d.ts","sourceRoot":"","sources":["../../../../../../src/features/IL-OTJ/_components/ConflictingReasoningCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAapE,UAAU,0BAA0B;IAClC,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,GAAG,EAAE,CAAC;CACnB;AAED,eAAO,MAAM,qBAAqB,yFAM/B,0BAA0B,oDA0K3B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"MarkdownElements.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/IL-OTJ/_components/MarkdownComponents/MarkdownElements.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAYvE,UAAU,qBAAqB;IAC3B,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB;AAED,UAAU,gBAAiB,SAAQ,qBAAqB;IACpD,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACzB,SAAS,EAAE,GAAG,EAAE,CAAC;IACjB,iBAAiB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,KAAK,IAAI,CAAC;IACpF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IACxD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAE;IAC/B,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC,qBAAqB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACvE,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,UAAU,iBAAkB,SAAQ,qBAAqB;IACrD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC7B,mBAAmB,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,GAAG,CAAC;IAC1D,iBAAiB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,KAAK,IAAI,CAAC;CACvF;AAsCD,eAAO,MAAM,gBAAgB,SAAU,MAAM,KAAG,MAI/C,CAAC;AAwFF,eAAO,MAAM,mBAAmB,yQAgB7B,gBAAgB,oDAsRjB,CAAC;AAEH,eAAO,MAAM,oBAAoB,oKAY5B,gBAAgB,oDAuKpB,CAAC;AAEF,eAAO,MAAM,oBAAoB,8HAQ9B,iBAAiB,6CA0ClB,CAAC"}
1
+ {"version":3,"file":"MarkdownElements.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/IL-OTJ/_components/MarkdownComponents/MarkdownElements.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAYvE,UAAU,qBAAqB;IAC3B,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB;AAED,UAAU,gBAAiB,SAAQ,qBAAqB;IACpD,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACzB,SAAS,EAAE,GAAG,EAAE,CAAC;IACjB,iBAAiB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,KAAK,IAAI,CAAC;IACpF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IACxD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAE;IAC/B,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC,qBAAqB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACvE,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,UAAU,iBAAkB,SAAQ,qBAAqB;IACrD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC7B,mBAAmB,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,GAAG,CAAC;IAC1D,iBAAiB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,KAAK,IAAI,CAAC;CACvF;AAuCD,eAAO,MAAM,gBAAgB,SAAU,MAAM,KAAG,MAI/C,CAAC;AAwFF,eAAO,MAAM,mBAAmB,yQAgB7B,gBAAgB,oDAsRjB,CAAC;AAEH,eAAO,MAAM,oBAAoB,oKAY5B,gBAAgB,oDAuKpB,CAAC;AAEF,eAAO,MAAM,oBAAoB,8HAQ9B,iBAAiB,6CA0ClB,CAAC"}
@@ -22,5 +22,6 @@ export declare const Textarea: import("react").ForwardRefExoticComponent<{
22
22
  conflictingGap?: string | null | undefined;
23
23
  errorMessage?: string | undefined;
24
24
  inputReadOnly?: boolean | undefined;
25
+ citations?: any[] | undefined;
25
26
  } & import("react").RefAttributes<unknown>>;
26
27
  //# sourceMappingURL=Textarea.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/IL-OTJ/_components/atoms/Textarea/Textarea.tsx"],"names":[],"mappings":";AAMA,eAAO,MAAM,QAAQ;;;WA0BZ,MAAM;kBACC,MAAM,WAAW,CAAC,mBAAmB,CAAC,KAAK,IAAI;mBAC/C,gBAAgB,CAAC,mBAAmB,CAAC,KAAK,IAAI;;;;;;;sBAO3C,IAAI;;oBAEL,MAAM,SAAS;;;;;;;;;2CAkN/B,CAAC"}
1
+ {"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/IL-OTJ/_components/atoms/Textarea/Textarea.tsx"],"names":[],"mappings":";AAMA,eAAO,MAAM,QAAQ;;;WA2BZ,MAAM;kBACC,MAAM,WAAW,CAAC,mBAAmB,CAAC,KAAK,IAAI;mBAC/C,gBAAgB,CAAC,mBAAmB,CAAC,KAAK,IAAI;;;;;;;sBAO3C,IAAI;;oBAEL,MAAM,SAAS;;;;;;;;;;2CAoN/B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ConditionList.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/IL-OTJ/_components/molecules/Condition/ConditionList.tsx"],"names":[],"mappings":";AAQA,UAAU,QAAQ;IAChB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,GAAG,CAAC;CAChB;AAED,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,KAAK,IAAI,CAAC;IAC5D,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxE,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACtC,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,EAAE,GAAG,EAAE,CAAC;IAClB,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC9C,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,gBAAgB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAChD;AAED,eAAO,MAAM,aAAa,uSAwBvB,kBAAkB,4CA+VpB,CAAC"}
1
+ {"version":3,"file":"ConditionList.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/IL-OTJ/_components/molecules/Condition/ConditionList.tsx"],"names":[],"mappings":";AAQA,UAAU,QAAQ;IAChB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,GAAG,CAAC;CAChB;AAED,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,KAAK,IAAI,CAAC;IAC5D,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxE,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACtC,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,EAAE,GAAG,EAAE,CAAC;IAClB,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC9C,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,gBAAgB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAChD;AAED,eAAO,MAAM,aAAa,uSAwBvB,kBAAkB,4CAoVpB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigSection.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/IL-OTJ/_components/organisms/ConfigSection/ConfigSection.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkB,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAM9F,UAAU,cAAc;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,6BAA6B,EAAE,MAAM,CAAC;CACvC;AAED,UAAU,UAAU;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,UAAU,kBAAmB,SAAQ,IAAI,CAAC,mBAAmB,EAAE,UAAU,CAAC;IACxE,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;IACnC,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC9C,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,gBAAgB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/C,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAChD;AAED,eAAO,MAAM,aAAa,uOAiBvB,kBAAkB,4CAgSpB,CAAC"}
1
+ {"version":3,"file":"ConfigSection.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/IL-OTJ/_components/organisms/ConfigSection/ConfigSection.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkB,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAM9F,UAAU,cAAc;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,6BAA6B,EAAE,MAAM,CAAC;CACvC;AAED,UAAU,UAAU;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,UAAU,kBAAmB,SAAQ,IAAI,CAAC,mBAAmB,EAAE,UAAU,CAAC;IACxE,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;IACnC,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC9C,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,gBAAgB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/C,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAChD;AAED,eAAO,MAAM,aAAa,uOAiBvB,kBAAkB,4CAuRpB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"TextSection.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/IL-OTJ/_components/organisms/TextSection/TextSection.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,WAAW,kSAuBrB,GAAG,4CAuLL,CAAC"}
1
+ {"version":3,"file":"TextSection.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/IL-OTJ/_components/organisms/TextSection/TextSection.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,WAAW,kSAuBrB,GAAG,4CAgLL,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CreateRule.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/IL-OTJ/_components/templates/TrafficManager/CreateRule.tsx"],"names":[],"mappings":"AAoDA,eAAO,MAAM,UAAU,iCAAkC,GAAG,4CA8rB3D,CAAC"}
1
+ {"version":3,"file":"CreateRule.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/IL-OTJ/_components/templates/TrafficManager/CreateRule.tsx"],"names":[],"mappings":"AAoDA,eAAO,MAAM,UAAU,iCAAkC,GAAG,4CAyoB3D,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-llm-studio/instant-learning",
3
- "version": "0.0.281",
3
+ "version": "0.0.283",
4
4
  "author": "Devesh Patel",
5
5
  "description": "",
6
6
  "license": "MIT",