@e-llm-studio/instant-learning 1.3.0-alpha.224 → 1.3.0-alpha.225

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 (115) hide show
  1. package/dist/cjs/features/IL-OTJ/_components/templates/TrafficManager/CreateRule.js +1 -1
  2. package/dist/cjs/features/LearningManagement/components/CreateLearningSetModal.js +1 -1
  3. package/dist/cjs/features/LearningManagement/styles/CreateLearningSetModal.module.css.js +1 -1
  4. package/dist/cjs/schema-driven/BPARenderer.js +1 -1
  5. package/dist/cjs/schema-driven/components/VariantListField.js +1 -1
  6. package/dist/cjs/schema-driven/hooks/useSectionEditSession.js +1 -1
  7. package/dist/cjs/schema-driven/primitives/Accordion.js +1 -1
  8. package/dist/cjs/schema-driven/utils/editLock.js +2 -0
  9. package/dist/cjs/schema-driven/utils/editLock.js.map +1 -0
  10. package/dist/features/IL-OTJ/_components/templates/TrafficManager/CreateRule.js +1 -1
  11. package/dist/features/LearningManagement/components/CreateLearningSetModal.js +1 -1
  12. package/dist/schema-driven/BPARenderer.js +1 -1
  13. package/dist/schema-driven/components/VariantListField.js +1 -1
  14. package/dist/schema-driven/hooks/useSectionEditSession.js +1 -1
  15. package/dist/schema-driven/primitives/Accordion.js +1 -1
  16. package/dist/schema-driven/utils/editLock.js +2 -0
  17. package/dist/schema-driven/utils/editLock.js.map +1 -0
  18. package/dist/types/src/features/IL-OTJ/_components/templates/TrafficManager/CreateRule.d.ts +2 -1
  19. package/dist/types/src/features/IL-OTJ/_components/templates/TrafficManager/CreateRule.d.ts.map +1 -1
  20. package/dist/types/src/schema-driven/BPARenderer.d.ts.map +1 -1
  21. package/dist/types/src/schema-driven/components/VariantListField.d.ts.map +1 -1
  22. package/dist/types/src/schema-driven/hooks/useSectionEditSession.d.ts +7 -2
  23. package/dist/types/src/schema-driven/hooks/useSectionEditSession.d.ts.map +1 -1
  24. package/dist/types/src/schema-driven/primitives/Accordion.d.ts.map +1 -1
  25. package/dist/types/src/schema-driven/types.d.ts +5 -0
  26. package/dist/types/src/schema-driven/types.d.ts.map +1 -1
  27. package/dist/types/src/schema-driven/utils/editLock.d.ts +39 -0
  28. package/dist/types/src/schema-driven/utils/editLock.d.ts.map +1 -0
  29. package/package.json +1 -1
  30. package/dist/6fbbe065ef78c384.gif +0 -0
  31. package/dist/cjs/6fbbe065ef78c384.gif +0 -0
  32. package/dist/cjs/features/IL-OTJ/_components/templates/BaseTemplate/BaseTemplate.js +0 -2
  33. package/dist/cjs/features/IL-OTJ/_components/templates/BaseTemplate/BaseTemplate.js.map +0 -1
  34. package/dist/cjs/features/IL-OTJ/_components/templates/CreateCategory/CreateCategory.js +0 -2
  35. package/dist/cjs/features/IL-OTJ/_components/templates/CreateCategory/CreateCategory.js.map +0 -1
  36. package/dist/cjs/features/IL-OTJ/_components/templates/WorkflowComposer/WorkflowComposer.js +0 -2
  37. package/dist/cjs/features/IL-OTJ/_components/templates/WorkflowComposer/WorkflowComposer.js.map +0 -1
  38. package/dist/cjs/features/LSCGuidelinesCart/Cart/Cart.js +0 -2
  39. package/dist/cjs/features/LSCGuidelinesCart/Cart/Cart.js.map +0 -1
  40. package/dist/cjs/features/LSCGuidelinesCart/Cart/Cart.styles.js +0 -2
  41. package/dist/cjs/features/LSCGuidelinesCart/Cart/Cart.styles.js.map +0 -1
  42. package/dist/cjs/features/LSCGuidelinesCart/GuidelineCard.js +0 -2
  43. package/dist/cjs/features/LSCGuidelinesCart/GuidelineCard.js.map +0 -1
  44. package/dist/cjs/features/LSCGuidelinesCart/GuidelineCard.styles.js +0 -2
  45. package/dist/cjs/features/LSCGuidelinesCart/GuidelineCard.styles.js.map +0 -1
  46. package/dist/cjs/features/LSCGuidelinesCart/GuidelinesLandingPage.js +0 -2
  47. package/dist/cjs/features/LSCGuidelinesCart/GuidelinesLandingPage.js.map +0 -1
  48. package/dist/cjs/features/LSCGuidelinesCart/GuidelinesLandingPage.styles.js +0 -2
  49. package/dist/cjs/features/LSCGuidelinesCart/GuidelinesLandingPage.styles.js.map +0 -1
  50. package/dist/cjs/features/LSCGuidelinesCart/LearningManagementWrapper.js +0 -2
  51. package/dist/cjs/features/LSCGuidelinesCart/LearningManagementWrapper.js.map +0 -1
  52. package/dist/cjs/features/LSCGuidelinesCart/api.js +0 -2
  53. package/dist/cjs/features/LSCGuidelinesCart/api.js.map +0 -1
  54. package/dist/cjs/features/LSCGuidelinesCart/endpoints.js +0 -2
  55. package/dist/cjs/features/LSCGuidelinesCart/endpoints.js.map +0 -1
  56. package/dist/cjs/features/LSCGuidelinesCart/transformSelectedGuidelineData.js +0 -2
  57. package/dist/cjs/features/LSCGuidelinesCart/transformSelectedGuidelineData.js.map +0 -1
  58. package/dist/cjs/features/LearningManagement/public/ThinkingBulbIcon.gif.js +0 -2
  59. package/dist/cjs/features/LearningManagement/public/ThinkingBulbIcon.gif.js.map +0 -1
  60. package/dist/features/IL-OTJ/_components/templates/BaseTemplate/BaseTemplate.js +0 -2
  61. package/dist/features/IL-OTJ/_components/templates/BaseTemplate/BaseTemplate.js.map +0 -1
  62. package/dist/features/IL-OTJ/_components/templates/CreateCategory/CreateCategory.js +0 -2
  63. package/dist/features/IL-OTJ/_components/templates/CreateCategory/CreateCategory.js.map +0 -1
  64. package/dist/features/IL-OTJ/_components/templates/WorkflowComposer/WorkflowComposer.js +0 -2
  65. package/dist/features/IL-OTJ/_components/templates/WorkflowComposer/WorkflowComposer.js.map +0 -1
  66. package/dist/features/LSCGuidelinesCart/Cart/Cart.js +0 -2
  67. package/dist/features/LSCGuidelinesCart/Cart/Cart.js.map +0 -1
  68. package/dist/features/LSCGuidelinesCart/Cart/Cart.styles.js +0 -2
  69. package/dist/features/LSCGuidelinesCart/Cart/Cart.styles.js.map +0 -1
  70. package/dist/features/LSCGuidelinesCart/GuidelineCard.js +0 -2
  71. package/dist/features/LSCGuidelinesCart/GuidelineCard.js.map +0 -1
  72. package/dist/features/LSCGuidelinesCart/GuidelineCard.styles.js +0 -2
  73. package/dist/features/LSCGuidelinesCart/GuidelineCard.styles.js.map +0 -1
  74. package/dist/features/LSCGuidelinesCart/GuidelinesLandingPage.js +0 -2
  75. package/dist/features/LSCGuidelinesCart/GuidelinesLandingPage.js.map +0 -1
  76. package/dist/features/LSCGuidelinesCart/GuidelinesLandingPage.styles.js +0 -2
  77. package/dist/features/LSCGuidelinesCart/GuidelinesLandingPage.styles.js.map +0 -1
  78. package/dist/features/LSCGuidelinesCart/LearningManagementWrapper.js +0 -2
  79. package/dist/features/LSCGuidelinesCart/LearningManagementWrapper.js.map +0 -1
  80. package/dist/features/LSCGuidelinesCart/api.js +0 -2
  81. package/dist/features/LSCGuidelinesCart/api.js.map +0 -1
  82. package/dist/features/LSCGuidelinesCart/endpoints.js +0 -2
  83. package/dist/features/LSCGuidelinesCart/endpoints.js.map +0 -1
  84. package/dist/features/LSCGuidelinesCart/transformSelectedGuidelineData.js +0 -2
  85. package/dist/features/LSCGuidelinesCart/transformSelectedGuidelineData.js.map +0 -1
  86. package/dist/features/LearningManagement/public/ThinkingBulbIcon.gif.js +0 -2
  87. package/dist/features/LearningManagement/public/ThinkingBulbIcon.gif.js.map +0 -1
  88. package/dist/types/src/ThinkingBulbIconComponent.d.ts +0 -4
  89. package/dist/types/src/ThinkingBulbIconComponent.d.ts.map +0 -1
  90. package/dist/types/src/features/LSCGuidelinesCart/Cart/Cart.d.ts +0 -10
  91. package/dist/types/src/features/LSCGuidelinesCart/Cart/Cart.d.ts.map +0 -1
  92. package/dist/types/src/features/LSCGuidelinesCart/Cart/Cart.styles.d.ts +0 -6
  93. package/dist/types/src/features/LSCGuidelinesCart/Cart/Cart.styles.d.ts.map +0 -1
  94. package/dist/types/src/features/LSCGuidelinesCart/GuidelineCard.d.ts +0 -11
  95. package/dist/types/src/features/LSCGuidelinesCart/GuidelineCard.d.ts.map +0 -1
  96. package/dist/types/src/features/LSCGuidelinesCart/GuidelineCard.styles.d.ts +0 -6
  97. package/dist/types/src/features/LSCGuidelinesCart/GuidelineCard.styles.d.ts.map +0 -1
  98. package/dist/types/src/features/LSCGuidelinesCart/GuidelinesLandingPage.d.ts +0 -16
  99. package/dist/types/src/features/LSCGuidelinesCart/GuidelinesLandingPage.d.ts.map +0 -1
  100. package/dist/types/src/features/LSCGuidelinesCart/GuidelinesLandingPage.styles.d.ts +0 -6
  101. package/dist/types/src/features/LSCGuidelinesCart/GuidelinesLandingPage.styles.d.ts.map +0 -1
  102. package/dist/types/src/features/LSCGuidelinesCart/LearningManagementWrapper.d.ts +0 -19
  103. package/dist/types/src/features/LSCGuidelinesCart/LearningManagementWrapper.d.ts.map +0 -1
  104. package/dist/types/src/features/LSCGuidelinesCart/api.d.ts +0 -4
  105. package/dist/types/src/features/LSCGuidelinesCart/api.d.ts.map +0 -1
  106. package/dist/types/src/features/LSCGuidelinesCart/endpoints.d.ts +0 -5
  107. package/dist/types/src/features/LSCGuidelinesCart/endpoints.d.ts.map +0 -1
  108. package/dist/types/src/features/LSCGuidelinesCart/interfacesApi.d.ts +0 -25
  109. package/dist/types/src/features/LSCGuidelinesCart/interfacesApi.d.ts.map +0 -1
  110. package/dist/types/src/features/LSCGuidelinesCart/transformSelectedGuidelineData.d.ts +0 -18
  111. package/dist/types/src/features/LSCGuidelinesCart/transformSelectedGuidelineData.d.ts.map +0 -1
  112. package/dist/types/src/routes/ErrorBoundary.d.ts +0 -22
  113. package/dist/types/src/routes/ErrorBoundary.d.ts.map +0 -1
  114. package/dist/types/src/routes/Routes.d.ts +0 -3
  115. package/dist/types/src/routes/Routes.d.ts.map +0 -1
