@e-llm-studio/federated-dashboard-components 2.2.10 → 2.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/HumanIntelligence/components/ReviewLearningConditionsModal/ReviewLearningConditionsModal.js +1 -1
- package/dist/HumanIntelligence/components/ReviewLearningConditionsModal/ReviewLearningConditionsModal.module.css.js +1 -1
- package/dist/HumanIntelligence/components/ReviewLearningConditionsModal/parser.js +1 -1
- package/dist/cjs/HumanIntelligence/components/ReviewLearningConditionsModal/ReviewLearningConditionsModal.js +1 -1
- package/dist/cjs/HumanIntelligence/components/ReviewLearningConditionsModal/ReviewLearningConditionsModal.module.css.js +1 -1
- package/dist/cjs/HumanIntelligence/components/ReviewLearningConditionsModal/parser.js +1 -1
- package/dist/cjs/styles.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/HumanIntelligence/components/ReviewLearningConditionsModal/ReviewLearningConditionsModal.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e
|
|
1
|
+
import{__assign as e}from"../../../_virtual/_tslib.js";import{jsx as n,jsxs as t}from"react/jsx-runtime";import{useState as l,useEffect as i}from"react";import{X as r,Check as a}from"lucide-react";import{parseSuggestedRule as c,buildDraftMessage as o}from"./parser.js";import s from"./ReviewLearningConditionsModal.module.css.js";var d=function(d){var u=d.isOpen,m=d.onClose,p=d.onContinue,f=d.summary,h=d.inferredLearning,g=d.isLoading,v=void 0!==g&&g,b=l([]),N=b[0],C=b[1],y=l(""),k=y[0],w=y[1],L=l(null),A=(L[0],L[1]),x=l("");x[0];var S=x[1];if(i(function(){if(u){var e=c(f);C(e.categories),w(e.ruleAction||"New rule."),A(null),S("")}},[u,f]),!u)return null;var j=(null==h?void 0:h.trim())||k||"",B=N.filter(function(e){return"configurable"===e.type}).flatMap(function(e){return e.options||[]}),R=B.length>0&&B.every(function(e){return e.selected});return n("div",e({className:s.overlay,onClick:m,role:"dialog","aria-modal":"true","aria-labelledby":"review-learning-title"},{children:t("div",e({className:s.modal,onClick:function(e){return e.stopPropagation()}},{children:[t("div",e({className:s.header},{children:[n("h2",e({id:"review-learning-title",className:s.title},{children:"Review learning conditions"})),n("p",e({className:s.subtitle},{children:"We identified these conditions from the recurring pattern. Deselect anything that should not be included in the learning."})),n("button",e({type:"button",className:s.closeButton,onClick:m,"aria-label":"Close dialog"},{children:n(r,{size:18})}))]})),t("div",e({className:s.body},{children:[Boolean(j)&&t("div",e({className:s.inferredCard},{children:[n("div",e({className:s.inferredLabel},{children:"Inferred Learning"})),n("p",e({className:s.inferredText},{children:j}))]})),n("div",e({className:s.selectAllRow},{children:t("button",e({type:"button",className:s.selectAllControl,onClick:function(){var n=!R;console.log("Select all toggled",{shouldSelectAll:n}),C(function(t){return t.map(function(t){return"configurable"!==t.type?t:e(e({},t),{options:t.options.map(function(t){return e(e({},t),{selected:n})})})})})},"aria-pressed":R},{children:[n("span",e({className:"".concat(s.selectAllCheckbox," ").concat(R?s.selectAllCheckboxChecked:"")},{children:R&&n(a,{size:12,strokeWidth:3})})),n("span",{children:"Select all"})]}))})),N.map(function(l,i){if("configurable"!==l.type)return null;var r=(l.options||[]).filter(function(e){return e.selected}).length;return l.tag,t("div",e({className:s.categorySection},{children:[t("div",e({className:s.categoryHeader},{children:[n("span",e({className:s.categoryLabel},{children:l.label})),t("span",e({className:s.categoryCount},{children:[r," selected"]}))]})),n("div",e({className:s.pillsRow},{children:(l.options||[]).map(function(l){return t("button",e({type:"button",className:"".concat(s.pill," ").concat(l.selected?s.pillSelected:s.pillDeselected),onClick:function(){return function(n,t){C(function(l){return l.map(function(l,i){return i!==n?l:e(e({},l),{options:l.options.map(function(n){return n.id===t?e(e({},n),{selected:!n.selected}):n})})})})}(i,l.id)}},{children:[l.selected&&n(a,{size:13,strokeWidth:2.5,className:s.checkIcon}),n("span",{children:l.value})]}),l.id)})}))]}),l.tag||"cat-".concat(i))})]})),t("div",e({className:s.footer},{children:[n("button",e({type:"button",className:s.cancelButton,onClick:m,disabled:v},{children:"Cancel"})),n("button",e({type:"button",className:s.continueButton,onClick:function(){var e=o(N,k);p(e)},disabled:v},{children:v?"Preparing...":"Continue to Generate Learning"}))]}))]}))}))};export{d as ReviewLearningConditionsModal,d as default};
|
|
2
2
|
//# sourceMappingURL=ReviewLearningConditionsModal.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e={overlay:"ReviewLearningConditionsModal-module_overlay__7x4JS",fadeIn:"ReviewLearningConditionsModal-module_fadeIn__M5tiM",modal:"ReviewLearningConditionsModal-module_modal__b6vcs",slideUp:"ReviewLearningConditionsModal-module_slideUp__I1z5s",header:"ReviewLearningConditionsModal-module_header__H37IG",title:"ReviewLearningConditionsModal-module_title__IxeAR",subtitle:"ReviewLearningConditionsModal-module_subtitle__UfjDL",closeButton:"ReviewLearningConditionsModal-module_closeButton__P1hJi",body:"ReviewLearningConditionsModal-module_body__ZXzL-",inferredCard:"ReviewLearningConditionsModal-module_inferredCard__JFTxd",inferredLabel:"ReviewLearningConditionsModal-module_inferredLabel__saLT7",inferredText:"ReviewLearningConditionsModal-module_inferredText__WNLhx",categorySection:"ReviewLearningConditionsModal-module_categorySection__AILgJ",categoryHeader:"ReviewLearningConditionsModal-module_categoryHeader__LaW5a",categoryLabel:"ReviewLearningConditionsModal-module_categoryLabel__H4Nn9",categoryCount:"ReviewLearningConditionsModal-module_categoryCount__opzUO",pillsRow:"ReviewLearningConditionsModal-module_pillsRow__DLqtd",pill:"ReviewLearningConditionsModal-module_pill__qPAoB",pillSelected:"ReviewLearningConditionsModal-module_pillSelected__hd3EE",pillDeselected:"ReviewLearningConditionsModal-module_pillDeselected__Fkbfn",checkIcon:"ReviewLearningConditionsModal-module_checkIcon__yWJ7l",addButton:"ReviewLearningConditionsModal-module_addButton__kpXy1",addInputContainer:"ReviewLearningConditionsModal-module_addInputContainer__rkGYe",addInput:"ReviewLearningConditionsModal-module_addInput__lIcIg",addConfirmButton:"ReviewLearningConditionsModal-module_addConfirmButton__HczRO",addCancelButton:"ReviewLearningConditionsModal-module_addCancelButton__XigwV",footer:"ReviewLearningConditionsModal-module_footer__7FiJ7",cancelButton:"ReviewLearningConditionsModal-module_cancelButton__OqwLc",continueButton:"ReviewLearningConditionsModal-module_continueButton__dNBHk"};export{e as default};
|
|
1
|
+
var e={overlay:"ReviewLearningConditionsModal-module_overlay__7x4JS",fadeIn:"ReviewLearningConditionsModal-module_fadeIn__M5tiM",modal:"ReviewLearningConditionsModal-module_modal__b6vcs",slideUp:"ReviewLearningConditionsModal-module_slideUp__I1z5s",header:"ReviewLearningConditionsModal-module_header__H37IG",title:"ReviewLearningConditionsModal-module_title__IxeAR",subtitle:"ReviewLearningConditionsModal-module_subtitle__UfjDL",closeButton:"ReviewLearningConditionsModal-module_closeButton__P1hJi",body:"ReviewLearningConditionsModal-module_body__ZXzL-",inferredCard:"ReviewLearningConditionsModal-module_inferredCard__JFTxd",inferredLabel:"ReviewLearningConditionsModal-module_inferredLabel__saLT7",inferredText:"ReviewLearningConditionsModal-module_inferredText__WNLhx",categorySection:"ReviewLearningConditionsModal-module_categorySection__AILgJ",categoryHeader:"ReviewLearningConditionsModal-module_categoryHeader__LaW5a",categoryLabel:"ReviewLearningConditionsModal-module_categoryLabel__H4Nn9",categoryCount:"ReviewLearningConditionsModal-module_categoryCount__opzUO",selectAllRow:"ReviewLearningConditionsModal-module_selectAllRow__-H8PS",selectAllControl:"ReviewLearningConditionsModal-module_selectAllControl__NUtrJ",selectAllCheckbox:"ReviewLearningConditionsModal-module_selectAllCheckbox__eOk-V",selectAllCheckboxChecked:"ReviewLearningConditionsModal-module_selectAllCheckboxChecked__BG0OE",pillsRow:"ReviewLearningConditionsModal-module_pillsRow__DLqtd",pill:"ReviewLearningConditionsModal-module_pill__qPAoB",pillSelected:"ReviewLearningConditionsModal-module_pillSelected__hd3EE",pillDeselected:"ReviewLearningConditionsModal-module_pillDeselected__Fkbfn",checkIcon:"ReviewLearningConditionsModal-module_checkIcon__yWJ7l",addButton:"ReviewLearningConditionsModal-module_addButton__kpXy1",addInputContainer:"ReviewLearningConditionsModal-module_addInputContainer__rkGYe",addInput:"ReviewLearningConditionsModal-module_addInput__lIcIg",addConfirmButton:"ReviewLearningConditionsModal-module_addConfirmButton__HczRO",addCancelButton:"ReviewLearningConditionsModal-module_addCancelButton__XigwV",footer:"ReviewLearningConditionsModal-module_footer__7FiJ7",cancelButton:"ReviewLearningConditionsModal-module_cancelButton__OqwLc",continueButton:"ReviewLearningConditionsModal-module_continueButton__dNBHk"};export{e as default};
|
|
2
2
|
//# sourceMappingURL=ReviewLearningConditionsModal.module.css.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function e(e){return e?e.replace(/[_-]+/g," ").replace(/\b\w/g,function(e){return e.toUpperCase()}).trim():""}function t(e){return e?e.replace(/<[^>]+>/g,"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/\s+/g," ").trim():""}function n(e){for(var t,n,c,r={},l=/([a-zA-Z_:][-\w:.]*)\s*=\s*(?:"([^"]*)"|'([^']*)')/g;null!==(c=l.exec(e));)r[c[1].toLowerCase()]=null!==(n=null!==(t=c[2])&&void 0!==t?t:c[3])&&void 0!==n?n:"";return r}function c(c){if(!c||"string"!=typeof c)return{categories:[],ruleAction:""};var r="New rule.",l=c.match(/<rule_action>\s*<p>\s*<b>RULE ACTION<\/b>\s*<br\s*\/?>\s*([\s\S]*?)\s*<\/p>\s*<\/rule_action>/i)||c.match(/<rule_action>([\s\S]*?)<\/rule_action>/i);l&&l[1]&&(r=t(l[1]).replace(/^RULE ACTION\s*/i,"").trim());for(var o,a=c.match(/<suggested_rule>([\s\S]*?)<\/suggested_rule>/i),i=a?a[1]:c,u=[],s=/<condition\b([^>]*)>([\s\S]*?)<\/condition>/gi,p=0;null!==(o=s.exec(i));){var g=n(o[1]),f=o[2],b=f.indexOf(":"),v=b>-1?t(f.slice(0,b)):"",d=b>-1?f.slice(b+1):f,h=g.id||v.toLowerCase().replace(/[\s-]+/g,"_").replace(/[^a-z0-9_]/g,"")||"condition_".concat(p);if(p+=1,"configurable"===g.type||"static"!==g.type&&/<option\b/i.test(d)){for(var _=[],m=/<option\b([^>]*)>([\s\S]*?)<\/option>/gi,x=void 0;null!==(x=m.exec(d));){var S=t(x[2]);S&&_.push({id:"".concat(h,"_").concat(_.length),value:S,selected:!
|
|
1
|
+
function e(e){return e?e.replace(/[_-]+/g," ").replace(/\b\w/g,function(e){return e.toUpperCase()}).trim():""}function t(e){return e?e.replace(/<[^>]+>/g,"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/\s+/g," ").trim():""}function n(e){for(var t,n,c,r={},l=/([a-zA-Z_:][-\w:.]*)\s*=\s*(?:"([^"]*)"|'([^']*)')/g;null!==(c=l.exec(e));)r[c[1].toLowerCase()]=null!==(n=null!==(t=c[2])&&void 0!==t?t:c[3])&&void 0!==n?n:"";return r}function c(c){if(!c||"string"!=typeof c)return{categories:[],ruleAction:""};var r="New rule.",l=c.match(/<rule_action>\s*<p>\s*<b>RULE ACTION<\/b>\s*<br\s*\/?>\s*([\s\S]*?)\s*<\/p>\s*<\/rule_action>/i)||c.match(/<rule_action>([\s\S]*?)<\/rule_action>/i);l&&l[1]&&(r=t(l[1]).replace(/^RULE ACTION\s*/i,"").trim());for(var o,a=c.match(/<suggested_rule>([\s\S]*?)<\/suggested_rule>/i),i=a?a[1]:c,u=[],s=/<condition\b([^>]*)>([\s\S]*?)<\/condition>/gi,p=0;null!==(o=s.exec(i));){var g=n(o[1]),f=o[2],b=f.indexOf(":"),v=b>-1?t(f.slice(0,b)):"",d=b>-1?f.slice(b+1):f,h=g.id||v.toLowerCase().replace(/[\s-]+/g,"_").replace(/[^a-z0-9_]/g,"")||"condition_".concat(p);if(p+=1,"configurable"===g.type||"static"!==g.type&&/<option\b/i.test(d)){for(var _=[],m=/<option\b([^>]*)>([\s\S]*?)<\/option>/gi,x=void 0;null!==(x=m.exec(d));){var S=t(x[2]);S&&_.push({id:"".concat(h,"_").concat(_.length),value:S,selected:!1})}0!==_.length&&u.push({tag:h,label:v||e(h),type:"configurable",options:_})}else u.push({tag:h,label:v,type:"static",text:t(d),options:[]})}return{categories:u,ruleAction:r}}function r(e){var t,n,c=(e.options||[]).filter(function(e){return e.selected}).map(function(e){return e.value.trim()}).filter(Boolean);return 0===c.length?"":1===c.length?c[0]:(t=c).length<=1?null!==(n=t[0])&&void 0!==n?n:"":2===t.length?"".concat(t[0]," and ").concat(t[1]):"".concat(t.slice(0,-1).join(", "),", and ").concat(t[t.length-1])}function l(e,t){void 0===t&&(t="New rule.");var n="";if(t&&(n+="<p><b>RULE ACTION</b><br>".concat(t,"</p>")),e&&e.length>0){n+="<p><b>SUGGESTED RULE</b></p><ul>";for(var c=0,l=e;c<l.length;c++){var o=l[c],a=o.label?"".concat(o.label,": "):"";if("static"!==o.type){var i=r(o);i&&(n+="<li>".concat(a).concat(i,".</li>"))}else o.text&&(n+="<li>".concat(a).concat(o.text,"</li>"))}n+="</ul>"}return n}export{l as buildDraftMessage,e as formatTagLabel,c as parseSuggestedRule};
|
|
2
2
|
//# sourceMappingURL=parser.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),n=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),n=require("react/jsx-runtime"),s=require("react"),t=require("lucide-react"),a=require("./parser.js"),i=require("./ReviewLearningConditionsModal.module.css.js"),l=function(l){var r=l.isOpen,c=l.onClose,o=l.onContinue,d=l.summary,u=l.inferredLearning,f=l.isLoading,g=void 0!==f&&f,_=s.useState([]),p=_[0],h=_[1],m=s.useState(""),x=m[0],j=m[1],v=s.useState(null),b=(v[0],v[1]),N=s.useState("");N[0];var C=N[1];if(s.useEffect(function(){if(r){var e=a.parseSuggestedRule(d);h(e.categories),j(e.ruleAction||"New rule."),b(null),C("")}},[r,d]),!r)return null;var y=(null==u?void 0:u.trim())||x||"",k=p.filter(function(e){return"configurable"===e.type}).flatMap(function(e){return e.options||[]}),S=k.length>0&&k.every(function(e){return e.selected});return n.jsx("div",e.__assign({className:i.default.overlay,onClick:c,role:"dialog","aria-modal":"true","aria-labelledby":"review-learning-title"},{children:n.jsxs("div",e.__assign({className:i.default.modal,onClick:function(e){return e.stopPropagation()}},{children:[n.jsxs("div",e.__assign({className:i.default.header},{children:[n.jsx("h2",e.__assign({id:"review-learning-title",className:i.default.title},{children:"Review learning conditions"})),n.jsx("p",e.__assign({className:i.default.subtitle},{children:"We identified these conditions from the recurring pattern. Deselect anything that should not be included in the learning."})),n.jsx("button",e.__assign({type:"button",className:i.default.closeButton,onClick:c,"aria-label":"Close dialog"},{children:n.jsx(t.X,{size:18})}))]})),n.jsxs("div",e.__assign({className:i.default.body},{children:[Boolean(y)&&n.jsxs("div",e.__assign({className:i.default.inferredCard},{children:[n.jsx("div",e.__assign({className:i.default.inferredLabel},{children:"Inferred Learning"})),n.jsx("p",e.__assign({className:i.default.inferredText},{children:y}))]})),n.jsx("div",e.__assign({className:i.default.selectAllRow},{children:n.jsxs("button",e.__assign({type:"button",className:i.default.selectAllControl,onClick:function(){var n=!S;console.log("Select all toggled",{shouldSelectAll:n}),h(function(s){return s.map(function(s){return"configurable"!==s.type?s:e.__assign(e.__assign({},s),{options:s.options.map(function(s){return e.__assign(e.__assign({},s),{selected:n})})})})})},"aria-pressed":S},{children:[n.jsx("span",e.__assign({className:"".concat(i.default.selectAllCheckbox," ").concat(S?i.default.selectAllCheckboxChecked:"")},{children:S&&n.jsx(t.Check,{size:12,strokeWidth:3})})),n.jsx("span",{children:"Select all"})]}))})),p.map(function(s,a){if("configurable"!==s.type)return null;var l=(s.options||[]).filter(function(e){return e.selected}).length;return s.tag,n.jsxs("div",e.__assign({className:i.default.categorySection},{children:[n.jsxs("div",e.__assign({className:i.default.categoryHeader},{children:[n.jsx("span",e.__assign({className:i.default.categoryLabel},{children:s.label})),n.jsxs("span",e.__assign({className:i.default.categoryCount},{children:[l," selected"]}))]})),n.jsx("div",e.__assign({className:i.default.pillsRow},{children:(s.options||[]).map(function(s){return n.jsxs("button",e.__assign({type:"button",className:"".concat(i.default.pill," ").concat(s.selected?i.default.pillSelected:i.default.pillDeselected),onClick:function(){return function(n,s){h(function(t){return t.map(function(t,a){return a!==n?t:e.__assign(e.__assign({},t),{options:t.options.map(function(n){return n.id===s?e.__assign(e.__assign({},n),{selected:!n.selected}):n})})})})}(a,s.id)}},{children:[s.selected&&n.jsx(t.Check,{size:13,strokeWidth:2.5,className:i.default.checkIcon}),n.jsx("span",{children:s.value})]}),s.id)})}))]}),s.tag||"cat-".concat(a))})]})),n.jsxs("div",e.__assign({className:i.default.footer},{children:[n.jsx("button",e.__assign({type:"button",className:i.default.cancelButton,onClick:c,disabled:g},{children:"Cancel"})),n.jsx("button",e.__assign({type:"button",className:i.default.continueButton,onClick:function(){var e=a.buildDraftMessage(p,x);o(e)},disabled:g},{children:g?"Preparing...":"Continue to Generate Learning"}))]}))]}))}))};exports.ReviewLearningConditionsModal=l,exports.default=l;
|
|
2
2
|
//# sourceMappingURL=ReviewLearningConditionsModal.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.default={overlay:"ReviewLearningConditionsModal-module_overlay__7x4JS",fadeIn:"ReviewLearningConditionsModal-module_fadeIn__M5tiM",modal:"ReviewLearningConditionsModal-module_modal__b6vcs",slideUp:"ReviewLearningConditionsModal-module_slideUp__I1z5s",header:"ReviewLearningConditionsModal-module_header__H37IG",title:"ReviewLearningConditionsModal-module_title__IxeAR",subtitle:"ReviewLearningConditionsModal-module_subtitle__UfjDL",closeButton:"ReviewLearningConditionsModal-module_closeButton__P1hJi",body:"ReviewLearningConditionsModal-module_body__ZXzL-",inferredCard:"ReviewLearningConditionsModal-module_inferredCard__JFTxd",inferredLabel:"ReviewLearningConditionsModal-module_inferredLabel__saLT7",inferredText:"ReviewLearningConditionsModal-module_inferredText__WNLhx",categorySection:"ReviewLearningConditionsModal-module_categorySection__AILgJ",categoryHeader:"ReviewLearningConditionsModal-module_categoryHeader__LaW5a",categoryLabel:"ReviewLearningConditionsModal-module_categoryLabel__H4Nn9",categoryCount:"ReviewLearningConditionsModal-module_categoryCount__opzUO",pillsRow:"ReviewLearningConditionsModal-module_pillsRow__DLqtd",pill:"ReviewLearningConditionsModal-module_pill__qPAoB",pillSelected:"ReviewLearningConditionsModal-module_pillSelected__hd3EE",pillDeselected:"ReviewLearningConditionsModal-module_pillDeselected__Fkbfn",checkIcon:"ReviewLearningConditionsModal-module_checkIcon__yWJ7l",addButton:"ReviewLearningConditionsModal-module_addButton__kpXy1",addInputContainer:"ReviewLearningConditionsModal-module_addInputContainer__rkGYe",addInput:"ReviewLearningConditionsModal-module_addInput__lIcIg",addConfirmButton:"ReviewLearningConditionsModal-module_addConfirmButton__HczRO",addCancelButton:"ReviewLearningConditionsModal-module_addCancelButton__XigwV",footer:"ReviewLearningConditionsModal-module_footer__7FiJ7",cancelButton:"ReviewLearningConditionsModal-module_cancelButton__OqwLc",continueButton:"ReviewLearningConditionsModal-module_continueButton__dNBHk"};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.default={overlay:"ReviewLearningConditionsModal-module_overlay__7x4JS",fadeIn:"ReviewLearningConditionsModal-module_fadeIn__M5tiM",modal:"ReviewLearningConditionsModal-module_modal__b6vcs",slideUp:"ReviewLearningConditionsModal-module_slideUp__I1z5s",header:"ReviewLearningConditionsModal-module_header__H37IG",title:"ReviewLearningConditionsModal-module_title__IxeAR",subtitle:"ReviewLearningConditionsModal-module_subtitle__UfjDL",closeButton:"ReviewLearningConditionsModal-module_closeButton__P1hJi",body:"ReviewLearningConditionsModal-module_body__ZXzL-",inferredCard:"ReviewLearningConditionsModal-module_inferredCard__JFTxd",inferredLabel:"ReviewLearningConditionsModal-module_inferredLabel__saLT7",inferredText:"ReviewLearningConditionsModal-module_inferredText__WNLhx",categorySection:"ReviewLearningConditionsModal-module_categorySection__AILgJ",categoryHeader:"ReviewLearningConditionsModal-module_categoryHeader__LaW5a",categoryLabel:"ReviewLearningConditionsModal-module_categoryLabel__H4Nn9",categoryCount:"ReviewLearningConditionsModal-module_categoryCount__opzUO",selectAllRow:"ReviewLearningConditionsModal-module_selectAllRow__-H8PS",selectAllControl:"ReviewLearningConditionsModal-module_selectAllControl__NUtrJ",selectAllCheckbox:"ReviewLearningConditionsModal-module_selectAllCheckbox__eOk-V",selectAllCheckboxChecked:"ReviewLearningConditionsModal-module_selectAllCheckboxChecked__BG0OE",pillsRow:"ReviewLearningConditionsModal-module_pillsRow__DLqtd",pill:"ReviewLearningConditionsModal-module_pill__qPAoB",pillSelected:"ReviewLearningConditionsModal-module_pillSelected__hd3EE",pillDeselected:"ReviewLearningConditionsModal-module_pillDeselected__Fkbfn",checkIcon:"ReviewLearningConditionsModal-module_checkIcon__yWJ7l",addButton:"ReviewLearningConditionsModal-module_addButton__kpXy1",addInputContainer:"ReviewLearningConditionsModal-module_addInputContainer__rkGYe",addInput:"ReviewLearningConditionsModal-module_addInput__lIcIg",addConfirmButton:"ReviewLearningConditionsModal-module_addConfirmButton__HczRO",addCancelButton:"ReviewLearningConditionsModal-module_addCancelButton__XigwV",footer:"ReviewLearningConditionsModal-module_footer__7FiJ7",cancelButton:"ReviewLearningConditionsModal-module_cancelButton__OqwLc",continueButton:"ReviewLearningConditionsModal-module_continueButton__dNBHk"};
|
|
2
2
|
//# sourceMappingURL=ReviewLearningConditionsModal.module.css.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";function e(e){return e?e.replace(/[_-]+/g," ").replace(/\b\w/g,function(e){return e.toUpperCase()}).trim():""}function t(e){return e?e.replace(/<[^>]+>/g,"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/\s+/g," ").trim():""}function n(e){for(var t,n,r,l={},c=/([a-zA-Z_:][-\w:.]*)\s*=\s*(?:"([^"]*)"|'([^']*)')/g;null!==(r=c.exec(e));)l[r[1].toLowerCase()]=null!==(n=null!==(t=r[2])&&void 0!==t?t:r[3])&&void 0!==n?n:"";return l}function r(e){var t,n,r=(e.options||[]).filter(function(e){return e.selected}).map(function(e){return e.value.trim()}).filter(Boolean);return 0===r.length?"":1===r.length?r[0]:(t=r).length<=1?null!==(n=t[0])&&void 0!==n?n:"":2===t.length?"".concat(t[0]," and ").concat(t[1]):"".concat(t.slice(0,-1).join(", "),", and ").concat(t[t.length-1])}Object.defineProperty(exports,"__esModule",{value:!0}),exports.buildDraftMessage=function(e,t){void 0===t&&(t="New rule.");var n="";if(t&&(n+="<p><b>RULE ACTION</b><br>".concat(t,"</p>")),e&&e.length>0){n+="<p><b>SUGGESTED RULE</b></p><ul>";for(var l=0,c=e;l<c.length;l++){var o=c[l],a=o.label?"".concat(o.label,": "):"";if("static"!==o.type){var i=r(o);i&&(n+="<li>".concat(a).concat(i,".</li>"))}else o.text&&(n+="<li>".concat(a).concat(o.text,"</li>"))}n+="</ul>"}return n},exports.formatTagLabel=e,exports.parseSuggestedRule=function(r){if(!r||"string"!=typeof r)return{categories:[],ruleAction:""};var l="New rule.",c=r.match(/<rule_action>\s*<p>\s*<b>RULE ACTION<\/b>\s*<br\s*\/?>\s*([\s\S]*?)\s*<\/p>\s*<\/rule_action>/i)||r.match(/<rule_action>([\s\S]*?)<\/rule_action>/i);c&&c[1]&&(l=t(c[1]).replace(/^RULE ACTION\s*/i,"").trim());for(var o,a=r.match(/<suggested_rule>([\s\S]*?)<\/suggested_rule>/i),i=a?a[1]:r,s=[],u=/<condition\b([^>]*)>([\s\S]*?)<\/condition>/gi,p=0;null!==(o=u.exec(i));){var g=n(o[1]),f=o[2],b=f.indexOf(":"),d=b>-1?t(f.slice(0,b)):"",v=b>-1?f.slice(b+1):f,h=g.id||d.toLowerCase().replace(/[\s-]+/g,"_").replace(/[^a-z0-9_]/g,"")||"condition_".concat(p);if(p+=1,"configurable"===g.type||"static"!==g.type&&/<option\b/i.test(v)){for(var _=[],x=/<option\b([^>]*)>([\s\S]*?)<\/option>/gi,m=void 0;null!==(m=x.exec(v));){var S=t(m[2]);S&&_.push({id:"".concat(h,"_").concat(_.length),value:S,selected:!
|
|
1
|
+
"use strict";function e(e){return e?e.replace(/[_-]+/g," ").replace(/\b\w/g,function(e){return e.toUpperCase()}).trim():""}function t(e){return e?e.replace(/<[^>]+>/g,"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/\s+/g," ").trim():""}function n(e){for(var t,n,r,l={},c=/([a-zA-Z_:][-\w:.]*)\s*=\s*(?:"([^"]*)"|'([^']*)')/g;null!==(r=c.exec(e));)l[r[1].toLowerCase()]=null!==(n=null!==(t=r[2])&&void 0!==t?t:r[3])&&void 0!==n?n:"";return l}function r(e){var t,n,r=(e.options||[]).filter(function(e){return e.selected}).map(function(e){return e.value.trim()}).filter(Boolean);return 0===r.length?"":1===r.length?r[0]:(t=r).length<=1?null!==(n=t[0])&&void 0!==n?n:"":2===t.length?"".concat(t[0]," and ").concat(t[1]):"".concat(t.slice(0,-1).join(", "),", and ").concat(t[t.length-1])}Object.defineProperty(exports,"__esModule",{value:!0}),exports.buildDraftMessage=function(e,t){void 0===t&&(t="New rule.");var n="";if(t&&(n+="<p><b>RULE ACTION</b><br>".concat(t,"</p>")),e&&e.length>0){n+="<p><b>SUGGESTED RULE</b></p><ul>";for(var l=0,c=e;l<c.length;l++){var o=c[l],a=o.label?"".concat(o.label,": "):"";if("static"!==o.type){var i=r(o);i&&(n+="<li>".concat(a).concat(i,".</li>"))}else o.text&&(n+="<li>".concat(a).concat(o.text,"</li>"))}n+="</ul>"}return n},exports.formatTagLabel=e,exports.parseSuggestedRule=function(r){if(!r||"string"!=typeof r)return{categories:[],ruleAction:""};var l="New rule.",c=r.match(/<rule_action>\s*<p>\s*<b>RULE ACTION<\/b>\s*<br\s*\/?>\s*([\s\S]*?)\s*<\/p>\s*<\/rule_action>/i)||r.match(/<rule_action>([\s\S]*?)<\/rule_action>/i);c&&c[1]&&(l=t(c[1]).replace(/^RULE ACTION\s*/i,"").trim());for(var o,a=r.match(/<suggested_rule>([\s\S]*?)<\/suggested_rule>/i),i=a?a[1]:r,s=[],u=/<condition\b([^>]*)>([\s\S]*?)<\/condition>/gi,p=0;null!==(o=u.exec(i));){var g=n(o[1]),f=o[2],b=f.indexOf(":"),d=b>-1?t(f.slice(0,b)):"",v=b>-1?f.slice(b+1):f,h=g.id||d.toLowerCase().replace(/[\s-]+/g,"_").replace(/[^a-z0-9_]/g,"")||"condition_".concat(p);if(p+=1,"configurable"===g.type||"static"!==g.type&&/<option\b/i.test(v)){for(var _=[],x=/<option\b([^>]*)>([\s\S]*?)<\/option>/gi,m=void 0;null!==(m=x.exec(v));){var S=t(m[2]);S&&_.push({id:"".concat(h,"_").concat(_.length),value:S,selected:!1})}0!==_.length&&s.push({tag:h,label:d||e(h),type:"configurable",options:_})}else s.push({tag:h,label:d,type:"static",text:t(v),options:[]})}return{categories:s,ruleAction:l}};
|
|
2
2
|
//# sourceMappingURL=parser.js.map
|