@e-llm-studio/instant-learning 1.3.0-alpha.95 → 1.3.0-alpha.96

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 (100) hide show
  1. package/dist/cjs/features/LSCGuidelinesCart/Cart/Cart.js +2 -0
  2. package/dist/cjs/features/LSCGuidelinesCart/Cart/Cart.js.map +1 -0
  3. package/dist/cjs/features/LSCGuidelinesCart/Cart/Cart.styles.js +2 -0
  4. package/dist/cjs/features/LSCGuidelinesCart/Cart/Cart.styles.js.map +1 -0
  5. package/dist/cjs/features/LSCGuidelinesCart/GuidelineCard.js +2 -0
  6. package/dist/cjs/features/LSCGuidelinesCart/GuidelineCard.js.map +1 -0
  7. package/dist/cjs/features/LSCGuidelinesCart/GuidelineCard.styles.js +2 -0
  8. package/dist/cjs/features/LSCGuidelinesCart/GuidelineCard.styles.js.map +1 -0
  9. package/dist/cjs/features/LSCGuidelinesCart/GuidelinesLandingPage.js +2 -0
  10. package/dist/cjs/features/LSCGuidelinesCart/GuidelinesLandingPage.js.map +1 -0
  11. package/dist/cjs/features/LSCGuidelinesCart/GuidelinesLandingPage.styles.js +2 -0
  12. package/dist/cjs/features/LSCGuidelinesCart/GuidelinesLandingPage.styles.js.map +1 -0
  13. package/dist/cjs/features/LSCGuidelinesCart/LearningManagementWrapper.js +2 -0
  14. package/dist/cjs/features/LSCGuidelinesCart/LearningManagementWrapper.js.map +1 -0
  15. package/dist/cjs/features/LSCGuidelinesCart/api.js +2 -0
  16. package/dist/cjs/features/LSCGuidelinesCart/api.js.map +1 -0
  17. package/dist/cjs/features/LSCGuidelinesCart/endpoints.js +2 -0
  18. package/dist/cjs/features/LSCGuidelinesCart/endpoints.js.map +1 -0
  19. package/dist/cjs/features/LearningManagement/LearningManagement.js +1 -1
  20. package/dist/cjs/features/LearningManagement/LearningManagementTest.js +1 -1
  21. package/dist/cjs/features/LearningManagement/LearningTemplateLayout.js +1 -1
  22. package/dist/cjs/features/LearningManagement/RBAC/AccessPanel.js +1 -1
  23. package/dist/cjs/features/LearningManagement/RuleContent/RuleContent.js +1 -1
  24. package/dist/cjs/features/LearningManagement/Sidebar.js +1 -1
  25. package/dist/cjs/features/LearningManagement/components/InstantLearningModal.js +1 -1
  26. package/dist/cjs/features/LearningManagement/components/ScopeTree/TreeNode.js +1 -1
  27. package/dist/cjs/index.js +1 -1
  28. package/dist/features/LSCGuidelinesCart/Cart/Cart.js +2 -0
  29. package/dist/features/LSCGuidelinesCart/Cart/Cart.js.map +1 -0
  30. package/dist/features/LSCGuidelinesCart/Cart/Cart.styles.js +2 -0
  31. package/dist/features/LSCGuidelinesCart/Cart/Cart.styles.js.map +1 -0
  32. package/dist/features/LSCGuidelinesCart/GuidelineCard.js +2 -0
  33. package/dist/features/LSCGuidelinesCart/GuidelineCard.js.map +1 -0
  34. package/dist/features/LSCGuidelinesCart/GuidelineCard.styles.js +2 -0
  35. package/dist/features/LSCGuidelinesCart/GuidelineCard.styles.js.map +1 -0
  36. package/dist/features/LSCGuidelinesCart/GuidelinesLandingPage.js +2 -0
  37. package/dist/features/LSCGuidelinesCart/GuidelinesLandingPage.js.map +1 -0
  38. package/dist/features/LSCGuidelinesCart/GuidelinesLandingPage.styles.js +2 -0
  39. package/dist/features/LSCGuidelinesCart/GuidelinesLandingPage.styles.js.map +1 -0
  40. package/dist/features/LSCGuidelinesCart/LearningManagementWrapper.js +2 -0
  41. package/dist/features/LSCGuidelinesCart/LearningManagementWrapper.js.map +1 -0
  42. package/dist/features/LSCGuidelinesCart/api.js +2 -0
  43. package/dist/features/LSCGuidelinesCart/api.js.map +1 -0
  44. package/dist/features/LSCGuidelinesCart/endpoints.js +2 -0
  45. package/dist/features/LSCGuidelinesCart/endpoints.js.map +1 -0
  46. package/dist/features/LearningManagement/LearningManagement.js +1 -1
  47. package/dist/features/LearningManagement/LearningManagementTest.js +1 -1
  48. package/dist/features/LearningManagement/LearningTemplateLayout.js +1 -1
  49. package/dist/features/LearningManagement/RBAC/AccessPanel.js +1 -1
  50. package/dist/features/LearningManagement/RuleContent/RuleContent.js +1 -1
  51. package/dist/features/LearningManagement/Sidebar.js +1 -1
  52. package/dist/features/LearningManagement/components/InstantLearningModal.js +1 -1
  53. package/dist/features/LearningManagement/components/ScopeTree/TreeNode.js +1 -1
  54. package/dist/index.js +1 -1
  55. package/dist/types/src/features/IL-OTJ/_components/index.d.ts +1 -0
  56. package/dist/types/src/features/IL-OTJ/_components/index.d.ts.map +1 -1
  57. package/dist/types/src/features/LSCGuidelinesCart/Cart/Cart.d.ts +10 -0
  58. package/dist/types/src/features/LSCGuidelinesCart/Cart/Cart.d.ts.map +1 -0
  59. package/dist/types/src/features/LSCGuidelinesCart/Cart/Cart.styles.d.ts +6 -0
  60. package/dist/types/src/features/LSCGuidelinesCart/Cart/Cart.styles.d.ts.map +1 -0
  61. package/dist/types/src/features/LSCGuidelinesCart/GuidelineCard.d.ts +11 -0
  62. package/dist/types/src/features/LSCGuidelinesCart/GuidelineCard.d.ts.map +1 -0
  63. package/dist/types/src/features/LSCGuidelinesCart/GuidelineCard.styles.d.ts +6 -0
  64. package/dist/types/src/features/LSCGuidelinesCart/GuidelineCard.styles.d.ts.map +1 -0
  65. package/dist/types/src/features/LSCGuidelinesCart/GuidelinesLandingPage.d.ts +17 -0
  66. package/dist/types/src/features/LSCGuidelinesCart/GuidelinesLandingPage.d.ts.map +1 -0
  67. package/dist/types/src/features/LSCGuidelinesCart/GuidelinesLandingPage.styles.d.ts +6 -0
  68. package/dist/types/src/features/LSCGuidelinesCart/GuidelinesLandingPage.styles.d.ts.map +1 -0
  69. package/dist/types/src/features/LSCGuidelinesCart/LearningManagementWrapper.d.ts +19 -0
  70. package/dist/types/src/features/LSCGuidelinesCart/LearningManagementWrapper.d.ts.map +1 -0
  71. package/dist/types/src/features/LSCGuidelinesCart/api.d.ts +4 -0
  72. package/dist/types/src/features/LSCGuidelinesCart/api.d.ts.map +1 -0
  73. package/dist/types/src/features/LSCGuidelinesCart/endpoints.d.ts +5 -0
  74. package/dist/types/src/features/LSCGuidelinesCart/endpoints.d.ts.map +1 -0
  75. package/dist/types/src/features/LSCGuidelinesCart/interfacesApi.d.ts +25 -0
  76. package/dist/types/src/features/LSCGuidelinesCart/interfacesApi.d.ts.map +1 -0
  77. package/dist/types/src/features/LearningManagement/LearningManagement.d.ts.map +1 -1
  78. package/dist/types/src/features/LearningManagement/LearningTemplateLayout.d.ts +0 -3
  79. package/dist/types/src/features/LearningManagement/LearningTemplateLayout.d.ts.map +1 -1
  80. package/dist/types/src/features/LearningManagement/RBAC/AccessPanel.d.ts.map +1 -1
  81. package/dist/types/src/features/LearningManagement/components/ScopeTree/TreeNode.d.ts.map +1 -1
  82. package/dist/types/src/features/LearningManagement/store/types.d.ts +25 -0
  83. package/dist/types/src/features/LearningManagement/store/types.d.ts.map +1 -1
  84. package/dist/types/src/features/LearningManagement/types.d.ts +0 -1
  85. package/dist/types/src/features/LearningManagement/types.d.ts.map +1 -1
  86. package/dist/types/src/index.d.ts +1 -0
  87. package/dist/types/src/index.d.ts.map +1 -1
  88. package/package.json +9 -1
  89. package/dist/cjs/features/IL-OTJ/_components/templates/BaseTemplate/BaseTemplate.js +0 -2
  90. package/dist/cjs/features/IL-OTJ/_components/templates/BaseTemplate/BaseTemplate.js.map +0 -1
  91. package/dist/cjs/features/IL-OTJ/_components/templates/CreateCategory/CreateCategory.js +0 -2
  92. package/dist/cjs/features/IL-OTJ/_components/templates/CreateCategory/CreateCategory.js.map +0 -1
  93. package/dist/cjs/features/IL-OTJ/_components/templates/WorkflowComposer/WorkflowComposer.js +0 -2
  94. package/dist/cjs/features/IL-OTJ/_components/templates/WorkflowComposer/WorkflowComposer.js.map +0 -1
  95. package/dist/features/IL-OTJ/_components/templates/BaseTemplate/BaseTemplate.js +0 -2
  96. package/dist/features/IL-OTJ/_components/templates/BaseTemplate/BaseTemplate.js.map +0 -1
  97. package/dist/features/IL-OTJ/_components/templates/CreateCategory/CreateCategory.js +0 -2
  98. package/dist/features/IL-OTJ/_components/templates/CreateCategory/CreateCategory.js.map +0 -1
  99. package/dist/features/IL-OTJ/_components/templates/WorkflowComposer/WorkflowComposer.js +0 -2
  100. package/dist/features/IL-OTJ/_components/templates/WorkflowComposer/WorkflowComposer.js.map +0 -1