@@ -1,2 +1,2 @@
1
- import{__assign as i}from"tslib";import{jsx as n,jsxs as t}from"react/jsx-runtime";import{useRef as o,useEffect as e}from"react";import{AlertTriangle as r}from"lucide-react";import{VariantListWrapper as a}from"../../features/IL-OTJ/_components/templates/TrafficManager/CreateRule.js";import d from"../../features/IL-OTJ/_components/AccordianSection.js";import{EditPencilIcon as l}from"../../features/IL-OTJ/_components/_svg/EditPencilIcon.js";import{useVariantEditSession as u,hasMeaningfulText as s}from"../../features/IL-OTJ/_components/hooks/useVariantEditSession.js";import{useDynamicFormStore as p}from"../store/useDynamicFormStore.js";import{splitConditions as c}from"../utils/conditionText.js";import{useParentEditEnabled as v}from"../hooks/useParentEditEnabled.js";function f(f){var m,h,g,y,x,C,A,S,T=v(f.schema),w=f.tierKey||"tier_1",b=!1!==(null===(m=f.schema)||void 0===m?void 0:m.show_variant_pill),E=(null===(g=null===(h=f.state)||void 0===h?void 0:h.variantsByTier)||void 0===g?void 0:g[w])||[{}],D=(null===(y=f.schema)||void 0===y?void 0:y.properties)||{},I=function(i){return Object.entries(D).filter(function(n){var t=n[1];return(null==t?void 0:t.bpa_ui_component)===i&&!(null==t?void 0:t.hidden)}).sort(function(i,n){var t,o,e=i[1],r=n[1];return(null!==(t=null==e?void 0:e.ui_position)&&void 0!==t?t:0)-(null!==(o=null==r?void 0:r.ui_position)&&void 0!==o?o:0)}).map(function(i){var n=i[0],t=i[1];return String((null==t?void 0:t.data_key)||n).replace("global.","")})},V=I("TextInput")[0],_=I("PromptTextEditor")[0],O=I("ConditionSection"),P=O[0],j=O[1],k=p(function(i){return i.variantData}),F=o(null===(x=f.uiState)||void 0===x?void 0:x.isAiStreaming);e(function(){var i,n;F.current&&!(null===(i=f.uiState)||void 0===i?void 0:i.isAiStreaming)&&p.getState().clearAllMirages(),F.current=null===(n=f.uiState)||void 0===n?void 0:n.isAiStreaming},[null===(C=f.uiState)||void 0===C?void 0:C.isAiStreaming]);var N=u(f.uiState,function(i){var n=p.getState().getVariantField,t=function(t){return t?n(w,i,t):void 0};return{ruleDescription:t(V)||"",instructionPrompt:t(_)||"",whenToApplyConditions:c(t(P)||"","wta"),whenNotToApplyConditions:c(t(j)||"","wnta")}},function(i,n){var t=p.getState(),o=t.setVariantField,e=t.setVariantMirage;void 0!==i.instructionPrompt&&_&&o(n.tierKey,n.variantIndex,_,i.instructionPrompt),void 0!==i.ruleDescription&&V&&e(n.tierKey,n.variantIndex,V,i.ruleDescription),void 0!==i.whenToApplyText&&P&&e(n.tierKey,n.variantIndex,P,i.whenToApplyText),void 0!==i.whenNotToApplyText&&j&&e(n.tierKey,n.variantIndex,j,i.whenNotToApplyText)}),R=N.variantEdit,z=N.pendingVariantId,B=N.handleStartVariantEdit,K=N.handleCancelVariantEdit,M=N.patchVariantDraft,J=N.editDraftCondition,L=N.removeDraftCondition,W=N.addDraftCondition,q=N.handleSaveVariantEdit;return n(a,i({onAddVariant:function(){var i;(null===(i=f.handlers)||void 0===i?void 0:i.addNewVariant)&&f.handlers.addNewVariant(w)},isDisabled:null===(A=f.uiState)||void 0===A?void 0:A.isAiStreaming,showAddVariantBtn:!T&&"Edit"!==(null===(S=f.uiState)||void 0===S?void 0:S.usedFor)},{children:E.map(function(o,e){var a,u,p,c,v,m=o.variantType||"default",h="default"===m||"default_variant"===m,g="".concat(w,"-variant-").concat(e),y=!0===o.is_variant,x=null===(a=f.uiState)||void 0===a?void 0:a.activeVariantAccordionIndex,C=void 0!==x?x===e:y,A=o.isReadOnly||(null===(u=f.uiState)||void 0===u?void 0:u.isAiStreaming),S="variant-".concat(w,"-").concat(e),E=T&&(null==R?void 0:R.id)===S,D=z===S,I=E?R.draft:null,O=A||D,F=(null===(p=null==k?void 0:k[w])||void 0===p?void 0:p[e])||{},N=![V,_,P,j].some(function(i){return i&&s(F[i])}),G=!I||!s(I.ruleDescription)||!I.whenToApplyConditions.some(function(i){return s(i.text)}),H=i({},function(i){var n,t={},o=function(n){void 0===n&&(n={}),Object.entries(n).forEach(function(n){var e=n[0],r=n[1],a=((null==r?void 0:r.data_key)||e).replace("global.","");t[a]={readOnly:i},(null==r?void 0:r.properties)&&o(r.properties)})};return o(null===(n=f.schema)||void 0===n?void 0:n.properties),t}(A));if(T){var Q=function(n,t){n&&(H[n]=i(i({},H[n]||{}),t))};Q(V,i({readOnly:A||!E,enableInlineEdit:!1},I?{value:I.ruleDescription,onChange:function(i){return M({ruleDescription:i})}}:{})),Q(_,i({readOnly:A||!E,hideEditControls:!0,parentEditing:E},I?{value:I.instructionPrompt,onChange:function(i){return M({instructionPrompt:i})}}:{})),Q(P,i({readOnly:A,hideEditControls:!0,parentEditing:E},I?{conditions:I.whenToApplyConditions,onAdd:function(){return W("whenToApplyConditions")},onRemove:function(i,n,t){return L("whenToApplyConditions",t)},onEdit:function(i,n,t,o){return J("whenToApplyConditions",t,o)}}:{})),Q(j,i({readOnly:A,hideEditControls:!0,parentEditing:E},I?{conditions:I.whenNotToApplyConditions,onAdd:function(){return W("whenNotToApplyConditions")},onRemove:function(i,n,t){return L("whenNotToApplyConditions",t)},onEdit:function(i,n,t,o){return J("whenNotToApplyConditions",t,o)}}:{}))}return n("div",i({style:{width:"100%"},"data-edit-id":T?S:void 0},{children:n(d,i({title:{type:h?"default":"variant",label:m,number:e+1,isNewVariant:y,isDefault:o.isDefault,isModified:o.isModified},expanded:C,onToggle:function(){var i,n;return null===(n=null===(i=f.uiState)||void 0===i?void 0:i.setActiveVariantAccordionIndex)||void 0===n?void 0:n.call(i,C?null:e)},variant:"rule-behavior",showTitlePill:b,footerData:{ruleTitle:m,description:o.ruleDescription||""},readOnly:A,actionButtons:T?function(o,r){return T&&(!A||E||D)?E||D?t("div",i({style:{display:"flex",alignItems:"center",gap:"6px"}},{children:[n("button",i({onClick:function(i){i.stopPropagation(),q()},disabled:G||D,style:{display:"flex",alignItems:"center",gap:"6px",padding:"6px 10.5px",borderRadius:"6px",border:"1px solid #D9D6FE",backgroundColor:D?"#F5F3FF":"#ffffff",color:"#5925DC",fontSize:"13px",fontWeight:500,cursor:G||D?"not-allowed":"pointer",opacity:G?.5:1}},{children:D?"Validating...":"Save"})),!D&&n("button",i({onClick:function(i){i.stopPropagation(),K()},style:{display:"flex",alignItems:"center",gap:"6px",padding:"6px 10.5px",borderRadius:"6px",border:"1px solid #D9D6FE",backgroundColor:"#ffffff",color:"#5925DC",fontSize:"13px",fontWeight:500,cursor:"pointer"}},{children:"Cancel"}))]})):t("button",i({title:O?"Editing unavailable":N?"Add":"Edit",onClick:function(i){i.stopPropagation(),B(e,w,e,m),o||r()},disabled:O,style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"6px 8px",border:"1px solid #CBD5E1",borderRadius:"6px",backgroundColor:"#ffffff",color:"#64748B",fontSize:"13px",fontWeight:500,cursor:O?"not-allowed":"pointer",opacity:O?.5:1,gap:"6px"}},{children:[n(l,{size:12})," ",N?"Add":"Edit"]})):null}:void 0,isAiStreaming:null===(c=f.uiState)||void 0===c?void 0:c.isAiStreaming,alwaysShowActions:T},{children:t("div",i({style:{display:"flex",flexDirection:"column",gap:"12px"}},{children:[f.renderChildren?f.renderChildren(e,H,w):null,T&&E&&(null===(v=f.uiState)||void 0===v?void 0:v.pendingEditId)===S&&t("div",i({style:{display:"flex",alignItems:"center",gap:"6px"}},{children:[n(r,{size:14,style:{color:"#C2410C"}}),n("div",i({style:{color:"#C2410C",fontSize:"13px"}},{children:"Pending - Changes not applied yet. Apply or discard them to continue."}))]}))]}))}))}),g)})}))}export{f as default};
1
+ import{__assign as i}from"tslib";import{jsxs as n,jsx as t}from"react/jsx-runtime";import e,{useRef as o,useEffect as r,useState as a,useCallback as l}from"react";import{AlertTriangle as d}from"lucide-react";import{VariantListWrapper as u}from"../../features/IL-OTJ/_components/templates/TrafficManager/CreateRule.js";import s from"../../features/IL-OTJ/_components/AccordianSection.js";import{EditPencilIcon as c}from"../../features/IL-OTJ/_components/_svg/EditPencilIcon.js";import{useVariantEditSession as p,hasMeaningfulText as v}from"../../features/IL-OTJ/_components/hooks/useVariantEditSession.js";import{useDynamicFormStore as f}from"../store/useDynamicFormStore.js";import{splitConditions as m}from"../utils/conditionText.js";import{useParentEditEnabled as h}from"../hooks/useParentEditEnabled.js";import{isNodeLocked as g,isWrapperEditLocked as y}from"../utils/editLock.js";function x(x){var C,S,b,A,w,T,E,D,I,V=h(x.schema),_=x.tierKey||"tier_1",k=!1!==(null===(C=x.schema)||void 0===C?void 0:C.show_variant_pill),F=(null===(b=null===(S=x.state)||void 0===S?void 0:S.variantsByTier)||void 0===b?void 0:b[_])||[{}],O=(null===(A=x.schema)||void 0===A?void 0:A.properties)||{},j=g(x.schema,x.uiState),P=y(x.schema,x.uiState),N=e.useMemo(function(){var i=new Set,n=function(t,e){void 0===t&&(t={}),void 0===e&&(e=!1),Object.entries(t).forEach(function(t){var o=t[0],r=t[1],a=e||j||g(r,x.uiState);a&&i.add(String((null==r?void 0:r.data_key)||o).replace("global.","")),(null==r?void 0:r.properties)&&n(r.properties,a)})};return n(O),i},[O,j,null===(w=x.uiState)||void 0===w?void 0:w.usedFor]),R=function(i){return Object.entries(O).filter(function(n){var t=n[1];return(null==t?void 0:t.bpa_ui_component)===i&&!(null==t?void 0:t.hidden)}).sort(function(i,n){var t,e,o=i[1],r=n[1];return(null!==(t=null==o?void 0:o.ui_position)&&void 0!==t?t:0)-(null!==(e=null==r?void 0:r.ui_position)&&void 0!==e?e:0)}).map(function(i){var n=i[0],t=i[1];return String((null==t?void 0:t.data_key)||n).replace("global.","")})},z=R("TextInput")[0],L=R("PromptTextEditor")[0],M=R("ConditionSection"),B=M[0],K=M[1],J=f(function(i){return i.variantData}),W=o(null===(T=x.uiState)||void 0===T?void 0:T.isAiStreaming);r(function(){var i,n;W.current&&!(null===(i=x.uiState)||void 0===i?void 0:i.isAiStreaming)&&f.getState().clearAllMirages(),W.current=null===(n=x.uiState)||void 0===n?void 0:n.isAiStreaming},[null===(E=x.uiState)||void 0===E?void 0:E.isAiStreaming]);var G=p(x.uiState,function(i){var n=f.getState().getVariantField,t=function(t){return t?n(_,i,t):void 0};return{ruleDescription:t(z)||"",instructionPrompt:t(L)||"",whenToApplyConditions:m(t(B)||"","wta"),whenNotToApplyConditions:m(t(K)||"","wnta")}},function(i,n){var t=f.getState(),e=t.setVariantField,o=t.setVariantMirage;void 0!==i.instructionPrompt&&L&&e(n.tierKey,n.variantIndex,L,i.instructionPrompt),void 0!==i.ruleDescription&&z&&o(n.tierKey,n.variantIndex,z,i.ruleDescription),void 0!==i.whenToApplyText&&B&&o(n.tierKey,n.variantIndex,B,i.whenToApplyText),void 0!==i.whenNotToApplyText&&K&&o(n.tierKey,n.variantIndex,K,i.whenNotToApplyText)}),q=G.variantEdit,H=G.pendingVariantId,Q=G.handleStartVariantEdit,U=G.handleCancelVariantEdit,X=G.patchVariantDraft,Y=G.editDraftCondition,Z=G.removeDraftCondition,$=G.addDraftCondition,ii=G.handleSaveVariantEdit,ni=o({}),ti=a(null),ei=ti[0],oi=ti[1],ri=o(null);r(function(){return function(){ri.current&&clearTimeout(ri.current)}},[]);var ai=l(function(i){var n=ni.current[i];n&&!n.disabled&&(n.scrollIntoView({behavior:"smooth",block:"center"}),oi(i),ri.current&&clearTimeout(ri.current),ri.current=setTimeout(function(){return oi(null)},1800))},[]);return n(u,i({onAddVariant:function(){var i;(null===(i=x.handlers)||void 0===i?void 0:i.addNewVariant)&&x.handlers.addNewVariant(_)},isDisabled:null===(D=x.uiState)||void 0===D?void 0:D.isAiStreaming,showAddVariantBtn:!V&&"Edit"!==(null===(I=x.uiState)||void 0===I?void 0:I.usedFor),showConnectorLines:!V},{children:[t("style",{children:"@keyframes ilVariantEditGlow {\n 0%, 100% { box-shadow: 0 0 0 0 rgba(127, 86, 217, 0); }\n 50% { box-shadow: 0 0 0 4px rgba(127, 86, 217, 0.25), 0 0 10px 2px rgba(127, 86, 217, 0.35); }\n }"}),F.map(function(e,o){var r,a,l,u,p,f=e.variantType||"default",m="default"===f||"default_variant"===f,h="".concat(_,"-variant-").concat(o),g=!0===e.is_variant,y=null===(r=x.uiState)||void 0===r?void 0:r.activeVariantAccordionIndex,C=void 0!==y?y===o:g,S=e.isReadOnly||(null===(a=x.uiState)||void 0===a?void 0:a.isAiStreaming),b="variant-".concat(_,"-").concat(o),A=V&&(null==q?void 0:q.id)===b,w=H===b,T=A?q.draft:null,E=S||w,D=(null===(l=null==J?void 0:J[_])||void 0===l?void 0:l[o])||{},I=![z,L,B,K].some(function(i){return i&&v(D[i])}),F=!T||!v(T.ruleDescription)||!T.whenToApplyConditions.some(function(i){return v(i.text)}),O=i({},function(i){var n,t={},e=function(n){void 0===n&&(n={}),Object.entries(n).forEach(function(n){var o=n[0],r=n[1],a=((null==r?void 0:r.data_key)||o).replace("global.","");t[a]={readOnly:i},(null==r?void 0:r.properties)&&e(r.properties)})};return e(null===(n=x.schema)||void 0===n?void 0:n.properties),t}(S||j));if(V){var R=function(n,t){n&&(!function(i){return!!i&&N.has(i)}(n)?O[n]=i(i({},O[n]||{}),t):O[n]=i(i({},O[n]||{}),{readOnly:!0,enableInlineEdit:!1,hideEditControls:!0,parentEditing:A}))};R(z,i({readOnly:S||!A,enableInlineEdit:!1},T?{value:T.ruleDescription,onChange:function(i){return X({ruleDescription:i})}}:{})),R(L,i({readOnly:S||!A,hideEditControls:!0,parentEditing:A},T?{value:T.instructionPrompt,onChange:function(i){return X({instructionPrompt:i})}}:{})),R(B,i({readOnly:S,hideEditControls:!0,parentEditing:A},T?{conditions:T.whenToApplyConditions,onAdd:function(){return $("whenToApplyConditions")},onRemove:function(i,n,t){return Z("whenToApplyConditions",t)},onEdit:function(i,n,t,e){return Y("whenToApplyConditions",t,e)}}:{})),R(K,i({readOnly:S,hideEditControls:!0,parentEditing:A},T?{conditions:T.whenNotToApplyConditions,onAdd:function(){return $("whenNotToApplyConditions")},onRemove:function(i,n,t){return Z("whenNotToApplyConditions",t)},onEdit:function(i,n,t,e){return Y("whenNotToApplyConditions",t,e)}}:{}))}var M=ei===b;return t("div",i({style:{width:"100%"},"data-edit-id":V?b:void 0},{children:t(s,i({title:{type:m?"default":"variant",label:f,number:o+1,isNewVariant:g,isDefault:e.isDefault,isModified:e.isModified},expanded:C,onToggle:function(){var i,n;return null===(n=null===(i=x.uiState)||void 0===i?void 0:i.setActiveVariantAccordionIndex)||void 0===n?void 0:n.call(i,C?null:o)},variant:"rule-behavior",showTitlePill:k,footerData:{ruleTitle:f,description:e.ruleDescription||""},readOnly:S,actionButtons:V?function(e,r){return V?P?null:!S||A||w?A||w?null:n("button",i({ref:function(i){ni.current[b]=i},title:E?"Editing unavailable":I?"Add":"Edit",onClick:function(i){i.stopPropagation(),Q(o,_,o,f),e||r()},disabled:E,style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"6px 8px",borderRadius:"6px",border:"1px solid ".concat(M?"#7F56D9":"#CBD5E1"),backgroundColor:M?"#F9F5FF":"#ffffff",color:M?"#5925DC":"#64748B",fontSize:"13px",fontWeight:500,cursor:E?"not-allowed":"pointer",opacity:E?.5:1,gap:"6px",transition:"border-color 150ms ease, background-color 150ms ease, color 150ms ease",animation:M?"ilVariantEditGlow 900ms ease-in-out 2":void 0}},{children:[t(c,{size:12})," ",I?"Add":"Edit"]})):null:null}:void 0,isAiStreaming:null===(u=x.uiState)||void 0===u?void 0:u.isAiStreaming,alwaysShowActions:V},{children:n("div",i({style:{display:"flex",flexDirection:"column",gap:"12px"},onClickCapture:function(){!V||P||A||w||E||ai(b)}},{children:[x.renderChildren?x.renderChildren(o,O,_):null,V&&(A||w)&&n("div",i({style:{display:"flex",alignItems:"center",gap:"6px",justifyContent:"flex-start"}},{children:[t("button",i({onClick:function(i){i.stopPropagation(),ii()},disabled:F||w,style:{display:"flex",alignItems:"center",gap:"6px",padding:"6px 10.5px",borderRadius:"6px",border:"1px solid #D9D6FE",backgroundColor:w?"#F5F3FF":"#ffffff",color:"#5925DC",fontSize:"13px",fontWeight:500,cursor:F||w?"not-allowed":"pointer",opacity:F?.5:1}},{children:w?"Validating...":"Save"})),!w&&t("button",i({onClick:function(i){i.stopPropagation(),U()},style:{display:"flex",alignItems:"center",gap:"6px",padding:"6px 10.5px",borderRadius:"6px",border:"1px solid #D9D6FE",backgroundColor:"#ffffff",color:"#5925DC",fontSize:"13px",fontWeight:500,cursor:"pointer"}},{children:"Cancel"}))]})),V&&A&&(null===(p=x.uiState)||void 0===p?void 0:p.pendingEditId)===b&&n("div",i({style:{display:"flex",alignItems:"center",gap:"6px"}},{children:[t(d,{size:14,style:{color:"#C2410C"}}),t("div",i({style:{color:"#C2410C",fontSize:"13px"}},{children:"Pending - Changes not applied yet. Apply or discard them to continue."}))]}))]}))}))}),h)})]}))}export{x as default};
2
2
  //# sourceMappingURL=VariantListField.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as n}from"tslib";import{useMemo as e,useState as t,useRef as i,useEffect as l}from"react";import{useDynamicFormStore as r}from"../store/useDynamicFormStore.js";import{hasMeaningfulText as o,buildEditMessage as a}from"../../features/IL-OTJ/_components/hooks/useVariantEditSession.js";var u=function(n){return"PromptTextEditor"===(null==n?void 0:n.bpa_ui_component)},d=function(n){return!0===(null==n?void 0:n.is_repeatable_variant)||"VariantListWrapper"===(null==n?void 0:n.bpa_ui_component)},c=function(n){return void 0===n&&(n={}),Object.values(n||{}).some(function(n){return d(n)||(null==n?void 0:n.properties)&&c(n.properties)})},v=function(n){void 0===n&&(n={});var e=[],t=function(n){void 0===n&&(n={}),Object.entries(n||{}).forEach(function(n){var i=n[0],l=n[1];!l||l.hidden||d(l)||(l.data_key&&!l.read_only&&e.push({propKey:i,node:l,cleanKey:String(l.data_key).replace("global.","")}),l.properties&&t(l.properties))})};return t(n),e};function s(d,c,s){var f=e(function(){return v(c)},[c]),g=t(null),p=g[0],m=g[1],y=t(!1),E=y[0],S=y[1],_=i(null==s?void 0:s.isAiStreaming),K=(null==s?void 0:s.activeEditId)===d&&null!==p;l(function(){_.current&&!(null==s?void 0:s.isAiStreaming)&&(E&&S(!1),r.getState().clearAllMirages()),_.current=null==s?void 0:s.isAiStreaming},[null==s?void 0:s.isAiStreaming,E]);var b=function(){var n,e;m(null),null===(n=null==s?void 0:s.setActiveEditId)||void 0===n||n.call(s,null),null===(e=null==s?void 0:s.setPendingEditId)||void 0===e||e.call(s,null)},h=r(function(n){return n.globalData}),I=!f.some(function(n){var e;return o(String(null!==(e=h[n.cleanKey])&&void 0!==e?e:""))}),A=!!p&&f.some(function(n){var e,t;return String(null!==(e=p[n.cleanKey])&&void 0!==e?e:"")!==String(null!==(t=r.getState().globalData[n.cleanKey])&&void 0!==t?t:"")}),D=!!p&&f.some(function(n){var e;return n.node.is_required&&""===String(null!==(e=p[n.cleanKey])&&void 0!==e?e:"").trim()}),O=!p||!A||D,k=e(function(){var e={};return f.forEach(function(t){var i,l=t.node.depends_on_global_key;e[t.cleanKey]=n({readOnly:!K||!!(null==s?void 0:s.isAiStreaming),enableInlineEdit:!1,hideEditControls:!0,parentEditing:K},K?n({value:p[t.cleanKey],onChange:function(e){return m(function(i){var l;if(!i)return i;var r=n(n({},i),((l={})[t.cleanKey]=e,l));return f.forEach(function(n){n.node.depends_on_global_key===t.cleanKey&&(r[n.cleanKey]="")}),r})}},l?{parentValueOverride:null!==(i=p[l])&&void 0!==i?i:""}:{}):{})}),e},[f,K,p,null==s?void 0:s.isAiStreaming]);return{leaves:f,isEditing:K,isEmpty:I,isPending:E,isSaveDisabled:O,start:function(){var n,e,t;if((null==s?void 0:s.activeEditId)&&s.activeEditId!==d)null===(n=null==s?void 0:s.setPendingEditId)||void 0===n||n.call(s,s.activeEditId);else{var i=r.getState().globalData,l={};f.forEach(function(n){var e;l[n.cleanKey]=null!==(e=i[n.cleanKey])&&void 0!==e?e:""}),m(l),null===(e=null==s?void 0:s.setActiveEditId)||void 0===e||e.call(s,d),null===(t=null==s?void 0:s.setPendingEditId)||void 0===t||t.call(s,null)}},cancel:b,save:function(){var n,e;if(p){var t=r.getState(),i=t.globalData,l=t.setGlobalField,o=t.setGlobalMirage,d=f.filter(function(n){var e,t;return String(null!==(e=p[n.cleanKey])&&void 0!==e?e:"")!==String(null!==(t=i[n.cleanKey])&&void 0!==t?t:"")});if(0!==d.length){if(d.filter(function(n){return!n.node.ai_generated||u(n.node)}).forEach(function(n){return l(n.cleanKey,p[n.cleanKey])}),d.filter(function(n){return n.node.ai_generated&&!u(n.node)}).forEach(function(n){return o(n.cleanKey,p[n.cleanKey])}),null==s?void 0:s.setSendMessageInChat){var c="sk-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),v=d.filter(function(n){return!u(n.node)}).map(function(n){var e;return"".concat(n.node.title||n.cleanKey,": ").concat(String(null!==(e=p[n.cleanKey])&&void 0!==e?e:"").trim()||"None")}),g=a(v,d.some(function(n){return u(n.node)}));s.setSendMessageInChat("__SKELETON__:".concat(c,":").concat(g)),S(!0)}m(null),null===(n=null==s?void 0:s.setActiveEditId)||void 0===n||n.call(s,null),null===(e=null==s?void 0:s.setPendingEditId)||void 0===e||e.call(s,null)}else b()}},childOverrides:k}}export{v as collectSectionLeaves,c as sectionHasVariantWrapper,s as useSectionEditSession};
