@e-llm-studio/instant-learning 0.0.126 → 0.0.128

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 (28) hide show
  1. package/dist/cjs/features/IL-OTJ/ILOTJ.js +1 -1
  2. package/dist/cjs/features/IL-OTJ/_components/ChatComponents/ChatComponent.js +1 -1
  3. package/dist/cjs/features/IL-OTJ/_components/ILPopup.js +1 -1
  4. package/dist/cjs/features/IL-OTJ/_components/MessageRendering/MarkdownElements.js +1 -1
  5. package/dist/cjs/features/IL-OTJ/_components/MessageRendering/MessageRendering.js +1 -1
  6. package/dist/cjs/features/IL-OTJ/_components/RuleValidationCard.js +1 -1
  7. package/dist/cjs/features/IL-OTJ/_components/atoms/Textarea/Textarea.js +1 -1
  8. package/dist/cjs/features/IL-OTJ/_components/molecules/Sections/SectionWrapper.js +1 -1
  9. package/dist/features/IL-OTJ/ILOTJ.js +1 -1
  10. package/dist/features/IL-OTJ/_components/ChatComponents/ChatComponent.js +1 -1
  11. package/dist/features/IL-OTJ/_components/ILPopup.js +1 -1
  12. package/dist/features/IL-OTJ/_components/MessageRendering/MarkdownElements.js +1 -1
  13. package/dist/features/IL-OTJ/_components/MessageRendering/MessageRendering.js +1 -1
  14. package/dist/features/IL-OTJ/_components/RuleValidationCard.js +1 -1
  15. package/dist/features/IL-OTJ/_components/atoms/Textarea/Textarea.js +1 -1
  16. package/dist/features/IL-OTJ/_components/molecules/Sections/SectionWrapper.js +1 -1
  17. package/dist/types/src/features/IL-OTJ/ILOTJ.d.ts +2 -0
  18. package/dist/types/src/features/IL-OTJ/ILOTJ.d.ts.map +1 -1
  19. package/dist/types/src/features/IL-OTJ/ILOTJTest.d.ts.map +1 -1
  20. package/dist/types/src/features/IL-OTJ/_components/ChatComponents/ChatComponent.d.ts +2 -0
  21. package/dist/types/src/features/IL-OTJ/_components/ChatComponents/ChatComponent.d.ts.map +1 -1
  22. package/dist/types/src/features/IL-OTJ/_components/ILPopup.d.ts +3 -1
  23. package/dist/types/src/features/IL-OTJ/_components/ILPopup.d.ts.map +1 -1
  24. package/dist/types/src/features/IL-OTJ/_components/MessageRendering/MarkdownElements.d.ts.map +1 -1
  25. package/dist/types/src/features/IL-OTJ/_components/MessageRendering/MessageRendering.d.ts.map +1 -1
  26. package/dist/types/src/features/IL-OTJ/_components/RuleValidationCard.d.ts +1 -0
  27. package/dist/types/src/features/IL-OTJ/_components/RuleValidationCard.d.ts.map +1 -1
  28. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../node_modules/tslib/tslib.es6.mjs.js"),n=require("react/jsx-runtime"),t=require("../../../../node_modules/react-markdown/lib/react-markdown.js"),r=require("../../../../node_modules/rehype-raw/lib/index.js"),a=require("../../../../node_modules/remark-gfm/index.js"),i=require("react"),s=require("./ClickableChatComponents.js"),o=require("./MarkdownElements.js"),c=require("../../helpers/utils.js");exports.default=function(l){var d=l.index,u=l.content,m=l.role;l.messages;var g=l.handleStream,f=l.scrollToBottom,p=l.isLastMessage,h=l.onSave,v=l.citations,S=l.setChatSize,_=l.chatSize,b=l.isStreamEnd,x=i.useState(u),w=x[0],k=x[1],y=i.useState([]),j=y[0],C=y[1],T=i.useState(!1),M=T[0],E=T[1],B=i.useState(!1),L=B[0],I=B[1],z=i.useState(new Set),q=z[0],D=z[1],N=i.useState(new Set),R=N[0],W=N[1],A=i.useRef({handleStream:g,onSave:h,selectedTiers:j,tiersSubmitted:L,citations:v,openCardIds:q,openCitationIds:R,chatSize:_,isLastMessage:p,scrollToBottom:f,isStreamEnd:b});A.current={handleStream:g,onSave:h,selectedTiers:j,tiersSubmitted:L,citations:v,openCardIds:q,openCitationIds:R,chatSize:_,isLastMessage:p,scrollToBottom:f,isStreamEnd:b};var P=i.useCallback(function(e,n,t){var r=function(t){var r=new Set(t);return n?r.add(e):r.delete(e),r};"card"===t?D(function(e){return r(e)}):W(function(e){return r(e)})},[]),F=i.useCallback(function(e){var n=A.current,t=n.handleStream,r=n.onSave,a=e.trim();"save this learning"===a.toLowerCase()&&r?r():t&&t(new KeyboardEvent("keydown",{key:"Enter"}),!1,a),k(function(e){return e.replace(/<button([^>]*)class=["']clickable-button["']([^>]*)>([\s\S]*?)<\/button>/gi,function(e,n,t,r){var i=r.trim(),s='data-selected="'.concat(i===a,'"');return"<button".concat(n,'class="clickable-button" ').concat(s).concat(t,">").concat(r,"</button>")})})},[]),$=i.useCallback(function(e,n){var t=A.current.citations;return t&&t.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},[]),H=i.useCallback(function(n,t){var r=A.current.scrollToBottom,a=Array.isArray(n)?n[0].trim():n.trim();E(!0),C(function(n){var r=e.__spreadArray([],n,!0);if(["both tiers","all tiers"].includes(a.toLowerCase()))r=t?["Both Tiers","Tier 1","Tier 2"]:[];else{t?r.includes(a)||r.push(a):r=r.filter(function(e){return e!==a});var i=r.includes("Tier 1"),s=r.includes("Tier 2");i&&s?r.includes("Both Tiers")||r.push("Both Tiers"):r=r.filter(function(e){return!["Both Tiers","All tiers"].includes(e)})}return r.filter(function(e,n){return r.indexOf(e)===n})}),null==r||r()},[]),J=i.useCallback(function(){var e=A.current,n=e.handleStream,t=e.selectedTiers,r=t.join(" and ");t.some(function(e){return"both tiers"===e.toLowerCase()||"all tiers"===e.toLowerCase()})&&(r="Both Tiers"),n(new KeyboardEvent("keydown",{key:"Enter"}),!1,"".concat(r)),I(!0),E(!1),k(function(e){return e.replace(/<checkbox\s+class=["']clickable-box["'][^>]*>([\s\S]*?)<\/checkbox>/gi,function(e,n){var r=n.trim();return t.includes(r)?e:""})})},[]),K=i.useMemo(function(){return{p:function(t){t.node;var r=e.__rest(t,["node"]);return n.jsx("span",e.__assign({},r,{style:{maxWidth:"100%",wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word",whiteSpace:"normal",overflow:"hidden",display:"block",fontSize:"1rem",lineHeight:"1.625rem",marginBottom:"user"===m?"0":"1rem"}},{children:null==r?void 0:r.children}))},code:function(t){t.node;var r=e.__rest(t,["node"]);return n.jsx("span",e.__assign({},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(t){t.node;var r=e.__rest(t,["node"]);return n.jsx("ol",e.__assign({},r,{style:{display:"flex",flexDirection:"column",gap:"1rem",listStyle:"decimal",paddingLeft:"2.5rem"}},{children:null==r?void 0:r.children}))},ul:function(t){t.node;var r=e.__rest(t,["node"]);return n.jsx("ul",e.__assign({},r,{style:{display:"flex",flexDirection:"column",gap:"1rem",listStyle:"decimal",paddingLeft:"2.5rem"}},{children:null==r?void 0:r.children}))},rule:function(t){t.node;var r=e.__rest(t,["node"]);return n.jsx(s.RuleDisplay,{content:c.extractTextFromChildren(r.children)})},button:function(t){var r=t.node,a=t.className,i=e.__rest(t,["node","className"]),o=A.current,c=o.isLastMessage,l=o.handleStream,d=o.isStreamEnd;return n.jsx(s.ActionableButton,e.__assign({node:r,className:a||i.class,handleStream:l,onAction:F,disabled:!c,isStreamEnd:d},i))},checkbox:function(t){var r=t.node,a=t.className,i=e.__rest(t,["node","className"]),o=A.current,c=o.selectedTiers,l=o.tiersSubmitted,d=o.isLastMessage;return n.jsx(s.ActionableCheckbox,e.__assign({node:r,className:a||i.class,selectedItems:c,onToggle:H,isSubmitted:l,disabled:!d},i))},a:function(t){var r=A.current,a=r.chatSize,i=r.openCitationIds;return n.jsx(o.MarkdownLinkRenderer,e.__assign({},t,{chatSize:a,openCitationIds:i,getCitationByNumber:$,handleToggleState:P,isStreamEnd:A.current.isStreamEnd}))},div:function(t){var r=A.current,a=r.openCardIds,i=r.citations,s=r.isLastMessage,c=r.isStreamEnd,l=!s||c;return"rule-validation-card-trigger"===t.className?n.jsx(o.MarkdownDivRenderer,e.__assign({},t)):n.jsx(o.MarkdownDivRenderer,e.__assign({},t,{openCardIds:a,citations:i,handleToggleState:P,isStreamEnd:l}))},span:function(t){var r;if(null===(r=t.className)||void 0===r?void 0:r.includes("cognitive-card-trigger")){var a=A.current,i=a.openCardIds,s=a.citations,c=a.isLastMessage,l=a.isStreamEnd,d=!c||l;return n.jsx(o.MarkdownSpanRenderer,e.__assign({},t,{openCardIds:i,citations:s,handleToggleState:P,isStreamEnd:d}))}return n.jsx("span",e.__assign({},t))},br:function(t){return n.jsx("p",e.__assign({style:{marginBottom:"0.75rem"}},t))}}},[F,H,$,P,m]);i.useEffect(function(){L||(k(u),setTimeout(function(){null==f||f()},50))},[u,L,f]);var O=i.useRef(0);i.useEffect(function(){var e=q.size+R.size;e>0&&0===O.current?null==S||S(50):0===e&&O.current>0&&(null==S||S(40)),O.current=e},[q,R,S]);var U=i.useMemo(function(){return[r.default]},[]),Y=i.useMemo(function(){return[a.default]},[]);return n.jsxs(n.Fragment,{children:[n.jsx("div",e.__assign({style:{lineHeight:"1.625rem",fontSize:"1rem",marginTop:"0.5rem",marginBottom:"".concat("assistant"===m?"1rem":"0rem"),fontFamily:"Plus Jakarta Sans, sans-serif"}},{children:n.jsx(t.ReactMarkdown,e.__assign({components:K,rehypePlugins:U,remarkPlugins:Y},{children:function(e){if(!e)return"";var n=e.replace(/\\"/g,'"').replace(/\\'/g,"'");n=(n=(n=(n=n.replace(/```(?:\w+)?\n?([\s\S]*?)```/gi,"$1")).replace(/<br\s*\/?>/gi,"\n\n")).replace(/<rule-validation-card\s+([\s\S]*?)>([\s\S]*?)<\/rule-validation-card>/gi,function(e,n){for(var t,r={},a=/([a-z0-9-]+)\s*=\s*(["'])([\s\S]*?)\2(?=\s|>|$)/gi;null!==(t=a.exec(n));)r[t[1]]=t[3];var i=function(e){return(r[e]||"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")};return'\n\n<div class="rule-validation-card-trigger" \n data-type="'.concat(i("validationType"),'"\n data-title="').concat(i("ruleTitle"),'"\n data-description="').concat(i("ruleDescription"),'"\n data-scope="').concat(i("scope"),'"\n data-wta="').concat(i("wta"),'"\n data-wnta="').concat(i("wnta"),'"\n data-whyissue="').concat(i("whyIssue"),'"></div>\n\n')})).replace(/<!--<ai_reasoning>(?![\s\S]*?<\/ai_reasoning>-->)[\s\S]*$/gi,"");["ai_reasoning"].forEach(function(e){var t=new RegExp("\x3c!--\\s*(<".concat(e,">[\\s\\S]*?<\\/").concat(e,">)\\s*--\x3e"),"gi");n=n.replace(t,"$1")});var t=0;n=n.replace(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/gi,function(e,n){var r=n.replace(/\[([^\]]+)\]\(([^)]+)\)/g,function(e,n,t){return'<a href="'.concat(t,'" data-shielded="true">').concat(n,"</a>")});return r=r.replace(/</g,"&lt;").replace(/>/g,"&gt;"),t++,'<span class="cognitive-card-trigger" data-card-id="card-'.concat(t,'">').concat(r,"</span>")});var r=0;return n.replace(/(\[[^\]]+\]\()([^)]+)(\))/g,function(e,n,t,a){var i=t.replace(/\s/g,"%20");if(i.includes("citationNumber=")){r++;var s=i.includes("?")?"&":"?";return"".concat(n).concat(i).concat(s,"uiUniqueId=").concat(r).concat(a)}return"".concat(n).concat(i).concat(a)})}(w)}),d)})),n.jsx("div",e.__assign({style:{display:"flex",maxWidth:"100%"}},{children:n.jsx("div",e.__assign({style:{width:"100%"}},{children:(null==j?void 0:j.length)>0&&M&&!L?n.jsxs("div",e.__assign({style:{marginTop:"10px"}},{children:[n.jsxs("span",{children:["It looks like you've chosen ",j&&0!==j.length?j.some(function(e){return"both tiers"===e.toLowerCase()||"all tiers"===e.toLowerCase()})?"Both Tiers":j.join(", "):"",". Would you like me to proceed?"]}),n.jsx("p",{children:n.jsx("button",e.__assign({style:{padding:"0.5rem 1rem",margin:"0.5rem 0",backgroundColor:"#2661eb",color:"white",border:"none",borderRadius:"8px",cursor:"pointer",fontSize:"0.75rem",fontWeight:"500",fontFamily:"Plus Jakarta Sans, sans-serif"},onClick:J},{children:"Yes"}))})]})):null}))}))]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../node_modules/tslib/tslib.es6.mjs.js"),n=require("react/jsx-runtime"),t=require("../../../../node_modules/react-markdown/lib/react-markdown.js"),r=require("../../../../node_modules/rehype-raw/lib/index.js"),a=require("../../../../node_modules/remark-gfm/index.js"),i=require("react"),s=require("./ClickableChatComponents.js"),o=require("./MarkdownElements.js"),c=require("../../helpers/utils.js");exports.default=function(l){var d=l.index,u=l.content,m=l.role;l.messages;var g=l.handleStream,f=l.scrollToBottom,p=l.isLastMessage,h=l.onSave,v=l.citations,S=l.setChatSize,_=l.chatSize,b=l.isStreamEnd,x=i.useState(u),w=x[0],k=x[1],y=i.useState([]),j=y[0],C=y[1],T=i.useState(!1),M=T[0],E=T[1],B=i.useState(!1),L=B[0],I=B[1],z=i.useState(new Set),q=z[0],D=z[1],N=i.useState(new Set),R=N[0],W=N[1],A=i.useRef({handleStream:g,onSave:h,selectedTiers:j,tiersSubmitted:L,citations:v,openCardIds:q,openCitationIds:R,chatSize:_,isLastMessage:p,scrollToBottom:f,isStreamEnd:b});A.current={handleStream:g,onSave:h,selectedTiers:j,tiersSubmitted:L,citations:v,openCardIds:q,openCitationIds:R,chatSize:_,isLastMessage:p,scrollToBottom:f,isStreamEnd:b};var P=i.useCallback(function(e,n,t){var r=function(t){var r=new Set(t);return n?r.add(e):r.delete(e),r};"card"===t?D(function(e){return r(e)}):W(function(e){return r(e)})},[]),F=i.useCallback(function(e){var n=A.current,t=n.handleStream,r=n.onSave,a=e.trim();"save this learning"===a.toLowerCase()&&r?r():t&&t(new KeyboardEvent("keydown",{key:"Enter"}),!1,a),k(function(e){return e.replace(/<button([^>]*)class=["']clickable-button["']([^>]*)>([\s\S]*?)<\/button>/gi,function(e,n,t,r){var i=r.trim(),s='data-selected="'.concat(i===a,'"');return"<button".concat(n,'class="clickable-button" ').concat(s).concat(t,">").concat(r,"</button>")})})},[]),$=i.useCallback(function(e,n){var t=A.current.citations;return t&&t.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},[]),H=i.useCallback(function(n,t){var r=A.current.scrollToBottom,a=Array.isArray(n)?n[0].trim():n.trim();E(!0),C(function(n){var r=e.__spreadArray([],n,!0);if(["both tiers","all tiers"].includes(a.toLowerCase()))r=t?["Both Tiers","Tier 1","Tier 2"]:[];else{t?r.includes(a)||r.push(a):r=r.filter(function(e){return e!==a});var i=r.includes("Tier 1"),s=r.includes("Tier 2");i&&s?r.includes("Both Tiers")||r.push("Both Tiers"):r=r.filter(function(e){return!["Both Tiers","All tiers"].includes(e)})}return r.filter(function(e,n){return r.indexOf(e)===n})}),null==r||r()},[]),J=i.useCallback(function(){var e=A.current,n=e.handleStream,t=e.selectedTiers,r=t.join(" and ");t.some(function(e){return"both tiers"===e.toLowerCase()||"all tiers"===e.toLowerCase()})&&(r="Both Tiers"),n(new KeyboardEvent("keydown",{key:"Enter"}),!1,"".concat(r)),I(!0),E(!1),k(function(e){return e.replace(/<checkbox\s+class=["']clickable-box["'][^>]*>([\s\S]*?)<\/checkbox>/gi,function(e,n){var r=n.trim();return t.includes(r)?e:""})})},[]),K=i.useMemo(function(){return{p:function(t){t.node;var r=e.__rest(t,["node"]);return n.jsx("span",e.__assign({},r,{style:{maxWidth:"100%",wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word",whiteSpace:"normal",overflow:"hidden",display:"block",fontSize:"1rem",lineHeight:"1.625rem",marginBottom:"user"===m?"0":"1rem"}},{children:null==r?void 0:r.children}))},code:function(t){t.node;var r=e.__rest(t,["node"]);return n.jsx("span",e.__assign({},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(t){t.node;var r=e.__rest(t,["node"]);return n.jsx("ol",e.__assign({},r,{style:{display:"flex",flexDirection:"column",gap:"1rem",listStyle:"decimal",paddingLeft:"2.5rem"}},{children:null==r?void 0:r.children}))},ul:function(t){t.node;var r=e.__rest(t,["node"]);return n.jsx("ul",e.__assign({},r,{style:{display:"flex",flexDirection:"column",gap:"1rem",listStyle:"decimal",paddingLeft:"2.5rem"}},{children:null==r?void 0:r.children}))},rule:function(t){t.node;var r=e.__rest(t,["node"]);return n.jsx(s.RuleDisplay,{content:c.extractTextFromChildren(r.children)})},button:function(t){var r=t.node,a=t.className,i=e.__rest(t,["node","className"]),o=A.current,c=o.isLastMessage,l=o.handleStream,d=o.isStreamEnd;return n.jsx(s.ActionableButton,e.__assign({node:r,className:a||i.class,handleStream:l,onAction:F,disabled:!c,isStreamEnd:d},i))},checkbox:function(t){var r=t.node,a=t.className,i=e.__rest(t,["node","className"]),o=A.current,c=o.selectedTiers,l=o.tiersSubmitted,d=o.isLastMessage;return n.jsx(s.ActionableCheckbox,e.__assign({node:r,className:a||i.class,selectedItems:c,onToggle:H,isSubmitted:l,disabled:!d},i))},a:function(t){var r=A.current,a=r.chatSize,i=r.openCitationIds;return n.jsx(o.MarkdownLinkRenderer,e.__assign({},t,{chatSize:a,openCitationIds:i,getCitationByNumber:$,handleToggleState:P,isStreamEnd:A.current.isStreamEnd}))},div:function(t){var r=A.current,a=r.openCardIds,i=r.citations,s=r.isLastMessage,c=r.isStreamEnd,l=!s||c;return"rule-validation-card-trigger"===t.className?n.jsx(o.MarkdownDivRenderer,e.__assign({},t)):n.jsx(o.MarkdownDivRenderer,e.__assign({},t,{openCardIds:a,citations:i,handleToggleState:P,isStreamEnd:l}))},span:function(t){var r;if(null===(r=t.className)||void 0===r?void 0:r.includes("cognitive-card-trigger")){var a=A.current,i=a.openCardIds,s=a.citations,c=a.isLastMessage,l=a.isStreamEnd,d=!c||l;return n.jsx(o.MarkdownSpanRenderer,e.__assign({},t,{openCardIds:i,citations:s,handleToggleState:P,isStreamEnd:d}))}return n.jsx("span",e.__assign({},t))},br:function(t){return n.jsx("p",e.__assign({style:{marginBottom:"0.75rem"}},t))}}},[F,H,$,P,m]);i.useEffect(function(){L||(k(u),setTimeout(function(){null==f||f()},50))},[u,L,f]);var O=i.useRef(0);i.useEffect(function(){var e=q.size+R.size;e>0&&0===O.current?null==S||S(50):0===e&&O.current>0&&(null==S||S(40)),O.current=e},[q,R,S]);var U=i.useMemo(function(){return[r.default]},[]),Y=i.useMemo(function(){return[a.default]},[]);return n.jsxs(n.Fragment,{children:[n.jsx("div",e.__assign({style:{lineHeight:"1.625rem",fontSize:"1rem",marginTop:"0.5rem",marginBottom:"".concat("assistant"===m?"1rem":"0rem"),fontFamily:"Plus Jakarta Sans, sans-serif"}},{children:n.jsx(t.ReactMarkdown,e.__assign({components:K,rehypePlugins:U,remarkPlugins:Y},{children:function(e){if(!e)return"";var n=e.replace(/\\"/g,'"').replace(/\\'/g,"'");n=(n=(n=(n=n.replace(/```(?:\w+)?\n?([\s\S]*?)```/gi,"$1")).replace(/<br\s*\/?>/gi,"\n\n")).replace(/<rule-validation-card\s+([\s\S]*?)>([\s\S]*?)<\/rule-validation-card>/gi,function(e,n){for(var t,r={},a=/([a-z0-9-]+)\s*=\s*(["'])([\s\S]*?)\2(?=\s|>|$)/gi;null!==(t=a.exec(n));)r[t[1]]=t[3];var i=function(e){return(r[e]||"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")};return'\n\n<div class="rule-validation-card-trigger" \n data-type="'.concat(i("validationType"),'"\n data-decision-strength="').concat(i("decisionStrength"),'"\n data-title="').concat(i("ruleTitle"),'"\n data-description="').concat(i("ruleDescription"),'"\n data-scope="').concat(i("scope"),'"\n data-wta="').concat(i("wta"),'"\n data-wnta="').concat(i("wnta"),'"\n data-whyissue="').concat(i("whyIssue"),'"></div>\n\n')})).replace(/<!--<ai_reasoning>(?![\s\S]*?<\/ai_reasoning>-->)[\s\S]*$/gi,"");["ai_reasoning"].forEach(function(e){var t=new RegExp("\x3c!--\\s*(<".concat(e,">[\\s\\S]*?<\\/").concat(e,">)\\s*--\x3e"),"gi");n=n.replace(t,"$1")});var t=0;n=n.replace(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/gi,function(e,n){var r=n.replace(/\[([^\]]+)\]\(([^)]+)\)/g,function(e,n,t){return'<a href="'.concat(t,'" data-shielded="true">').concat(n,"</a>")});return r=r.replace(/</g,"&lt;").replace(/>/g,"&gt;"),t++,'<span class="cognitive-card-trigger" data-card-id="card-'.concat(t,'">').concat(r,"</span>")});var r=0;return n.replace(/(\[[^\]]+\]\()([^)]+)(\))/g,function(e,n,t,a){var i=t.replace(/\s/g,"%20");if(i.includes("citationNumber=")){r++;var s=i.includes("?")?"&":"?";return"".concat(n).concat(i).concat(s,"uiUniqueId=").concat(r).concat(a)}return"".concat(n).concat(i).concat(a)})}(w)}),d)})),n.jsx("div",e.__assign({style:{display:"flex",maxWidth:"100%"}},{children:n.jsx("div",e.__assign({style:{width:"100%"}},{children:(null==j?void 0:j.length)>0&&M&&!L?n.jsxs("div",e.__assign({style:{marginTop:"10px"}},{children:[n.jsxs("span",{children:["It looks like you've chosen ",j&&0!==j.length?j.some(function(e){return"both tiers"===e.toLowerCase()||"all tiers"===e.toLowerCase()})?"Both Tiers":j.join(", "):"",". Would you like me to proceed?"]}),n.jsx("p",{children:n.jsx("button",e.__assign({style:{padding:"0.5rem 1rem",margin:"0.5rem 0",backgroundColor:"#2661eb",color:"white",border:"none",borderRadius:"8px",cursor:"pointer",fontSize:"0.75rem",fontWeight:"500",fontFamily:"Plus Jakarta Sans, sans-serif"},onClick:J},{children:"Yes"}))})]})):null}))}))]})};