@@ -1,2 +0,0 @@
1
- import{__assign as e,__spreadArray as t}from"tslib";import{jsx as n,jsxs as i,Fragment as o}from"react/jsx-runtime";import r,{useState as l,useRef as a,useEffect as d,useCallback as c,useMemo as s}from"react";import{Loader2Icon as p,Check as u,X as f,Pencil as h,Trash2 as g,ChevronUp as y,ChevronDown as x,ArrowLeft as m,Sparkles as b,Plus as v}from"lucide-react";var w=0,C=function(){return"cond-".concat(Date.now(),"-").concat(++w)},F="#CBD5E1",k="#9B8AFB",S="#7C3AED",z="#FDA29B",D="#344054",E="#1E293B",A="#334155",B="#64748B",R="#94A3B8",T="#98A2B3",I="#F04438",W="#8F2C23",H="#5925DC",j="#475569",L="#FFFFFF",M="#F8FAFC",N="#F1F5F9",_="#F9F5FF",O="#17B26A",K="#F04438",q="#64748B",U="6px",Y="8px",P="Inter, sans-serif",X={width:38,height:38,display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid #D0D5DD",borderRadius:U,cursor:"pointer",background:L,flexShrink:0,transition:"background 0.15s"},V={width:"100%",boxSizing:"border-box",padding:"8px 11.5px",border:"1px solid #D0D5DD",borderRadius:U,fontSize:14,fontWeight:400,lineHeight:"100%",fontFamily:P,outline:"none",color:D,background:L},Z={display:"flex",alignItems:"center",gap:4,marginBottom:8,color:D,fontSize:14,fontWeight:500,lineHeight:"130%",fontFamily:P},G={background:L,border:"1px solid ".concat(F),borderRadius:Y,padding:16},J=n("span",e({style:{color:W,fontSize:12,lineHeight:1,display:"inline-flex",transform:"translateY(0.5px)"}},{children:"*"})),Q={exact_match:{label:"Exact Match",bg:"#F0FDF4",border:"#BBF7D0",text:"#166534",dot:"#22C55E"},conflict:{label:"Conflict",bg:"#FEF2F2",border:"#FECACA",text:"#991B1B",dot:"#EF4444"},partial_overlap:{label:"Partial Match",bg:"#FFF7ED",border:"#FED7AA",text:"#92400E",dot:"#F97316"},new_field:{label:"New",bg:"#F5F3FF",border:"#DDD6FE",text:"#5925DC",dot:"#7C3AED"}},$=function(e){return e?Array.isArray(e)?e.filter(Boolean).join("\n"):e:""},ee=function(e,t){if(!t&&!e)return"exact_match";if(!t)return"new_field";if(!e)return"new_field";var n=function(e){return e.trim().toLowerCase()};if(n(e)===n(t))return"exact_match";var i=new Set(n(e).split(/\s+/)),o=new Set(n(t).split(/\s+/));return Array.from(i).filter(function(e){return o.has(e)}).length/Math.max(i.size,o.size)>=.45?"partial_overlap":"conflict"},te=function(t){var o=t.relation,r=Q[o];return i("div",e({style:{display:"inline-flex",alignItems:"center",gap:4,padding:"3px 9px",borderRadius:20,background:r.bg,border:"1px solid ".concat(r.border),fontSize:10,fontWeight:600,color:r.text,fontFamily:P,whiteSpace:"nowrap",flexShrink:0}},{children:[n("span",{style:{width:5,height:5,borderRadius:"50%",background:r.dot,flexShrink:0}}),r.label]}))},ne=r.forwardRef(function(t,o){var r=t.label,l=t.value;return i("div",e({ref:o,style:{display:"flex",flexDirection:"column"}},{children:[n("p",e({style:{margin:"0 0 5px 0",fontSize:12,color:B,fontFamily:P}},{children:r})),n("div",e({style:{flex:1,padding:"9px 12px",borderRadius:Y,background:"#FFF3F2",border:"1px solid ".concat("#FECACA"),fontSize:13,lineHeight:"150%",color:l?E:R,fontFamily:P,fontStyle:l?"normal":"italic",wordBreak:"break-word",whiteSpace:"pre-wrap",minHeight:37}},{children:l||"—"}))]}))});ne.displayName="FieldCell";var ie=function(t){var r=t.formData,p=t.existingData,u=t.onClose,f=t.visible,h=r.whenToApply.map(function(e){return e.text}).filter(Boolean).join("\n"),g=r.whenNotToApply.map(function(e){return e.text}).filter(Boolean).join("\n"),y=$(p.whenToApply),x=$(p.whenNotToApply),v=s(function(){return[{label:"Title",proposed:r.name,existing:p.name||"",relation:ee(r.name,p.name||"")},{label:"Description",proposed:r.description,existing:p.description||"",relation:ee(r.description,p.description||"")},{label:"When to apply",proposed:h,existing:y,relation:ee(h,y)},{label:"When NOT to Apply",proposed:g,existing:x,relation:g?ee(g,x):x?"new_field":"exact_match"}]},[r.name,r.description,h,g,p.name,p.description,y,x]),w=v.reduce(function(e,t){return e[t.relation]=(e[t.relation]||0)+1,e},{}),C=a(null),k=a([]),S=a([]),z=l([]),D=z[0],B=z[1];k.current=[],S.current=[];var R=c(function(){if(C.current){var e=C.current.getBoundingClientRect(),t=[];v.forEach(function(n,i){var o=k.current[i],r=S.current[i];if(o&&r){o.style.height="auto",r.style.height="auto";var l=o.getBoundingClientRect(),a=r.getBoundingClientRect(),d=Math.max(l.height,a.height);o.style.height="".concat(d,"px"),r.style.height="".concat(d,"px");var c=o.getBoundingClientRect(),s=r.getBoundingClientRect(),p=c.top+c.height/2-e.top;t.push({x1:c.right-e.left,y1:p,x2:s.left-e.left,y2:p,relation:n.relation})}}),B(t)}},[v]);return d(function(){var e=setTimeout(R,150);window.addEventListener("resize",R);var t=null;return C.current&&(t=new ResizeObserver(function(){window.requestAnimationFrame(function(){return R()})})).observe(C.current),function(){clearTimeout(e),window.removeEventListener("resize",R),t&&t.disconnect()}},[R,f]),i(o,{children:[n("div",{onClick:u,style:{position:"absolute",inset:0,background:"rgba(15,23,42,0.18)",zIndex:10,opacity:f?1:0,transition:"opacity 0.25s ease",pointerEvents:f?"auto":"none"}}),i("div",e({style:{position:"absolute",inset:0,background:L,zIndex:11,display:"flex",flexDirection:"column",transform:f?"translateX(0)":"translateX(100%)",transition:"transform 0.28s cubic-bezier(0.4,0,0.2,1)",borderRadius:Y,overflow:"hidden"}},{children:[i("div",e({style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",borderBottom:"1px solid ".concat(F),flexShrink:0,background:L}},{children:[i("div",e({style:{display:"flex",alignItems:"center",gap:10}},{children:[n("button",e({type:"button",onClick:u,style:e(e({},X),{width:32,height:32,border:"1px solid ".concat(F),borderRadius:U})},{children:n(m,{size:15,color:A})})),n("span",e({style:{fontSize:15,fontWeight:600,color:E,fontFamily:P,letterSpacing:"-0.01em"}},{children:"Category Comparison"}))]})),n("div",e({style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"}},{children:Object.entries(w).map(function(t){var o=t[0],r=t[1];return i("div",e({style:{display:"flex",alignItems:"center",gap:4,padding:"3px 10px",borderRadius:20,background:Q[o].bg,border:"1px solid ".concat(Q[o].border),fontSize:11,fontWeight:600,color:Q[o].text,fontFamily:P}},{children:[n("span",{style:{width:5,height:5,borderRadius:"50%",background:Q[o].dot}}),r," ",Q[o].label]}),o)})}))]})),n("div",e({style:{flex:1,overflowY:"auto",padding:16}},{children:i("div",e({ref:C,style:{display:"grid",gridTemplateColumns:"1fr 140px 1fr",alignItems:"start",gap:"0",position:"relative"}},{children:[n("svg",e({style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:10}},{children:D.map(function(t,o){var r=(t.x1+t.x2)/2,l=t.y1,a=Q[t.relation];return i("g",{children:[n("line",{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:a.border,strokeWidth:"1.5"}),n("foreignObject",e({x:r-70,y:l-14,width:"140",height:"28"},{children:n("div",e({style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:n(te,{relation:t.relation})}))}))]},o)})})),i("div",e({style:{border:"1.5px dashed #CBD5E1",borderRadius:10,padding:14,display:"flex",flexDirection:"column",gap:14}},{children:[n("p",e({style:{margin:"0 0 2px 0",fontSize:13,fontWeight:600,color:E,fontFamily:P}},{children:"Category You're Creating"})),v.map(function(e,t){return n(ne,{ref:function(e){k.current[t]=e},label:e.label,value:e.proposed},t)})]})),n("div",{}),i("div",e({style:{border:"1.5px dashed #CBD5E1",borderRadius:10,padding:14,display:"flex",flexDirection:"column",gap:14}},{children:[i("p",e({style:{margin:"0 0 2px 0",fontSize:13,fontWeight:600,color:H,fontFamily:P,display:"flex",alignItems:"center",gap:5}},{children:[n(b,{size:13,color:H}),"Existing Category"]})),v.map(function(e,t){return n(ne,{ref:function(e){S.current[t]=e},label:e.label,value:e.existing},t)})]}))]}))}))]}))]})},oe=function(t){var r=t.condition,l=t.index,a=t.isEditing,d=t.editText,c=t.onEditStart,s=t.onEditChange,p=t.onEditSave,y=t.onEditCancel,x=t.onRemove,m=t.readOnly,b=t.onBlurContainer,v={width:40,height:38,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:M,borderRight:"1px solid #D0D5DD",color:j,fontSize:14,fontFamily:P};return i("div",a?e({style:{display:"flex",alignItems:"center",gap:12},onBlur:b},{children:[i("div",e({style:{display:"flex",flex:1,alignItems:"center",background:L,border:"1px solid ".concat(k),borderRadius:Y,overflow:"hidden"}},{children:[n("div",e({style:v},{children:l+1})),n("input",{type:"text",value:d,onChange:function(e){return s(e.target.value)},autoFocus:!0,onKeyDown:function(e){"Enter"===e.key&&d.trim()?p():"Escape"===e.key&&y()},style:{flex:1,padding:"8px 11.5px",fontSize:14,fontFamily:P,color:D,border:"none",outline:"none",background:"transparent"}})]})),n("button",e({type:"button",disabled:!d.trim(),onClick:p,style:e(e({},X),{borderRadius:Y,opacity:d.trim()?1:.5,cursor:d.trim()?"pointer":"not-allowed",background:d.trim()?L:M})},{children:n(u,{size:18,color:O})})),n("button",e({type:"button",onClick:y,style:e(e({},X),{borderRadius:Y})},{children:n(f,{size:18,color:K})}))]}):e({style:{display:"flex",alignItems:"center",gap:12}},{children:[i("div",e({style:{display:"flex",flex:1,alignItems:"center",background:L,border:"1px solid #D0D5DD",borderRadius:Y,overflow:"hidden",height:38}},{children:[n("div",e({style:e(e({},v),{height:"100%"})},{children:l+1})),n("div",e({style:{flex:1,padding:"0 11.5px",fontSize:14,fontFamily:P,display:"flex",alignItems:"center",height:"100%"}},{children:r.text?n("span",e({style:{color:D}},{children:r.text})):n("span",e({style:{color:R}},{children:"Enter condition"}))}))]})),!m&&i(o,{children:[n("button",e({type:"button",onClick:c,style:e(e({},X),{border:"1px solid ".concat(F),borderRadius:Y})},{children:n(h,{size:16,color:q})})),n("button",e({type:"button",onClick:x,style:e(e({},X),{border:"1px solid ".concat(z),borderRadius:Y})},{children:n(g,{size:16,color:K})}))]})]}))},re=function(t){var r=t.title,l=t.required,a=t.isExpanded,d=t.setIsExpanded,c=t.conditions,s=t.prefix,p=t.editingCondKey,u=t.editingCondText,f=t.setEditingCondKey,h=t.setEditingCondText,g=t.onAdd,x=t.onUpdate,m=t.onRemove,b=t.addLabel,w=t.readOnly,C=t.errorMessage,k=t.style,S=c.length>0;return i("div",e({style:e({border:"1px solid ".concat(F),borderRadius:Y,padding:16},k)},{children:[i("div",e({style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:8,cursor:S?"pointer":"default",userSelect:"none"},onClick:function(){S&&d(function(e){return!e})}},{children:[i("label",e({style:e(e({},Z),{marginBottom:0,cursor:S?"pointer":"default"})},{children:[l&&J,n("span",{children:r})]})),n("button",e({type:"button",style:{background:"none",border:"none",cursor:"pointer",padding:0,display:"flex",alignItems:"center",transform:a?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.2s"}},{children:n(y,{size:20,color:S?D:R})}))]})),a&&i(o,{children:[0===c.length&&n("p",e({style:{color:B,fontSize:14,fontStyle:"italic",fontWeight:300,fontFamily:P,margin:"0 0 12px 0"}},{children:"No conditions applied"})),n("div",e({style:{display:"flex",flexDirection:"column",gap:12,marginBottom:12}},{children:c.map(function(e,t){var i="".concat(s,"_").concat(e.id);return n(oe,{condition:e,index:t,isEditing:p===i,editText:u,onEditStart:function(){f(i),h(e.text)},onEditChange:h,onEditSave:function(){u.trim()&&(x(e.id,u),f(null))},onEditCancel:function(){e.text?f(null):m(e.id)},onRemove:function(){return m(e.id)},readOnly:w,onBlurContainer:function(t){return function(e,t,n){if(!e.currentTarget.contains(e.relatedTarget)){var i="".concat(s,"_").concat(t);u.trim()||n?u.trim()&&x(t,u):m(t),p===i&&f(null)}}(t,e.id,e.text)}},e.id)})})),!w&&i("button",e({type:"button",onClick:g,style:{display:"flex",alignItems:"center",gap:7,color:H,fontSize:14,fontWeight:500,fontFamily:P,background:"none",border:"none",cursor:"pointer",padding:0}},{children:[n(v,{size:16}),b]})),C&&n("p",e({style:{marginTop:8,color:I,fontSize:12,fontFamily:P,margin:"8px 0 0 0"}},{children:C}))]})]}))},le=function(r){var s=r.state,m=r.handlers,b=r.uiState,w=s.formData,k=s.nameLabel,W=void 0===k?"Category Name":k,M=s.namePlaceholder,Q=void 0===M?"Enter category name":M,$=m.setFormData,ee=b.readOnly,te=void 0!==ee&&ee,ne=b.isAiStreaming,oe=void 0!==ne&≠b.setActiveEditId,b.setSendMessageInChat;var le=b.validationErrors,ae=void 0===le?{}:le,de=b.addExampleBtnRef,ce=b.comparisonData,se=void 0===ce?null:ce,pe=b.onComparisonClose,ue=l(null),fe=ue[0],he=ue[1],ge=l(""),ye=ge[0],xe=ge[1],me=l(null),be=me[0],ve=me[1],we=l(""),Ce=we[0],Fe=we[1],ke=l(!0),Se=ke[0],ze=ke[1],De=l(!0),Ee=De[0],Ae=De[1],Be=l(null),Re=Be[0],Te=Be[1],Ie=l(""),We=Ie[0],He=Ie[1],je=l(""),Le=je[0],Me=je[1],Ne=l([]),_e=Ne[0],Oe=Ne[1],Ke=l(!1),qe=Ke[0],Ue=Ke[1],Ye=a(null),Pe=l(!1),Xe=Pe[0],Ve=Pe[1],Ze=a(oe);d(function(){se?requestAnimationFrame(function(){return Ue(!0)}):Ue(!1)},[se]),d(function(){Ze.current&&!oe&&Xe&&Ve(!1),Ze.current=oe},[oe,Xe]);var Ge=te,Je=c(function(t,n){return $(function(i){var o;return e(e({},i),((o={})[t]=n,o))})},[$]),Qe=function(n){var i=C();$(function(o){var r;return e(e({},o),((r={})[n]=t(t([],o[n],!0),[{id:i,text:""}],!1),r))}),ve("".concat("whenToApply"===n?"wta":"wnta","_").concat(i)),Fe(""),"whenToApply"!==n||Se||ze(!0),"whenNotToApply"!==n||Ee||Ae(!0)},$e=function(t,n,i){return $(function(o){var r;return e(e({},o),((r={})[t]=o[t].map(function(t){return t.id===n?e(e({},t),{text:i}):t}),r))})},et=function(t,n){return $(function(i){var o;return e(e({},i),((o={})[t]=i[t].filter(function(e){return e.id!==n}),o))})},tt=function(e){return Oe(function(n){return n.includes(e)?n.filter(function(t){return t!==e}):t(t([],n,!0),[e],!1)})},nt=c(function(){var n=C();$(function(i){return e(e({},i),{occurrences:t(t([],i.occurrences||[],!0),[{id:n,title:"",description:""}],!1)})}),Te(n),He(""),Me(""),Oe(function(e){return t(t([],e,!0),[n],!1)})},[$]),it=c(function(){Ue(!1),setTimeout(function(){null==pe||pe()},280)},[pe]),ot=function(t){return i("button",e({ref:t?void 0:de,type:"button",disabled:t,onClick:nt,style:{display:"flex",alignItems:"center",gap:7,padding:"7px 10.5px",background:"none",border:"none",cursor:t?"not-allowed":"pointer",opacity:t?.5:1,transition:"opacity 0.15s"}},{children:[n(v,{size:14,color:H}),n("span",e({style:{color:H,fontSize:14,fontWeight:500,fontFamily:P}},{children:"Add example"}))]}))};return i("div",e({style:{flex:1,overflowY:"auto",position:"relative"}},{children:[se&&n(ie,{formData:w,existingData:se,onClose:it,visible:qe}),Xe&&oe&&i("div",e({style:{display:"flex",alignItems:"center",color:"#141414",fontSize:13,fontWeight:500,fontStyle:"italic",marginBottom:12,paddingLeft:4,fontFamily:P}},{children:[n(p,{size:16,style:{marginRight:8,animation:"spin 1s linear infinite"}}),"Updating category details..."]})),i("div",e({style:e(e({},G),{marginBottom:12})},{children:[i("div",e({style:{marginBottom:12}},{children:[i("label",e({style:Z},{children:[J,n("span",{children:W})]})),Ge&&"name"!==fe?n("div",e({style:{display:"flex",alignItems:"center",gap:12}},{children:n("div",e({style:{flex:1,padding:"10px 14px",border:"1px solid #D0D5DD",borderRadius:U,fontSize:14,background:L,minHeight:42,display:"flex",alignItems:"center"}},{children:w.name?n("span",e({style:{color:D}},{children:w.name})):n("span",e({style:{color:T}},{children:Q}))}))})):Ge&&"name"===fe?i("div",e({style:{display:"flex",alignItems:"center",gap:12}},{children:[n("input",{type:"text",value:ye,onChange:function(e){return xe(e.target.value)},autoFocus:!0,onKeyDown:function(e){"Enter"===e.key?(Je("name",ye),he(null)):"Escape"===e.key&&he(null)},placeholder:Q,style:e(e({},V),{flex:1,width:"auto",border:"1px solid ".concat(S)})}),n("button",e({type:"button",onClick:function(){Je("name",ye),he(null)},style:X},{children:n(u,{size:18,color:O})})),n("button",e({type:"button",onClick:function(){return he(null)},style:X},{children:n(f,{size:18,color:K})}))]})):n("input",{type:"text",value:w.name,onChange:function(e){return Je("name",e.target.value)},placeholder:Q,disabled:oe,style:e(e({},V),{opacity:oe?.6:1,cursor:oe?"not-allowed":"text"})}),(null==ae?void 0:ae.name)&&n("p",e({style:{marginTop:4,color:I,fontSize:12,fontFamily:P,margin:"4px 0 0 0"}},{children:ae.name}))]})),i("div",e({style:{marginBottom:12}},{children:[i("label",e({style:Z},{children:[J,n("span",{children:"Category Description"})]})),Ge&&"description"!==fe?n("div",e({style:{display:"flex",alignItems:"flex-start",gap:12}},{children:n("div",e({style:{flex:1,padding:"12px 14px",border:"1px solid #D0D5DD",borderRadius:U,fontSize:14,background:L,minHeight:80}},{children:w.description?n("span",e({style:{color:D,whiteSpace:"pre-wrap"}},{children:w.description})):n("span",e({style:{color:T}},{children:"Describe when this category should be applied"}))}))})):Ge&&"description"===fe?i("div",e({style:{display:"flex",alignItems:"flex-start",gap:12}},{children:[n("textarea",{value:ye,onChange:function(e){return xe(e.target.value)},autoFocus:!0,onKeyDown:function(e){"Escape"===e.key&&he(null)},placeholder:"Enter Description",rows:4,style:e(e({},V),{flex:1,width:"auto",border:"1px solid ".concat(S),resize:"none",lineHeight:"140%"})}),i("div",e({style:{display:"flex",flexDirection:"column",gap:8}},{children:[n("button",e({type:"button",onClick:function(){Je("description",ye),he(null)},style:X},{children:n(u,{size:18,color:O})})),n("button",e({type:"button",onClick:function(){return he(null)},style:X},{children:n(f,{size:18,color:K})}))]}))]})):n("textarea",{value:w.description,onChange:function(e){return Je("description",e.target.value)},placeholder:"Describe when this category should be applied.",disabled:oe,style:e(e({},V),{height:60,paddingTop:7,paddingBottom:10.5,border:"1px solid ".concat(F),lineHeight:"140%",resize:"none",boxShadow:"0 1px 2px 0 rgba(18,18,23,0.05)",opacity:oe?.6:1,cursor:oe?"not-allowed":"text"})}),(null==ae?void 0:ae.description)&&n("p",e({style:{marginTop:4,color:I,fontSize:12,fontFamily:P,margin:"4px 0 0 0"}},{children:ae.description}))]})),n(re,{title:"When to Apply",required:!0,isExpanded:Se,setIsExpanded:ze,conditions:w.whenToApply,prefix:"wta",editingCondKey:be,editingCondText:Ce,setEditingCondKey:ve,setEditingCondText:Fe,onAdd:function(){return Qe("whenToApply")},onUpdate:function(e,t){return $e("whenToApply",e,t)},onRemove:function(e){return et("whenToApply",e)},addLabel:"Add When to Apply",readOnly:oe||te,errorMessage:null==ae?void 0:ae.whenToApply,style:{marginBottom:12}}),n(re,{title:"When NOT to Apply",required:!1,isExpanded:Ee,setIsExpanded:Ae,conditions:w.whenNotToApply,prefix:"wnta",editingCondKey:be,editingCondText:Ce,setEditingCondKey:ve,setEditingCondText:Fe,onAdd:function(){return Qe("whenNotToApply")},onUpdate:function(e,t){return $e("whenNotToApply",e,t)},onRemove:function(e){return et("whenNotToApply",e)},addLabel:"Add When NOT to Apply",readOnly:oe||te,errorMessage:null==ae?void 0:ae.whenNotToApply})]})),i("div",e({style:e(e({},G),{marginTop:12})},{children:[i("div",e({style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12}},{children:[i("div",{children:[i("h4",e({style:{color:E,fontSize:14,fontWeight:500,lineHeight:"120%",letterSpacing:"0.02em",fontFamily:P,margin:"0 0 4px 0"}},{children:["Example (",(w.occurrences||[]).length,")"]})),n("p",e({style:{color:B,fontSize:12,fontWeight:300,lineHeight:"120%",letterSpacing:"0.02em",fontFamily:P,margin:0}},{children:"Add real examples to help the system understand this category"}))]}),(w.occurrences||[]).length>0&&!te&&ot(null!==Re||oe)]})),0===(w.occurrences||[]).length?i("div",e({style:{border:"1px solid ".concat(F),borderRadius:Y,background:L,padding:"24px 12px 12px",minHeight:181,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}},{children:[n("div",e({style:{marginBottom:16}},{children:i("svg",e({xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 56 56",fill:"none"},{children:[n("rect",{x:"4",y:"4",width:"48",height:"48",rx:"24",fill:"#F1F5F9"}),n("rect",{x:"4",y:"4",width:"48",height:"48",rx:"24",stroke:"#F8FAFC",strokeWidth:"8"}),n("rect",{width:"24",height:"24",transform:"translate(16 16)",fill:"#F1F5F9"}),n("path",{d:"M25 19.5V18M21.0607 21.0607L20 20M21.0607 29L20 30.0607M29 21.0607L30.0607 20M19.5 25H18M31.8645 32.1896L29.3727 36.817C29.0881 37.3457 28.9457 37.61 28.7745 37.6769C28.6259 37.7349 28.4585 37.7185 28.324 37.6328C28.1689 37.534 28.0806 37.2471 27.9038 36.6733L24.4452 25.4453C24.3008 24.9765 24.2286 24.7421 24.2867 24.5838C24.3373 24.446 24.446 24.3373 24.5838 24.2867C24.7421 24.2286 24.9765 24.3008 25.4452 24.4452L36.6732 27.9038C37.247 28.0806 37.5339 28.169 37.6327 28.324C37.7185 28.4586 37.7348 28.6259 37.6768 28.7745C37.61 28.9458 37.3456 29.0881 36.817 29.3728L32.1896 31.8645C32.111 31.9068 32.0717 31.9279 32.0374 31.9551C32.0068 31.9792 31.9792 32.0068 31.9551 32.0374C31.9279 32.0717 31.9068 32.111 31.8645 32.1896Z",stroke:"#475569",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}))})),n("p",e({style:{color:A,fontSize:12,fontWeight:500,lineHeight:"120%",fontFamily:P,margin:"0 0 8px 0"}},{children:"No example added yet"})),n("p",e({style:{color:B,fontSize:14,fontWeight:300,lineHeight:"140%",fontFamily:P,margin:"0 0 8px 0",maxWidth:530}},{children:"Add an example to show how this category is used, or generate one using chat."})),!te&&ot(null!==Re||oe)]})):n("div",e({style:{display:"flex",flexDirection:"column",gap:12}},{children:(w.occurrences||[]).map(function(t,r){var l=_e.includes(t.id);return Re===t.id?i("div",e({style:{display:"flex",flexDirection:"column",gap:12,border:"1px solid ".concat(F),borderRadius:Y,background:L,padding:16,boxShadow:"0 1px 3px rgba(0,0,0,0.07)"}},{children:[i("div",{children:[n("label",e({style:e(e({},Z),{marginBottom:8})},{children:n("span",e({style:{color:A}},{children:"Title/Subject"}))})),n("input",{type:"text",value:We,onChange:function(e){return He(e.target.value)},placeholder:"e.g., Follow-up on client feedback from last meeting",style:e(e({},V),{border:"1px solid ".concat(F),lineHeight:"140%"})})]}),i("div",{children:[i("label",e({style:{display:"flex",alignItems:"center",gap:4,marginBottom:8}},{children:[n("span",e({style:{color:A,fontSize:14,fontWeight:500,fontFamily:P}},{children:"Message body"})),J]})),n("textarea",{ref:function(e){e&&Re===t.id&&!Ye.current&&(Ye.current=e),e&&(e.style.height="auto",e.style.height="".concat(e.scrollHeight,"px"))},value:Le,onChange:function(e){Me(e.target.value),e.target.style.height="auto",e.target.style.height="".concat(e.target.scrollHeight,"px")},placeholder:"e.g., Hi, here's the latest update on the project. Let us know if you have any questions.",rows:1,style:e(e({},V),{border:"1px solid ".concat(F),overflow:"hidden",minHeight:60,lineHeight:"140%",resize:"none"})})]}),i("div",e({style:{display:"flex",justifyContent:"flex-end",gap:12,marginTop:4}},{children:[n("button",e({type:"button",onClick:function(){t.title||t.description||$(function(n){return e(e({},n),{occurrences:(n.occurrences||[]).filter(function(e){return e.id!==t.id})})}),Te(null),Ye.current=null},style:{padding:"6px 12px",color:j,fontSize:14,fontWeight:500,lineHeight:"140%",fontFamily:P,background:"none",border:"none",cursor:"pointer",borderRadius:U}},{children:"Cancel"})),n("button",e({type:"button",disabled:!Le.trim(),onClick:function(){var n;Le.trim()&&(n=t.id,$(function(t){return e(e({},t),{occurrences:t.occurrences.map(function(t){return t.id===n?e(e({},t),{title:We,description:Le}):t})})}),Te(null),Ye.current=null,Oe(function(e){return e.filter(function(e){return e!==t.id})}))},style:{padding:"6px 12px",borderRadius:U,fontSize:14,fontWeight:500,lineHeight:"140%",fontFamily:P,cursor:Le.trim()?"pointer":"not-allowed",background:Le.trim()?_:L,border:"1px solid ".concat(Le.trim()?_:"#E2E8F0"),color:Le.trim()?H:R,transition:"background 0.15s"}},{children:"Save"}))]}))]}),t.id):i("div",e({style:{display:"flex",flexDirection:"column",border:"1px solid #E2E8F0",borderRadius:Y,background:L,overflow:"hidden",boxShadow:"0 1px 3px rgba(0,0,0,0.07)"}},{children:[i("div",e({style:{display:"flex",alignItems:"center",gap:12,padding:12}},{children:[n("div",e({style:{width:20,height:20,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:N,borderRadius:U,color:j,fontSize:10,fontWeight:500,fontFamily:P}},{children:r+1})),n("div",e({style:{flex:1,fontSize:15,fontWeight:500,lineHeight:"140%",fontFamily:P,color:A,wordBreak:"break-word"}},{children:t.title||n("span",e({style:{color:R,fontWeight:400,fontSize:14}},{children:"Untitled example"}))})),i("div",e({style:{display:"flex",alignItems:"center",gap:8,flexShrink:0}},{children:[!te&&i(o,{children:[n("button",e({type:"button",disabled:null!==Re||oe,onClick:function(){Te(t.id),He(t.title),Me(t.description),l||tt(t.id)},style:e(e({},X),{width:36,height:36,border:"1px solid #E2E8F0",borderRadius:U,opacity:null!==Re||oe?.5:1,cursor:null!==Re||oe?"not-allowed":"pointer"})},{children:n(h,{size:16,color:q})})),n("button",e({type:"button",disabled:null!==Re||oe,onClick:function(){return $(function(n){return e(e({},n),{occurrences:(n.occurrences||[]).filter(function(e){return e.id!==t.id})})})},style:e(e({},X),{width:36,height:36,border:"1px solid ".concat(z),borderRadius:U,opacity:null!==Re||oe?.5:1,cursor:null!==Re||oe?"not-allowed":"pointer"})},{children:n(g,{size:16,color:K})}))]}),n("button",e({type:"button",onClick:function(){return tt(t.id)},style:e(e({},X),{width:36,height:36,border:"none",background:"transparent"})},{children:n(l?y:x,{size:20,color:q})}))]}))]})),l&&i("div",e({style:{display:"flex",flexDirection:"column",padding:"4px 12px 16px"}},{children:[i("div",e({style:{marginBottom:12}},{children:[n("p",e({style:{color:B,fontSize:13,lineHeight:"140%",fontFamily:P,margin:"0 0 4px 0"}},{children:"Title/Subject:"})),n("p",e({style:{color:E,fontSize:14,fontWeight:300,lineHeight:"150%",fontFamily:P,whiteSpace:"pre-wrap",wordBreak:"break-word",margin:0}},{children:t.title||n("span",e({style:{color:R,fontStyle:"italic"}},{children:"—"}))}))]})),i("div",{children:[n("p",e({style:{color:B,fontSize:13,lineHeight:"140%",fontFamily:P,margin:"0 0 4px 0"}},{children:"Message body:"})),n("p",e({style:{color:E,fontSize:14,fontWeight:300,lineHeight:"150%",fontFamily:P,whiteSpace:"pre-wrap",wordBreak:"break-word",margin:0}},{children:t.description}))]})]}))]}),t.id)})}))]}))]}))};export{le as CreateCategory,le as default};
2
- //# sourceMappingURL=CreateCategory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CreateCategory.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import{__assign as i}from"tslib";import{jsx as e,jsxs as n}from"react/jsx-runtime";import{useState as t}from"react";import{ConditionSection as o}from"../../organisms/ConditionSection/ConditionSection.js";import{TextSection as l}from"../../organisms/TextSection/TextSection.js";var r=function(r){var d,s,u,a=r.state,p=r.handlers,h=r.uiState,g=(null==h?void 0:h.highlights)||{},c=t({}),v=c[0],y=c[1],m=function(e){y(function(n){var t;return i(i({},n),((t={})[e]=!n[e],t))})},A=function(i){var e,n=null===(e=a.fieldCitations)||void 0===e?void 0:e[i];return Array.isArray(n)&&n.length>0?n:a.citations};return e("div",i({className:"simple-guideline-template"},{children:n("div",i({style:{display:"flex",flexDirection:"column",gap:"20px"}},{children:[e(l,i({id:"guideline-title",title:"Guideline Title",rows:1,placeholder:"Enter a short, descriptive title for the guideline",required:!0,value:a.guidelineTitle,onChange:p.setGuidelineTitle,readOnly:null==h?void 0:h.isAiStreaming,isOpen:v.guidelineTitle,onToggle:function(){return m("guidelineTitle")},isHighlighted:g.guidelineTitle||!1,tooltipDescription:"Why this Title?",errorMessage:null===(d=null==h?void 0:h.validationErrors)||void 0===d?void 0:d.guidelineTitle},h)),e(l,i({id:"guideline-description",title:"Guideline Description",rows:4,placeholder:"Describe what this guideline enforces or ensures",required:!0,value:a.guidelineDescription,onChange:p.setGuidelineDescription,readOnly:null==h?void 0:h.isAiStreaming,isOpen:v.guidelineDescription,onToggle:function(){return m("guidelineDescription")},isHighlighted:g.guidelineDescription||!1,tooltipDescription:"Why this Description?",errorMessage:null===(s=null==h?void 0:h.validationErrors)||void 0===s?void 0:s.guidelineDescription},h)),e(o,i({id:"when-to-apply",title:"When to apply",required:!0,dividerRequired:!0,readOnly:null==h?void 0:h.isAiStreaming,conditions:a.whenToApplyConditions||[],onAdd:function(){return p.addWhenToApply()},onRemove:function(i,e,n){return p.removeWhenToApply(n)},onEdit:function(i,e,n,t){return p.editWhenToApply(n,t)},index:0,tierKey:"default",isHighlighted:g.wta||!1,highlightedIds:null==h?void 0:h.highlightedIds,tooltipDescription:"Why this Condition?",citations:A("whenToApply"),bordered:!0,addLabel:"Add When to apply",isAiStreaming:null==h?void 0:h.isAiStreaming,errorMessage:null===(u=null==h?void 0:h.validationErrors)||void 0===u?void 0:u.whenToApply},h)),e(o,i({id:"when-not-to-apply",title:"When NOT to apply",required:!1,dividerRequired:!0,readOnly:null==h?void 0:h.isAiStreaming,conditions:a.whenNotToApplyConditions||[],onAdd:function(){return p.addWhenNotToApply()},onRemove:function(i,e,n){return p.removeWhenNotToApply(n)},onEdit:function(i,e,n,t){return p.editWhenNotToApply(n,t)},index:0,tierKey:"default",isHighlighted:g.wnta||!1,highlightedIds:null==h?void 0:h.highlightedIds,tooltipDescription:"Why this Condition?",citations:A("whenNotToApply"),bordered:!0,addLabel:"Add When NOT to apply",isAiStreaming:null==h?void 0:h.isAiStreaming},h))]}))}))};export{r as WorkflowComposer};
2
- //# sourceMappingURL=WorkflowComposer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WorkflowComposer.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}