1
+ import{__assign as n}from"tslib";import{useMemo as e,useState as i,useRef as t,useEffect as l}from"react";import{useDynamicFormStore as r}from"../store/useDynamicFormStore.js";import{hasMeaningfulText as o,buildEditMessage as a}from"../../features/IL-OTJ/_components/hooks/useVariantEditSession.js";import{isNodeLocked as u}from"../utils/editLock.js";var d=function(n){return"PromptTextEditor"===(null==n?void 0:n.bpa_ui_component)},c=function(n){return!0===(null==n?void 0:n.is_repeatable_variant)||"VariantListWrapper"===(null==n?void 0:n.bpa_ui_component)},v=function(n){return void 0===n&&(n={}),Object.values(n||{}).some(function(n){return c(n)||(null==n?void 0:n.properties)&&v(n.properties)})},s=function(n,e){void 0===n&&(n={});var i=[],t=function(n,l){void 0===n&&(n={}),void 0===l&&(l=!1),Object.entries(n||{}).forEach(function(n){var r=n[0],o=n[1];if(o&&!o.hidden&&!c(o)){var a=l||u(o,e);!o.data_key||o.read_only||a||i.push({propKey:r,node:o,cleanKey:String(o.data_key).replace("global.","")}),o.properties&&t(o.properties,a)}})};return t(n),i};function f(u,c,v){var f=e(function(){return s(c,v)},[c,null==v?void 0:v.usedFor]),g=i(null),p=g[0],m=g[1],y=i(!1),E=y[0],S=y[1],_=t(null==v?void 0:v.isAiStreaming),K=(null==v?void 0:v.activeEditId)===u&&null!==p;l(function(){_.current&&!(null==v?void 0:v.isAiStreaming)&&(E&&S(!1),r.getState().clearAllMirages()),_.current=null==v?void 0:v.isAiStreaming},[null==v?void 0:v.isAiStreaming,E]);var b=function(){var n,e;m(null),null===(n=null==v?void 0:v.setActiveEditId)||void 0===n||n.call(v,null),null===(e=null==v?void 0:v.setPendingEditId)||void 0===e||e.call(v,null)},h=r(function(n){return n.globalData}),I=!f.some(function(n){var e;return o(String(null!==(e=h[n.cleanKey])&&void 0!==e?e:""))}),A=!!p&&f.some(function(n){var e,i;return String(null!==(e=p[n.cleanKey])&&void 0!==e?e:"")!==String(null!==(i=r.getState().globalData[n.cleanKey])&&void 0!==i?i:"")}),k=!!p&&f.some(function(n){var e;return n.node.is_required&&""===String(null!==(e=p[n.cleanKey])&&void 0!==e?e:"").trim()}),D=!p||!A||k,O=e(function(){var e={};return f.forEach(function(i){var t,l=i.node.depends_on_global_key;e[i.cleanKey]=n({readOnly:!K||!!(null==v?void 0:v.isAiStreaming),enableInlineEdit:!1,hideEditControls:!0,parentEditing:K},K?n({value:p[i.cleanKey],onChange:function(e){return m(function(t){var l;if(!t)return t;var r=n(n({},t),((l={})[i.cleanKey]=e,l));return f.forEach(function(n){n.node.depends_on_global_key===i.cleanKey&&(r[n.cleanKey]="")}),r})}},l?{parentValueOverride:null!==(t=p[l])&&void 0!==t?t:""}:{}):{})}),e},[f,K,p,null==v?void 0:v.isAiStreaming]);return{leaves:f,isEditing:K,isEmpty:I,isPending:E,isSaveDisabled:D,start:function(){var n,e,i;if((null==v?void 0:v.activeEditId)&&v.activeEditId!==u)null===(n=null==v?void 0:v.setPendingEditId)||void 0===n||n.call(v,v.activeEditId);else{var t=r.getState().globalData,l={};f.forEach(function(n){var e;l[n.cleanKey]=null!==(e=t[n.cleanKey])&&void 0!==e?e:""}),m(l),null===(e=null==v?void 0:v.setActiveEditId)||void 0===e||e.call(v,u),null===(i=null==v?void 0:v.setPendingEditId)||void 0===i||i.call(v,null)}},cancel:b,save:function(){var n,e;if(p){var i=r.getState(),t=i.globalData,l=i.setGlobalField,o=i.setGlobalMirage,u=f.filter(function(n){var e,i;return String(null!==(e=p[n.cleanKey])&&void 0!==e?e:"")!==String(null!==(i=t[n.cleanKey])&&void 0!==i?i:"")});if(0!==u.length){if(u.filter(function(n){return!n.node.ai_generated||d(n.node)}).forEach(function(n){return l(n.cleanKey,p[n.cleanKey])}),u.filter(function(n){return n.node.ai_generated&&!d(n.node)}).forEach(function(n){return o(n.cleanKey,p[n.cleanKey])}),null==v?void 0:v.setSendMessageInChat){var c="sk-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),s=u.filter(function(n){return!d(n.node)}).map(function(n){var e;return"".concat(n.node.title||n.cleanKey,": ").concat(String(null!==(e=p[n.cleanKey])&&void 0!==e?e:"").trim()||"None")}),g=a(s,u.some(function(n){return d(n.node)}));v.setSendMessageInChat("__SKELETON__:".concat(c,":").concat(g)),S(!0)}m(null),null===(n=null==v?void 0:v.setActiveEditId)||void 0===n||n.call(v,null),null===(e=null==v?void 0:v.setPendingEditId)||void 0===e||e.call(v,null)}else b()}},childOverrides:O}}export{s as collectSectionLeaves,v as sectionHasVariantWrapper,f as useSectionEditSession};
2
2
  //# sourceMappingURL=useSectionEditSession.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as i}from"tslib";import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState as o}from"react";import{ChevronDown as r,AlertTriangle as l}from"lucide-react";import d from"../../features/IL-OTJ/_components/AccordianSection.js";import{EditPencilIcon as s}from"../../features/IL-OTJ/_components/_svg/EditPencilIcon.js";import{sectionHasVariantWrapper as a,collectSectionLeaves as c,useSectionEditSession as p}from"../hooks/useSectionEditSession.js";import{useParentEditEnabled as f}from"../hooks/useParentEditEnabled.js";var u={display:"flex",alignItems:"center",gap:"7px",padding:"7px 10.5px",borderRadius:"6px",border:"1px solid #D9D6FE",color:"#5925DC",fontSize:"14px",fontWeight:500},g=function(g){var m,h=g,y=h.schema,x=h.children,b=h.renderChildren,v=h.uiState,C=o(!!y.default_open),S=C[0],P=C[1],E="section-".concat(g.id||y.title||"accordion"),k=a(y.properties),F=c(y.properties),D=f(y)&&!k&&F.length>0,I=p(E,y.properties,v);if(!D)return e("div",i({style:{border:"1px solid #E2E8F0",borderRadius:12,marginBottom:12,overflow:"hidden"}},{children:[e("button",i({type:"button",onClick:function(){return P(function(i){return!i})},"aria-expanded":S,style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",background:"#F8FAFC",border:"none",cursor:"pointer",fontSize:14,fontWeight:500,color:"#19213D",fontFamily:'"Plus Jakarta Sans", sans-serif'}},{children:[y.title,t(r,{size:18,style:{transform:S?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s"}})]})),S&&e("div",i({style:{padding:16,display:"flex",flexDirection:"column",gap:12}},{children:[y.subtitle&&t("div",i({style:{fontFamily:"Inter",fontWeight:400,fontSize:12,lineHeight:"130%",color:"#64748B"}},{children:y.subtitle})),x]}))]}));return t("div",i({"data-edit-id":E},{children:t(d,i({title:{type:"other",label:y.title||""},subtitle:y.subtitle,defaultOpen:null===(m=y.default_open)||void 0===m||m,isAiStreaming:null==v?void 0:v.isAiStreaming,actionButtons:function(o,r){if(I.isEditing)return e("div",i({style:{display:"flex",alignItems:"center",gap:"6px"}},{children:[t("button",i({onClick:function(i){i.stopPropagation(),I.save()},disabled:I.isSaveDisabled||I.isPending,style:i(i({},u),{backgroundColor:I.isPending?"#F5F3FF":"#ffffff",cursor:I.isSaveDisabled||I.isPending?"not-allowed":"pointer",opacity:I.isSaveDisabled?.5:1})},{children:I.isPending?"Validating...":"Save"})),!I.isPending&&t("button",i({onClick:function(i){i.stopPropagation(),I.cancel()},style:i(i({},u),{backgroundColor:"#ffffff",cursor:"pointer"})},{children:"Cancel"}))]}));var l=I.isPending||!!(null==v?void 0:v.isAiStreaming),d=I.isEmpty?"Add":"Edit";return t("button",i({title:I.isPending?"Validating...":d,onClick:function(i){i.stopPropagation(),I.start(),o||r()},disabled:l,style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",padding:"6px 10px",border:"1px solid #CBD5E1",borderRadius:"6px",backgroundColor:"#ffffff",color:"#64748B",fontSize:"13px",fontWeight:500,cursor:l?"not-allowed":"pointer",opacity:l?.5:1}},{children:I.isPending?"Validating...":e(n,{children:[t(s,{size:12})," ",d]})}))},alwaysShowActions:!0},{children:e("div",i({style:{display:"flex",flexDirection:"column",gap:12}},{children:[b?b(void 0,I.childOverrides):x,(null==v?void 0:v.pendingEditId)===E&&e("div",i({style:{display:"flex",alignItems:"center",gap:"6px"}},{children:[t(l,{size:14,style:{color:"#C2410C"}}),t("div",i({style:{color:"#C2410C",fontSize:"13px"}},{children:"Pending - Changes not applied yet. Apply or discard them to continue."}))]}))]}))}))}))};export{g as default};
1
+ import{__assign as i}from"tslib";import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState as o}from"react";import{ChevronDown as r,AlertTriangle as l}from"lucide-react";import d from"../../features/IL-OTJ/_components/AccordianSection.js";import{EditPencilIcon as s}from"../../features/IL-OTJ/_components/_svg/EditPencilIcon.js";import{sectionHasVariantWrapper as a,collectSectionLeaves as c,useSectionEditSession as p}from"../hooks/useSectionEditSession.js";import{useParentEditEnabled as f}from"../hooks/useParentEditEnabled.js";import{isWrapperEditLocked as u,isNodeLocked as g,buildLockedSubtreeOverrides as m}from"../utils/editLock.js";var h={display:"flex",alignItems:"center",gap:"7px",padding:"7px 10.5px",borderRadius:"6px",border:"1px solid #D9D6FE",color:"#5925DC",fontSize:"14px",fontWeight:500},y=function(y){var x,b=y,v=b.schema,C=b.children,S=b.renderChildren,P=b.uiState,k=o(!!v.default_open),E=k[0],F=k[1],D="section-".concat(y.id||v.title||"accordion"),I=a(v.properties),j=c(v.properties,P),z=f(v),A=u(v,P),w=z&&!I&&j.length>0&&!A,B=p(D,v.properties,P);if(!w)return e("div",i({style:{border:"1px solid #E2E8F0",borderRadius:12,marginBottom:12,overflow:"hidden"}},{children:[e("button",i({type:"button",onClick:function(){return F(function(i){return!i})},"aria-expanded":E,style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",background:"#F8FAFC",border:"none",cursor:"pointer",fontSize:14,fontWeight:500,color:"#19213D",fontFamily:'"Plus Jakarta Sans", sans-serif'}},{children:[v.title,t(r,{size:18,style:{transform:E?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s"}})]})),E&&e("div",i({style:{padding:16,display:"flex",flexDirection:"column",gap:12}},{children:[v.subtitle&&t("div",i({style:{fontFamily:"Inter",fontWeight:400,fontSize:12,lineHeight:"130%",color:"#64748B"}},{children:v.subtitle})),g(v,P)&&S?S(void 0,m(v.properties)):C]}))]}));return t("div",i({"data-edit-id":D},{children:t(d,i({title:{type:"other",label:v.title||""},subtitle:v.subtitle,defaultOpen:null===(x=v.default_open)||void 0===x||x,isAiStreaming:null==P?void 0:P.isAiStreaming,actionButtons:function(o,r){if(B.isEditing)return e("div",i({style:{display:"flex",alignItems:"center",gap:"6px"}},{children:[t("button",i({onClick:function(i){i.stopPropagation(),B.save()},disabled:B.isSaveDisabled||B.isPending,style:i(i({},h),{backgroundColor:B.isPending?"#F5F3FF":"#ffffff",cursor:B.isSaveDisabled||B.isPending?"not-allowed":"pointer",opacity:B.isSaveDisabled?.5:1})},{children:B.isPending?"Validating...":"Save"})),!B.isPending&&t("button",i({onClick:function(i){i.stopPropagation(),B.cancel()},style:i(i({},h),{backgroundColor:"#ffffff",cursor:"pointer"})},{children:"Cancel"}))]}));var l=B.isPending||!!(null==P?void 0:P.isAiStreaming),d=B.isEmpty?"Add":"Edit";return t("button",i({title:B.isPending?"Validating...":d,onClick:function(i){i.stopPropagation(),B.start(),o||r()},disabled:l,style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",padding:"6px 10px",border:"1px solid #CBD5E1",borderRadius:"6px",backgroundColor:"#ffffff",color:"#64748B",fontSize:"13px",fontWeight:500,cursor:l?"not-allowed":"pointer",opacity:l?.5:1}},{children:B.isPending?"Validating...":e(n,{children:[t(s,{size:12})," ",d]})}))},alwaysShowActions:!0},{children:e("div",i({style:{display:"flex",flexDirection:"column",gap:12}},{children:[S?S(void 0,B.childOverrides):C,(null==P?void 0:P.pendingEditId)===D&&e("div",i({style:{display:"flex",alignItems:"center",gap:"6px"}},{children:[t(l,{size:14,style:{color:"#C2410C"}}),t("div",i({style:{color:"#C2410C",fontSize:"13px"}},{children:"Pending - Changes not applied yet. Apply or discard them to continue."}))]}))]}))}))}))};export{y as default};
2
2
  //# sourceMappingURL=Accordion.js.map
@@ -0,0 +1,2 @@
1
+ var e="This field is locked and cannot be changed after it has been created.",n=function(e){return"Edit"===(null==e?void 0:e.usedFor)},r=function(e,r){return n(r)&&!0===(null==e?void 0:e.read_only_in_edit_flow)},i=function(e,n){void 0===e&&(e={});var i=[],t=function(e,o){void 0===e&&(e={}),void 0===o&&(o=!1),Object.entries(e||{}).forEach(function(e){var a=e[1];if(a&&!a.hidden&&!function(e){return!0===(null==e?void 0:e.is_repeatable_variant)||"VariantListWrapper"===(null==e?void 0:e.bpa_ui_component)}(a)){var d=o||r(a,n);a.data_key&&!a.read_only&&i.push({node:a,locked:d}),a.properties&&t(a.properties,d)}})};return t(e),i},t=function(e,t){if(!n(t))return!1;if(r(e,t))return!0;var o=i(null==e?void 0:e.properties,t);return o.length>0&&o.every(function(e){return e.locked})},o=function(e){void 0===e&&(e={});var n={},r=function(e){void 0===e&&(e={}),Object.entries(e||{}).forEach(function(e){var i=e[0],t=e[1];if(t){var o=String(t.data_key||i).replace("global.","");n[o]={readOnly:!0,enableInlineEdit:!1,hideEditControls:!0,parentEditing:!1},t.properties&&r(t.properties)}})};return r(e),n};export{e as LOCKED_IN_EDIT_FLOW_TOOLTIP,o as buildLockedSubtreeOverrides,i as collectLockableLeaves,n as isEditFlow,r as isNodeLocked,t as isWrapperEditLocked};
2
+ //# sourceMappingURL=editLock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editLock.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,9 +1,10 @@
1
1
  import React from "react";
2
- export declare const VariantListWrapper: ({ children, onAddVariant, isDisabled, showAddVariantBtn }: {
2
+ export declare const VariantListWrapper: ({ children, onAddVariant, isDisabled, showAddVariantBtn, showConnectorLines }: {
3
3
  children: React.ReactNode;
4
4
  onAddVariant: () => void;
5
5
  isDisabled?: boolean | undefined;
6
6
  showAddVariantBtn?: boolean | undefined;
7
+ showConnectorLines?: boolean | undefined;
7
8
  }) => React.JSX.Element;
8
9
  export declare const CreateRule: ({ state, handlers, uiState }: any) => React.JSX.Element;
9
10
  //# sourceMappingURL=CreateRule.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CreateRule.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/IL-OTJ/_components/templates/TrafficManager/CreateRule.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwC,MAAM,OAAO,CAAC;AA0B7D,eAAO,MAAM,kBAAkB;cAAkF,MAAM,SAAS;kBAAgB,MAAM,IAAI;;;uBAgDzJ,CAAC;AAEF,eAAO,MAAM,UAAU,iCAAkC,GAAG,sBAkjC3D,CAAC"}
1
+ {"version":3,"file":"CreateRule.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/IL-OTJ/_components/templates/TrafficManager/CreateRule.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwC,MAAM,OAAO,CAAC;AA0B7D,eAAO,MAAM,kBAAkB;cAA6G,MAAM,SAAS;kBAAgB,MAAM,IAAI;;;;uBAgDpL,CAAC;AAEF,eAAO,MAAM,UAAU,iCAAkC,GAAG,sBAkjC3D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"BPARenderer.d.ts","sourceRoot":"","sources":["../../../../src/schema-driven/BPARenderer.tsx"],"names":[],"mappings":"AACA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AA6I1C,UAAU,gBAAgB;IACxB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,gBAAgB,CAAC,EAAE,GAAG,CAAC;CACxB;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAoDlD,CAAC"}
1
+ {"version":3,"file":"BPARenderer.d.ts","sourceRoot":"","sources":["../../../../src/schema-driven/BPARenderer.tsx"],"names":[],"mappings":"AACA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAGjD,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AA8L1C,UAAU,gBAAgB;IACxB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,gBAAgB,CAAC,EAAE,GAAG,CAAC;CACxB;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAoDlD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"VariantListField.d.ts","sourceRoot":"","sources":["../../../../../src/schema-driven/components/VariantListField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAmBjD,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,KAAK,EAAE,GAAG,qBAoSlD"}
1
+ {"version":3,"file":"VariantListField.d.ts","sourceRoot":"","sources":["../../../../../src/schema-driven/components/VariantListField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAoBxE,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,KAAK,EAAE,GAAG,qBAkXlD"}
@@ -6,8 +6,13 @@ export interface SectionLeaf {
6
6
  node: any;
7
7
  cleanKey: string;
8
8
  }
9
- /** Editable global leaves under a section (skips hidden, read-only and variant subtrees). */
10
- export declare const collectSectionLeaves: (properties?: Record<string, any>) => SectionLeaf[];
9
+ /**
10
+ * Editable global leaves under a section (skips hidden, read-only and variant subtrees).
11
+ * In the edit flow, `read_only_in_edit_flow` leaves are skipped too: they are frozen,
12
+ * so they must never join a draft or the combined Save message. Pass `uiState` for
13
+ * that gate — without it the flow is unknown and nothing is treated as frozen.
14
+ */
15
+ export declare const collectSectionLeaves: (properties?: Record<string, any>, uiState?: any) => SectionLeaf[];
11
16
  /**
12
17
  * Section-level equivalent of useVariantEditSession: one "Edit" opens a draft over
13
18
  * every editable leaf in the section, and Save sends ONE combined chat message.
@@ -1 +1 @@
1
- {"version":3,"file":"useSectionEditSession.d.ts","sourceRoot":"","sources":["../../../../../src/schema-driven/hooks/useSectionEditSession.ts"],"names":[],"mappings":"AAWA;qFACqF;AACrF,eAAO,MAAM,wBAAwB,gBAAgB,OAAO,MAAM,EAAE,GAAG,CAAC,KAAQ,OAG7E,CAAC;AAEJ,MAAM,WAAW,WAAW;IAAG,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,GAAG,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE;AAE7E,6FAA6F;AAC7F,eAAO,MAAM,oBAAoB,gBAAgB,OAAO,MAAM,EAAE,GAAG,CAAC,KAAQ,WAAW,EAatF,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG;;;;;;;;;;EAgIrF"}
1
+ {"version":3,"file":"useSectionEditSession.d.ts","sourceRoot":"","sources":["../../../../../src/schema-driven/hooks/useSectionEditSession.ts"],"names":[],"mappings":"AAYA;qFACqF;AACrF,eAAO,MAAM,wBAAwB,gBAAgB,OAAO,MAAM,EAAE,GAAG,CAAC,KAAQ,OAG7E,CAAC;AAEJ,MAAM,WAAW,WAAW;IAAG,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,GAAG,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE;AAE7E;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,gBAAgB,OAAO,MAAM,EAAE,GAAG,CAAC,YAAiB,GAAG,KAAG,WAAW,EAcrG,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG;;;;;;;;;;EAgIrF"}
@@ -1 +1 @@
1
- {"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../../../../src/schema-driven/primitives/Accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAWhD;;;;;;;;;;;;;;;GAeG;AACH,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAwI7C,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../../../../src/schema-driven/primitives/Accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAYhD;;;;;;;;;;;;;;;GAeG;AACH,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAgJ7C,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -35,6 +35,11 @@ export interface SchemaFieldNode {
35
35
  ai_generated?: boolean;
36
36
  is_required?: boolean;
37
37
  read_only?: boolean;
38
+ /** Frozen-after-creation flag (defaults to false). In the EDIT flow the field can
39
+ * never be opened for editing — not even inside a parent edit session — while it
40
+ * stays fully editable during creation. On a wrapper node it freezes the whole
41
+ * subtree and removes that section's Edit button. See utils/editLock.ts. */
42
+ read_only_in_edit_flow?: boolean;
38
43
  hidden?: boolean;
39
44
  default_open?: boolean;
40
45
  is_repeatable_variant?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/schema-driven/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;4DAGwD;IACxD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAMlB,OAAO,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACnE,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAG9E,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAG/B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IAGtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;2DACuD;IACvD,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;oCAGgC;IAChC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;CAC9C;AAED,yDAAyD;AACzD,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;CAC9C;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,eAAe,CAAC;IACxB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/schema-driven/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;4DAGwD;IACxD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAMlB,OAAO,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACnE,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAG9E,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAG/B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IAGtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;iFAG6E;IAC7E,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;2DACuD;IACvD,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;oCAGgC;IAChC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;CAC9C;AAED,yDAAyD;AACzD,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;CAC9C;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,eAAe,CAAC;IACxB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB"}
@@ -0,0 +1,39 @@
1
+ import { SchemaFieldNode } from '../types';
2
+ /**
3
+ * `read_only_in_edit_flow` — schema-authored, defaults to false.
4
+ *
5
+ * A field carrying it is frozen once the rule exists: in the EDIT flow it can
6
+ * never be opened for editing, not even inside a parent edit session. It stays
7
+ * fully editable while the rule is being created.
8
+ *
9
+ * On a wrapper node (Accordion / VariantListWrapper) the flag freezes the whole
10
+ * subtree and removes the section's own Edit button. A wrapper whose every
11
+ * editable leaf is frozen loses its Edit button too — there would be nothing
12
+ * left to edit behind it.
13
+ */
14
+ export declare const LOCKED_IN_EDIT_FLOW_TOOLTIP = "This field is locked and cannot be changed after it has been created.";
15
+ /** The modal reports the flow through `uiState.usedFor` ('Edit' | 'Create'). */
16
+ export declare const isEditFlow: (uiState?: any) => boolean;
17
+ /** True when this specific node is frozen for the current flow. */
18
+ export declare const isNodeLocked: (node?: any, uiState?: any) => boolean;
19
+ /**
20
+ * Editable (non-hidden, non-`read_only`) leaves under `properties`, paired with
21
+ * whether each one is frozen. Variant subtrees are skipped — those belong to
22
+ * VariantListField's own per-variant session, exactly like collectSectionLeaves.
23
+ */
24
+ export declare const collectLockableLeaves: (properties?: Record<string, SchemaFieldNode>, uiState?: any) => {
25
+ node: any;
26
+ locked: boolean;
27
+ }[];
28
+ /**
29
+ * Whether a wrapper should hide its Edit button in the edit flow: either the
30
+ * wrapper itself is frozen, or every editable leaf beneath it is.
31
+ */
32
+ export declare const isWrapperEditLocked: (schema?: any, uiState?: any) => boolean;
33
+ /**
34
+ * Overrides that freeze every descendant leaf of a wrapper whose own
35
+ * `read_only_in_edit_flow` is set — the flag on a container applies to its whole
36
+ * subtree, including leaves that don't carry it themselves.
37
+ */
38
+ export declare const buildLockedSubtreeOverrides: (properties?: Record<string, SchemaFieldNode>) => Record<string, any>;
39
+ //# sourceMappingURL=editLock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editLock.d.ts","sourceRoot":"","sources":["../../../../../src/schema-driven/utils/editLock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,2BAA2B,0EACiC,CAAC;AAE1E,gFAAgF;AAChF,eAAO,MAAM,UAAU,aAAc,GAAG,KAAG,OAAsC,CAAC;AAElF,mEAAmE;AACnE,eAAO,MAAM,YAAY,UAAW,GAAG,YAAY,GAAG,KAAG,OACK,CAAC;AAK/D;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,gBACpB,OAAO,MAAM,EAAE,eAAe,CAAC,YACjC,GAAG,KACZ;IAAE,IAAI,EAAE,GAAG,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,EAYhC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,YAAa,GAAG,YAAY,GAAG,KAAG,OAKjE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,gBAC1B,OAAO,MAAM,EAAE,eAAe,CAAC,KAC1C,OAAO,MAAM,EAAE,GAAG,CAiBpB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-llm-studio/instant-learning",
3
- "version": "1.3.0-alpha.224",
3
+ "version": "1.3.0-alpha.225",
4
4
  "author": "Devesh Patel",
5
5
  "description": "",
6
6
  "license": "MIT",
Binary file
Binary file
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),e=require("react/jsx-runtime"),t=require("react"),n=require("../../organisms/TextSection/TextSection.js"),o=require("../../organisms/ScopeSection/ScopeSection.js"),s=require("../../organisms/ConditionSection/ConditionSection.js"),d=require("../../organisms/ConfigSection/ConfigSection.js"),a=require("../../InputDataReasoningCard.js"),l=require("../../_svg/ButtonCognitiveIcon.js");exports.BaseTemplate=function(r){var c,p,g,h,v,u,I,E,m,f,b,S,y,x,C,A,_,j,T,N,w,W,D,L,O,M,q,P,R,V,H,B,K,z=r.state,k=r.handlers,F=r.uiState,G=r.customNodes,J=void 0===G?{}:G,Q=t.useState({}),U=Q[0],X=Q[1],Y=t.useState(new Set),Z=Y[0],$=Y[1],ii=function(e){X(function(t){var n;return i.__assign(i.__assign({},t),((n={})[e]=!t[e],n))})},ei=function(i){var e,t=null===(e=z.fieldCitations)||void 0===e?void 0:e[i];return Array.isArray(t)&&t.length>0?t:z.citations||[]},ti={marginTop:"-17px",position:"relative",zIndex:1},ni=function(i){return!!F.isAiStreaming||(!!F.isReadOnly||!(!F.activeEditId||F.activeEditId.startsWith(i)))};return e.jsxs("div",i.__assign({className:"base-template-container",style:{display:"flex",flexDirection:"column",gap:"16px",width:"100%"}},{children:[J.top&&e.jsx("div",i.__assign({className:"custom-slot-top"},{children:J.top})),e.jsxs("div",i.__assign({className:"template-section"},{children:[e.jsx(n.TextSection,{id:"base-title",title:F.titleLabel||"Title",fieldName:F.titleLabel||"Title",rows:1,placeholder:"Enter a descriptive title",required:!0,value:z.title||"",onChange:k.onTitleChange,readOnly:ni("base-title"),isOpen:U.title,onToggle:function(){return ii("title")},isHighlighted:(null===(c=F.highlights)||void 0===c?void 0:c.get("title"))||!1,showCognitiveIcon:!!(null===(p=z.citation)||void 0===p?void 0:p.title),tooltipDescription:"Why this ".concat(F.titleLabel||"Title","?"),errorMessage:null===(g=F.validationErrors)||void 0===g?void 0:g.title,enableInlineEdit:!0,setSendMessageInChat:F.setSendMessageInChat,activeEditId:null!==(h=F.activeEditId)&&void 0!==h?h:null,setActiveEditId:F.setActiveEditId,pendingEditId:null!==(v=F.pendingEditId)&&void 0!==v?v:null,setPendingEditId:F.setPendingEditId}),(null===(u=z.citation)||void 0===u?void 0:u.title)&&e.jsx("div",i.__assign({style:ti},{children:e.jsx(a.InputDataReasoningCard,{isVisible:U.title,citation:z.citation.title,citations:ei("title"),fieldName:F.titleLabel||"Title",fieldValue:z.title||""})}))]})),J.afterTitle&&e.jsx("div",i.__assign({className:"custom-slot"},{children:J.afterTitle})),F.showScope&&e.jsxs("div",i.__assign({className:"template-section"},{children:[e.jsx(o.ScopeSection,{id:"base-scope",title:F.scopeLabel||"",required:!1,scopeData:z.scopeData||{},onScopeChange:k.onScopeChange,openSections:Z,setOpenSections:$,stationOptions:F.stationOptions||[],tierOptions:F.tierOptions||[],tierLabel:F.tierLabel||"Where should this apply?",stationLabel:F.stationLabel||"Which scope should this belong to?",highlights:(null===(I=F.highlights)||void 0===I?void 0:I.get("scope"))||{},isOpen:U.scope,onToggle:function(){return ii("scope")},showCognitiveIcon:!!(null===(E=z.citation)||void 0===E?void 0:E.scope),cognitiveIcon:e.jsx(l.ButtonCognitiveIcon,{}),tooltipDescription:"Why this Scope?",errorMessage:(null===(m=F.validationErrors)||void 0===m?void 0:m.station)||(null===(f=F.validationErrors)||void 0===f?void 0:f.tiers),stationErrorMessage:null===(b=F.validationErrors)||void 0===b?void 0:b.station,tierErrorMessage:null===(S=F.validationErrors)||void 0===S?void 0:S.tiers,readOnly:ni("base-scope")}),(null===(y=z.citation)||void 0===y?void 0:y.scope)&&e.jsx("div",i.__assign({style:ti},{children:e.jsx(a.InputDataReasoningCard,{isVisible:U.scope,citation:z.citation.scope,citations:ei("scope"),fieldName:"Scope",fieldValue:(null===(C=null===(x=z.scopeData)||void 0===x?void 0:x.tiers)||void 0===C?void 0:C.join(", "))||""})}))]})),J.afterScope&&e.jsx("div",i.__assign({className:"custom-slot"},{children:J.afterScope})),e.jsxs("div",i.__assign({className:"template-section"},{children:[e.jsx(n.TextSection,{id:"base-description",title:F.descriptionLabel||"Description",fieldName:F.descriptionLabel||"Description",rows:3,placeholder:"Explain the behaviour or learning",required:!0,value:z.description||"",onChange:k.onDescriptionChange,readOnly:ni("base-description"),isOpen:U.description,onToggle:function(){return ii("description")},isHighlighted:(null===(A=F.highlights)||void 0===A?void 0:A.get("description"))||!1,showCognitiveIcon:!!(null===(_=z.citation)||void 0===_?void 0:_.description),tooltipDescription:"Why this ".concat(F.descriptionLabel||"Description","?"),errorMessage:null===(j=F.validationErrors)||void 0===j?void 0:j.description,enableInlineEdit:!0,setSendMessageInChat:F.setSendMessageInChat,activeEditId:null!==(T=F.activeEditId)&&void 0!==T?T:null,setActiveEditId:F.setActiveEditId,pendingEditId:null!==(N=F.pendingEditId)&&void 0!==N?N:null,setPendingEditId:F.setPendingEditId}),(null===(w=z.citation)||void 0===w?void 0:w.description)&&e.jsx("div",i.__assign({style:ti},{children:e.jsx(a.InputDataReasoningCard,{isVisible:U.description,citation:z.citation.description,citations:ei("description"),fieldName:F.descriptionLabel||"Description",fieldValue:z.description||""})}))]})),J.afterDescription&&e.jsx("div",i.__assign({className:"custom-slot"},{children:J.afterDescription})),e.jsx("div",i.__assign({className:"template-section"},{children:e.jsx(s.ConditionSection,{id:"condition-wta-base",idPrefix:"condition-wta",title:F.whenToApplyLabel||"When to apply",required:!0,dividerRequired:!0,readOnly:ni("condition-wta"),conditions:z.whenToApplyConditions||[],onAdd:k.onAddWhenToApply,onRemove:function(i,e,t){return k.onRemoveWhenToApply(t)},onEdit:function(i,e,t,n){return k.onEditWhenToApply(t,n)},isHighlighted:(null===(W=F.highlights)||void 0===W?void 0:W.get("wta"))||!1,highlightedIds:F.highlightedIds,tooltipDescription:"Why this Condition?",citations:ei("whenToApply"),bordered:!0,addLabel:"Add ".concat(F.whenToApplyLabel||"When to apply"),isAiStreaming:F.isAiStreaming,errorMessage:(null===(D=F.validationErrors)||void 0===D?void 0:D.whenToApply)||F.conflictReason,index:0,tierKey:"base",activeEditId:null!==(L=F.activeEditId)&&void 0!==L?L:null,setActiveEditId:F.setActiveEditId,pendingEditId:null!==(O=F.pendingEditId)&&void 0!==O?O:null,setPendingEditId:F.setPendingEditId,setSendMessageInChat:F.setSendMessageInChat})})),J.afterWhenToApply&&e.jsx("div",i.__assign({className:"custom-slot"},{children:J.afterWhenToApply})),e.jsx("div",i.__assign({className:"template-section"},{children:e.jsx(s.ConditionSection,{id:"condition-wnta-base",idPrefix:"condition-wnta",title:F.whenNotToApplyLabel||"When NOT to apply",required:!1,dividerRequired:!0,readOnly:ni("condition-wnta"),conditions:z.whenNotToApplyConditions||[],onAdd:k.onAddWhenNotToApply,onRemove:function(i,e,t){return k.onRemoveWhenToApply(t)},onEdit:function(i,e,t,n){return k.onEditWhenNotToApply(t,n)},isHighlighted:(null===(M=F.highlights)||void 0===M?void 0:M.get("wnta"))||!1,highlightedIds:F.highlightedIds,tooltipDescription:"Why this Condition?",citations:ei("whenNotToApply"),bordered:!0,addLabel:"Add ".concat(F.whenNotToApplyLabel||"When NOT to apply"),isAiStreaming:F.isAiStreaming,errorMessage:null===(q=F.validationErrors)||void 0===q?void 0:q.whenNotToApply,index:0,tierKey:"base",activeEditId:null!==(P=F.activeEditId)&&void 0!==P?P:null,setActiveEditId:F.setActiveEditId,pendingEditId:null!==(R=F.pendingEditId)&&void 0!==R?R:null,setPendingEditId:F.setPendingEditId,setSendMessageInChat:F.setSendMessageInChat})})),J.afterWhenNotToApply&&e.jsx("div",i.__assign({className:"custom-slot"},{children:J.afterWhenNotToApply})),F.showConfiguration&&e.jsxs("div",i.__assign({className:"template-section"},{children:[e.jsx(d.ConfigSection,{id:"base-config",title:F.configLabel||"Configuration",required:!1,highlights:(null===(V=F.highlights)||void 0===V?void 0:V.get("config"))||{},bordered:!0,readOnly:ni("base-config"),onConfigChange:function(i,e){var t;return null===(t=k.onConfigChange)||void 0===t?void 0:t.call(k,i,e)},separationItems:F.separationItems||[],toggles:F.toggles||[],index:0,openSections:Z,setOpenSections:$,activeEditId:null!==(H=F.activeEditId)&&void 0!==H?H:null,setActiveEditId:F.setActiveEditId,pendingEditId:null!==(B=F.pendingEditId)&&void 0!==B?B:null,setPendingEditId:F.setPendingEditId,isAiStreaming:F.isAiStreaming,setSendMessageInChat:F.setSendMessageInChat}),(null===(K=z.citation)||void 0===K?void 0:K.config)&&e.jsx("div",i.__assign({style:ti},{children:e.jsx(a.InputDataReasoningCard,{isVisible:U.config,citation:z.citation.config,citations:ei("config"),fieldName:F.configLabel||"Configuration",fieldValue:"Proposed Configuration"})}))]})),J.bottom&&e.jsx("div",i.__assign({className:"custom-slot-bottom"},{children:J.bottom}))]}))};
2
- //# sourceMappingURL=BaseTemplate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BaseTemplate.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),i=require("lucide-react");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=s(t),o=0,a=function(){return"cond-".concat(Date.now(),"-").concat(++o)},l="#CBD5E1",d="#9B8AFB",c="#7C3AED",g="#FDA29B",u="#344054",p="#1E293B",x="#334155",f="#64748B",h="#94A3B8",_="#98A2B3",y="#F04438",m="#8F2C23",b="#5925DC",j="#475569",v="#FFFFFF",w="#F8FAFC",C="#F1F5F9",F="#F9F5FF",k="#17B26A",S="#F04438",z="#64748B",D="6px",E="8px",A="Inter, sans-serif",B={width:38,height:38,display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid #D0D5DD",borderRadius:D,cursor:"pointer",background:v,flexShrink:0,transition:"background 0.15s"},R={width:"100%",boxSizing:"border-box",padding:"8px 11.5px",border:"1px solid #D0D5DD",borderRadius:D,fontSize:14,fontWeight:400,lineHeight:"100%",fontFamily:A,outline:"none",color:u,background:v},T={display:"flex",alignItems:"center",gap:4,marginBottom:8,color:u,fontSize:14,fontWeight:500,lineHeight:"130%",fontFamily:A},I={background:v,border:"1px solid ".concat(l),borderRadius:E,padding:16},W=n.jsx("span",e.__assign({style:{color:m,fontSize:12,lineHeight:1,display:"inline-flex",transform:"translateY(0.5px)"}},{children:"*"})),H={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"}},L=function(e){return e?Array.isArray(e)?e.filter(Boolean).join("\n"):e:""},M=function(e,n){if(!n&&!e)return"exact_match";if(!n)return"new_field";if(!e)return"new_field";var t=function(e){return e.trim().toLowerCase()};if(t(e)===t(n))return"exact_match";var i=new Set(t(e).split(/\s+/)),s=new Set(t(n).split(/\s+/));return Array.from(i).filter(function(e){return s.has(e)}).length/Math.max(i.size,s.size)>=.45?"partial_overlap":"conflict"},N=function(t){var i=t.relation,s=H[i];return n.jsxs("div",e.__assign({style:{display:"inline-flex",alignItems:"center",gap:4,padding:"3px 9px",borderRadius:20,background:s.bg,border:"1px solid ".concat(s.border),fontSize:10,fontWeight:600,color:s.text,fontFamily:A,whiteSpace:"nowrap",flexShrink:0}},{children:[n.jsx("span",{style:{width:5,height:5,borderRadius:"50%",background:s.dot,flexShrink:0}}),s.label]}))},O=r.default.forwardRef(function(t,i){var s=t.label,r=t.value;return n.jsxs("div",e.__assign({ref:i,style:{display:"flex",flexDirection:"column"}},{children:[n.jsx("p",e.__assign({style:{margin:"0 0 5px 0",fontSize:12,color:f,fontFamily:A}},{children:s})),n.jsx("div",e.__assign({style:{flex:1,padding:"9px 12px",borderRadius:E,background:"#FFF3F2",border:"1px solid ".concat("#FECACA"),fontSize:13,lineHeight:"150%",color:r?p:h,fontFamily:A,fontStyle:r?"normal":"italic",wordBreak:"break-word",whiteSpace:"pre-wrap",minHeight:37}},{children:r||"—"}))]}))});O.displayName="FieldCell";var q=function(s){var r=s.formData,o=s.existingData,a=s.onClose,d=s.visible,c=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"),u=L(o.whenToApply),f=L(o.whenNotToApply),h=t.useMemo(function(){return[{label:"Title",proposed:r.name,existing:o.name||"",relation:M(r.name,o.name||"")},{label:"Description",proposed:r.description,existing:o.description||"",relation:M(r.description,o.description||"")},{label:"When to apply",proposed:c,existing:u,relation:M(c,u)},{label:"When NOT to Apply",proposed:g,existing:f,relation:g?M(g,f):f?"new_field":"exact_match"}]},[r.name,r.description,c,g,o.name,o.description,u,f]),_=h.reduce(function(e,n){return e[n.relation]=(e[n.relation]||0)+1,e},{}),y=t.useRef(null),m=t.useRef([]),j=t.useRef([]),w=t.useState([]),C=w[0],F=w[1];m.current=[],j.current=[];var k=t.useCallback(function(){if(y.current){var e=y.current.getBoundingClientRect(),n=[];h.forEach(function(t,i){var s=m.current[i],r=j.current[i];if(s&&r){s.style.height="auto",r.style.height="auto";var o=s.getBoundingClientRect(),a=r.getBoundingClientRect(),l=Math.max(o.height,a.height);s.style.height="".concat(l,"px"),r.style.height="".concat(l,"px");var d=s.getBoundingClientRect(),c=r.getBoundingClientRect(),g=d.top+d.height/2-e.top;n.push({x1:d.right-e.left,y1:g,x2:c.left-e.left,y2:g,relation:t.relation})}}),F(n)}},[h]);return t.useEffect(function(){var e=setTimeout(k,150);window.addEventListener("resize",k);var n=null;return y.current&&(n=new ResizeObserver(function(){window.requestAnimationFrame(function(){return k()})})).observe(y.current),function(){clearTimeout(e),window.removeEventListener("resize",k),n&&n.disconnect()}},[k,d]),n.jsxs(n.Fragment,{children:[n.jsx("div",{onClick:a,style:{position:"absolute",inset:0,background:"rgba(15,23,42,0.18)",zIndex:10,opacity:d?1:0,transition:"opacity 0.25s ease",pointerEvents:d?"auto":"none"}}),n.jsxs("div",e.__assign({style:{position:"absolute",inset:0,background:v,zIndex:11,display:"flex",flexDirection:"column",transform:d?"translateX(0)":"translateX(100%)",transition:"transform 0.28s cubic-bezier(0.4,0,0.2,1)",borderRadius:E,overflow:"hidden"}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",borderBottom:"1px solid ".concat(l),flexShrink:0,background:v}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:10}},{children:[n.jsx("button",e.__assign({type:"button",onClick:a,style:e.__assign(e.__assign({},B),{width:32,height:32,border:"1px solid ".concat(l),borderRadius:D})},{children:n.jsx(i.ArrowLeft,{size:15,color:x})})),n.jsx("span",e.__assign({style:{fontSize:15,fontWeight:600,color:p,fontFamily:A,letterSpacing:"-0.01em"}},{children:"Category Comparison"}))]})),n.jsx("div",e.__assign({style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"}},{children:Object.entries(_).map(function(t){var i=t[0],s=t[1];return n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:4,padding:"3px 10px",borderRadius:20,background:H[i].bg,border:"1px solid ".concat(H[i].border),fontSize:11,fontWeight:600,color:H[i].text,fontFamily:A}},{children:[n.jsx("span",{style:{width:5,height:5,borderRadius:"50%",background:H[i].dot}}),s," ",H[i].label]}),i)})}))]})),n.jsx("div",e.__assign({style:{flex:1,overflowY:"auto",padding:16}},{children:n.jsxs("div",e.__assign({ref:y,style:{display:"grid",gridTemplateColumns:"1fr 140px 1fr",alignItems:"start",gap:"0",position:"relative"}},{children:[n.jsx("svg",e.__assign({style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:10}},{children:C.map(function(t,i){var s=(t.x1+t.x2)/2,r=t.y1,o=H[t.relation];return n.jsxs("g",{children:[n.jsx("line",{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:o.border,strokeWidth:"1.5"}),n.jsx("foreignObject",e.__assign({x:s-70,y:r-14,width:"140",height:"28"},{children:n.jsx("div",e.__assign({style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:n.jsx(N,{relation:t.relation})}))}))]},i)})})),n.jsxs("div",e.__assign({style:{border:"1.5px dashed #CBD5E1",borderRadius:10,padding:14,display:"flex",flexDirection:"column",gap:14}},{children:[n.jsx("p",e.__assign({style:{margin:"0 0 2px 0",fontSize:13,fontWeight:600,color:p,fontFamily:A}},{children:"Category You're Creating"})),h.map(function(e,t){return n.jsx(O,{ref:function(e){m.current[t]=e},label:e.label,value:e.proposed},t)})]})),n.jsx("div",{}),n.jsxs("div",e.__assign({style:{border:"1.5px dashed #CBD5E1",borderRadius:10,padding:14,display:"flex",flexDirection:"column",gap:14}},{children:[n.jsxs("p",e.__assign({style:{margin:"0 0 2px 0",fontSize:13,fontWeight:600,color:b,fontFamily:A,display:"flex",alignItems:"center",gap:5}},{children:[n.jsx(i.Sparkles,{size:13,color:b}),"Existing Category"]})),h.map(function(e,t){return n.jsx(O,{ref:function(e){j.current[t]=e},label:e.label,value:e.existing},t)})]}))]}))}))]}))]})},K=function(t){var s=t.condition,r=t.index,o=t.isEditing,a=t.editText,c=t.onEditStart,p=t.onEditChange,x=t.onEditSave,f=t.onEditCancel,_=t.onRemove,y=t.readOnly,m=t.onBlurContainer,b={width:40,height:38,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:w,borderRight:"1px solid #D0D5DD",color:j,fontSize:14,fontFamily:A};return o?n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:12},onBlur:m},{children:[n.jsxs("div",e.__assign({style:{display:"flex",flex:1,alignItems:"center",background:v,border:"1px solid ".concat(d),borderRadius:E,overflow:"hidden"}},{children:[n.jsx("div",e.__assign({style:b},{children:r+1})),n.jsx("input",{type:"text",value:a,onChange:function(e){return p(e.target.value)},autoFocus:!0,onKeyDown:function(e){"Enter"===e.key&&a.trim()?x():"Escape"===e.key&&f()},style:{flex:1,padding:"8px 11.5px",fontSize:14,fontFamily:A,color:u,border:"none",outline:"none",background:"transparent"}})]})),n.jsx("button",e.__assign({type:"button",disabled:!a.trim(),onClick:x,style:e.__assign(e.__assign({},B),{borderRadius:E,opacity:a.trim()?1:.5,cursor:a.trim()?"pointer":"not-allowed",background:a.trim()?v:w})},{children:n.jsx(i.Check,{size:18,color:k})})),n.jsx("button",e.__assign({type:"button",onClick:f,style:e.__assign(e.__assign({},B),{borderRadius:E})},{children:n.jsx(i.X,{size:18,color:S})}))]})):n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:12}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",flex:1,alignItems:"center",background:v,border:"1px solid #D0D5DD",borderRadius:E,overflow:"hidden",height:38}},{children:[n.jsx("div",e.__assign({style:e.__assign(e.__assign({},b),{height:"100%"})},{children:r+1})),n.jsx("div",e.__assign({style:{flex:1,padding:"0 11.5px",fontSize:14,fontFamily:A,display:"flex",alignItems:"center",height:"100%"}},{children:s.text?n.jsx("span",e.__assign({style:{color:u}},{children:s.text})):n.jsx("span",e.__assign({style:{color:h}},{children:"Enter condition"}))}))]})),!y&&n.jsxs(n.Fragment,{children:[n.jsx("button",e.__assign({type:"button",onClick:c,style:e.__assign(e.__assign({},B),{border:"1px solid ".concat(l),borderRadius:E})},{children:n.jsx(i.Pencil,{size:16,color:z})})),n.jsx("button",e.__assign({type:"button",onClick:_,style:e.__assign(e.__assign({},B),{border:"1px solid ".concat(g),borderRadius:E})},{children:n.jsx(i.Trash2,{size:16,color:S})}))]})]}))},P=function(t){var s=t.title,r=t.required,o=t.isExpanded,a=t.setIsExpanded,d=t.conditions,c=t.prefix,g=t.editingCondKey,p=t.editingCondText,x=t.setEditingCondKey,_=t.setEditingCondText,m=t.onAdd,j=t.onUpdate,v=t.onRemove,w=t.addLabel,C=t.readOnly,F=t.errorMessage,k=t.style,S=d.length>0;return n.jsxs("div",e.__assign({style:e.__assign({border:"1px solid ".concat(l),borderRadius:E,padding:16},k)},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:8,cursor:S?"pointer":"default",userSelect:"none"},onClick:function(){S&&a(function(e){return!e})}},{children:[n.jsxs("label",e.__assign({style:e.__assign(e.__assign({},T),{marginBottom:0,cursor:S?"pointer":"default"})},{children:[r&&W,n.jsx("span",{children:s})]})),n.jsx("button",e.__assign({type:"button",style:{background:"none",border:"none",cursor:"pointer",padding:0,display:"flex",alignItems:"center",transform:o?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.2s"}},{children:n.jsx(i.ChevronUp,{size:20,color:S?u:h})}))]})),o&&n.jsxs(n.Fragment,{children:[0===d.length&&n.jsx("p",e.__assign({style:{color:f,fontSize:14,fontStyle:"italic",fontWeight:300,fontFamily:A,margin:"0 0 12px 0"}},{children:"No conditions applied"})),n.jsx("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:12,marginBottom:12}},{children:d.map(function(e,t){var i="".concat(c,"_").concat(e.id);return n.jsx(K,{condition:e,index:t,isEditing:g===i,editText:p,onEditStart:function(){x(i),_(e.text)},onEditChange:_,onEditSave:function(){p.trim()&&(j(e.id,p),x(null))},onEditCancel:function(){e.text?x(null):v(e.id)},onRemove:function(){return v(e.id)},readOnly:C,onBlurContainer:function(n){return function(e,n,t){if(!e.currentTarget.contains(e.relatedTarget)){var i="".concat(c,"_").concat(n);p.trim()||t?p.trim()&&j(n,p):v(n),g===i&&x(null)}}(n,e.id,e.text)}},e.id)})})),!C&&n.jsxs("button",e.__assign({type:"button",onClick:m,style:{display:"flex",alignItems:"center",gap:7,color:b,fontSize:14,fontWeight:500,fontFamily:A,background:"none",border:"none",cursor:"pointer",padding:0}},{children:[n.jsx(i.Plus,{size:16}),w]})),F&&n.jsx("p",e.__assign({style:{marginTop:8,color:y,fontSize:12,fontFamily:A,margin:"8px 0 0 0"}},{children:F}))]})]}))},U=function(s){var r=s.state,o=s.handlers,d=s.uiState,m=r.formData,w=r.nameLabel,H=void 0===w?"Category Name":w,L=r.namePlaceholder,M=void 0===L?"Enter category name":L,N=o.setFormData,O=d.readOnly,K=void 0!==O&&O,U=d.isAiStreaming,X=void 0!==U&&U;d.setActiveEditId,d.setSendMessageInChat;var Y=d.validationErrors,V=void 0===Y?{}:Y,Z=d.addExampleBtnRef,G=d.comparisonData,J=void 0===G?null:G,Q=d.onComparisonClose,$=t.useState(null),ee=$[0],ne=$[1],te=t.useState(""),ie=te[0],se=te[1],re=t.useState(null),oe=re[0],ae=re[1],le=t.useState(""),de=le[0],ce=le[1],ge=t.useState(!0),ue=ge[0],pe=ge[1],xe=t.useState(!0),fe=xe[0],he=xe[1],_e=t.useState(null),ye=_e[0],me=_e[1],be=t.useState(""),je=be[0],ve=be[1],we=t.useState(""),Ce=we[0],Fe=we[1],ke=t.useState([]),Se=ke[0],ze=ke[1],De=t.useState(!1),Ee=De[0],Ae=De[1],Be=t.useRef(null),Re=t.useState(!1),Te=Re[0],Ie=Re[1],We=t.useRef(X);t.useEffect(function(){J?requestAnimationFrame(function(){return Ae(!0)}):Ae(!1)},[J]),t.useEffect(function(){We.current&&!X&&Te&&Ie(!1),We.current=X},[X,Te]);var He=K,Le=t.useCallback(function(n,t){return N(function(i){var s;return e.__assign(e.__assign({},i),((s={})[n]=t,s))})},[N]),Me=function(n){var t=a();N(function(i){var s;return e.__assign(e.__assign({},i),((s={})[n]=e.__spreadArray(e.__spreadArray([],i[n],!0),[{id:t,text:""}],!1),s))}),ae("".concat("whenToApply"===n?"wta":"wnta","_").concat(t)),ce(""),"whenToApply"!==n||ue||pe(!0),"whenNotToApply"!==n||fe||he(!0)},Ne=function(n,t,i){return N(function(s){var r;return e.__assign(e.__assign({},s),((r={})[n]=s[n].map(function(n){return n.id===t?e.__assign(e.__assign({},n),{text:i}):n}),r))})},Oe=function(n,t){return N(function(i){var s;return e.__assign(e.__assign({},i),((s={})[n]=i[n].filter(function(e){return e.id!==t}),s))})},qe=function(n){return ze(function(t){return t.includes(n)?t.filter(function(e){return e!==n}):e.__spreadArray(e.__spreadArray([],t,!0),[n],!1)})},Ke=t.useCallback(function(){var n=a();N(function(t){return e.__assign(e.__assign({},t),{occurrences:e.__spreadArray(e.__spreadArray([],t.occurrences||[],!0),[{id:n,title:"",description:""}],!1)})}),me(n),ve(""),Fe(""),ze(function(t){return e.__spreadArray(e.__spreadArray([],t,!0),[n],!1)})},[N]),Pe=t.useCallback(function(){Ae(!1),setTimeout(function(){null==Q||Q()},280)},[Q]),Ue=function(t){return n.jsxs("button",e.__assign({ref:t?void 0:Z,type:"button",disabled:t,onClick:Ke,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.jsx(i.Plus,{size:14,color:b}),n.jsx("span",e.__assign({style:{color:b,fontSize:14,fontWeight:500,fontFamily:A}},{children:"Add example"}))]}))};return n.jsxs("div",e.__assign({style:{flex:1,overflowY:"auto",position:"relative"}},{children:[J&&n.jsx(q,{formData:m,existingData:J,onClose:Pe,visible:Ee}),Te&&X&&n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",color:"#141414",fontSize:13,fontWeight:500,fontStyle:"italic",marginBottom:12,paddingLeft:4,fontFamily:A}},{children:[n.jsx(i.Loader2Icon,{size:16,style:{marginRight:8,animation:"spin 1s linear infinite"}}),"Updating category details..."]})),n.jsxs("div",e.__assign({style:e.__assign(e.__assign({},I),{marginBottom:12})},{children:[n.jsxs("div",e.__assign({style:{marginBottom:12}},{children:[n.jsxs("label",e.__assign({style:T},{children:[W,n.jsx("span",{children:H})]})),He&&"name"!==ee?n.jsx("div",e.__assign({style:{display:"flex",alignItems:"center",gap:12}},{children:n.jsx("div",e.__assign({style:{flex:1,padding:"10px 14px",border:"1px solid #D0D5DD",borderRadius:D,fontSize:14,background:v,minHeight:42,display:"flex",alignItems:"center"}},{children:m.name?n.jsx("span",e.__assign({style:{color:u}},{children:m.name})):n.jsx("span",e.__assign({style:{color:_}},{children:M}))}))})):He&&"name"===ee?n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:12}},{children:[n.jsx("input",{type:"text",value:ie,onChange:function(e){return se(e.target.value)},autoFocus:!0,onKeyDown:function(e){"Enter"===e.key?(Le("name",ie),ne(null)):"Escape"===e.key&&ne(null)},placeholder:M,style:e.__assign(e.__assign({},R),{flex:1,width:"auto",border:"1px solid ".concat(c)})}),n.jsx("button",e.__assign({type:"button",onClick:function(){Le("name",ie),ne(null)},style:B},{children:n.jsx(i.Check,{size:18,color:k})})),n.jsx("button",e.__assign({type:"button",onClick:function(){return ne(null)},style:B},{children:n.jsx(i.X,{size:18,color:S})}))]})):n.jsx("input",{type:"text",value:m.name,onChange:function(e){return Le("name",e.target.value)},placeholder:M,disabled:X,style:e.__assign(e.__assign({},R),{opacity:X?.6:1,cursor:X?"not-allowed":"text"})}),(null==V?void 0:V.name)&&n.jsx("p",e.__assign({style:{marginTop:4,color:y,fontSize:12,fontFamily:A,margin:"4px 0 0 0"}},{children:V.name}))]})),n.jsxs("div",e.__assign({style:{marginBottom:12}},{children:[n.jsxs("label",e.__assign({style:T},{children:[W,n.jsx("span",{children:"Category Description"})]})),He&&"description"!==ee?n.jsx("div",e.__assign({style:{display:"flex",alignItems:"flex-start",gap:12}},{children:n.jsx("div",e.__assign({style:{flex:1,padding:"12px 14px",border:"1px solid #D0D5DD",borderRadius:D,fontSize:14,background:v,minHeight:80}},{children:m.description?n.jsx("span",e.__assign({style:{color:u,whiteSpace:"pre-wrap"}},{children:m.description})):n.jsx("span",e.__assign({style:{color:_}},{children:"Describe when this category should be applied"}))}))})):He&&"description"===ee?n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"flex-start",gap:12}},{children:[n.jsx("textarea",{value:ie,onChange:function(e){return se(e.target.value)},autoFocus:!0,onKeyDown:function(e){"Escape"===e.key&&ne(null)},placeholder:"Enter Description",rows:4,style:e.__assign(e.__assign({},R),{flex:1,width:"auto",border:"1px solid ".concat(c),resize:"none",lineHeight:"140%"})}),n.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:8}},{children:[n.jsx("button",e.__assign({type:"button",onClick:function(){Le("description",ie),ne(null)},style:B},{children:n.jsx(i.Check,{size:18,color:k})})),n.jsx("button",e.__assign({type:"button",onClick:function(){return ne(null)},style:B},{children:n.jsx(i.X,{size:18,color:S})}))]}))]})):n.jsx("textarea",{value:m.description,onChange:function(e){return Le("description",e.target.value)},placeholder:"Describe when this category should be applied.",disabled:X,style:e.__assign(e.__assign({},R),{height:60,paddingTop:7,paddingBottom:10.5,border:"1px solid ".concat(l),lineHeight:"140%",resize:"none",boxShadow:"0 1px 2px 0 rgba(18,18,23,0.05)",opacity:X?.6:1,cursor:X?"not-allowed":"text"})}),(null==V?void 0:V.description)&&n.jsx("p",e.__assign({style:{marginTop:4,color:y,fontSize:12,fontFamily:A,margin:"4px 0 0 0"}},{children:V.description}))]})),n.jsx(P,{title:"When to Apply",required:!0,isExpanded:ue,setIsExpanded:pe,conditions:m.whenToApply,prefix:"wta",editingCondKey:oe,editingCondText:de,setEditingCondKey:ae,setEditingCondText:ce,onAdd:function(){return Me("whenToApply")},onUpdate:function(e,n){return Ne("whenToApply",e,n)},onRemove:function(e){return Oe("whenToApply",e)},addLabel:"Add When to Apply",readOnly:X||K,errorMessage:null==V?void 0:V.whenToApply,style:{marginBottom:12}}),n.jsx(P,{title:"When NOT to Apply",required:!1,isExpanded:fe,setIsExpanded:he,conditions:m.whenNotToApply,prefix:"wnta",editingCondKey:oe,editingCondText:de,setEditingCondKey:ae,setEditingCondText:ce,onAdd:function(){return Me("whenNotToApply")},onUpdate:function(e,n){return Ne("whenNotToApply",e,n)},onRemove:function(e){return Oe("whenNotToApply",e)},addLabel:"Add When NOT to Apply",readOnly:X||K,errorMessage:null==V?void 0:V.whenNotToApply})]})),n.jsxs("div",e.__assign({style:e.__assign(e.__assign({},I),{marginTop:12})},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12}},{children:[n.jsxs("div",{children:[n.jsxs("h4",e.__assign({style:{color:p,fontSize:14,fontWeight:500,lineHeight:"120%",letterSpacing:"0.02em",fontFamily:A,margin:"0 0 4px 0"}},{children:["Example (",(m.occurrences||[]).length,")"]})),n.jsx("p",e.__assign({style:{color:f,fontSize:12,fontWeight:300,lineHeight:"120%",letterSpacing:"0.02em",fontFamily:A,margin:0}},{children:"Add real examples to help the system understand this category"}))]}),(m.occurrences||[]).length>0&&!K&&Ue(null!==ye||X)]})),0===(m.occurrences||[]).length?n.jsxs("div",e.__assign({style:{border:"1px solid ".concat(l),borderRadius:E,background:v,padding:"24px 12px 12px",minHeight:181,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}},{children:[n.jsx("div",e.__assign({style:{marginBottom:16}},{children:n.jsxs("svg",e.__assign({xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 56 56",fill:"none"},{children:[n.jsx("rect",{x:"4",y:"4",width:"48",height:"48",rx:"24",fill:"#F1F5F9"}),n.jsx("rect",{x:"4",y:"4",width:"48",height:"48",rx:"24",stroke:"#F8FAFC",strokeWidth:"8"}),n.jsx("rect",{width:"24",height:"24",transform:"translate(16 16)",fill:"#F1F5F9"}),n.jsx("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.jsx("p",e.__assign({style:{color:x,fontSize:12,fontWeight:500,lineHeight:"120%",fontFamily:A,margin:"0 0 8px 0"}},{children:"No example added yet"})),n.jsx("p",e.__assign({style:{color:f,fontSize:14,fontWeight:300,lineHeight:"140%",fontFamily:A,margin:"0 0 8px 0",maxWidth:530}},{children:"Add an example to show how this category is used, or generate one using chat."})),!K&&Ue(null!==ye||X)]})):n.jsx("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:12}},{children:(m.occurrences||[]).map(function(t,s){var r=Se.includes(t.id);return ye===t.id?n.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:12,border:"1px solid ".concat(l),borderRadius:E,background:v,padding:16,boxShadow:"0 1px 3px rgba(0,0,0,0.07)"}},{children:[n.jsxs("div",{children:[n.jsx("label",e.__assign({style:e.__assign(e.__assign({},T),{marginBottom:8})},{children:n.jsx("span",e.__assign({style:{color:x}},{children:"Title/Subject"}))})),n.jsx("input",{type:"text",value:je,onChange:function(e){return ve(e.target.value)},placeholder:"e.g., Follow-up on client feedback from last meeting",style:e.__assign(e.__assign({},R),{border:"1px solid ".concat(l),lineHeight:"140%"})})]}),n.jsxs("div",{children:[n.jsxs("label",e.__assign({style:{display:"flex",alignItems:"center",gap:4,marginBottom:8}},{children:[n.jsx("span",e.__assign({style:{color:x,fontSize:14,fontWeight:500,fontFamily:A}},{children:"Message body"})),W]})),n.jsx("textarea",{ref:function(e){e&&ye===t.id&&!Be.current&&(Be.current=e),e&&(e.style.height="auto",e.style.height="".concat(e.scrollHeight,"px"))},value:Ce,onChange:function(e){Fe(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.__assign(e.__assign({},R),{border:"1px solid ".concat(l),overflow:"hidden",minHeight:60,lineHeight:"140%",resize:"none"})})]}),n.jsxs("div",e.__assign({style:{display:"flex",justifyContent:"flex-end",gap:12,marginTop:4}},{children:[n.jsx("button",e.__assign({type:"button",onClick:function(){t.title||t.description||N(function(n){return e.__assign(e.__assign({},n),{occurrences:(n.occurrences||[]).filter(function(e){return e.id!==t.id})})}),me(null),Be.current=null},style:{padding:"6px 12px",color:j,fontSize:14,fontWeight:500,lineHeight:"140%",fontFamily:A,background:"none",border:"none",cursor:"pointer",borderRadius:D}},{children:"Cancel"})),n.jsx("button",e.__assign({type:"button",disabled:!Ce.trim(),onClick:function(){var n;Ce.trim()&&(n=t.id,N(function(t){return e.__assign(e.__assign({},t),{occurrences:t.occurrences.map(function(t){return t.id===n?e.__assign(e.__assign({},t),{title:je,description:Ce}):t})})}),me(null),Be.current=null,ze(function(e){return e.filter(function(e){return e!==t.id})}))},style:{padding:"6px 12px",borderRadius:D,fontSize:14,fontWeight:500,lineHeight:"140%",fontFamily:A,cursor:Ce.trim()?"pointer":"not-allowed",background:Ce.trim()?F:v,border:"1px solid ".concat(Ce.trim()?F:"#E2E8F0"),color:Ce.trim()?b:h,transition:"background 0.15s"}},{children:"Save"}))]}))]}),t.id):n.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",border:"1px solid #E2E8F0",borderRadius:E,background:v,overflow:"hidden",boxShadow:"0 1px 3px rgba(0,0,0,0.07)"}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:12,padding:12}},{children:[n.jsx("div",e.__assign({style:{width:20,height:20,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:C,borderRadius:D,color:j,fontSize:10,fontWeight:500,fontFamily:A}},{children:s+1})),n.jsx("div",e.__assign({style:{flex:1,fontSize:15,fontWeight:500,lineHeight:"140%",fontFamily:A,color:x,wordBreak:"break-word"}},{children:t.title||n.jsx("span",e.__assign({style:{color:h,fontWeight:400,fontSize:14}},{children:"Untitled example"}))})),n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:8,flexShrink:0}},{children:[!K&&n.jsxs(n.Fragment,{children:[n.jsx("button",e.__assign({type:"button",disabled:null!==ye||X,onClick:function(){me(t.id),ve(t.title),Fe(t.description),r||qe(t.id)},style:e.__assign(e.__assign({},B),{width:36,height:36,border:"1px solid #E2E8F0",borderRadius:D,opacity:null!==ye||X?.5:1,cursor:null!==ye||X?"not-allowed":"pointer"})},{children:n.jsx(i.Pencil,{size:16,color:z})})),n.jsx("button",e.__assign({type:"button",disabled:null!==ye||X,onClick:function(){return N(function(n){return e.__assign(e.__assign({},n),{occurrences:(n.occurrences||[]).filter(function(e){return e.id!==t.id})})})},style:e.__assign(e.__assign({},B),{width:36,height:36,border:"1px solid ".concat(g),borderRadius:D,opacity:null!==ye||X?.5:1,cursor:null!==ye||X?"not-allowed":"pointer"})},{children:n.jsx(i.Trash2,{size:16,color:S})}))]}),n.jsx("button",e.__assign({type:"button",onClick:function(){return qe(t.id)},style:e.__assign(e.__assign({},B),{width:36,height:36,border:"none",background:"transparent"})},{children:r?n.jsx(i.ChevronUp,{size:20,color:z}):n.jsx(i.ChevronDown,{size:20,color:z})}))]}))]})),r&&n.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",padding:"4px 12px 16px"}},{children:[n.jsxs("div",e.__assign({style:{marginBottom:12}},{children:[n.jsx("p",e.__assign({style:{color:f,fontSize:13,lineHeight:"140%",fontFamily:A,margin:"0 0 4px 0"}},{children:"Title/Subject:"})),n.jsx("p",e.__assign({style:{color:p,fontSize:14,fontWeight:300,lineHeight:"150%",fontFamily:A,whiteSpace:"pre-wrap",wordBreak:"break-word",margin:0}},{children:t.title||n.jsx("span",e.__assign({style:{color:h,fontStyle:"italic"}},{children:"—"}))}))]})),n.jsxs("div",{children:[n.jsx("p",e.__assign({style:{color:f,fontSize:13,lineHeight:"140%",fontFamily:A,margin:"0 0 4px 0"}},{children:"Message body:"})),n.jsx("p",e.__assign({style:{color:p,fontSize:14,fontWeight:300,lineHeight:"150%",fontFamily:A,whiteSpace:"pre-wrap",wordBreak:"break-word",margin:0}},{children:t.description}))]})]}))]}),t.id)})}))]}))]}))};exports.CreateCategory=U,exports.default=U;
2
- //# sourceMappingURL=CreateCategory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CreateCategory.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),e=require("react/jsx-runtime"),n=require("react"),t=require("../../organisms/ConditionSection/ConditionSection.js"),o=require("../../organisms/TextSection/TextSection.js");exports.WorkflowComposer=function(l){var r,d,s,u=l.state,a=l.handlers,p=l.uiState,g=(null==p?void 0:p.highlights)||{},h=n.useState({}),c=h[0],v=h[1],y=function(e){v(function(n){var t;return i.__assign(i.__assign({},n),((t={})[e]=!n[e],t))})},T=function(i){var e,n=null===(e=u.fieldCitations)||void 0===e?void 0:e[i];return Array.isArray(n)&&n.length>0?n:u.citations};return e.jsx("div",i.__assign({className:"simple-guideline-template"},{children:e.jsxs("div",i.__assign({style:{display:"flex",flexDirection:"column",gap:"20px"}},{children:[e.jsx(o.TextSection,i.__assign({id:"guideline-title",title:"Guideline Title",rows:1,placeholder:"Enter a short, descriptive title for the guideline",required:!0,value:u.guidelineTitle,onChange:a.setGuidelineTitle,readOnly:null==p?void 0:p.isAiStreaming,isOpen:c.guidelineTitle,onToggle:function(){return y("guidelineTitle")},isHighlighted:g.guidelineTitle||!1,tooltipDescription:"Why this Title?",errorMessage:null===(r=null==p?void 0:p.validationErrors)||void 0===r?void 0:r.guidelineTitle},p)),e.jsx(o.TextSection,i.__assign({id:"guideline-description",title:"Guideline Description",rows:4,placeholder:"Describe what this guideline enforces or ensures",required:!0,value:u.guidelineDescription,onChange:a.setGuidelineDescription,readOnly:null==p?void 0:p.isAiStreaming,isOpen:c.guidelineDescription,onToggle:function(){return y("guidelineDescription")},isHighlighted:g.guidelineDescription||!1,tooltipDescription:"Why this Description?",errorMessage:null===(d=null==p?void 0:p.validationErrors)||void 0===d?void 0:d.guidelineDescription},p)),e.jsx(t.ConditionSection,i.__assign({id:"when-to-apply",title:"When to apply",required:!0,dividerRequired:!0,readOnly:null==p?void 0:p.isAiStreaming,conditions:u.whenToApplyConditions||[],onAdd:function(){return a.addWhenToApply()},onRemove:function(i,e,n){return a.removeWhenToApply(n)},onEdit:function(i,e,n,t){return a.editWhenToApply(n,t)},index:0,tierKey:"default",isHighlighted:g.wta||!1,highlightedIds:null==p?void 0:p.highlightedIds,tooltipDescription:"Why this Condition?",citations:T("whenToApply"),bordered:!0,addLabel:"Add When to apply",isAiStreaming:null==p?void 0:p.isAiStreaming,errorMessage:null===(s=null==p?void 0:p.validationErrors)||void 0===s?void 0:s.whenToApply},p)),e.jsx(t.ConditionSection,i.__assign({id:"when-not-to-apply",title:"When NOT to apply",required:!1,dividerRequired:!0,readOnly:null==p?void 0:p.isAiStreaming,conditions:u.whenNotToApplyConditions||[],onAdd:function(){return a.addWhenNotToApply()},onRemove:function(i,e,n){return a.removeWhenNotToApply(n)},onEdit:function(i,e,n,t){return a.editWhenNotToApply(n,t)},index:0,tierKey:"default",isHighlighted:g.wnta||!1,highlightedIds:null==p?void 0:p.highlightedIds,tooltipDescription:"Why this Condition?",citations:T("whenNotToApply"),bordered:!0,addLabel:"Add When NOT to apply",isAiStreaming:null==p?void 0:p.isAiStreaming},p))]}))}))};
2
- //# sourceMappingURL=WorkflowComposer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WorkflowComposer.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),s=require("lucide-react"),i=require("./Cart.styles.js");function r(e){try{var t=new Date(e),n=t.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),s=t.toLocaleDateString("en-GB").replace(/\//g,"/");return"Added on - ".concat(n," | ").concat(s)}catch(t){return e}}function a(a){var l=a.items,d=a.onRemove,c=a.onProceed,u=n.useState(new Set),o=u[0],_=u[1];n.useEffect(function(){1!==l.length?_(function(t){var n=new Set(l.map(function(e){return e.instant_learning_id})),s=new Set(e.__spreadArray([],t,!0).filter(function(e){return n.has(e)}));return s.size===t.size?t:s}):_(new Set([l[0].instant_learning_id]))},[l]);var f=l.filter(function(e){return o.has(e.instant_learning_id)});return t.jsxs("section",e.__assign({style:i.default.cartSection},{children:[t.jsxs("div",e.__assign({style:i.default.cartHeaderRow},{children:[t.jsx("p",e.__assign({style:i.default.cartTitle},{children:"Guideline Cart"})),t.jsxs("span",e.__assign({style:i.default.cartBadge},{children:[l.length," Added"]}))]})),t.jsx("p",e.__assign({style:i.default.cartDescription},{children:l.length>1?"Click items to select them for this session":"Selected for this session"})),t.jsx("div",e.__assign({style:i.default.cartBody},{children:t.jsx("div",e.__assign({style:i.default.cartList},{children:0===l.length?t.jsx("div",e.__assign({style:i.default.emptyState},{children:"No guidelines added yet"})):l.map(function(n){var a=o.has(n.instant_learning_id);return t.jsxs("div",e.__assign({style:a?i.default.cartItemSelected:i.default.cartItem,onClick:function(){return e=n.instant_learning_id,void _(function(t){var n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});var e}},{children:[t.jsxs("div",e.__assign({style:i.default.cartItemTop},{children:[t.jsxs("div",e.__assign({style:i.default.cartItemTopLeft},{children:[t.jsx("span",e.__assign({style:a?i.default.cartCheckbox:i.default.cartCheckboxEmpty},{children:a&&t.jsx(s.Check,{size:12,strokeWidth:3})})),t.jsx("p",e.__assign({style:i.default.cartItemName},{children:n.instant_learning_title}))]})),t.jsxs("div",e.__assign({style:i.default.cartItemIcons},{children:[t.jsx(s.Eye,{size:16,strokeWidth:2}),t.jsx("button",e.__assign({type:"button",style:i.default.removeBtn,onClick:function(e){return function(e,t){e.stopPropagation(),_(function(e){if(!e.has(t))return e;var n=new Set(e);return n.delete(t),n}),d(t)}(e,n.instant_learning_id)}},{children:t.jsx(s.X,{size:16,strokeWidth:2})}))]}))]})),t.jsx("p",e.__assign({style:i.default.cartItemDescription},{children:n.instant_learning_description})),t.jsx("p",e.__assign({style:i.default.cartItemDate},{children:r(n.created_at)}))]}),n.instant_learning_id)})}))})),t.jsx("button",e.__assign({type:"button",style:f.length>0?i.default.proceedButton:i.default.proceedButtonDisabled,disabled:0===f.length,onClick:function(){return f.length>0&&c(f)}},{children:t.jsxs("span",{children:["Proceed with Selected",f.length>1?" (".concat(f.length,")"):""]})}))]}))}exports.Cart=a,exports.default=a;
2
- //# sourceMappingURL=Cart.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Cart.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.default={cartSection:{display:"flex",width:"100%",flexDirection:"column",borderRadius:12,border:"1px solid #5B2CF4",background:"#F5F1FF",padding:28,fontFamily:"Inter, sans-serif",boxShadow:"0 1px 4px rgba(16,24,40,0.04)"},cartHeaderRow:{display:"flex",alignItems:"center",gap:12},cartTitle:{fontSize:18,fontWeight:700,color:"#1F2937",margin:0},cartBadge:{display:"inline-flex",height:24,alignItems:"center",borderRadius:9999,background:"#EDE7FF",padding:"0 12px",fontSize:12,fontWeight:600,color:"#5B2CF4",whiteSpace:"nowrap"},cartDescription:{marginTop:4,fontSize:13,color:"#667085"},cartBody:{marginTop:24,minHeight:280,flex:"1 1 0%",overflow:"hidden"},cartList:{maxHeight:420,overflowY:"auto",paddingRight:8,display:"flex",flexDirection:"column",gap:16},emptyState:{display:"flex",alignItems:"center",justifyContent:"center",height:120,fontSize:14,color:"#98A2B3"},cartItem:{display:"flex",flexDirection:"column",borderRadius:10,border:"1px solid #EAECF0",background:"#ffffff",padding:16,cursor:"pointer"},cartItemSelected:{display:"flex",flexDirection:"column",borderRadius:10,border:"2px solid #4438F5",background:"#F5F3FF",padding:16,cursor:"pointer"},cartItemTop:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8},cartItemTopLeft:{display:"flex",alignItems:"center",gap:8,minWidth:0},cartCheckbox:{display:"inline-flex",height:18,width:18,flexShrink:0,alignItems:"center",justifyContent:"center",borderRadius:4,background:"#4438F5",color:"#ffffff"},cartCheckboxEmpty:{display:"inline-flex",height:18,width:18,flexShrink:0,alignItems:"center",justifyContent:"center",borderRadius:4,border:"2px solid #D0D5DD",background:"#ffffff"},cartItemName:{fontSize:14,fontWeight:600,color:"#1F2937",margin:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},cartItemIcons:{display:"flex",alignItems:"center",gap:10,flexShrink:0,color:"#98A2B3"},cartItemDescription:{marginTop:8,fontSize:13,color:"#667085"},cartItemDate:{marginTop:8,fontSize:12,color:"#98A2B3"},proceedButton:{marginTop:24,display:"inline-flex",height:44,width:"100%",alignItems:"center",justifyContent:"center",gap:8,borderRadius:6,background:"#4438F5",fontSize:15,fontWeight:600,color:"#ffffff",border:"none",boxShadow:"0 1px 2px rgba(16,24,40,0.08)",cursor:"pointer"},proceedButtonDisabled:{marginTop:24,display:"inline-flex",height:44,width:"100%",alignItems:"center",justifyContent:"center",gap:8,borderRadius:6,background:"#C4C9D4",fontSize:15,fontWeight:600,color:"#ffffff",border:"none",cursor:"not-allowed"},removeBtn:{background:"none",border:"none",padding:0,cursor:"pointer",display:"flex",alignItems:"center",color:"#98A2B3"}};
2
- //# sourceMappingURL=Cart.styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Cart.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),s=require("lucide-react"),i=require("./GuidelineCard.styles.js");function n(e){try{var t=new Date(e),s=t.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),i=t.toLocaleDateString("en-GB").replace(/\//g,"/");return"Added on - ".concat(s," | ").concat(i)}catch(t){return e}}function r(r){var d=r.guideline,l=r.inCart,a=r.onToggleCart,o=r.onExplore;return t.jsxs("div",e.__assign({style:i.default.card},{children:[t.jsxs("div",e.__assign({style:i.default.cardTop},{children:[t.jsxs("div",e.__assign({style:i.default.cardTopLeft},{children:[t.jsx(s.BookOpen,{size:18,strokeWidth:2,color:"#6D5BFF"}),t.jsx("p",e.__assign({style:i.default.cardTitle},{children:d.instant_learning_title}))]})),t.jsxs("div",e.__assign({style:i.default.cardTopIcons},{children:[t.jsx(s.Eye,{size:16,strokeWidth:2}),t.jsx(s.MoreVertical,{size:16,strokeWidth:2}),t.jsx(s.UserCheck,{size:16,strokeWidth:2})]}))]})),t.jsx("p",e.__assign({style:i.default.cardDescription},{children:d.instant_learning_description})),t.jsx("p",e.__assign({style:i.default.cardDate},{children:n(d.created_at)})),t.jsxs("div",e.__assign({style:i.default.cardActionsRow},{children:[t.jsxs("button",e.__assign({type:"button",style:i.default.exploreButton,onClick:function(){return null==o?void 0:o(d)}},{children:[t.jsx(s.Compass,{size:15,strokeWidth:2.4}),t.jsx("span",{children:"Explore"})]})),l?t.jsxs("button",e.__assign({type:"button",style:i.default.cardAddedButton,onClick:function(){return a(d)}},{children:[t.jsx(s.Check,{size:16,strokeWidth:2.4}),t.jsx("span",{children:"Selected"})]})):t.jsxs("button",e.__assign({type:"button",style:i.default.cardAddButton,onClick:function(){return a(d)}},{children:[t.jsx(s.Plus,{size:16,strokeWidth:2.4}),t.jsx("span",{children:"Select"})]}))]}))]}))}exports.GuidelineCard=r,exports.default=r;
2
- //# sourceMappingURL=GuidelineCard.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GuidelineCard.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.default={card:{display:"flex",flexDirection:"column",borderRadius:10,border:"1px solid #EAECF0",background:"#ffffff",padding:20,boxShadow:"0 1px 2px rgba(16,24,40,0.04)"},cardTop:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8},cardTopLeft:{display:"flex",alignItems:"center",gap:8,minWidth:0},cardTitle:{fontSize:15,fontWeight:600,lineHeight:"24px",color:"#1F2937",margin:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},cardTopIcons:{display:"flex",alignItems:"center",gap:10,flexShrink:0,color:"#98A2B3"},cardDescription:{marginTop:8,fontSize:13,lineHeight:"19px",color:"#667085",overflow:"hidden",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},cardDate:{marginTop:12,fontSize:12,color:"#98A2B3"},cardActions:{marginTop:16},cardAddButton:{display:"inline-flex",height:36,flex:1,alignItems:"center",justifyContent:"center",gap:8,borderRadius:6,border:"1px solid #4438F5",background:"#ffffff",fontSize:13,fontWeight:600,color:"#4438F5",cursor:"pointer"},cardAddedButton:{display:"inline-flex",height:36,flex:1,alignItems:"center",justifyContent:"center",gap:8,borderRadius:6,border:"1px solid #EAE7FF",background:"#EDE9FE",fontSize:13,fontWeight:600,color:"#4438F5",cursor:"pointer"},exploreButton:{display:"inline-flex",height:36,flex:1,alignItems:"center",justifyContent:"center",gap:6,borderRadius:6,border:"1px solid #D0D5DD",background:"#ffffff",fontSize:13,fontWeight:600,color:"#344054",cursor:"pointer"},cardActionsRow:{display:"flex",gap:8,marginTop:16}};
2
- //# sourceMappingURL=GuidelineCard.styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GuidelineCard.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),i=require("lucide-react"),s=require("./api.js"),r=require("./GuidelineCard.js"),a=require("./Cart/Cart.js"),l=require("./LearningManagementWrapper.js"),d=require("./GuidelinesLandingPage.styles.js"),o=require("@mui/material"),u=require("./transformSelectedGuidelineData.js");function c(e,n){var t,i,s,r;return n?null!==(r=null===(s=e.mode_mappings.find(function(e){return e.mode_id===n}))||void 0===s?void 0:s.application_integration_id)&&void 0!==r?r:"":null!==(i=null===(t=e.mode_mappings[0])||void 0===t?void 0:t.application_integration_id)&&void 0!==i?i:""}function _(_){var g=_.baseUrl,h=_.baseWebsocketUrl,p=_.token,f=_.userDetails,x=_.modeId,j=_.assistantName,b=_.appsecRbacUrl,y=_.appsecBaseUrl,m=_.onProceedSelected,v=t.useState([]),C=v[0],k=v[1],S=t.useState(6),w=S[0],z=S[1],A=t.useState([]),W=A[0],I=A[1],q=t.useState(!1),F=q[0],G=q[1],L=t.useState(null),U=L[0],B=L[1],E=t.useState(null),D=E[0],M=E[1],P=t.useState(""),T=P[0],O=P[1],R=t.useState(""),N=R[0],H=R[1];t.useEffect(function(){var e=setTimeout(function(){H(T.trim())},750);return function(){return clearTimeout(e)}},[T]),t.useEffect(function(){z(6)},[N]),t.useEffect(function(){G(!0),B(null),s.fetchGuidelineInstances(g,p).then(function(e){k(e.data)}).catch(function(e){return B(e.message)}).finally(function(){return G(!1)})},[g,p]);var K=new Set(W.map(function(e){return e.instant_learning_id}));function J(e){I(function(n){return n.some(function(n){return n.instant_learning_id===e.instant_learning_id})?n.filter(function(n){return n.instant_learning_id!==e.instant_learning_id}):[e]})}var Q=N.length>=2?C.filter(function(e){var n,t,i=N.toLowerCase();return(null===(n=e.instant_learning_title)||void 0===n?void 0:n.toLowerCase().includes(i))||(null===(t=e.instant_learning_description)||void 0===t?void 0:t.toLowerCase().includes(i))}):C,V=Q.slice(0,w),X=Q.length-w,Y=w>6;return n.jsx("div",e.__assign({style:d.default.page},{children:n.jsxs("main",e.__assign({style:d.default.main},{children:[n.jsxs("section",e.__assign({style:d.default.headerSection},{children:[n.jsxs("div",e.__assign({style:d.default.intro},{children:[n.jsx("h1",e.__assign({style:d.default.title},{children:"Add Guidelines"})),n.jsx("p",e.__assign({style:d.default.description},{children:"Add guidelines that shape how your agent behaves, responds, and interprets."})),n.jsxs("button",e.__assign({type:"button",style:d.default.debugLink},{children:[n.jsx("span",{children:"Know more about debug mode"}),n.jsx(i.CircleHelp,{size:18,strokeWidth:2})]}))]})),n.jsxs("button",e.__assign({type:"button",style:d.default.addButton},{children:[n.jsx(i.Plus,{size:20,strokeWidth:2.4}),n.jsx("span",{children:"Add Guideline"})]}))]})),n.jsxs("section",e.__assign({style:d.default.bodySection},{children:[n.jsxs("section",e.__assign({style:d.default.librarySection},{children:[n.jsxs("div",e.__assign({style:d.default.libraryTabs},{children:[n.jsxs("button",e.__assign({type:"button",style:e.__assign(e.__assign({},d.default.tab),d.default.tabActive)},{children:[n.jsx(i.UserCheck,{size:18,strokeWidth:2}),n.jsx("span",{children:"Saved"})]})),n.jsxs("button",e.__assign({type:"button",style:d.default.tab},{children:[n.jsx(i.Clock3,{size:18,strokeWidth:2}),n.jsx("span",{children:"Recently used"})]})),n.jsxs("button",e.__assign({type:"button",style:d.default.tab},{children:[n.jsx(i.ShoppingBag,{size:18,strokeWidth:2}),n.jsx("span",{children:"Marketplace"})]}))]})),!D&&n.jsx("div",e.__assign({style:{position:"sticky",top:0,zIndex:10,backgroundColor:"#FFFFFF",paddingTop:12,backdropFilter:"blur(8px)"}},{children:n.jsx(o.OutlinedInput,{placeholder:"Search Guideline",value:T,onChange:function(e){return O(e.target.value)},size:"small",startAdornment:n.jsx(o.InputAdornment,e.__assign({position:"start"},{children:n.jsx(i.Search,{size:16,color:"#9CA3AF"})})),sx:{width:"280px",borderRadius:"8px",fontSize:"14px","& .MuiOutlinedInput-notchedOutline":{borderColor:"#E5E7EB"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#D1D5DB"},bgcolor:"#fff"}})})),D?n.jsx(l.LearningManagementWrapper,{userDetails:f,baseUrl:g,baseWebsocketUrl:h,assistantName:j,appsecRbacUrl:b,appsecBaseUrl:y,appIntegrationId:c(D,x),modeId:x,guidelineTitle:D.instant_learning_title,onBack:function(){return M(null)},headerActions:K.has(D.instant_learning_id)?n.jsxs("button",e.__assign({type:"button",style:d.default.cardAddedButton,onClick:function(){return J(D)}},{children:[n.jsx(i.Check,{size:16,strokeWidth:2.4}),n.jsx("span",{children:"Added to Cart"})]})):n.jsxs("button",e.__assign({type:"button",style:d.default.cardAddButton,onClick:function(){return J(D)}},{children:[n.jsx(i.Plus,{size:16,strokeWidth:2.4}),n.jsx("span",{children:"Add to Cart"})]}))}):n.jsxs(n.Fragment,{children:[F&&n.jsx("p",e.__assign({style:d.default.loadingState},{children:"Loading guidelines..."})),U&&n.jsxs("p",e.__assign({style:d.default.errorState},{children:["Error: ",U]})),!F&&!U&&n.jsx(n.Fragment,{children:0===Q.length?n.jsx("p",e.__assign({style:d.default.loadingState},{children:N.length>=2?"No guidelines match your search.":"No guidelines found."})):n.jsxs(n.Fragment,{children:[n.jsx("div",e.__assign({style:d.default.libraryGrid},{children:V.map(function(e){return n.jsx(r.GuidelineCard,{guideline:e,inCart:K.has(e.instant_learning_id),onToggleCart:J,onExplore:M},e.instant_learning_id)})})),n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:16}},{children:[X>0&&n.jsxs("button",e.__assign({type:"button",style:d.default.showMore,onClick:function(){return z(function(e){return e+6})}},{children:[n.jsxs("span",{children:["Show more guidelines (",X,")"]}),n.jsx(i.ChevronDown,{size:16,strokeWidth:2.4})]})),Y&&n.jsxs("button",e.__assign({type:"button",style:d.default.showMore,onClick:function(){return z(6)}},{children:[n.jsx("span",{children:"Hide"}),n.jsx(i.ChevronUp,{size:16,strokeWidth:2.4})]}))]}))]})})]})]})),n.jsx(a.Cart,{items:W,onRemove:function(e){I(function(n){return n.filter(function(n){return n.instant_learning_id!==e})})},onProceed:function(n){return e.__awaiter(this,void 0,void 0,function(){var t,i;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,u.transformSelectedToILData(n,x,f.accessToken)];case 1:return t=e.sent(),console.log("Proceeding with il_data:",t),m(t),[3,3];case 2:return i=e.sent(),console.error("Error building il_data for selected guidelines:",i),[3,3];case 3:return[2]}})})}})]}))]}))}))}exports.GuidelineLandingPage=_,exports.default=_;
2
- //# sourceMappingURL=GuidelinesLandingPage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GuidelinesLandingPage.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.default={page:{height:"100%",width:"100%",background:"#ffffff",fontFamily:"Inter, sans-serif"},main:{height:"100%",overflow:"auto",padding:40},headerSection:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:24,justifyContent:"space-between",alignItems:"flex-start"},intro:{minWidth:280,flex:"1 1 0%"},title:{fontSize:30,fontWeight:700,lineHeight:"38px",color:"#6D35F2",margin:0},description:{marginTop:8,fontSize:19,lineHeight:"28px",color:"#1F2937"},debugLink:{marginTop:12,display:"inline-flex",alignItems:"center",gap:8,fontSize:14,fontWeight:500,color:"#53657D",background:"none",border:"none",padding:0,cursor:"pointer"},addButton:{display:"inline-flex",height:44,minWidth:210,flexShrink:0,alignItems:"center",justifyContent:"center",gap:12,borderRadius:6,background:"#4438F5",padding:"0 20px",fontSize:15,fontWeight:600,color:"#ffffff",border:"none",boxShadow:"0 1px 2px rgba(16,24,40,0.08)",cursor:"pointer",marginLeft:"auto"},bodySection:{marginTop:48,display:"grid",width:"100%",gridTemplateColumns:"minmax(0,1fr) minmax(300px,360px)",alignItems:"start",gap:24},librarySection:{minWidth:0},libraryTabs:{display:"flex",borderBottom:"1px solid #EAECF0"},tab:{position:"relative",display:"inline-flex",height:40,alignItems:"center",gap:8,padding:"0 16px",fontSize:14,fontWeight:500,background:"none",border:"none",cursor:"pointer",color:"#B5BDC8"},tabActive:{color:"#1F2937",boxShadow:"inset 0 -3px 0 0 #6D5BFF"},libraryGrid:{marginTop:24,display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:20},cardAddButton:{display:"inline-flex",height:36,flex:1,alignItems:"center",justifyContent:"center",gap:8,borderRadius:6,border:"1px solid #4438F5",background:"#ffffff",fontSize:13,fontWeight:600,color:"#4438F5",cursor:"pointer"},cardAddedButton:{display:"inline-flex",height:36,flex:1,alignItems:"center",justifyContent:"center",gap:8,borderRadius:6,border:"1px solid #EAE7FF",background:"#EDE9FE",fontSize:13,fontWeight:600,color:"#4438F5",cursor:"pointer"},showMore:{marginTop:28,display:"inline-flex",alignItems:"center",gap:8,fontSize:14,fontWeight:600,color:"#5B2CF4",background:"none",border:"none",cursor:"pointer"},loadingState:{marginTop:24,fontSize:14,color:"#667085"},errorState:{marginTop:24,fontSize:14,color:"#F04438"}};
2
- //# sourceMappingURL=GuidelinesLandingPage.styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GuidelinesLandingPage.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),a=require("react/jsx-runtime"),i=require("react"),n=require("lucide-react"),t=require("@tanstack/react-query"),r=require("../LearningManagement/LearningManagement.js"),s=require("./api.js"),l={config:{CUSTOM_SCOPE_GROUP_NAME:"Preview",INSTANT_LEARNING_TYPE:"iL",MODEL:"claude-3.5-sonnet",CONFIG_MASTER_NAME:"preview-config",SCOPE_NAME:"Custom",ASSISTANT_NAME:"preview",ORGANIZATION_NAME:"techolution",BASE_URL:"https://devllmstudio.creativeworkspace.ai",BASE_WEBSOCKET_URL:"wss://devllmstudio.creativeworkspace.ai/graphql",CHAT_TITLE:"Preview",CHAT_TITLE_EDIT:"Preview Edit",FORM_TITLE:"Learning Details",INITIAL_CHAT_MESSAGE:"Hi",CATEGORY:"Global-Template",SOCKET_TIMEOUT:24e4},llmStudioUrl:"https://devllmstudio.creativeworkspace.ai",audacyBackendUrl:"https://dev-audacy-traffic-manager.techo.camp",ilLabels:{setupLabel:"Learning Setup",ruleTitle:"Learning Title",ruleDescriptionTitle:"Learning Description"}},o={applicationName:"IL Mode - ILOTJ",applicationId:"6a22c19581f05dc3afc8ad57",moduleId:"6a22c19581f05dc3afc8ad8e",applicationModuleId:"6a22c19581f05dc3afc8ad88",applicationResourceId:"6a22c19681f05dc3afc8ad94",appsecRbacUrl:"https://dev-cw-appsec.techo.camp/granularApi",appsecBaseUrl:"https://dev-cw-appsec.techo.camp"},c={configId:"6a1825e9fb722c37637b9490"},d=new t.QueryClient,p={wrapper:{display:"flex",flexDirection:"column",height:"100%",minHeight:0},header:{display:"flex",alignItems:"center",gap:12,padding:"10px 0",borderBottom:"1px solid #EAECF0",flexShrink:0},backButton:{display:"inline-flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",fontSize:14,fontWeight:500,color:"#344054",padding:"4px 8px",borderRadius:6},headerTitle:{fontSize:14,fontWeight:600,color:"#1F2937",margin:0,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},headerActions:{display:"flex",alignItems:"center",gap:8,marginLeft:"auto"},lmsContainer:{flex:1,minHeight:0,overflow:"hidden"},loadingState:{padding:24,fontSize:14,color:"#667085"}};function g(g){var _=g.userDetails,u=g.baseUrl,f=g.baseWebsocketUrl,h=g.assistantName,m=g.appsecRbacUrl,v=g.appsecBaseUrl,T=g.appIntegrationId,I=g.modeId,A=g.guidelineTitle,E=g.onBack,S=g.headerActions,x=i.useState(null),L=x[0],b=x[1];return i.useEffect(function(){if(T){var a=e.__assign(e.__assign({},l),{config:e.__assign(e.__assign({},l.config),{ASSISTANT_NAME:h,BASE_URL:u,BASE_WEBSOCKET_URL:f}),llmStudioUrl:u}),i=e.__assign(e.__assign({},o),{appsecRbacUrl:m,appsecBaseUrl:v}),n=!1;return b(null),s.fetchRBACConfig(u,_.accessToken,T).then(function(t){var r,s,l,o;if(!n){var d=t?{applicationName:t.application_name,applicationId:t.application_id,moduleId:null===(r=t.module_data)||void 0===r?void 0:r.Scopes,applicationModuleId:null===(s=t.module_data)||void 0===s?void 0:s.General,applicationResourceId:null===(l=t.resource_data)||void 0===l?void 0:l["Learning Management"],appsecRbacUrl:m,appsecBaseUrl:v}:i;b(e.__assign(e.__assign({},a),{auditLogConfig:{configId:null!==(o=null==t?void 0:t.change_log_config_id)&&void 0!==o?o:c.configId},rbacConfig:d}))}}).catch(function(){n||(console.warn("RBAC config fetch failed, using fallback."),b(e.__assign(e.__assign({},a),{auditLogConfig:c,rbacConfig:i})))}),function(){n=!0}}},[T,u,f,h,m,v]),a.jsx(t.QueryClientProvider,e.__assign({client:d},{children:a.jsxs("div",e.__assign({style:p.wrapper},{children:[a.jsxs("div",e.__assign({style:p.header},{children:[a.jsxs("button",e.__assign({type:"button",style:p.backButton,onClick:E},{children:[a.jsx(n.ArrowLeft,{size:16,strokeWidth:2}),"Back"]})),A&&a.jsx("p",e.__assign({style:p.headerTitle},{children:A})),S&&a.jsx("div",e.__assign({style:p.headerActions},{children:S}))]})),a.jsx("div",e.__assign({style:p.lmsContainer},{children:L?a.jsx(r.default,e.__assign({},L,{userDetails:_,app_integration_id:T,modeId:I}),"lms-explore"):a.jsx("p",e.__assign({style:p.loadingState},{children:"Loading..."}))}))]}))}))}exports.LearningManagementWrapper=g,exports.default=g;
2
- //# sourceMappingURL=LearningManagementWrapper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LearningManagementWrapper.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),e=require("./endpoints.js");exports.fetchGuidelineInstances=function(n,r){return t.__awaiter(this,void 0,void 0,function(){var i;return t.__generator(this,function(t){switch(t.label){case 0:return[4,fetch(e.endpoints.listInstances(n),{headers:{accept:"application/json, text/plain, */*",authorization:"Bearer ".concat(r)}})];case 1:if(!(i=t.sent()).ok)throw new Error("Failed to fetch guidelines: ".concat(i.status));return[2,i.json()]}})})},exports.fetchRBACConfig=function(n,r,i){return t.__awaiter(this,void 0,void 0,function(){var a;return t.__generator(this,function(t){switch(t.label){case 0:return[4,fetch(e.endpoints.getRbacConfig(n,i),{headers:{accept:"application/json, text/plain, */*",authorization:"Bearer ".concat(r)}})];case 1:if(!(a=t.sent()).ok)throw new Error("Failed to fetch RBAC config: ".concat(a.status));return[4,a.json()];case 2:return[2,t.sent().data]}})})};
2
- //# sourceMappingURL=api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"api.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.endpoints={listInstances:function(t){return"".concat(t,"/instant_learning/ilotj/listInstances?createdAt=desc")},getRbacConfig:function(t,n){return"".concat(t,"/instant_learning/ilotj/application/getRBACAuditConfig/").concat(n)}};
2
- //# sourceMappingURL=endpoints.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"endpoints.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("../LearningManagement/apis/apiConfig.js"),r=require("../LearningManagement/apis/scopeApis.js");function n(n,i){var o;return e.__awaiter(this,void 0,void 0,function(){var a,s;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,r.llmApiWithToken(i).get(t.API_ENDPOINTS.getTiers.replace("{appIntegrationId}",n))];case 1:return a=e.sent(),"success"===(null===(o=a.data)||void 0===o?void 0:o.status)?[2,a.data.data.map(function(e){return e.id})]:[2,[]];case 2:throw s=e.sent(),console.error("Error fetching tiers:",s),s;case 3:return[2]}})})}function i(n,i){var o,a,s;return e.__awaiter(this,void 0,void 0,function(){var c,u,l;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,r.llmApiWithToken(i).get("".concat(t.API_ENDPOINTS.fetchScopes,"/").concat(n))];case 1:return c=e.sent(),console.log("fetchScopeIds response:",c),[2,(u=null===(s=null===(a=null===(o=c.data)||void 0===o?void 0:o.data)||void 0===a?void 0:a.data)||void 0===s?void 0:s.id)?[u]:[]];case 2:throw l=e.sent(),console.error("Error fetching rule sets:",l),l;case 3:return[2]}})})}exports.transformSelectedToILData=function(t,r,o){return e.__awaiter(this,void 0,void 0,function(){var a=this;return e.__generator(this,function(s){switch(s.label){case 0:return console.log(t,"selected",r,"modeId"),[4,Promise.all(t.map(function(t){return e.__awaiter(a,void 0,void 0,function(){var a,s,c,u;return e.__generator(this,function(e){switch(e.label){case 0:return a=function(e,t){var r,n,i,o;return t?null!==(o=null===(i=e.mode_mappings.find(function(e){return e.mode_id===t}))||void 0===i?void 0:i.application_integration_id)&&void 0!==o?o:"":null!==(n=null===(r=e.mode_mappings[0])||void 0===r?void 0:r.application_integration_id)&&void 0!==n?n:""}(t,r),[4,Promise.all([a?i(a,o):Promise.resolve([]),a?n(a,o):Promise.resolve([])])];case 1:return s=e.sent(),c=s[0],u=s[1],[2,{app_map_id:a,scope_ids:c,tier_ids:u}]}})})}))];case 1:return[2,{il_data:{selected_guidelines:s.sent()}}]}})})};
2
- //# sourceMappingURL=transformSelectedGuidelineData.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transformSelectedGuidelineData.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.default="6fbbe065ef78c384.gif";
2
- //# sourceMappingURL=ThinkingBulbIcon.gif.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ThinkingBulbIcon.gif.js","sources":["../../../../../src/features/LearningManagement/public/ThinkingBulbIcon.gif"],"sourcesContent":["export default \"6fbbe065ef78c384.gif\""],"names":[],"mappings":"oFAAe"}