2
2
  //# sourceMappingURL=MessageRendering.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../node_modules/tslib/tslib.es6.mjs.js"),i=require("react/jsx-runtime"),n=require("react"),s=require("./_svg/ArrowDown.js"),l=require("./_svg/InfoIcon.js"),t=require("./_svg/WarningIcon.js"),o=i.jsx("svg",e.__assign({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:i.jsx("path",{d:"M5.6875 13C5.21875 13 4.82031 12.8396 4.49219 12.5188C4.16406 12.1979 4 11.8083 4 11.35C4 10.9925 4.10547 10.6717 4.31641 10.3875C4.52734 10.1033 4.79687 9.90625 5.125 9.79625V5.20375C4.79687 5.09375 4.52734 4.89667 4.31641 4.6125C4.10547 4.32833 4 4.0075 4 3.65C4 3.19167 4.16406 2.80208 4.49219 2.48125C4.82031 2.16042 5.21875 2 5.6875 2C6.15625 2 6.55469 2.16042 6.88281 2.48125C7.21094 2.80208 7.375 3.19167 7.375 3.65C7.375 4.0075 7.26953 4.32833 7.05859 4.6125C6.84766 4.89667 6.57812 5.09375 6.25 5.20375V5.3C6.25 5.75833 6.41406 6.14792 6.74219 6.46875C7.07031 6.78958 7.46875 6.95 7.9375 6.95H9.0625C9.84062 6.95 10.5039 7.21812 11.0523 7.75437C11.6008 8.29063 11.875 8.93917 11.875 9.7V9.79625C12.2031 9.90625 12.4727 10.1033 12.6836 10.3875C12.8945 10.6717 13 10.9925 13 11.35C13 11.8083 12.8359 12.1979 12.5078 12.5188C12.1797 12.8396 11.7812 13 11.3125 13C10.8438 13 10.4453 12.8396 10.1172 12.5188C9.78906 12.1979 9.625 11.8083 9.625 11.35C9.625 10.9925 9.73047 10.6717 9.94141 10.3875C10.1523 10.1033 10.4219 9.90625 10.75 9.79625V9.7C10.75 9.24167 10.5859 8.85208 10.2578 8.53125C9.92969 8.21042 9.53125 8.05 9.0625 8.05H7.9375C7.61875 8.05 7.31641 8.00187 7.03047 7.90562C6.74453 7.80937 6.48438 7.67417 6.25 7.5V9.79625C6.57812 9.90625 6.84766 10.1033 7.05859 10.3875C7.26953 10.6717 7.375 10.9925 7.375 11.35C7.375 11.8083 7.21094 12.1979 6.88281 12.5188C6.55469 12.8396 6.15625 13 5.6875 13ZM5.6875 11.9C5.84687 11.9 5.98047 11.8473 6.08828 11.7419C6.19609 11.6365 6.25 11.5058 6.25 11.35C6.25 11.1942 6.19609 11.0635 6.08828 10.9581C5.98047 10.8527 5.84687 10.8 5.6875 10.8C5.52812 10.8 5.39453 10.8527 5.28672 10.9581C5.17891 11.0635 5.125 11.1942 5.125 11.35C5.125 11.5058 5.17891 11.6365 5.28672 11.7419C5.39453 11.8473 5.52812 11.9 5.6875 11.9ZM11.3125 11.9C11.4719 11.9 11.6055 11.8473 11.7133 11.7419C11.8211 11.6365 11.875 11.5058 11.875 11.35C11.875 11.1942 11.8211 11.0635 11.7133 10.9581C11.6055 10.8527 11.4719 10.8 11.3125 10.8C11.1531 10.8 11.0195 10.8527 10.9117 10.9581C10.8039 11.0635 10.75 11.1942 10.75 11.35C10.75 11.5058 10.8039 11.6365 10.9117 11.7419C11.0195 11.8473 11.1531 11.9 11.3125 11.9ZM5.6875 4.2C5.84687 4.2 5.98047 4.14729 6.08828 4.04187C6.19609 3.93646 6.25 3.80583 6.25 3.65C6.25 3.49417 6.19609 3.36354 6.08828 3.25812C5.98047 3.15271 5.84687 3.1 5.6875 3.1C5.52812 3.1 5.39453 3.15271 5.28672 3.25812C5.17891 3.36354 5.125 3.49417 5.125 3.65C5.125 3.80583 5.17891 3.93646 5.28672 4.04187C5.39453 4.14729 5.52812 4.2 5.6875 4.2Z",fill:"#666F8D"})})),r=function(n){var s=n.items,l=n.tierLabel,t=function(n,s){if(void 0===s&&(s=!1),!(null==n?void 0:n.value))return null;var t=(null==n?void 0:n.tier)?"".concat(n.value," | ").concat(l," ").concat(n.tier):null==n?void 0:n.value;return i.jsx("span",e.__assign({style:{fontSize:"11px",fontWeight:500,padding:"1px 6px",borderRadius:"9999px",border:"1px solid #E5E7EB",backgroundColor:s?"#EFF6FF":"#F9FAFB",color:s?"#2563EB":"#111827",whiteSpace:"nowrap"}},{children:t}))};return s&&0!==s.length?s.length>=2?i.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[i.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px",color:"#666F8D",fontSize:"12px"}},{children:[o,i.jsx("span",{children:"Inherited"})]})),s[0]&&t(s[0]),s[0]&&s[1]&&i.jsx("span",e.__assign({style:{color:"#9CA3AF"}},{children:"→"})),s[1]&&t(s[1],!0)]})):s[0]?t(s[0],!0):null:null},a=function(l){var t=l.label,o=l.content,r=l.styleLabel,a=l.styleContent,d=l.customHeaderStyle,c=n.useState(!0),g=c[0],p=c[1];return i.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column"}},{children:[i.jsxs("div",e.__assign({onClick:function(){return p(!g)},style:e.__assign(e.__assign({display:"flex",gap:"4px",alignItems:"center",cursor:"pointer"},r),d)},{children:[i.jsx("div",{children:t}),i.jsx("div",e.__assign({style:{display:"flex",alignItems:"center",width:"8px",height:"8px",transition:"transform 0.2s ease",transform:g?"rotate(180deg)":"rotate(0deg)",transformOrigin:"center"}},{children:i.jsx(s.default,{})}))]})),g&&i.jsx("div",e.__assign({style:e.__assign({marginTop:"4px"},a)},{children:o}))]}))};exports.default=function(n){var s=n.validationType,o=n.title,d=n.description,c=n.scope,g=n.whenToApply,p=n.whenNotToApply,x=n.whyIssue,_=n.tierLabel,C=void 0===_?"Tier":_,u=n.customStyles,h="conflicting"===s?"Duplicate Rule Found":"Similar Rule Found",f=e.__assign({display:"flex",flexDirection:"column",border:"1px solid ".concat("conflicting"===s?"#B91C1C":"#0369A1"),gap:"8px",borderRadius:"8px",padding:"16px",maxWidth:"500px",backgroundColor:"#fff",overflow:"hidden"},null==u?void 0:u.container),v=e.__assign({display:"flex",flexDirection:"column",gap:"8px"},null==u?void 0:u.upperSection),y=e.__assign({borderTop:"1px solid #F0F2F5"},null==u?void 0:u.lowerSection),j=e.__assign({display:"inline-flex",alignItems:"center",gap:"2px",backgroundColor:"".concat("conflicting"===s?"#FFE9E980":"#E0F2FE"),color:"".concat("conflicting"===s?"#B91C1C":"#0369A1"),padding:"0px 8px",borderRadius:"9999px",fontSize:"13px",fontWeight:500,width:"fit-content"},null==u?void 0:u.headerTag),m=e.__assign({color:"#666F8D",fontSize:"12px",fontWeight:500},null==u?void 0:u.sectionLabel),b=e.__assign({fontSize:"12px",fontWeight:500,color:"#19213D",margin:0,lineHeight:"1.5"},null==u?void 0:u.sectionContent);return i.jsxs("div",e.__assign({style:f},{children:[i.jsxs("div",e.__assign({style:v},{children:[i.jsxs("div",e.__assign({style:j},{children:["conflicting"==s?i.jsx(t.default,{}):i.jsx(l.default,{})," ",h]})),i.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:"8px"}},{children:[i.jsxs("div",{children:[i.jsx("div",e.__assign({style:m},{children:"Rule Title"})),i.jsx("h3",e.__assign({style:e.__assign(e.__assign({},b),null==u?void 0:u.title)},{children:o}))]}),i.jsxs("div",{children:[i.jsx("div",e.__assign({style:m},{children:"Rule Description"})),i.jsx("p",e.__assign({style:e.__assign(e.__assign({},b),null==u?void 0:u.description)},{children:d}))]}),c&&c.length>0&&i.jsxs("div",{children:[i.jsx("div",e.__assign({style:m},{children:"Scope"})),i.jsx(r,{items:c,tierLabel:C})]}),g&&i.jsx(a,{label:"When To Apply",content:g,styleLabel:m,styleContent:b}),p&&i.jsx(a,{label:"When Not To Apply",content:p,styleLabel:m,styleContent:b})]}))]})),x&&i.jsx("div",e.__assign({style:y},{children:i.jsx(a,{label:"Why this is an issue?",content:x,styleLabel:e.__assign(e.__assign({},m),{marginTop:"6px"}),styleContent:b})}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../node_modules/tslib/tslib.es6.mjs.js"),i=require("react/jsx-runtime"),n=require("react"),s=require("./_svg/ArrowDown.js"),l=require("./_svg/InfoIcon.js"),t=require("./_svg/WarningIcon.js"),o=require("./_svg/CitationLinkSparkleIcon.js"),r=require("./TooltipComponent.js"),a=i.jsx("svg",e.__assign({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:i.jsx("path",{d:"M5.6875 13C5.21875 13 4.82031 12.8396 4.49219 12.5188C4.16406 12.1979 4 11.8083 4 11.35C4 10.9925 4.10547 10.6717 4.31641 10.3875C4.52734 10.1033 4.79687 9.90625 5.125 9.79625V5.20375C4.79687 5.09375 4.52734 4.89667 4.31641 4.6125C4.10547 4.32833 4 4.0075 4 3.65C4 3.19167 4.16406 2.80208 4.49219 2.48125C4.82031 2.16042 5.21875 2 5.6875 2C6.15625 2 6.55469 2.16042 6.88281 2.48125C7.21094 2.80208 7.375 3.19167 7.375 3.65C7.375 4.0075 7.26953 4.32833 7.05859 4.6125C6.84766 4.89667 6.57812 5.09375 6.25 5.20375V5.3C6.25 5.75833 6.41406 6.14792 6.74219 6.46875C7.07031 6.78958 7.46875 6.95 7.9375 6.95H9.0625C9.84062 6.95 10.5039 7.21812 11.0523 7.75437C11.6008 8.29063 11.875 8.93917 11.875 9.7V9.79625C12.2031 9.90625 12.4727 10.1033 12.6836 10.3875C12.8945 10.6717 13 10.9925 13 11.35C13 11.8083 12.8359 12.1979 12.5078 12.5188C12.1797 12.8396 11.7812 13 11.3125 13C10.8438 13 10.4453 12.8396 10.1172 12.5188C9.78906 12.1979 9.625 11.8083 9.625 11.35C9.625 10.9925 9.73047 10.6717 9.94141 10.3875C10.1523 10.1033 10.4219 9.90625 10.75 9.79625V9.7C10.75 9.24167 10.5859 8.85208 10.2578 8.53125C9.92969 8.21042 9.53125 8.05 9.0625 8.05H7.9375C7.61875 8.05 7.31641 8.00187 7.03047 7.90562C6.74453 7.80937 6.48438 7.67417 6.25 7.5V9.79625C6.57812 9.90625 6.84766 10.1033 7.05859 10.3875C7.26953 10.6717 7.375 10.9925 7.375 11.35C7.375 11.8083 7.21094 12.1979 6.88281 12.5188C6.55469 12.8396 6.15625 13 5.6875 13ZM5.6875 11.9C5.84687 11.9 5.98047 11.8473 6.08828 11.7419C6.19609 11.6365 6.25 11.5058 6.25 11.35C6.25 11.1942 6.19609 11.0635 6.08828 10.9581C5.98047 10.8527 5.84687 10.8 5.6875 10.8C5.52812 10.8 5.39453 10.8527 5.28672 10.9581C5.17891 11.0635 5.125 11.1942 5.125 11.35C5.125 11.5058 5.17891 11.6365 5.28672 11.7419C5.39453 11.8473 5.52812 11.9 5.6875 11.9ZM11.3125 11.9C11.4719 11.9 11.6055 11.8473 11.7133 11.7419C11.8211 11.6365 11.875 11.5058 11.875 11.35C11.875 11.1942 11.8211 11.0635 11.7133 10.9581C11.6055 10.8527 11.4719 10.8 11.3125 10.8C11.1531 10.8 11.0195 10.8527 10.9117 10.9581C10.8039 11.0635 10.75 11.1942 10.75 11.35C10.75 11.5058 10.8039 11.6365 10.9117 11.7419C11.0195 11.8473 11.1531 11.9 11.3125 11.9ZM5.6875 4.2C5.84687 4.2 5.98047 4.14729 6.08828 4.04187C6.19609 3.93646 6.25 3.80583 6.25 3.65C6.25 3.49417 6.19609 3.36354 6.08828 3.25812C5.98047 3.15271 5.84687 3.1 5.6875 3.1C5.52812 3.1 5.39453 3.15271 5.28672 3.25812C5.17891 3.36354 5.125 3.49417 5.125 3.65C5.125 3.80583 5.17891 3.93646 5.28672 4.04187C5.39453 4.14729 5.52812 4.2 5.6875 4.2Z",fill:"#666F8D"})})),d=function(n){var s=n.items,l=n.tierLabel,t=function(n,s){if(void 0===s&&(s=!1),!(null==n?void 0:n.value))return null;var t=(null==n?void 0:n.tier)?"".concat(n.value," | ").concat(l," ").concat(n.tier):null==n?void 0:n.value;return i.jsx("span",e.__assign({style:{fontSize:"11px",fontWeight:500,padding:"1px 6px",borderRadius:"9999px",border:"1px solid #E5E7EB",backgroundColor:s?"#EFF6FF":"#F9FAFB",color:s?"#2563EB":"#111827",whiteSpace:"nowrap"}},{children:t}))};return s&&0!==s.length?s.length>=2?i.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[i.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px",color:"#666F8D",fontSize:"12px"}},{children:[a,i.jsx("span",{children:"Inherited"})]})),s[0]&&t(s[0]),s[0]&&s[1]&&i.jsx("span",e.__assign({style:{color:"#9CA3AF"}},{children:"→"})),s[1]&&t(s[1],!0)]})):s[0]?t(s[0],!0):null:null},c=function(l){var t=l.label,o=l.content,r=l.styleLabel,a=l.styleContent,d=l.customHeaderStyle,c=n.useState(!0),p=c[0],g=c[1];return i.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column"}},{children:[i.jsxs("div",e.__assign({onClick:function(){return g(!p)},style:e.__assign(e.__assign({display:"flex",gap:"4px",alignItems:"center",cursor:"pointer"},r),d)},{children:[i.jsx("div",{children:t}),i.jsx("div",e.__assign({style:{display:"flex",alignItems:"center",width:"8px",height:"8px",transition:"transform 0.2s ease",transform:p?"rotate(180deg)":"rotate(0deg)",transformOrigin:"center"}},{children:i.jsx(s.default,{})}))]})),p&&i.jsx("div",e.__assign({style:e.__assign({marginTop:"4px"},a)},{children:o}))]}))};exports.default=function(n){var s=n.validationType,a=n.decisionStrength,p=n.title,g=n.description,x=n.scope,_=n.whenToApply,C=n.whenNotToApply;n.whyIssue;var u=n.tierLabel,h=void 0===u?"Tier":u,f=n.customStyles,v="conflicting"===s?"Conflicting Rule Found":"Similar Rule Found",y=null!=a&&""!==a&&"null"!==a&&"undefined"!==a,j=e.__assign({display:"flex",flexDirection:"column",border:"1px solid ".concat("conflicting"===s?"#B91C1C":"#0369A1"),gap:"8px",borderRadius:"8px",padding:"16px",maxWidth:"500px",backgroundColor:"#fff",overflow:"hidden"},null==f?void 0:f.container),m=e.__assign({display:"flex",flexDirection:"column",gap:"8px"},null==f?void 0:f.upperSection);e.__assign({borderTop:"1px solid #F0F2F5"},null==f?void 0:f.lowerSection);var b=e.__assign({display:"inline-flex",alignItems:"center",gap:"2px",backgroundColor:"".concat("conflicting"===s?"#FFE9E980":"#E0F2FE"),color:"".concat("conflicting"===s?"#B91C1C":"#0369A1"),padding:"0px 7px",borderRadius:"9999px",fontSize:"13px",fontWeight:500,width:"fit-content"},null==f?void 0:f.headerTag),F=e.__assign({color:"#666F8D",fontSize:"12px",fontWeight:500},null==f?void 0:f.sectionLabel),w=e.__assign({fontSize:"12px",fontWeight:500,color:"#19213D",margin:0,lineHeight:"1.5"},null==f?void 0:f.sectionContent);return i.jsx("div",e.__assign({style:j},{children:i.jsxs("div",e.__assign({style:m},{children:[i.jsxs("div",e.__assign({style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"8px"}},{children:[i.jsx("div",e.__assign({style:b},{children:i.jsxs("span",{children:["conflicting"==s?i.jsx(t.default,{}):i.jsx(l.default,{})," ",v]})})),y&&i.jsx(r.default,e.__assign({description:"Decision Strength ".concat(a,"%")},{children:i.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",borderRadius:"9999px",border:"1px solid #C4B5FD",backgroundColor:"#FFF",padding:"0px 5px",fontSize:"12px",fontWeight:600,color:"#1E293B",gap:"4px",cursor:"pointer",width:"fit-content"}},{children:[i.jsx(o.CitationLinkSparkleIcon,{width:12,height:12}),i.jsxs("span",e.__assign({style:{lineHeight:"2"}},{children:[a,"%"]}))]}))}))]})),i.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:"8px"}},{children:[i.jsxs("div",{children:[i.jsx("div",e.__assign({style:F},{children:"Rule Title"})),i.jsx("h3",e.__assign({style:e.__assign(e.__assign({},w),null==f?void 0:f.title)},{children:p}))]}),i.jsxs("div",{children:[i.jsx("div",e.__assign({style:F},{children:"Rule Description"})),i.jsx("p",e.__assign({style:e.__assign(e.__assign({},w),null==f?void 0:f.description)},{children:g}))]}),x&&x.length>0&&i.jsxs("div",{children:[i.jsx("div",e.__assign({style:F},{children:"Scope"})),i.jsx(d,{items:x,tierLabel:h})]}),_&&i.jsx(c,{label:"When To Apply",content:_,styleLabel:F,styleContent:w}),C&&i.jsx(c,{label:"When Not To Apply",content:C,styleLabel:F,styleContent:w})]}))]}))}))};
2
2
  //# sourceMappingURL=RuleValidationCard.js.map