@e-llm-studio/instant-learning 0.1.1-alpha.7 → 0.1.1-alpha.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/features/IL-OTJ/ILOTJ.js +1 -1
- package/dist/cjs/features/IL-OTJ/ILOTJTest.js +1 -1
- package/dist/cjs/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.js +2 -0
- package/dist/cjs/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.js.map +1 -0
- package/dist/cjs/features/IL-OTJ/ValueTypeWrappers/TeachMeWrapper.js +1 -1
- package/dist/cjs/features/IL-OTJ/_components/MessageRendering/RuleValidationCard.js +1 -1
- package/dist/cjs/features/IL-OTJ/_components/templates/RuleComparison/RuleComparison.js +1 -1
- package/dist/cjs/features/LearningManagement/LearningManagement.js +1 -1
- package/dist/cjs/features/LearningManagement/LearningTemplateLayout.js +1 -1
- package/dist/cjs/features/LearningManagement/RBAC/AccessManagementPanel.js +2 -0
- package/dist/cjs/features/LearningManagement/RBAC/AccessManagementPanel.js.map +1 -0
- package/dist/cjs/features/LearningManagement/RBAC/AccessPanel.js +2 -0
- package/dist/cjs/features/LearningManagement/RBAC/AccessPanel.js.map +1 -0
- package/dist/cjs/features/LearningManagement/RBAC/AccessPanel.module.css.js +2 -0
- package/dist/cjs/features/LearningManagement/RBAC/AccessPanel.module.css.js.map +1 -0
- package/dist/cjs/features/LearningManagement/RuleContent/AddScopeApprovalSearchComponent.js +2 -0
- package/dist/cjs/features/LearningManagement/RuleContent/AddScopeApprovalSearchComponent.js.map +1 -0
- package/dist/cjs/features/LearningManagement/RuleContent/AddScopeModal.js +2 -0
- package/dist/cjs/features/LearningManagement/RuleContent/AddScopeModal.js.map +1 -0
- package/dist/cjs/features/LearningManagement/RuleContent/ApprovalActionButton.js +2 -0
- package/dist/cjs/features/LearningManagement/RuleContent/ApprovalActionButton.js.map +1 -0
- package/dist/cjs/features/LearningManagement/RuleContent/ApprovalLearningDialog.js +2 -0
- package/dist/cjs/features/LearningManagement/RuleContent/ApprovalLearningDialog.js.map +1 -0
- package/dist/cjs/features/LearningManagement/RuleContent/PendingApprovalChip.js +2 -0
- package/dist/cjs/features/LearningManagement/RuleContent/PendingApprovalChip.js.map +1 -0
- package/dist/cjs/features/LearningManagement/RuleContent/RenameScopeModal.js +2 -0
- package/dist/cjs/features/LearningManagement/RuleContent/RenameScopeModal.js.map +1 -0
- package/dist/cjs/features/LearningManagement/RuleContent/RuleContent.js +1 -1
- package/dist/cjs/features/LearningManagement/apis/apiConfig.js +1 -1
- package/dist/cjs/features/LearningManagement/apis/scopeApis.js +1 -1
- package/dist/cjs/features/LearningManagement/components/CreateLearningSetModal.js +1 -1
- package/dist/cjs/features/LearningManagement/components/CreateRuleSetLegacyModal.js +2 -0
- package/dist/cjs/features/LearningManagement/components/CreateRuleSetLegacyModal.js.map +1 -0
- package/dist/cjs/features/LearningManagement/components/InstantLearningModal.js +1 -1
- package/dist/cjs/features/LearningManagement/components/ScopeSkeletonLoader.js +2 -0
- package/dist/cjs/features/LearningManagement/components/ScopeSkeletonLoader.js.map +1 -0
- package/dist/cjs/features/LearningManagement/components/ScopeTree/TreeNode.js +1 -1
- package/dist/cjs/features/LearningManagement/components/ScopeTree/TreeSidebar.js +1 -1
- package/dist/cjs/features/LearningManagement/components/StationOnboarding/StationAutocomplete.js +1 -1
- package/dist/cjs/features/LearningManagement/components/StationOnboarding/StationOnboardModal.js +1 -1
- package/dist/cjs/features/LearningManagement/components/ToolTip.js +1 -1
- package/dist/cjs/features/LearningManagement/queries/useApprovalQueries.js +2 -0
- package/dist/cjs/features/LearningManagement/queries/useApprovalQueries.js.map +1 -0
- package/dist/cjs/features/LearningManagement/store/useAppSecRolesStore.js +2 -0
- package/dist/cjs/features/LearningManagement/store/useAppSecRolesStore.js.map +1 -0
- package/dist/cjs/features/LearningManagement/store/useConfigStore.js +1 -1
- package/dist/cjs/features/LearningManagement/store/useLearningTemplateStore.js +1 -1
- package/dist/cjs/features/LearningManagement/store/usePermissionsStore.js +2 -0
- package/dist/cjs/features/LearningManagement/store/usePermissionsStore.js.map +1 -0
- package/dist/cjs/features/LearningManagement/styles/ScopeTree.module.css.js +1 -1
- package/dist/cjs/plugins/ValueTypes/Default/DefaultTeachMeRenderer.js +2 -0
- package/dist/cjs/plugins/ValueTypes/Guidelines/GuidelinesTeachMeRenderer.js +2 -0
- package/dist/cjs/plugins/ValueTypes/Guidelines/GuidelinesTeachMeRenderer.js.map +1 -0
- package/dist/cjs/plugins/ValueTypes/RadioTrafficLearning/RadioTrafficLearningRenderer.js +2 -0
- package/dist/features/IL-OTJ/ILOTJ.js +1 -1
- package/dist/features/IL-OTJ/ILOTJTest.js +1 -1
- package/dist/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.js +2 -0
- package/dist/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.js.map +1 -0
- package/dist/features/IL-OTJ/ValueTypeWrappers/TeachMeWrapper.js +1 -1
- package/dist/features/IL-OTJ/_components/MessageRendering/RuleValidationCard.js +1 -1
- package/dist/features/IL-OTJ/_components/templates/RuleComparison/RuleComparison.js +1 -1
- package/dist/features/LearningManagement/LearningManagement.js +1 -1
- package/dist/features/LearningManagement/LearningTemplateLayout.js +1 -1
- package/dist/features/LearningManagement/RBAC/AccessManagementPanel.js +2 -0
- package/dist/features/LearningManagement/RBAC/AccessManagementPanel.js.map +1 -0
- package/dist/features/LearningManagement/RBAC/AccessPanel.js +2 -0
- package/dist/features/LearningManagement/RBAC/AccessPanel.js.map +1 -0
- package/dist/features/LearningManagement/RBAC/AccessPanel.module.css.js +2 -0
- package/dist/features/LearningManagement/RBAC/AccessPanel.module.css.js.map +1 -0
- package/dist/features/LearningManagement/RuleContent/AddScopeApprovalSearchComponent.js +2 -0
- package/dist/features/LearningManagement/RuleContent/AddScopeApprovalSearchComponent.js.map +1 -0
- package/dist/features/LearningManagement/RuleContent/AddScopeModal.js +2 -0
- package/dist/features/LearningManagement/RuleContent/AddScopeModal.js.map +1 -0
- package/dist/features/LearningManagement/RuleContent/ApprovalActionButton.js +2 -0
- package/dist/features/LearningManagement/RuleContent/ApprovalActionButton.js.map +1 -0
- package/dist/features/LearningManagement/RuleContent/ApprovalLearningDialog.js +2 -0
- package/dist/features/LearningManagement/RuleContent/ApprovalLearningDialog.js.map +1 -0
- package/dist/features/LearningManagement/RuleContent/PendingApprovalChip.js +2 -0
- package/dist/features/LearningManagement/RuleContent/PendingApprovalChip.js.map +1 -0
- package/dist/features/LearningManagement/RuleContent/RenameScopeModal.js +2 -0
- package/dist/features/LearningManagement/RuleContent/RenameScopeModal.js.map +1 -0
- package/dist/features/LearningManagement/RuleContent/RuleContent.js +1 -1
- package/dist/features/LearningManagement/apis/apiConfig.js +1 -1
- package/dist/features/LearningManagement/apis/scopeApis.js +1 -1
- package/dist/features/LearningManagement/components/CreateLearningSetModal.js +1 -1
- package/dist/features/LearningManagement/components/CreateRuleSetLegacyModal.js +2 -0
- package/dist/features/LearningManagement/components/CreateRuleSetLegacyModal.js.map +1 -0
- package/dist/features/LearningManagement/components/InstantLearningModal.js +1 -1
- package/dist/features/LearningManagement/components/ScopeSkeletonLoader.js +2 -0
- package/dist/features/LearningManagement/components/ScopeSkeletonLoader.js.map +1 -0
- package/dist/features/LearningManagement/components/ScopeTree/TreeNode.js +1 -1
- package/dist/features/LearningManagement/components/ScopeTree/TreeSidebar.js +1 -1
- package/dist/features/LearningManagement/components/StationOnboarding/StationAutocomplete.js +1 -1
- package/dist/features/LearningManagement/components/StationOnboarding/StationOnboardModal.js +1 -1
- package/dist/features/LearningManagement/components/ToolTip.js +1 -1
- package/dist/features/LearningManagement/queries/useApprovalQueries.js +2 -0
- package/dist/features/LearningManagement/queries/useApprovalQueries.js.map +1 -0
- package/dist/features/LearningManagement/store/useAppSecRolesStore.js +2 -0
- package/dist/features/LearningManagement/store/useAppSecRolesStore.js.map +1 -0
- package/dist/features/LearningManagement/store/useConfigStore.js +1 -1
- package/dist/features/LearningManagement/store/useLearningTemplateStore.js +1 -1
- package/dist/features/LearningManagement/store/usePermissionsStore.js +2 -0
- package/dist/features/LearningManagement/store/usePermissionsStore.js.map +1 -0
- package/dist/features/LearningManagement/styles/ScopeTree.module.css.js +1 -1
- package/dist/plugins/ValueTypes/Default/DefaultTeachMeRenderer.js +2 -0
- package/dist/plugins/ValueTypes/Guidelines/GuidelinesTeachMeRenderer.js +2 -0
- package/dist/plugins/ValueTypes/Guidelines/GuidelinesTeachMeRenderer.js.map +1 -0
- package/dist/plugins/ValueTypes/RadioTrafficLearning/RadioTrafficLearningRenderer.js +2 -0
- package/dist/types/src/features/IL-OTJ/ILOTJ.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/ILOTJTest.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.d.ts +57 -0
- package/dist/types/src/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.d.ts.map +1 -0
- package/dist/types/src/features/IL-OTJ/ValueTypeWrappers/TeachMeWrapper.d.ts +9 -3
- package/dist/types/src/features/IL-OTJ/ValueTypeWrappers/TeachMeWrapper.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/templates/RuleComparison/RuleComparison.d.ts +41 -6
- package/dist/types/src/features/IL-OTJ/_components/templates/RuleComparison/RuleComparison.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/LearningManagement.d.ts +3 -4
- package/dist/types/src/features/LearningManagement/LearningManagement.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/LearningTemplateLayout.d.ts +1 -0
- package/dist/types/src/features/LearningManagement/LearningTemplateLayout.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/RBAC/AccessManagementPanel.d.ts +8 -0
- package/dist/types/src/features/LearningManagement/RBAC/AccessManagementPanel.d.ts.map +1 -0
- package/dist/types/src/features/LearningManagement/RBAC/AccessPanel.d.ts +14 -0
- package/dist/types/src/features/LearningManagement/RBAC/AccessPanel.d.ts.map +1 -0
- package/dist/types/src/features/LearningManagement/RBAC/index.d.ts +4 -0
- package/dist/types/src/features/LearningManagement/RBAC/index.d.ts.map +1 -0
- package/dist/types/src/features/LearningManagement/RuleContent/AddScopeApprovalSearchComponent.d.ts +12 -0
- package/dist/types/src/features/LearningManagement/RuleContent/AddScopeApprovalSearchComponent.d.ts.map +1 -0
- package/dist/types/src/features/LearningManagement/RuleContent/AddScopeModal.d.ts +15 -0
- package/dist/types/src/features/LearningManagement/RuleContent/AddScopeModal.d.ts.map +1 -0
- package/dist/types/src/features/LearningManagement/RuleContent/ApprovalActionButton.d.ts +8 -0
- package/dist/types/src/features/LearningManagement/RuleContent/ApprovalActionButton.d.ts.map +1 -0
- package/dist/types/src/features/LearningManagement/RuleContent/ApprovalLearningDialog.d.ts +17 -0
- package/dist/types/src/features/LearningManagement/RuleContent/ApprovalLearningDialog.d.ts.map +1 -0
- package/dist/types/src/features/LearningManagement/RuleContent/PendingApprovalChip.d.ts +7 -0
- package/dist/types/src/features/LearningManagement/RuleContent/PendingApprovalChip.d.ts.map +1 -0
- package/dist/types/src/features/LearningManagement/RuleContent/RenameScopeModal.d.ts +10 -0
- package/dist/types/src/features/LearningManagement/RuleContent/RenameScopeModal.d.ts.map +1 -0
- package/dist/types/src/features/LearningManagement/RuleContent/RuleContent.d.ts +1 -0
- package/dist/types/src/features/LearningManagement/RuleContent/RuleContent.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/apis/apiConfig.d.ts +11 -0
- package/dist/types/src/features/LearningManagement/apis/apiConfig.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/apis/scopeApis.d.ts +33 -6
- package/dist/types/src/features/LearningManagement/apis/scopeApis.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/CreateLearningSetModal.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/CreateRuleSetLegacyModal.d.ts +10 -0
- package/dist/types/src/features/LearningManagement/components/CreateRuleSetLegacyModal.d.ts.map +1 -0
- package/dist/types/src/features/LearningManagement/components/InstantLearningModal.d.ts +3 -0
- package/dist/types/src/features/LearningManagement/components/InstantLearningModal.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/ScopeSkeletonLoader.d.ts +32 -0
- package/dist/types/src/features/LearningManagement/components/ScopeSkeletonLoader.d.ts.map +1 -0
- package/dist/types/src/features/LearningManagement/components/ScopeTree/TreeNode.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/ScopeTree/TreeSidebar.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/StationOnboarding/StationAutocomplete.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/StationOnboarding/StationOnboardModal.d.ts +2 -0
- package/dist/types/src/features/LearningManagement/components/StationOnboarding/StationOnboardModal.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/queries/useApprovalQueries.d.ts +11 -0
- package/dist/types/src/features/LearningManagement/queries/useApprovalQueries.d.ts.map +1 -0
- package/dist/types/src/features/LearningManagement/store/useAppSecRolesStore.d.ts +11 -0
- package/dist/types/src/features/LearningManagement/store/useAppSecRolesStore.d.ts.map +1 -0
- package/dist/types/src/features/LearningManagement/store/useConfigStore.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/store/useLearningTemplateStore.d.ts +10 -0
- package/dist/types/src/features/LearningManagement/store/useLearningTemplateStore.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/store/usePermissionsStore.d.ts +34 -0
- package/dist/types/src/features/LearningManagement/store/usePermissionsStore.d.ts.map +1 -0
- package/dist/types/src/features/LearningManagement/types.d.ts +6 -4
- package/dist/types/src/features/LearningManagement/types.d.ts.map +1 -1
- package/dist/types/src/plugins/{valueTypes/RadioTrafficLearning/RadioTrafficLearningRenderer.d.ts → ValueTypes/Category/CategoryTeachMeRenderer.d.ts} +4 -4
- package/dist/types/src/plugins/ValueTypes/Category/CategoryTeachMeRenderer.d.ts.map +1 -0
- package/dist/types/src/plugins/{valueTypes → ValueTypes}/Default/DefaultTeachMeRenderer.d.ts.map +1 -1
- package/dist/types/src/plugins/ValueTypes/Guidelines/GuidelinesTeachMeRenderer.d.ts +28 -0
- package/dist/types/src/plugins/ValueTypes/Guidelines/GuidelinesTeachMeRenderer.d.ts.map +1 -0
- package/dist/types/src/plugins/ValueTypes/RadioTrafficLearning/RadioTrafficLearningRenderer.d.ts +4 -0
- package/dist/types/src/plugins/ValueTypes/RadioTrafficLearning/RadioTrafficLearningRenderer.d.ts.map +1 -0
- package/package.json +8 -6
- package/dist/cjs/plugins/valueTypes/Default/DefaultTeachMeRenderer.js +0 -2
- package/dist/cjs/plugins/valueTypes/RadioTrafficLearning/RadioTrafficLearningRenderer.js +0 -2
- package/dist/plugins/valueTypes/Default/DefaultTeachMeRenderer.js +0 -2
- package/dist/plugins/valueTypes/RadioTrafficLearning/RadioTrafficLearningRenderer.js +0 -2
- package/dist/types/src/plugins/valueTypes/RadioTrafficLearning/RadioTrafficLearningRenderer.d.ts.map +0 -1
- /package/dist/cjs/plugins/{valueTypes → ValueTypes}/Default/DefaultTeachMeRenderer.js.map +0 -0
- /package/dist/cjs/plugins/{valueTypes → ValueTypes}/RadioTrafficLearning/RadioTrafficLearningRenderer.js.map +0 -0
- /package/dist/plugins/{valueTypes → ValueTypes}/Default/DefaultTeachMeRenderer.js.map +0 -0
- /package/dist/plugins/{valueTypes → ValueTypes}/RadioTrafficLearning/RadioTrafficLearningRenderer.js.map +0 -0
- /package/dist/types/src/plugins/{valueTypes → ValueTypes}/Default/DefaultTeachMeRenderer.d.ts +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),e=require("react/jsx-runtime"),t=require("lucide-react"),n=function(t){var n=t.width,s=void 0===n?"100%":n,r=t.height,x=void 0===r?"10px":r,o=t.style;return e.jsx("div",{style:i.__assign({width:s,height:x,backgroundColor:"#E2E8F0",borderRadius:"4px",backgroundImage:"linear-gradient(90deg, #E2E8F0 0px, #F1F5F9 40px, #E2E8F0 80px)",backgroundSize:"200px 100%",animation:"shimmer 1.5s ease-in-out infinite"},o)})},s=function(){return e.jsxs("div",i.__assign({style:{display:"flex",flexDirection:"column",gap:"12px",padding:"24px",backgroundColor:"#fff",borderRadius:"12px",border:"1px solid #E2E8F0",width:"100%"}},{children:[e.jsx(n,{width:"100%",height:"12px"}),e.jsx(n,{width:"85%",height:"10px"}),e.jsx("div",{style:{height:"8px"}}),e.jsx(n,{width:"60%",height:"12px"}),e.jsx(n,{width:"90%",height:"10px"}),e.jsx(n,{width:"75%",height:"10px"}),e.jsx("div",{style:{height:"8px"}}),e.jsx(n,{width:"40%",height:"12px"}),e.jsx(n,{width:"100%",height:"10px"}),e.jsx(n,{width:"80%",height:"10px"}),e.jsx("div",{style:{height:"8px"}}),e.jsx(n,{width:"55%",height:"12px"}),e.jsx(n,{width:"95%",height:"10px"}),e.jsx(n,{width:"70%",height:"10px"}),e.jsx(n,{width:"45%",height:"12px"}),e.jsx(n,{width:"88%",height:"10px"})]}))};exports.default=function(n){return n.isLoading?e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"\n @keyframes shimmer {\n 0% {\n background-position: -200px 0;\n }\n 100% {\n background-position: calc(200px + 100%) 0;\n }\n }\n"}),e.jsx("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:99}}),e.jsxs("div",i.__assign({style:{position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",backgroundColor:"#fff",borderRadius:"16px",boxShadow:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",padding:"48px",maxWidth:"1000px",width:"70%",maxHeight:"90vh",display:"flex",flexDirection:"row",gap:"48px",zIndex:100,animation:"fadeIn 0.3s ease-out"}},{children:[e.jsxs("div",i.__assign({style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center"}},{children:[e.jsx("div",i.__assign({style:{marginBottom:"16px"}},{children:e.jsx(t.Sparkles,{size:32,color:"#7C3AED"})})),e.jsx("h2",i.__assign({style:{fontSize:"1.5rem",fontWeight:600,color:"#0F172A",margin:"0 0 8px 0"}},{children:"Setting up your scope…"})),e.jsx("p",i.__assign({style:{fontSize:"0.875rem",color:"#64748B",margin:"0",lineHeight:"1.5"}},{children:"Inheriting Learnings from Global. This will only take a moment."}))]})),e.jsx("div",i.__assign({style:{flex:1.5,display:"flex",alignItems:"center",justifyContent:"center",minWidth:"350px"}},{children:e.jsx(s,{})}))]})),e.jsx("style",{children:"\n @keyframes fadeIn {\n from {\n opacity: 0;\n transform: translate(-50%, -48%);\n }\n to {\n opacity: 1;\n transform: translate(-50%, -50%);\n }\n }\n "})]}):null};
|
|
2
|
+
//# sourceMappingURL=ScopeSkeletonLoader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScopeSkeletonLoader.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("lucide-react"),d=require("../../styles/ScopeTree.module.css.js"),o=require("./TreeNodeHeader.js"),r=require("./TreeSectionItem.js"),l=require("./TreeAddAction.js"),t=function(a){var c,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("lucide-react"),d=require("../../styles/ScopeTree.module.css.js"),o=require("./TreeNodeHeader.js"),r=require("./TreeSectionItem.js"),l=require("./TreeAddAction.js"),t=function(a){var s,c,u=a.node,h=a.depth,p=void 0===h?0:h,v=a.nodePath,C=void 0===v?[]:v,g=a.expandedNodeIds,f=a.activeSelection,m=a.onToggleExpand,b=a.onSectionSelect,y=a.onNodeOptionsClick,T=a.onAddChild,x=a.onRenameChild,A=a.onDeleteChild,_=a.searchQuery,S=a.sectionsConfig,j=void 0===S?[]:S,N=a.nodeTypesConfig,P=void 0===N?[]:N,k=e.__spreadArray(e.__spreadArray([],C,!0),[u.id],!1),q=g.has(u.id),I=!!f&&f.nodePath[f.nodePath.length-1]===u.id,E=!!f&&(f.nodePath.includes(u.id)&&!I),L=function(e,n){if(!n)return!0;var i=n.toLowerCase();return!!e.name.toLowerCase().includes(i)||!!e.children&&e.children.some(function(e){return L(e,n)})};if(!L(u,_||""))return null;var O=p>=P.length-1?P[P.length-1]:P[p],D=!!(null==O?void 0:O.addChildType);return n.jsxs("div",e.__assign({className:d.default.nodeWrapper,style:{"--tree-depth":p}},{children:[n.jsx(o.TreeNodeHeader,{name:u.name,isExpanded:q,isSelected:I,isAncestor:E,childrenCount:null===(s=u.children)||void 0===s?void 0:s.length,onToggleExpand:function(e){e.stopPropagation(),m(u.id)},onClick:function(){b(k,"learnings")},searchQuery:_,menuOptions:e.__spreadArray(e.__spreadArray([],D?[{label:O.addChildLabel||"Add Child",icon:i.Plus,onClick:function(){return null==T?void 0:T(u.id,O.addChildType,u.name)}}]:[],!0),[{label:"Rename",icon:i.Pencil,disabled:"Station"===u.type,onClick:function(){return null==x?void 0:x(u.id,u.name)}},{label:"Delete ".concat("Station"===u.type?"Station":(null==O?void 0:O.label)||"Node"),icon:i.Trash2,onClick:function(){var e;return null==A?void 0:A(u.id,u.name,(null===(e=u.metrics)||void 0===e?void 0:e.learningsCount)||0)},disabled:u.children&&u.children.length>0,tooltip:"This scope cannot be deleted because other scopes inherit learnings from it.",className:"text-red-500 hover:text-red-600 hover:bg-red-50"}],!1)}),q&&n.jsxs("div",e.__assign({className:d.default.childrenWrapper},{children:[j.filter(function(e){return!e.isVisible||e.isVisible(u,p)}).map(function(e){var i;return n.jsx(r.TreeSectionItem,{icon:e.icon,label:e.label,badgeCount:e.badgeKey?null===(i=u.metrics)||void 0===i?void 0:i[e.badgeKey]:void 0,isActive:I&&(null==f?void 0:f.sectionId)===e.id,onClick:function(){return b(k,e.id)}},"".concat(u.id,"-").concat(e.id))}),null===(c=u.children)||void 0===c?void 0:c.map(function(e){return n.jsx(t,{node:e,depth:p+1,nodePath:k,expandedNodeIds:g,activeSelection:f,onToggleExpand:m,onSectionSelect:b,onNodeOptionsClick:y,onAddChild:T,onRenameChild:x,onDeleteChild:A,searchQuery:_,sectionsConfig:j,nodeTypesConfig:P},e.id)}),D&&n.jsx(l.TreeAddAction,{label:O.addChildLabel||"Add Child",onAdd:function(){return null==T?void 0:T(u.id,O.addChildType,u.name)}})]}))]}))};exports.TreeNode=t;
|
|
2
2
|
//# sourceMappingURL=TreeNode.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),o=require("../../styles/ScopeTree.module.css.js"),i=require("../../utils/treeUtils.js"),r=require("./TreeNode.js");exports.TreeSidebar=function(d){var c=d.data,a=d.defaultExpandedIds,u=void 0===a?[]:a,s=d.onSectionSelect,l=d.onNodeOptionsClick,f=d.onAddChild,h=d.onRenameChild,C=d.onDeleteChild,S=d.searchQuery,v=void 0===S?"":S,p=d.onSearchCountChange,g=d.sectionsConfig,w=d.nodeTypesConfig,E=d.selectedRuleSetId,x=d.activeSectionId,y=t.useState(new Set(c?e.__spreadArray([c.id],u,!0):u)),j=y[0],m=y[1],I=t.useState(null),N=I[0],T=I[1];t.useEffect(function(){c&&m(function(e){if(!e.has(c.id)){var n=new Set(e);return n.add(c.id),n}return e})},[null==c?void 0:c.id]),t.useEffect(function(){if(c&&E&&x){var e=i.findNodePathById(c,E);e&&(T({nodePath:e,sectionId:x}),m(function(n){var t=new Set(n);return e.forEach(function(e){return t.add(e)}),t}))}},[c,E,x]),t.useEffect(function(){if(v&&c){var e=new Set,n=function(t){var o=v.toLowerCase(),i=t.name.toLowerCase().includes(o),r=!1;t.children&&t.children.forEach(function(e){n(e)&&(r=!0)});var d=i||r;return d&&r&&e.add(t.id),d};n(c),m(e)}},[v,c]);var q=function(e,n){if(!n)return 0;var t=0,o=n.toLowerCase();return e.name.toLowerCase().includes(o)&&t++,e.children&&e.children.forEach(function(e){t+=q(e,n)}),t};t.useEffect(function(){p&&c&&p(q(c,v))},[v,c,p]);return c?n.jsx("div",e.__assign({className:o.default.treeContainer},{children:n.jsx(r.TreeNode,{node:c,expandedNodeIds:j,activeSelection:N,onToggleExpand:function(e){m(function(n){var t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t})},onSectionSelect:function(e,n){console.log("handleSectionSelect",e,n),T({nodePath:e,sectionId:n}),s&&s(e[e.length-1],n)},onNodeOptionsClick:function(e){l&&l(e)},onAddChild:function(e,n,t){f&&f(e,n,t)},onRenameChild:function(e,n){h&&h(e,n)},onDeleteChild:function(e,n,t){C&&C(e,n,t)},searchQuery:v,sectionsConfig:g,nodeTypesConfig:w})})):null};
|
|
2
2
|
//# sourceMappingURL=TreeSidebar.js.map
|
package/dist/cjs/features/LearningManagement/components/StationOnboarding/StationAutocomplete.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),a=require("lucide-react"),s=require("../../apis/scopeApis.js"),r=require("../../styles/StationAutocomplete.module.css.js");exports.default=function(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),a=require("lucide-react"),s=require("../../apis/scopeApis.js"),r=require("../../styles/StationAutocomplete.module.css.js"),i=require("../../store/useLearningTemplateStore.js");exports.default=function(u){var c=u.value,l=u.onChange,o=u.onStationSelect,d=u.className,f=n.useState([]),m=f[0],_=f[1],p=n.useState(!1),h=p[0],v=p[1],g=n.useState(!1),j=g[0],x=g[1],N=n.useRef(null),S=n.useRef(null),b=n.useRef(!1),k=i.useLearningTemplateStore(function(e){return e.allScopeIds});return n.useEffect(function(){var e=function(e){S.current&&!S.current.contains(e.target)&&j&&(x(!1),b.current||(l(""),o(null)))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[j,l,o]),n.useEffect(function(){return c.trim()?(N.current&&clearTimeout(N.current),v(!0),N.current=setTimeout(function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,3,4]),[4,s.fetchStationsByKeyword(c,!0)];case 1:return(t=e.sent())&&t.data?_(t.data):_([]),[3,4];case 2:return n=e.sent(),console.error("Error fetching stations:",n),_([]),[3,4];case 3:return v(!1),[7];case 4:return[2]}})})},500)):(_([]),v(!1)),function(){N.current&&clearTimeout(N.current)}},[c]),t.jsxs("div",e.__assign({className:"".concat(r.default.wrapper," ").concat(d||""),ref:S},{children:[t.jsxs("div",e.__assign({className:r.default.inputWrapper},{children:[t.jsx("input",{type:"text",value:c,onChange:function(e){l(e.target.value),x(!0),o(null),b.current=!1},onFocus:function(){(m.length>0||c.length>0)&&x(!0)},placeholder:"Search for a station...",className:r.default.input}),h&&t.jsx("div",e.__assign({className:r.default.spinnerWrapper},{children:t.jsx(a.Loader2,{className:r.default.spinner})}))]})),j&&c&&t.jsx("div",e.__assign({className:r.default.dropdown},{children:m.length>0?m.map(function(n){var s=!!n.ruleset_id&&k.includes(n.ruleset_id);return t.jsxs("div",e.__assign({className:"".concat(r.default.item," ").concat(s?r.default.itemOnboarded:r.default.itemClickable),onClick:function(){s||(l(n.station_name),o(n),x(!1),b.current=!0)}},{children:[t.jsxs("div",e.__assign({className:r.default.itemLeft},{children:[s&&t.jsx("div",e.__assign({className:r.default.checkWrapper},{children:t.jsx(a.Check,{size:12,strokeWidth:3})})),t.jsxs("div",{children:[t.jsx("div",e.__assign({className:"".concat(r.default.stationName," ").concat(s?r.default.stationNameOnboarded:r.default.stationNameUnonboarded)},{children:n.station_name})),t.jsx("div",e.__assign({className:r.default.market},{children:n.market}))]})]})),s&&t.jsx("span",e.__assign({className:r.default.badge},{children:"Onboarded"}))]}),n.station_guid)}):!h&&t.jsx("div",e.__assign({className:r.default.noResults},{children:"No stations found"}))}))]}))};
|
|
2
2
|
//# sourceMappingURL=StationAutocomplete.js.map
|
package/dist/cjs/features/LearningManagement/components/StationOnboarding/StationOnboardModal.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),r=require("@mui/material"),o=require("lucide-react"),i=require("primereact/toast"),s=require("uuid"),a=require("../../apis/scopeApis.js"),l=require("./StationAutocomplete.js"),u=require("../CardSkeleton.js"),c=require("./OnboardingLoader.js"),d=require("./TemplateCard.js"),p=require("../../styles/StationOnboardModal.module.css.js"),f=require("./InputField.js"),g=require("../../store/useAuthStore.js"),m=require("../../store/useConfigStore.js"),x=[{label:"PT - Pacific Time",value:"Pacific Time"},{label:"MT - Mountain Time",value:"Mountain Time"},{label:"CT - Central Time",value:"Central Time"},{label:"ET - Eastern Time",value:"Eastern Time"}],h=[{label:"6am to 7pm",value:"06:00 AM - 7:00 PM"},{label:"5am to 7pm",value:"05:00 AM - 7:00 PM"}],_=[{label:"Low Sellout",value:"Low Sellout"},{label:"High Sellout",value:"High Sellout"},{label:"None",value:""}],S=[{label:"None",value:"None"},{label:"Distribute spots evenly across all breaks in the hour",value:"Distribute spots evenly across all breaks in the hour"}];exports.default=function(v){var b,y=v.isOpen,j=v.onClose,C=v.onBoardStation,w=t.useState(null),T=w[0],O=w[1],F=t.useState([]),B=F[0],E=F[1],z=t.useState(0),D=z[0],q=z[1],k=t.useState(!0),N=k[0],A=k[1],M=t.useState(!1),R=M[0],I=M[1],P=t.useState([]),W=P[0],L=P[1],G=t.useState(""),U=G[0],Y=G[1],H=t.useState(""),X=H[0],Z=H[1],K=t.useState(!1),J=K[0],Q=K[1],V=t.useState(!1),$=V[0],ee=V[1],ne=t.useState(null),te=ne[0],re=ne[1],oe=t.useState(!1),ie=oe[0],se=oe[1],ae=t.useState(0),le=ae[0],ue=ae[1],ce=t.useState(""),de=ce[0],pe=ce[1],fe=g.default().user,ge=t.useRef(null),me=t.useRef(null),xe=t.useRef(null),he=t.useRef(null),_e=m.useConfigStore().configuration,Se=t.useState({region:"",timezone:"",primeTime:[],genre:"",type:"",lowSelloutConfig:""}),ve=Se[0],be=Se[1],ye=function(e,n){return e.find(function(e){return e.value===n})||null},je=t.useMemo(function(){return B.map(function(e){return{label:e.scope_name,value:e.scope_name}})},[B]),Ce=t.useMemo(function(){var e,n,t;if(!ve.genre)return null;var r=B.find(function(e){return e.scope_name===ve.genre});return r?{id:r.id,title:r.scope_name||"Unnamed Template",description:(null===(e=r.description)||void 0===e?void 0:e.trim())||"No description available.",inheritedText:(null===(n=r.inheritance)||void 0===n?void 0:n[0])||void 0,rulesCount:r.rules_count||0,tiersCount:r.tier_count||0,isCopy:null!==(t=r.is_copy)&&void 0!==t&&t}:null},[ve.genre,B]);t.useEffect(function(){return function(){xe.current&&clearTimeout(xe.current)}},[]);var we=function(n){return e.__awaiter(void 0,void 0,void 0,function(){var t,r,o;return e.__generator(this,function(i){switch(i.label){case 0:if(R)return[2];I(!0),i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,a.retrieveGenreScopes({limit:"20",offset:String(n)})];case 2:return"success"===(null==(t=i.sent())?void 0:t.status)&&Array.isArray(null==t?void 0:t.data)?(r=t.data,E(function(t){if(0===n)return r;var o=new Set(t.map(function(e){return e.id})),i=r.filter(function(e){return!o.has(e.id)});return e.__spreadArray(e.__spreadArray([],t,!0),i,!0)}),r.length<20?A(!1):A(!0),q(n+20)):A(!1),[3,5];case 3:return o=i.sent(),console.error("[StationOnboard] Failed to fetch genre scopes:",o),A(!1),[3,5];case 4:return I(!1),[7];case 5:return[2]}})})};t.useEffect(function(){y&&(E([]),q(0),A(!0),we(0))},[y]);t.useEffect(function(){be(T?function(n){var t;return e.__assign(e.__assign({},n),{region:null!==(t=T.market)&&void 0!==t?t:""})}:{region:"",timezone:"",primeTime:[],genre:"",type:"",lowSelloutConfig:""})},[T]),t.useEffect(function(){var e=setTimeout(function(){Z(U)},500);return function(){return clearTimeout(e)}},[U]),t.useEffect(function(){e.__awaiter(void 0,void 0,void 0,function(){var n,t,r;return e.__generator(this,function(e){switch(e.label){case 0:if(!X.trim())return L([]),[2];Q(!0),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,a.searchScopes({search_string:X})];case 2:return"success"===(null==(n=e.sent())?void 0:n.status)&&Array.isArray(null==n?void 0:n.data)?(t=n.data.map(function(e){var n,t,r;return{id:e.id,title:e.scope_name||"Unnamed Template",description:(null===(n=e.description)||void 0===n?void 0:n.trim())||"No description available.",inheritedText:(null===(t=e.inheritance)||void 0===t?void 0:t[0])||void 0,rulesCount:e.rules_count||0,tiersCount:e.tier_count||0,isCopy:null!==(r=e.is_copy)&&void 0!==r&&r}}),L(t)):L([]),[3,5];case 3:return r=e.sent(),console.error("[StationOnboard] Error searching scopes:",r),L([]),[3,5];case 4:return Q(!1),[7];case 5:return[2]}})})},[X]),t.useEffect(function(){!X.trim()&&Ce&&re(Ce.id)},[X,Ce]);var Te=function(){setTimeout(function(){he.current&&he.current.scrollTo({top:he.current.scrollHeight,behavior:"smooth"})},100)},Oe=function(){pe(""),O(null),be({region:"",timezone:"",primeTime:[],genre:"",type:"",lowSelloutConfig:""}),L([]),Y(""),re(null),j()},Fe=function(n,t){var r;if("primeTime"!==n){var o=null!==(r=null==t?void 0:t.value)&&void 0!==r?r:"";be(function(t){var r;return e.__assign(e.__assign({},t),((r={})[n]=String(o),r))}),"genre"===n&&(ee(!0),xe.current&&clearTimeout(xe.current),xe.current=setTimeout(function(){var e=B.find(function(e){return e.scope_name===o});re(e?e.id:null),ee(!1)},800))}else{var i=(null==t?void 0:t.value)?String(t.value):"";be(function(n){return e.__assign(e.__assign({},n),{primeTime:i?[i]:[]})})}},Be=Boolean(T&&ve.region&&ve.timezone&&ve.primeTime.length>0&&ve.genre);return n.jsxs(r.Dialog,e.__assign({open:y,onClose:Oe,maxWidth:!1,disableEscapeKeyDown:!0,PaperProps:{sx:{width:"90vw",height:"90vh",borderRadius:"12px",display:"flex",flexDirection:"column",overflow:"hidden",fontFamily:"sans-serif"}}},{children:[n.jsx(i.Toast,{ref:ge}),n.jsxs(r.Box,e.__assign({sx:{p:"20px 20px 20px 27px",borderBottom:"1px solid #F0F2F5",display:"flex",justifyContent:"space-between",alignItems:"center",bgcolor:"#fff"}},{children:[n.jsxs(r.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[n.jsx(r.Typography,e.__assign({sx:{fontSize:"18px",fontWeight:600,color:"#19213D"}},{children:"Onboard a Station"})),n.jsx(r.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:400,color:"#666F8D"}},{children:"Onboard a station to start configuring learnings."}))]})),n.jsx(r.IconButton,e.__assign({onClick:Oe,disabled:ie,sx:{color:"#19213D"}},{children:n.jsx(o.X,{size:24})}))]})),n.jsxs(r.DialogContent,e.__assign({sx:{p:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"row",overflow:"hidden",position:"relative"}},{children:[n.jsx(c.default,{isLoading:ie,currentStep:le,onComplete:function(){se(!1);var e=me.current;Oe(),C(e||void 0),me.current=null}}),n.jsxs(r.Box,e.__assign({sx:{display:"flex",flex:1,paddingY:"14px",paddingX:"20px",gap:3,overflowY:"hidden"}},{children:[n.jsxs(r.Box,e.__assign({ref:he,sx:{flex:1,bgcolor:"#fff",p:3,borderRadius:"16px",border:"1px solid #F0F2F5",height:"100%",overflowY:"auto"}},{children:[n.jsx(r.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:600,mb:.5,color:"#19213D"}},{children:"Basic Details"})),n.jsx(r.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#00000080",mb:"20px"}},{children:"Set up basic station details to unlock AI recommended scopes."})),n.jsxs(r.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:"16px"}},{children:[n.jsxs(r.Box,e.__assign({className:p.default.formGroup},{children:[n.jsxs("label",e.__assign({className:p.default.label},{children:[n.jsx("span",e.__assign({className:p.default.asterisk},{children:"*"})),"Station Name/Call Letters"]})),n.jsx(l.default,{value:de,onChange:pe,onStationSelect:function(e){return O(e)}})]})),n.jsx(f.default,{required:!0,disabled:!0,label:"Region",placeholder:"Select Region",value:ve.region||void 0,isSearchable:!1}),n.jsx(f.default,{required:!0,label:"TimeZone",placeholder:"Select TimeZone",options:x,value:ye(x,ve.timezone),onOptionChange:function(e){return Fe("timezone",e)},isSearchable:!1}),n.jsx(f.default,{required:!0,label:"Prime Time Window",placeholder:"Select Prime Time",options:h,value:ye(h,(null===(b=ve.primeTime)||void 0===b?void 0:b[0])||""),onOptionChange:function(e){return Fe("primeTime",e)},isSearchable:!1}),n.jsx(r.Box,e.__assign({onClick:Te,sx:{width:"100%"}},{children:n.jsx(f.default,{required:!0,label:"Genre",placeholder:"Select Genre",options:je,value:ye(je,ve.genre),onOptionChange:function(e){return Fe("genre",e)},isSearchable:!1,onMenuScrollToBottom:function(){!R&&N&&we(D)},isLoadingOptions:R,hasMoreOptions:N})})),n.jsx(r.Box,e.__assign({onClick:Te,sx:{width:"100%"}},{children:n.jsx(f.default,{label:"Station Type",placeholder:"None",options:_,value:ye(_,ve.type),onOptionChange:function(n){Fe("type",n),"Low Sellout"!==(null==n?void 0:n.value)&&be(function(n){return e.__assign(e.__assign({},n),{lowSelloutConfig:""})})},isSearchable:!1})})),"Low Sellout"===ve.type&&n.jsx(r.Box,e.__assign({onClick:Te,sx:{width:"100%"}},{children:n.jsx(f.default,{label:"Low Sell Out Configurations",placeholder:"Select Configuration",options:S,value:ye(S,ve.lowSelloutConfig),onOptionChange:function(e){return Fe("lowSelloutConfig",e)},isSearchable:!1})}))]}))]})),n.jsx(r.Box,e.__assign({sx:{flex:1,bgcolor:"#fff",p:3,borderRadius:"12px",border:"1px solid #F0F2F5",display:"flex",flexDirection:"column",height:"100%",overflowY:"auto"}},{children:ve.genre?n.jsxs(n.Fragment,{children:[n.jsx(r.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:500,mb:1.5}},{children:"Matching scope for your station"})),n.jsx(r.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:2,mb:4}},{children:$?n.jsx(u.default,{}):Ce?n.jsx(d.default,e.__assign({},Ce,{isSelected:te===Ce.id,onSelect:re}),Ce.id):null})),n.jsx(r.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:500,mb:1.5}},{children:"Other available stations"})),n.jsxs("div",e.__assign({className:p.default.searchWrapper},{children:[n.jsx("input",{type:"text",value:U,onChange:function(e){return Y(e.target.value)},placeholder:"Search for station...",className:p.default.searchInput}),n.jsx(o.Search,{className:p.default.searchIcon,size:16})]})),n.jsxs(r.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:2}},{children:[J&&n.jsx(u.default,{}),!J&&0===W.length&&X.trim()&&n.jsxs(r.Typography,e.__assign({sx:{fontSize:"0.875rem",color:"#64748B",textAlign:"center",py:4}},{children:['No scopes found matching "',X,'".']})),!J&&W.map(function(t){return n.jsx(d.default,e.__assign({},t,{isSelected:te===t.id,onSelect:re}),t.id)})]}))]}):n.jsxs(n.Fragment,{children:[n.jsx(r.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:500,mb:1.5}},{children:"Fill in the station details to load AI recommended scopes"})),n.jsx(r.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#64748B",mb:3}},{children:"AI will recommend the most relevant scope for this station."})),n.jsx(r.Box,e.__assign({sx:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",opacity:.5,py:10}},{children:n.jsx(o.BrushCleaning,{})}))]})}))]}))]})),n.jsxs(r.Box,e.__assign({sx:{p:"12px 20px",borderTop:"1px solid #F0F2F5",display:"flex",justifyContent:"flex-end",gap:2,bgcolor:"#fff"}},{children:[n.jsx("button",e.__assign({onClick:Oe,disabled:ie,style:{padding:"7px 10px",borderRadius:"6px",color:"#64748B",border:"1px solid #E2E8F0",backgroundColor:"#fff",cursor:"pointer",fontSize:"14px",fontWeight:500}},{children:"Cancel"})),n.jsx("button",e.__assign({onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var n,t,r,o,i,l,u,c,d,p,f,g,m,x,h,_,S,v;return e.__generator(this,function(b){switch(b.label){case 0:if(!T||!te)return console.error("[StationOnboard] Missing required data for onboarding"),[2];n=Ce?e.__spreadArray([Ce],W,!0):W,t=n.find(function(e){return e.id===te}),r=null!==(m=null==t?void 0:t.isCopy)&&void 0!==m&&m,se(!0),ue(0),o=null,b.label=1;case 1:return b.trys.push([1,3,,4]),i={topic:"customRuleSet",customScopeGroupName:(null==_e?void 0:_e.CUSTOM_SCOPE_GROUP_NAME)||"",scopeDescription:"demo",parentScopeId:null,customScopeName:T.station_name||"New Station",customScopeId:s.v4(),createByName:(null==fe?void 0:fe.firstname)||"System",createdBy:(null==fe?void 0:fe.email)||"system@audacy.com"},console.log("[StationOnboard] Step 1: Creating rule set with payload:",i),[4,a.createRuleSet(i)];case 2:if(l=b.sent(),!(o=null===(x=null==l?void 0:l.data)||void 0===x?void 0:x.scopeId))throw new Error("Failed to create scope - no scopeId returned");return console.log("[StationOnboard] Step 1 Complete: Created scope with ID:",o),ue(1),[3,4];case 3:return u=b.sent(),console.error("[StationOnboard] Error creating rule set:",u),null===(h=ge.current)||void 0===h||h.show({severity:"error",life:3e3,summary:"Error",detail:"Failed to create rule set. Please try again."}),se(!1),ue(0),[2];case 4:return b.trys.push([4,6,,11]),c={market:T.market,region:T.region,timezone:ve.timezone,primetime_windows:ve.primeTime,genre:ve.genre,station_type:""===ve.type?null:ve.type,low_sellout_configurations:"Low Sellout"===ve.type?ve.lowSelloutConfig:null,ruleset_id:o,station_guid:T.station_guid,station_name:T.station_name||"New Station"},console.log("[StationOnboard] Step 2: Updating station with payload:",c),[4,a.updateStation(c)];case 5:return b.sent(),console.log("[StationOnboard] Step 2 Complete: Station updated"),ue(2),[3,11];case 6:d=b.sent(),console.error("[StationOnboard] Error updating station, rolling back rule set:",d),409===d.status?(null===(_=ge.current)||void 0===_||_.show({severity:"error",life:2500,summary:"Error updating station",detail:"Station already Onboarded."}),O(null),re(null),pe(""),be(function(n){return e.__assign(e.__assign({},n),{region:""})})):null===(S=ge.current)||void 0===S||S.show({severity:"error",life:2500,summary:"Error updating station",detail:"Please try again."}),b.label=7;case 7:return b.trys.push([7,9,,10]),[4,a.deleteRuleSet(o)];case 8:return b.sent(),console.log("[StationOnboard] Rollback complete: Deleted rule set",o),[3,10];case 9:return p=b.sent(),console.error("[StationOnboard] Failed to rollback rule set deletion:",p),[3,10];case 10:return se(!1),ue(0),[2];case 11:return b.trys.push([11,13,,14]),f={source_scope_id:te,target_scope_id:o,is_copy_parent_variant_id:r},console.log("[StationOnboard] Step 3: Inheriting scope with payload:",f),[4,a.inheritScope(f)];case 12:return b.sent(),console.log("[StationOnboard] Step 3 Complete: Scope inherited"),ue(3),[3,14];case 13:return g=b.sent(),console.error("[StationOnboard] Error inheriting scope (no rollback):",g),null===(v=ge.current)||void 0===v||v.show({severity:"error",life:3e3,summary:"Error",detail:"Failed to apply rule template. Please try again."}),se(!1),ue(0),[2];case 14:return me.current=o,console.log("[StationOnboard] Onboarding completed successfully!"),[2]}})})},disabled:!Be||ie,style:{padding:"7px 10px",borderRadius:"6px",border:"none",backgroundColor:Be?"#2563EB":"#BFDBFE",color:"#fff",cursor:Be&&!ie?"pointer":"not-allowed",fontSize:"14px",fontWeight:500,display:"flex",alignItems:"center",gap:"7px"}},{children:ie?n.jsxs(n.Fragment,{children:[n.jsx(r.CircularProgress,{size:16,color:"inherit"}),n.jsx("span",{children:"Onboarding..."})]}):n.jsxs(n.Fragment,{children:[n.jsx("span",{children:"Onboard Station"}),n.jsx(o.ArrowRight,{size:16})]})}))]}))]}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),r=require("react"),t=require("@mui/material"),o=require("lucide-react"),i=require("primereact/toast"),s=require("uuid"),a=require("../../apis/scopeApis.js"),l=require("./StationAutocomplete.js"),u=require("../CardSkeleton.js"),c=require("./OnboardingLoader.js"),d=require("./TemplateCard.js"),p=require("../../styles/StationOnboardModal.module.css.js"),g=require("./InputField.js"),x=require("../../store/useAuthStore.js"),f=require("../../store/useConfigStore.js"),m=require("../../store/useLearningTemplateStore.js"),h=require("../../config.js"),_=[{label:"PT - Pacific Time",value:"Pacific Time"},{label:"MT - Mountain Time",value:"Mountain Time"},{label:"CT - Central Time",value:"Central Time"},{label:"ET - Eastern Time",value:"Eastern Time"}],S=[{label:"6am to 7pm",value:"06:00 AM - 7:00 PM"},{label:"5am to 7pm",value:"05:00 AM - 7:00 PM"}],b=[{label:"Low Sellout",value:"Low Sellout"},{label:"High Sellout",value:"High Sellout"},{label:"None",value:""}],v=[{label:"None",value:"None"},{label:"Distribute spots evenly across all breaks in the hour",value:"Distribute spots evenly across all breaks in the hour"}];exports.default=function(y){var j,C=y.isOpen,T=y.onClose,w=y.onBoardStation,F=y.app_integration_id,B=y.token,E=r.useState(null),O=E[0],k=E[1],z=r.useState([]),N=z[0],D=z[1],R=r.useState(0),q=R[0],I=R[1],A=r.useState(!0),M=A[0],L=A[1],P=r.useState(!1),W=P[0],G=P[1],U=r.useState([]),Y=U[0],H=U[1],X=r.useState(""),Z=X[0],K=X[1],J=r.useState(""),Q=J[0],V=J[1],$=r.useState(!1),ee=$[0],ne=$[1],re=r.useState(!1),te=re[0],oe=re[1],ie=r.useState(null),se=ie[0],ae=ie[1],le=r.useState(null);le[0],le[1];var ue=r.useState(!1),ce=ue[0],de=ue[1],pe=r.useState(0),ge=pe[0],xe=pe[1],fe=r.useState(""),me=fe[0],he=fe[1],_e=x.default().user,Se=r.useRef(null),be=r.useRef(null),ve=r.useRef(null),ye=r.useRef(null);f.useConfigStore().configuration;var je=r.useState({region:"",timezone:"",primeTime:[],genre:"",type:"",lowSelloutConfig:""}),Ce=je[0],Te=je[1],we=function(e,n){return e.find(function(e){return e.value===n})||null},Fe=r.useMemo(function(){return N.map(function(e){return{label:e.scope_name,value:e.scope_name}})},[N]),Be=r.useMemo(function(){var e,n,r;if(!Ce.genre)return null;var t=N.find(function(e){return e.scope_name===Ce.genre});return t?{id:t.id,title:t.scope_name||"Unnamed Template",description:(null===(e=t.description)||void 0===e?void 0:e.trim())||"No description available.",inheritedText:(null===(n=t.inheritance)||void 0===n?void 0:n[0])||void 0,rulesCount:t.rules_count||0,tiersCount:t.tier_count||0,isCopy:null!==(r=t.is_copy)&&void 0!==r&&r}:null},[Ce.genre,N]);r.useEffect(function(){return function(){ve.current&&clearTimeout(ve.current)}},[]);var Ee=function(n){return e.__awaiter(void 0,void 0,void 0,function(){var r,t,o;return e.__generator(this,function(i){switch(i.label){case 0:if(W)return[2];G(!0),i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,a.retrieveGenreScopes({limit:"20",offset:String(n)})];case 2:return"success"===(null==(r=i.sent())?void 0:r.status)&&Array.isArray(null==r?void 0:r.data)?(t=r.data,D(function(r){if(0===n)return t;var o=new Set(r.map(function(e){return e.id})),i=t.filter(function(e){return!o.has(e.id)});return e.__spreadArray(e.__spreadArray([],r,!0),i,!0)}),t.length<20?L(!1):L(!0),I(n+20)):L(!1),[3,5];case 3:return o=i.sent(),console.error("[StationOnboard] Failed to fetch genre scopes:",o),L(!1),[3,5];case 4:return G(!1),[7];case 5:return[2]}})})};r.useEffect(function(){C&&(D([]),I(0),L(!0),Ee(0))},[C]);r.useEffect(function(){Te(O?function(n){var r;return e.__assign(e.__assign({},n),{region:null!==(r=O.market)&&void 0!==r?r:""})}:{region:"",timezone:"",primeTime:[],genre:"",type:"",lowSelloutConfig:""})},[O]),r.useEffect(function(){var e=setTimeout(function(){V(Z)},500);return function(){return clearTimeout(e)}},[Z]),r.useEffect(function(){e.__awaiter(void 0,void 0,void 0,function(){var n,r,t,o;return e.__generator(this,function(e){switch(e.label){case 0:if(!Q.trim())return H([]),[2];ne(!0),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,a.searchScopes({search_string:Q})];case 2:return"success"===(null==(n=e.sent())?void 0:n.status)&&Array.isArray(null==n?void 0:n.data)?(r=n.data.filter(function(e){var n,r=null!==(n=e.inheritance)&&void 0!==n?n:[],t=r.indexOf(e.scope_name);return!(t<=0)&&r[t-1]===Ce.genre}),t=r.map(function(e){var n,r,t;return{id:e.id,title:e.scope_name||"Unnamed Template",description:(null===(n=e.description)||void 0===n?void 0:n.trim())||"No description available.",inheritedText:(null===(r=e.inheritance)||void 0===r?void 0:r[0])||void 0,rulesCount:e.rules_count||0,tiersCount:e.tier_count||0,isCopy:null!==(t=e.is_copy)&&void 0!==t&&t}}),H(t)):H([]),[3,5];case 3:return o=e.sent(),console.error("[StationOnboard] Error searching scopes:",o),H([]),[3,5];case 4:return ne(!1),[7];case 5:return[2]}})})},[Q,Ce.genre]),r.useEffect(function(){!Q.trim()&&Be&&ae(Be.id)},[Q,Be]);var Oe=function(){setTimeout(function(){ye.current&&ye.current.scrollTo({top:ye.current.scrollHeight,behavior:"smooth"})},100)},ke=function(){he(""),k(null),Te({region:"",timezone:"",primeTime:[],genre:"",type:"",lowSelloutConfig:""}),H([]),K(""),ae(null),T()},ze=function(n,r){var t;if("primeTime"!==n){var o=null!==(t=null==r?void 0:r.value)&&void 0!==t?t:"";Te(function(r){var t;return e.__assign(e.__assign({},r),((t={})[n]=String(o),t))}),"genre"===n&&(oe(!0),ve.current&&clearTimeout(ve.current),ve.current=setTimeout(function(){var e=N.find(function(e){return e.scope_name===o});ae(e?e.id:null),oe(!1)},800))}else{var i=(null==r?void 0:r.value)?String(r.value):"";Te(function(n){return e.__assign(e.__assign({},n),{primeTime:i?[i]:[]})})}},Ne=Boolean(O&&Ce.region&&Ce.timezone&&Ce.primeTime.length>0&&Ce.genre);return n.jsxs(t.Dialog,e.__assign({open:C,onClose:ke,maxWidth:!1,disableEscapeKeyDown:!0,PaperProps:{sx:{width:"90vw",height:"90vh",borderRadius:"12px",display:"flex",flexDirection:"column",overflow:"hidden",fontFamily:"sans-serif"}}},{children:[n.jsx(i.Toast,{ref:Se}),n.jsxs(t.Box,e.__assign({sx:{p:"20px 20px 20px 27px",borderBottom:"1px solid #F0F2F5",display:"flex",justifyContent:"space-between",alignItems:"center",bgcolor:"#fff"}},{children:[n.jsxs(t.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[n.jsx(t.Typography,e.__assign({sx:{fontSize:"18px",fontWeight:600,color:"#19213D"}},{children:"Onboard a Station"})),n.jsx(t.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:400,color:"#666F8D"}},{children:"Onboard a station to start configuring learnings."}))]})),n.jsx(t.IconButton,e.__assign({onClick:ke,disabled:ce,sx:{color:"#19213D"}},{children:n.jsx(o.X,{size:24})}))]})),n.jsxs(t.DialogContent,e.__assign({sx:{p:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"row",overflow:"hidden",position:"relative"}},{children:[n.jsx(c.default,{isLoading:ce,currentStep:ge,onComplete:function(){de(!1);var e=be.current;ke(),w(e||void 0),be.current=null}}),n.jsxs(t.Box,e.__assign({sx:{display:"flex",flex:1,paddingY:"14px",paddingX:"20px",gap:3,overflowY:"hidden"}},{children:[n.jsxs(t.Box,e.__assign({ref:ye,sx:{flex:1,bgcolor:"#fff",p:3,borderRadius:"16px",border:"1px solid #F0F2F5",height:"100%",overflowY:"auto"}},{children:[n.jsx(t.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:600,mb:.5,color:"#19213D"}},{children:"Basic Details"})),n.jsx(t.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#00000080",mb:"20px"}},{children:"Set up basic station details to unlock AI recommended scopes."})),n.jsxs(t.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:"16px"}},{children:[n.jsxs(t.Box,e.__assign({className:p.default.formGroup},{children:[n.jsxs("label",e.__assign({className:p.default.label},{children:[n.jsx("span",e.__assign({className:p.default.asterisk},{children:"*"})),"Station Name/Call Letters"]})),n.jsx(l.default,{value:me,onChange:he,onStationSelect:function(e){return k(e)}})]})),n.jsx(g.default,{required:!0,disabled:!0,label:"Region",placeholder:"Select Region",value:Ce.region||void 0,isSearchable:!1}),n.jsx(g.default,{required:!0,label:"TimeZone",placeholder:"Select TimeZone",options:_,value:we(_,Ce.timezone),onOptionChange:function(e){return ze("timezone",e)},isSearchable:!1}),n.jsx(g.default,{required:!0,label:"Prime Time Window",placeholder:"Select Prime Time",options:S,value:we(S,(null===(j=Ce.primeTime)||void 0===j?void 0:j[0])||""),onOptionChange:function(e){return ze("primeTime",e)},isSearchable:!1}),n.jsx(t.Box,e.__assign({onClick:Oe,sx:{width:"100%"}},{children:n.jsx(g.default,{label:"Station Type",placeholder:"None",options:b,value:we(b,Ce.type),onOptionChange:function(n){ze("type",n),"Low Sellout"!==(null==n?void 0:n.value)&&Te(function(n){return e.__assign(e.__assign({},n),{lowSelloutConfig:""})})},isSearchable:!1})})),"Low Sellout"===Ce.type&&n.jsx(t.Box,e.__assign({onClick:Oe,sx:{width:"100%"}},{children:n.jsx(g.default,{label:"Low Sell Out Configurations",placeholder:"Select Configuration",options:v,value:we(v,Ce.lowSelloutConfig),onOptionChange:function(e){return ze("lowSelloutConfig",e)},isSearchable:!1})}))]}))]})),n.jsxs(t.Box,e.__assign({sx:{flex:1,bgcolor:"#fff",p:3,borderRadius:"12px",border:"1px solid #F0F2F5",display:"flex",flexDirection:"column",height:"100%",overflowY:"auto"}},{children:[n.jsxs(t.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:600,mb:.5,color:"#19213D"}},{children:[n.jsx("span",e.__assign({style:{color:"#E53E3E",marginRight:"2px"}},{children:"*"})),"Select a scope for your station"]})),n.jsx(t.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#64748B",mb:"16px"}},{children:"Your station will inherit the rules from the selected scope."})),n.jsx(t.Box,e.__assign({sx:{mb:2}},{children:n.jsx(g.default,{required:!0,label:"",placeholder:"Select Genre",options:Fe,value:we(Fe,Ce.genre),onOptionChange:function(e){return ze("genre",e)},isSearchable:!1,onMenuScrollToBottom:function(){!W&&M&&Ee(q)},isLoadingOptions:W,hasMoreOptions:M})})),n.jsx(t.Box,e.__assign({sx:{mb:3}},{children:te?n.jsx(u.default,{}):Be?n.jsxs(t.Box,e.__assign({sx:{border:"1.5px solid #2563EB",borderRadius:"10px",p:"14px 16px",bgcolor:"#EFF6FF",display:"flex",alignItems:"flex-start",gap:"12px"}},{children:[n.jsx(t.Box,e.__assign({sx:{width:36,height:36,borderRadius:"8px",bgcolor:"#DBEAFE",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},{children:n.jsxs("svg",e.__assign({width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"#2563EB",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n.jsx("circle",{cx:"12",cy:"12",r:"2"}),n.jsx("path",{d:"M16.24 7.76a6 6 0 0 1 0 8.49m-8.48-.01a6 6 0 0 1 0-8.49m11.31-2.82a10 10 0 0 1 0 14.14m-14.14 0a10 10 0 0 1 0-14.14"})]}))})),n.jsxs(t.Box,e.__assign({sx:{flex:1,minWidth:0}},{children:[n.jsx(t.Typography,e.__assign({sx:{fontSize:"0.875rem",fontWeight:600,color:"#1E3A5F",mb:"2px"}},{children:Be.title})),n.jsx(t.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#2563EB",mb:"8px"}},{children:Be.description})),n.jsxs(t.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"}},{children:[Be.inheritedText&&n.jsxs(t.Box,e.__assign({component:"span",sx:{fontSize:"0.7rem",color:"#475569",bgcolor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"4px",px:"6px",py:"2px",display:"inline-flex",alignItems:"center",gap:"4px"}},{children:[n.jsxs("svg",e.__assign({width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n.jsx("polyline",{points:"15 3 21 3 21 9"}),n.jsx("path",{d:"M21 3L9 15"}),n.jsx("path",{d:"M3 21l6-6"})]})),Be.inheritedText]})),n.jsxs(t.Box,e.__assign({component:"span",sx:{fontSize:"0.7rem",color:"#475569",bgcolor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"4px",px:"6px",py:"2px"}},{children:[Be.rulesCount," rules"]})),n.jsxs(t.Box,e.__assign({component:"span",sx:{fontSize:"0.7rem",color:"#475569",bgcolor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"4px",px:"6px",py:"2px"}},{children:[Be.tiersCount," Tiers"]}))]}))]}))]})):Ce.genre?null:n.jsxs(t.Box,e.__assign({sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",opacity:.4,py:6,gap:1}},{children:[n.jsx(o.Brush,{size:28}),n.jsx(t.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#94A3B8"}},{children:"Select a genre to load the matching scope"}))]}))})),Ce.genre&&n.jsxs(n.Fragment,{children:[n.jsxs(t.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:600,mb:.5,color:"#19213D"}},{children:["Select an Existing Station from the “",Ce.genre,"” Scope"," ",n.jsx(t.Typography,e.__assign({component:"span",sx:{fontSize:"1rem",fontWeight:400,color:"#64748B"}},{children:"(Optional)"}))]})),n.jsxs(t.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#64748B",mb:"12px"}},{children:["Please select an existing station under the “",Ce.genre,"” category to copy its learnings."]})),n.jsxs("div",e.__assign({className:p.default.searchWrapper,style:{marginBottom:"12px"}},{children:[n.jsx("input",{type:"text",value:Z,onChange:function(e){return K(e.target.value)},placeholder:"Search for station...",className:p.default.searchInput}),n.jsx(o.Search,{className:p.default.searchIcon,size:16})]})),n.jsxs(t.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:2}},{children:[ee&&n.jsx(u.default,{}),!ee&&0===Y.length&&Q.trim()&&n.jsxs(t.Typography,e.__assign({sx:{fontSize:"0.875rem",color:"#64748B",textAlign:"center",py:4}},{children:['No scopes found matching "',Q,'".']})),!ee&&Y.map(function(r){return n.jsx(d.default,e.__assign({},r,{isSelected:se===r.id,onSelect:function(e){var n;ae(se===e?null!==(n=null==Be?void 0:Be.id)&&void 0!==n?n:null:e)}}),r.id)})]}))]})]}))]}))]})),n.jsxs(t.Box,e.__assign({sx:{p:"12px 20px",borderTop:"1px solid #F0F2F5",display:"flex",justifyContent:"flex-end",gap:2,bgcolor:"#fff"}},{children:[n.jsx("button",e.__assign({onClick:ke,disabled:ce,style:{padding:"7px 10px",borderRadius:"6px",color:"#64748B",border:"1px solid #E2E8F0",backgroundColor:"#fff",cursor:"pointer",fontSize:"14px",fontWeight:500}},{children:"Cancel"})),n.jsx("button",e.__assign({onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var n,r,t,o,i,l,u,c,d,p,g,x,f,_,S,b,v,y,j;return e.__generator(this,function(C){switch(C.label){case 0:if(!O||!se)return console.error("[StationOnboard] Missing required data for onboarding"),[2];n=Be?e.__spreadArray([Be],Y,!0):Y,r=n.find(function(e){return e.id===se}),null==r?void 0:r.isCopy,de(!0),xe(0),t=null,C.label=1;case 1:return C.trys.push([1,3,,4]),u=m.useLearningTemplateStore.getState().backwardCompatibility,o=u?{topic:"customRuleSet",customScopeGroupName:h.IL_CONFIG_CONSTANTS.CUSTOM_SCOPE_GROUP_NAME,scopeDescription:O.station_name||"New Station",parentScopeId:null,customScopeName:O.station_name||"New Station",customScopeId:s.v4(),createByName:(null==_e?void 0:_e.firstname)||"System",createdBy:(null==_e?void 0:_e.email)||"system@audacy.com",scopeType:"Station"}:{topic:"customRuleSet",scope_reference_id:null,scopeDescription:"demo",parentScopeId:null,scopeName:O.station_name||"New Station",scopeReferenceMetadata:{},applicationMappingId:F},console.log("[StationOnboard] Step 1: Creating rule set with payload:",o),[4,a.createRuleSet(o,B)];case 2:if(i=C.sent(),!(t=null===(_=null==i?void 0:i.data)||void 0===_?void 0:_.scopeId))throw new Error("Failed to create scope - no scopeId returned");return console.log("[StationOnboard] Step 1 Complete: Created scope with ID:",t),xe(1),[3,4];case 3:return l=C.sent(),console.error("[StationOnboard] Error creating rule set:",l),null===(S=Se.current)||void 0===S||S.show({severity:"error",life:3e3,summary:"Error",detail:"Failed to create rule set. Please try again."}),de(!1),xe(0),[2];case 4:return C.trys.push([4,6,,11]),u=m.useLearningTemplateStore.getState().backwardCompatibility,c=e.__assign(e.__assign({market:O.market,region:O.region},u?{}:{timezone:Ce.timezone}),{primetime_windows:Ce.primeTime,genre:Ce.genre,station_type:""===Ce.type?null:Ce.type,low_sellout_configurations:"Low Sellout"===Ce.type?Ce.lowSelloutConfig:null,ruleset_id:t,station_guid:O.station_guid,station_name:O.station_name||"New Station"}),console.log("[StationOnboard] Step 2: Updating station with payload:",c),[4,a.updateStation(c)];case 5:return C.sent(),console.log("[StationOnboard] Step 2 Complete: Station updated"),xe(2),[3,11];case 6:d=C.sent(),console.error("[StationOnboard] Error updating station, rolling back rule set:",d),409===d.status?(null===(b=Se.current)||void 0===b||b.show({severity:"error",life:2500,summary:"Error updating station",detail:"Station already Onboarded."}),k(null),ae(null),he(""),Te(function(n){return e.__assign(e.__assign({},n),{region:""})})):null===(v=Se.current)||void 0===v||v.show({severity:"error",life:2500,summary:"Error updating station",detail:"Please try again."}),C.label=7;case 7:return C.trys.push([7,9,,10]),[4,a.deleteRuleSet(t,B)];case 8:return C.sent(),console.log("[StationOnboard] Rollback complete: Deleted rule set",t),[3,10];case 9:return p=C.sent(),console.error("[StationOnboard] Failed to rollback rule set deletion:",p),[3,10];case 10:return de(!1),xe(0),[2];case 11:return C.trys.push([11,13,,14]),g=null!==se&&se!==(null==Be?void 0:Be.id),x={source_scope_id:g?se:null!==(y=null==Be?void 0:Be.id)&&void 0!==y?y:se,target_scope_id:t,is_copy_parent_variant_id:g},console.log("[StationOnboard] Step 3: Inheriting scope with payload:",x),[4,a.inheritScopeBackwardCompatible(x)];case 12:return C.sent(),console.log("[StationOnboard] Step 3 Complete: Scope inherited"),xe(3),[3,14];case 13:return f=C.sent(),console.error("[StationOnboard] Error inheriting scope (no rollback):",f),null===(j=Se.current)||void 0===j||j.show({severity:"error",life:3e3,summary:"Error",detail:"Failed to apply rule template. Please try again."}),de(!1),xe(0),[2];case 14:return be.current=t,console.log("[StationOnboard] Onboarding completed successfully!"),[2]}})})},disabled:!Ne||ce,style:{padding:"7px 10px",borderRadius:"6px",border:"none",backgroundColor:Ne?"#2563EB":"#BFDBFE",color:"#fff",cursor:Ne&&!ce?"pointer":"not-allowed",fontSize:"14px",fontWeight:500,display:"flex",alignItems:"center",gap:"7px"}},{children:ce?n.jsxs(n.Fragment,{children:[n.jsx(t.CircularProgress,{size:16,color:"inherit"}),n.jsx("span",{children:"Onboarding..."})]}):n.jsxs(n.Fragment,{children:[n.jsx("span",{children:"Onboard Station"}),n.jsx(o.ArrowRight,{size:16})]})}))]}))]}))};
|
|
2
2
|
//# sourceMappingURL=StationOnboardModal.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),r=require("react"),o=require("@radix-ui/react-tooltip"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),r=require("react"),o=require("@radix-ui/react-tooltip"),i=require("../styles/ToolTip.module.css.js");function s(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}var a=s(r),n=s(o),c=n.Provider,l=n.Root,u=n.Trigger,f=a.forwardRef(function(r,o){var s=r.className,a=r.sideOffset,c=void 0===a?4:a,l=e.__rest(r,["className","sideOffset"]);return t.jsx(n.Portal,{children:t.jsx(n.Content,e.__assign({ref:o,sideOffset:c,className:"".concat(i.default.tooltipContent," ").concat(s||"")},l))})});f.displayName=n.Content.displayName,exports.Tooltip=l,exports.TooltipContent=f,exports.TooltipProvider=c,exports.TooltipTrigger=u;
|
|
2
2
|
//# sourceMappingURL=ToolTip.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("@tanstack/react-query"),t=require("../apis/scopeApis.js"),n=require("../store/useEnvStore.js");exports.useApproveOrRejectVariantsMutation=function(){return r.useMutation({mutationFn:function(e){var r=e.variantIds,n=e.status,u=e.feedback,a=e.scopeId,s=e.is_deleted;return t.ApproveOrRejectVariants({variant_ids:r,status:n,feedback:u,scopeId:a,is_deleted:s})}})},exports.useApproverSearchQuery=function(n){var u=this;return r.useQuery({queryKey:["approver-search",n],queryFn:function(){return e.__awaiter(u,void 0,void 0,function(){var r;return e.__generator(this,function(e){switch(e.label){case 0:return[4,t.appsecGetUsersByQueryLite(n)];case 1:return[2,(null==(r=e.sent())?void 0:r.data)||[]]}})})},enabled:!!n.trim(),staleTime:3e4})},exports.useGetAppSecRolesQuery=function(n,u){var a=this;return void 0===u&&(u=!0),r.useQuery({queryKey:["appsec-roles",n],queryFn:function(){return e.__awaiter(a,void 0,void 0,function(){return e.__generator(this,function(e){switch(e.label){case 0:return[4,t.GetAppsecRoles(n)];case 1:return[2,e.sent().data]}})})},enabled:u&&!!n,staleTime:1e5})},exports.useGroupSearchQuery=function(u){var a=this,s=n.default(function(e){var r;return null===(r=e.rbacConfig)||void 0===r?void 0:r.applicationId});return r.useQuery({queryKey:["group-search",s,u],queryFn:function(){return e.__awaiter(a,void 0,void 0,function(){return e.__generator(this,function(e){switch(e.label){case 0:return[4,t.appsecGetUserGroups({appId:s,name:u})];case 1:return[2,e.sent().data]}})})},enabled:!!s,staleTime:3e4})};
|
|
2
|
+
//# sourceMappingURL=useApprovalQueries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useApprovalQueries.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAppSecRolesStore.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("zustand").create(function(n){return{configuration:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("zustand"),t={"Separation rule":"I would want to add a separation rule","Max priority rule":"I would want to set a max priority rule","Break code matching":"I would want to add a break code matching rule","Inventory code matching":"I would want to add a inventory window matching rule","Enter a rule description":"I want to add a rule description","Tester Genie":"Loading prompt..."},r="<p><span>Hi! 👋 I'm your Instant Learning Concierge.</span>\n <span>How would you like to get started? You can select an option below or describe the rule you'd like to create.</span>\n ".concat(["Separation rule","Max priority rule","Break code matching","Inventory code matching","Enter a rule description","Tester Genie"].map(function(e){return'<button class="clickable-button" data-value="'.concat(t[e],'">').concat(e,"</button>")}).join(""),"</p>"),i=n.create(function(n){return{configuration:{INITIAL_CHAT_MESSAGE:r},ilLabels:{setupLabel:"Learning Setup",ruleTitle:"Learning Title",ruleDescriptionTitle:"Learning Description"},setConfig:function(e){return n(function(){return{configuration:e}})},setIlLabels:function(t){return n(function(n){return{ilLabels:e.__assign(e.__assign({},n.ilLabels),t)}})},resetConfig:function(){return n({configuration:null,ilLabels:{setupLabel:"Learning Setup",ruleTitle:"Learning Title",ruleDescriptionTitle:"Learning Description"}})}}});exports.useConfigStore=i;
|
|
2
2
|
//# sourceMappingURL=useConfigStore.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("zustand"),r=require("../hooks/useLearningTemplateQueryParams.js"),n={globalRuleSet:[],genreRuleSet:[],customRuleSet:[]},u=t.create(function(t){return{sidebarTab:"rule-sets",selectedRuleSetId:null,ruleSets:n,isStationModalOpen:!1,isILModalTriggered:"true"===r.getQueryParam(r.QUERY_PARAM_KEYS.OPEN_IL),isStationOnboardModalTriggered:"true"===r.getQueryParam(r.QUERY_PARAM_KEYS.ONBOARD_STATION),scopeTreeData:null,stations:[],selectedStationId:null,currentRules:[],createdVariantInfo:null,setRuleSets:function(e){return t({ruleSets:e})},setScopeTreeData:function(e){return t({scopeTreeData:e})},setStationModalOpen:function(e){return t({isStationModalOpen:e})},setIsILModalTriggered:function(e){var n;r.setQueryParams(((n={})[r.QUERY_PARAM_KEYS.OPEN_IL]=e?"true":null,n)),t({isILModalTriggered:e})},setIsStationOnboardModalTriggered:function(e){var n;r.setQueryParams(((n={})[r.QUERY_PARAM_KEYS.ONBOARD_STATION]=e?"true":null,n)),t({isStationOnboardModalTriggered:e})},setInitialRules:function(e){return t({currentRules:e})},setCreatedVariantInfo:function(e){return t({createdVariantInfo:e})},resetCreatedVariantInfo:function(){return t({createdVariantInfo:null})},setSelectedRuleSetId:function(e){var n;r.setQueryParams(((n={})[r.QUERY_PARAM_KEYS.RULESET_ID]=e,n)),t({selectedRuleSetId:e})},toggleRuleTier:function(r){return t(function(t){return{currentRules:t.currentRules.map(function(t){return t.id===r?e.__assign(e.__assign({},t),{isOpen:!t.isOpen}):t})}})},deleteRule:function(r,n){return t(function(t){return{currentRules:t.currentRules.map(function(t){return t.id===r?e.__assign(e.__assign({},t),{rules:t.rules.filter(function(e){return e.id!==n}),ruleCount:t.ruleCount-1}):t})}})},setStations:function(e){return t({stations:e})},addStation:function(r){return t(function(t){return{stations:e.__spreadArray(e.__spreadArray([],t.stations,!0),[r],!1)}})},deleteStation:function(e){return t(function(t){return{stations:t.stations.filter(function(t){return t.stationId!==e}),selectedStationId:t.selectedStationId===e?null:t.selectedStationId}})},error:null,setError:function(e){return t({error:e})},tiers:[],setTiers:function(e){return t({tiers:e})}}});exports.INITIAL_RULE_SETS=n,exports.useLearningTemplateStore=u;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("zustand"),r=require("../hooks/useLearningTemplateQueryParams.js"),n={globalRuleSet:[],genreRuleSet:[],customRuleSet:[]},u=t.create(function(t){return{sidebarTab:"rule-sets",selectedRuleSetId:null,ruleSets:n,isStationModalOpen:!1,isILModalTriggered:"true"===r.getQueryParam(r.QUERY_PARAM_KEYS.OPEN_IL),isStationOnboardModalTriggered:"true"===r.getQueryParam(r.QUERY_PARAM_KEYS.ONBOARD_STATION),scopeTreeData:null,stations:[],selectedStationId:null,currentRules:[],createdVariantInfo:null,templateMap:{},setTemplateData:function(r,n){return t(function(t){var u;return{templateMap:e.__assign(e.__assign({},t.templateMap),(u={},u[r]=n,u))}})},setRuleSets:function(e){return t({ruleSets:e})},setScopeTreeData:function(e){return t({scopeTreeData:e})},setStationModalOpen:function(e){return t({isStationModalOpen:e})},setIsILModalTriggered:function(e){var n;r.setQueryParams(((n={})[r.QUERY_PARAM_KEYS.OPEN_IL]=e?"true":null,n)),t({isILModalTriggered:e})},setIsStationOnboardModalTriggered:function(e){var n;r.setQueryParams(((n={})[r.QUERY_PARAM_KEYS.ONBOARD_STATION]=e?"true":null,n)),t({isStationOnboardModalTriggered:e})},setInitialRules:function(e){return t({currentRules:e})},setCreatedVariantInfo:function(e){return t({createdVariantInfo:e})},resetCreatedVariantInfo:function(){return t({createdVariantInfo:null})},setSelectedRuleSetId:function(e){var n;r.setQueryParams(((n={})[r.QUERY_PARAM_KEYS.RULESET_ID]=e,n)),t({selectedRuleSetId:e})},toggleRuleTier:function(r){return t(function(t){return{currentRules:t.currentRules.map(function(t){return t.id===r?e.__assign(e.__assign({},t),{isOpen:!t.isOpen}):t})}})},deleteRule:function(r,n){return t(function(t){return{currentRules:t.currentRules.map(function(t){return t.id===r?e.__assign(e.__assign({},t),{rules:t.rules.filter(function(e){return e.id!==n}),ruleCount:t.ruleCount-1}):t})}})},setStations:function(e){return t({stations:e})},addStation:function(r){return t(function(t){return{stations:e.__spreadArray(e.__spreadArray([],t.stations,!0),[r],!1)}})},deleteStation:function(e){return t(function(t){return{stations:t.stations.filter(function(t){return t.stationId!==e}),selectedStationId:t.selectedStationId===e?null:t.selectedStationId}})},error:null,setError:function(e){return t({error:e})},tiers:[],setTiers:function(e){return t({tiers:e})},backwardCompatibility:!1,setBackwardCompatibility:function(e){return t({backwardCompatibility:e})},app_integration_id:null,setAppIntegrationId:function(e){return t({app_integration_id:e})},token:"",setToken:function(e){return t({token:e})},allScopeIds:[],setAllScopeIds:function(e){return t({allScopeIds:e})}}});exports.INITIAL_RULE_SETS=n,exports.useLearningTemplateStore=u;
|
|
2
2
|
//# sourceMappingURL=useLearningTemplateStore.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("zustand"),i=require("../apis/scopeApis.js"),t=require("./useLearningTemplateStore.js"),n=require("./useEnvStore.js"),s=function(e,r){return!!r&&function(e){return e?"string"==typeof e?[e]:[e._id,e.id,e.resourceId,e.resource_id].filter(function(e){return"string"==typeof e&&e.length>0}):[]}(e).includes(r)},o=r.create(function(r,o){return{accessData:[],isLoading:!1,error:null,fetchPermissions:function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var s,o,a;return e.__generator(this,function(e){switch(e.label){case 0:if(!t)return[2];r({isLoading:!0,error:null}),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.appsecApi.get("/users/me",{params:{appId:t,resourceId:n}})];case 2:return s=e.sent(),r({accessData:(null===(a=s.data)||void 0===a?void 0:a.data)||[],isLoading:!1}),[3,4];case 3:return o=e.sent(),console.error("Failed to fetch permissions:",o),r({error:o.message||"Failed to fetch permissions",isLoading:!1}),[3,4];case 4:return[2]}})})},hasPermission:function(e,r){var i;if(!t.useLearningTemplateStore.getState().backwardCompatibility)return!0;var a=o().accessData,u=null===(i=n.default.getState().rbacConfig)||void 0===i?void 0:i.applicationResourceId,c=function(e,r){return a.some(function(i){var t,n,o;return s(i.resourceId,r)&&null!==(o=null===(n=null===(t=i.role)||void 0===t?void 0:t.permissions)||void 0===n?void 0:n.some(function(r){return r.name===e}))&&void 0!==o&&o})};return!(!u||!c(e,u))||c(e,r)},hasGlobalPermission:function(e,r){return!t.useLearningTemplateStore.getState().backwardCompatibility||!!r&&(o().hasApplicationAccess(r)||o().hasPermission(e,r))},hasApplicationAccess:function(e){return!t.useLearningTemplateStore.getState().backwardCompatibility||!!e&&o().accessData.some(function(r){var i,t,n;return s(r.resourceId,e)&&null!==(n=null===(t=null===(i=r.role)||void 0===i?void 0:i.permissions)||void 0===t?void 0:t.some(function(e){return"ilotj.scope.access.application.user.add"===e.name}))&&void 0!==n&&n})},reset:function(){return r({accessData:[],isLoading:!1,error:null})}}});exports.usePermissionsStore=o;
|
|
2
|
+
//# sourceMappingURL=usePermissionsStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePermissionsStore.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});require("../../../node_modules/style-inject/dist/style-inject.es.js").default(".ScopeTree-module_treeContainer__IfdEO{display:flex;flex:1;flex-direction:column;gap:.5rem;height:100%;overflow:auto;padding:0 1.25rem 80px}.ScopeTree-module_treeContainer__IfdEO::-webkit-scrollbar{height:4px;width:4px}.ScopeTree-module_treeContainer__IfdEO::-webkit-scrollbar-thumb{background-color:#e5e7eb;border-radius:9999px}.ScopeTree-module_nodeWrapper__zt96G{display:flex;flex-direction:column;min-width:max-content;position:relative}.ScopeTree-module_childrenWrapper__uggxw{border-left:1px solid #e3e6ea;display:flex;flex-direction:column;gap:.5rem;margin-left:calc(var(--tree-depth, 0)*0px + .875rem);margin-top:.5rem;min-width:max-content;padding-left:1rem}.ScopeTree-module_nodeHeader__qxJAp{align-items:center;border:1px solid #0000;border-radius:.375rem;color:#19213d;cursor:pointer;display:flex;gap:.5rem;min-width:max-content;padding:.5rem;transition:all .2s}.ScopeTree-module_nodeHeader__qxJAp:hover{background-color:#f7f8fa}.ScopeTree-module_nodeHeaderSelected__UTNOH{border-color:#2563eb;color:#2563eb}.ScopeTree-module_nodeHeaderAncestor__Cjnkv{color:#2563eb}.ScopeTree-module_chevron__bmchk{align-items:center;color:#9ca3af;display:flex;flex-shrink:0;justify-content:center;transition:transform .2s}.ScopeTree-module_chevronExpanded__aZNQo{transform:rotate(180deg)}.ScopeTree-module_chevronHidden__dfrws{visibility:hidden;width:16px}.ScopeTree-module_folderIcon__93n7V{align-items:center;color:inherit;display:flex;flex-shrink:0;justify-content:center}.ScopeTree-module_nodeName__-o5cw{flex:1;font-size:.875rem;font-weight:500;white-space:nowrap}.ScopeTree-module_optionsButton__KD0N8{align-items:center;background:#0000;border:none;border-radius:.25rem;color:#64748b;cursor:pointer;display:flex;justify-content:center;padding:.25rem;transition:all .2s}.ScopeTree-module_optionsButton__KD0N8:hover{background-color:#e2e8f0;color:#19213d}.ScopeTree-module_pill__LfoFO{align-items:center;border:1px solid #0000;border-radius:.5rem;color:#64748b;cursor:pointer;display:flex;gap:.5rem;padding:.5rem 1rem;transition:all .2s}.ScopeTree-module_pill__LfoFO:hover{background-color:#f7f8fa;color:#19213d}.ScopeTree-module_pillActive__hV98M{background-color:#f0f5ff;border-color:#2563eb;color:#2563eb}.ScopeTree-module_pillActive__hV98M:hover{background-color:#e0ebff;color:#2563eb}.ScopeTree-module_pillIcon__qOzv0{align-items:center;display:flex;justify-content:center}.ScopeTree-module_pillLabel__-pnNE{flex:1;font-size:.875rem;font-weight:500}.ScopeTree-module_badge__0M-VE{align-items:center;background-color:#f1f5f9;border-radius:9999px;color:#475569;display:inline-flex;font-size:.625rem;font-weight:600;height:1.25rem;justify-content:center;min-width:1.25rem;padding:0 .375rem}.ScopeTree-module_badgeActive__lFpKZ{background-color:#2563eb;color:#fff}.ScopeTree-module_addAction__alNAW{align-items:center;background:#0000;border:none;border-radius:.375rem;color:#2563eb;cursor:pointer;display:flex;font-size:.875rem;font-weight:500;gap:.5rem;margin-top:.25rem;padding:.5rem;transition:all .2s;width:fit-content}.ScopeTree-module_addAction__alNAW:hover{background-color:#f0f5ff}.ScopeTree-module_addIcon__Rx81g{align-items:center;display:flex;justify-content:center}.ScopeTree-module_menuContainer__IyejG{display:inline-block;position:relative;text-align:left}.ScopeTree-module_menuDropdown__12xxX{background-color:#fff;border:1px solid #0000000d;border-radius:.375rem;box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -2px #0000000d;display:flex;flex-direction:column;outline:none;padding:.25rem 0;position:absolute;width:12rem;z-index:9999}.ScopeTree-module_menuDropdownTop__hkZpa{bottom:100%;margin-bottom:.25rem;right:0}.ScopeTree-module_menuDropdownBottom__w53jm{margin-top:.25rem;right:0;top:100%}.ScopeTree-module_menuOption__wcvl7{align-items:center;background:#0000;border:none;color:#374151;cursor:pointer;display:flex;font-size:.875rem;padding:.5rem 1rem;text-align:left;width:100%}.ScopeTree-module_menuOption__wcvl7:not(:disabled):hover{background-color:#f3f4f6;color:#111827}.ScopeTree-module_menuOptionDisabled__1FaQQ{color:#9ca3af;cursor:not-allowed;opacity:.6}.ScopeTree-module_menuOptionIcon__s2FWC{flex-shrink:0;margin-right:.75rem}.ScopeTree-module_tooltipWrapper__Jhz1M{position:relative;width:100%}.ScopeTree-module_tooltipContent__J02zm{animation:ScopeTree-module_tooltipFadeIn__of1bQ .15s ease-out;background-color:#2a3547;border-radius:.375rem;box-shadow:0 10px 15px -3px #0000001a;color:#fff;font-family:sans-serif;font-size:.875rem;max-width:280px;padding:.5rem .75rem;position:relative;z-index:9999}.ScopeTree-module_tooltipArrow__m9eHn{fill:#2a3547;position:absolute}@keyframes ScopeTree-module_tooltipFadeIn__of1bQ{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}.ScopeTree-module_highlightText__mHYra{background-color:#fde047;border-radius:.125rem;color:#111827}"),exports.default={treeContainer:"ScopeTree-module_treeContainer__IfdEO",nodeWrapper:"ScopeTree-module_nodeWrapper__zt96G",childrenWrapper:"ScopeTree-module_childrenWrapper__uggxw",nodeHeader:"ScopeTree-module_nodeHeader__qxJAp",nodeHeaderSelected:"ScopeTree-module_nodeHeaderSelected__UTNOH",nodeHeaderAncestor:"ScopeTree-module_nodeHeaderAncestor__Cjnkv",chevron:"ScopeTree-module_chevron__bmchk",chevronExpanded:"ScopeTree-module_chevronExpanded__aZNQo",chevronHidden:"ScopeTree-module_chevronHidden__dfrws",folderIcon:"ScopeTree-module_folderIcon__93n7V",nodeName:"ScopeTree-module_nodeName__-o5cw",optionsButton:"ScopeTree-module_optionsButton__KD0N8",pill:"ScopeTree-module_pill__LfoFO",pillActive:"ScopeTree-module_pillActive__hV98M",pillIcon:"ScopeTree-module_pillIcon__qOzv0",pillLabel:"ScopeTree-module_pillLabel__-pnNE",badge:"ScopeTree-module_badge__0M-VE",badgeActive:"ScopeTree-module_badgeActive__lFpKZ",addAction:"ScopeTree-module_addAction__alNAW",addIcon:"ScopeTree-module_addIcon__Rx81g",menuContainer:"ScopeTree-module_menuContainer__IyejG",menuDropdown:"ScopeTree-module_menuDropdown__12xxX",menuDropdownTop:"ScopeTree-module_menuDropdownTop__hkZpa",menuDropdownBottom:"ScopeTree-module_menuDropdownBottom__w53jm",menuOption:"ScopeTree-module_menuOption__wcvl7",menuOptionDisabled:"ScopeTree-module_menuOptionDisabled__1FaQQ",menuOptionIcon:"ScopeTree-module_menuOptionIcon__s2FWC",tooltipWrapper:"ScopeTree-module_tooltipWrapper__Jhz1M",tooltipContent:"ScopeTree-module_tooltipContent__J02zm",tooltipFadeIn:"ScopeTree-module_tooltipFadeIn__of1bQ",tooltipArrow:"ScopeTree-module_tooltipArrow__m9eHn",highlightText:"ScopeTree-module_highlightText__mHYra"};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});require("../../../node_modules/style-inject/dist/style-inject.es.js").default(".ScopeTree-module_treeContainer__IfdEO{display:flex;flex:1;flex-direction:column;gap:.5rem;height:100%;overflow:auto;padding:0 1.25rem 80px}.ScopeTree-module_treeContainer__IfdEO::-webkit-scrollbar{height:4px;width:4px}.ScopeTree-module_treeContainer__IfdEO::-webkit-scrollbar-thumb{background-color:#e5e7eb;border-radius:9999px}.ScopeTree-module_nodeWrapper__zt96G{display:flex;flex-direction:column;min-width:max-content;position:relative}.ScopeTree-module_childrenWrapper__uggxw{border-left:1px solid #e3e6ea;display:flex;flex-direction:column;gap:.5rem;margin-left:calc(var(--tree-depth, 0)*0px + .875rem);margin-top:.5rem;min-width:max-content;padding-left:1rem}.ScopeTree-module_nodeHeader__qxJAp{align-items:center;border:1px solid #0000;border-radius:.375rem;color:#19213d;cursor:pointer;display:flex;gap:.5rem;min-width:max-content;padding:.5rem;transition:all .2s}.ScopeTree-module_nodeHeader__qxJAp:hover{background-color:#f7f8fa}.ScopeTree-module_nodeHeaderSelected__UTNOH{border-color:#2563eb;color:#2563eb}.ScopeTree-module_nodeHeaderAncestor__Cjnkv{color:#2563eb}.ScopeTree-module_chevron__bmchk{align-items:center;border-radius:50px;color:#9ca3af;display:flex;flex-shrink:0;justify-content:center;padding:5px;transition:transform .2s;transition:background-color .3s ease-in-out}.ScopeTree-module_chevron__bmchk:hover{background:#e8ebf0}.ScopeTree-module_chevronExpanded__aZNQo{transform:rotate(180deg)}.ScopeTree-module_chevronHidden__dfrws{visibility:hidden;width:16px}.ScopeTree-module_folderIcon__93n7V{align-items:center;color:inherit;display:flex;flex-shrink:0;justify-content:center}.ScopeTree-module_nodeName__-o5cw{flex:1;font-size:.875rem;font-weight:500;white-space:nowrap}.ScopeTree-module_optionsButton__KD0N8{align-items:center;background:#0000;border:none;border-radius:.25rem;color:#64748b;cursor:pointer;display:flex;justify-content:center;padding:.25rem;transition:all .2s}.ScopeTree-module_optionsButton__KD0N8:hover{background-color:#e2e8f0;color:#19213d}.ScopeTree-module_pill__LfoFO{align-items:center;border:1px solid #0000;border-radius:.5rem;color:#64748b;cursor:pointer;display:flex;gap:.5rem;padding:.5rem 1rem;transition:all .2s}.ScopeTree-module_pill__LfoFO:hover{background-color:#f7f8fa;color:#19213d}.ScopeTree-module_pillActive__hV98M{background-color:#f0f5ff;border-color:#2563eb;color:#2563eb}.ScopeTree-module_pillActive__hV98M:hover{background-color:#e0ebff;color:#2563eb}.ScopeTree-module_pillIcon__qOzv0{align-items:center;display:flex;justify-content:center}.ScopeTree-module_pillLabel__-pnNE{flex:1;font-size:.875rem;font-weight:500}.ScopeTree-module_badge__0M-VE{align-items:center;background-color:#f1f5f9;border-radius:9999px;color:#475569;display:inline-flex;font-size:.625rem;font-weight:600;height:1.25rem;justify-content:center;min-width:1.25rem;padding:0 .375rem}.ScopeTree-module_badgeActive__lFpKZ{background-color:#2563eb;color:#fff}.ScopeTree-module_addAction__alNAW{align-items:center;background:#0000;border:none;border-radius:.375rem;color:#2563eb;cursor:pointer;display:flex;font-size:.875rem;font-weight:500;gap:.5rem;margin-top:.25rem;padding:.5rem;transition:all .2s;width:fit-content}.ScopeTree-module_addAction__alNAW:hover{background-color:#f0f5ff}.ScopeTree-module_addIcon__Rx81g{align-items:center;display:flex;justify-content:center}.ScopeTree-module_menuContainer__IyejG{display:inline-block;position:relative;text-align:left}.ScopeTree-module_menuDropdown__12xxX{background-color:#fff;border:1px solid #0000000d;border-radius:.375rem;box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -2px #0000000d;display:flex;flex-direction:column;outline:none;padding:.25rem 0;position:absolute;width:12rem;z-index:9999}.ScopeTree-module_menuDropdownTop__hkZpa{bottom:100%;margin-bottom:.25rem;right:0}.ScopeTree-module_menuDropdownBottom__w53jm{margin-top:.25rem;right:0;top:100%}.ScopeTree-module_menuOption__wcvl7{align-items:center;background:#0000;border:none;color:#374151;cursor:pointer;display:flex;font-size:.875rem;padding:.5rem 1rem;text-align:left;width:100%}.ScopeTree-module_menuOption__wcvl7:not(:disabled):hover{background-color:#f3f4f6;color:#111827}.ScopeTree-module_menuOptionDisabled__1FaQQ{color:#9ca3af;cursor:not-allowed;opacity:.6}.ScopeTree-module_menuOptionIcon__s2FWC{flex-shrink:0;margin-right:.75rem}.ScopeTree-module_tooltipWrapper__Jhz1M{position:relative;width:100%}.ScopeTree-module_tooltipContent__J02zm{animation:ScopeTree-module_tooltipFadeIn__of1bQ .15s ease-out;background-color:#2a3547;border-radius:.375rem;box-shadow:0 10px 15px -3px #0000001a;color:#fff;font-family:sans-serif;font-size:.875rem;max-width:280px;padding:.5rem .75rem;position:relative;z-index:9999}.ScopeTree-module_tooltipArrow__m9eHn{fill:#2a3547;position:absolute}@keyframes ScopeTree-module_tooltipFadeIn__of1bQ{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}.ScopeTree-module_highlightText__mHYra{background-color:#fde047;border-radius:.125rem;color:#111827}"),exports.default={treeContainer:"ScopeTree-module_treeContainer__IfdEO",nodeWrapper:"ScopeTree-module_nodeWrapper__zt96G",childrenWrapper:"ScopeTree-module_childrenWrapper__uggxw",nodeHeader:"ScopeTree-module_nodeHeader__qxJAp",nodeHeaderSelected:"ScopeTree-module_nodeHeaderSelected__UTNOH",nodeHeaderAncestor:"ScopeTree-module_nodeHeaderAncestor__Cjnkv",chevron:"ScopeTree-module_chevron__bmchk",chevronExpanded:"ScopeTree-module_chevronExpanded__aZNQo",chevronHidden:"ScopeTree-module_chevronHidden__dfrws",folderIcon:"ScopeTree-module_folderIcon__93n7V",nodeName:"ScopeTree-module_nodeName__-o5cw",optionsButton:"ScopeTree-module_optionsButton__KD0N8",pill:"ScopeTree-module_pill__LfoFO",pillActive:"ScopeTree-module_pillActive__hV98M",pillIcon:"ScopeTree-module_pillIcon__qOzv0",pillLabel:"ScopeTree-module_pillLabel__-pnNE",badge:"ScopeTree-module_badge__0M-VE",badgeActive:"ScopeTree-module_badgeActive__lFpKZ",addAction:"ScopeTree-module_addAction__alNAW",addIcon:"ScopeTree-module_addIcon__Rx81g",menuContainer:"ScopeTree-module_menuContainer__IyejG",menuDropdown:"ScopeTree-module_menuDropdown__12xxX",menuDropdownTop:"ScopeTree-module_menuDropdownTop__hkZpa",menuDropdownBottom:"ScopeTree-module_menuDropdownBottom__w53jm",menuOption:"ScopeTree-module_menuOption__wcvl7",menuOptionDisabled:"ScopeTree-module_menuOptionDisabled__1FaQQ",menuOptionIcon:"ScopeTree-module_menuOptionIcon__s2FWC",tooltipWrapper:"ScopeTree-module_tooltipWrapper__Jhz1M",tooltipContent:"ScopeTree-module_tooltipContent__J02zm",tooltipFadeIn:"ScopeTree-module_tooltipFadeIn__of1bQ",tooltipArrow:"ScopeTree-module_tooltipArrow__m9eHn",highlightText:"ScopeTree-module_highlightText__mHYra"};
|
|
2
2
|
//# sourceMappingURL=ScopeTree.module.css.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),r=require("react"),n=require("lucide-react");require("../../../features/IL-OTJ/_components/atoms/Textarea/Textarea.js"),require("../../../features/IL-OTJ/_components/InputDataReasoningCard.js"),require("../../../features/IL-OTJ/_components/TooltipComponent.js");var a=require("../../../features/IL-OTJ/_components/templates/TemplatesMap/templatesMap.js");require("../../../features/IL-OTJ/store/CitationsContext.js"),require("@mui/material"),require("uuid"),require("@mui/material/Tooltip"),require("react-markdown"),require("rehype-raw"),require("axios"),require("@e-llm-studio/streaming-response"),require("@e-llm-studio/watch-me-work"),require("../../../features/IL-OTJ/_components/ChatComponents/ChatHeader.js"),require("remark-gfm"),require("../../../features/IL-OTJ/_components/MarkdownComponents/MarkdownElements.js"),require("../../../features/IL-OTJ/_components/CitationLink.js"),require("@e-llm-studio/citation"),require("../../../features/IL-OTJ/_components/templates/RuleComparison/RuleComparison.js"),require("../../../features/LearningManagement/store/useLearningTemplateStore.js"),require("primereact/toast"),require("../../../features/LearningManagement/apis/scopeApis.js"),require("../../../features/LearningManagement/components/ToolTip.js"),require("../../../features/LearningManagement/store/useAuthStore.js"),require("date-fns"),require("framer-motion"),require("@mui/icons-material/Close");var o=require("../../../features/IL-OTJ/_components/AccordianSection.js"),i=require("../../../features/IL-OTJ/ILOTJ.js");require("../../../features/LearningManagement/store/useConfigStore.js"),require("../../../features/LearningManagement/config.js"),require("@radix-ui/react-tooltip"),require("../../../features/LearningManagement/components/StationOnboarding/InputField.js"),require("../../../features/LearningManagement/store/useEnvStore.js"),require("react-router-dom");var s={order_rules:{enabled:!1,global_min_separation_seconds:0},advertiser_rules:{enabled:!1,global_min_separation_seconds:0},inventory_rules:{respect_inventory_code:!1},break_code_rules:{respect_break_code:!1},is_default_enabled:!1},l=[{label:"Global Scope",value:"global"},{label:"Genre Scope",value:"genre"},{label:"Custom Scope",value:"custom"}],u=["Tier 1"];exports.default=function(){var c=r.useState(!0),p=c[0],d=c[1],_=r.useState(""),m=_[0],f=_[1],g=r.useState(""),b=g[0],v=g[1],h=r.useState({station:"",tiers:["Tier 1"]}),y=h[0],T=h[1],q=r.useState([]),L=q[0],k=q[1],C=r.useState([]),j=C[0],x=C[1],S=r.useState(s),A=S[0],w=S[1],I=r.useCallback(function(t,r){T(function(n){var a;return e.__assign(e.__assign({},n),((a={})[t]=r,a))})},[]),O=r.useCallback(function(t,r){w(function(n){var a=e.__assign({},n);switch(t){case"order_rules":case"advertiser_rules":a[t]="boolean"==typeof r?e.__assign(e.__assign({},n[t]),{enabled:r}):{enabled:r.enabled,global_min_separation_seconds:r.global_min_separation_seconds};break;case"inventory_rules":a.inventory_rules={respect_inventory_code:"boolean"==typeof r?r:r.respect_inventory_code};break;case"break_code_rules":a.break_code_rules={respect_break_code:"boolean"==typeof r?r:r.respect_break_code};break;case"is_default_enabled":a.is_default_enabled="boolean"==typeof r?r:!!r}return a})},[]),M=function(t){t(function(t){return e.__spreadArray(e.__spreadArray([],t,!0),[{id:Date.now(),text:"",reasoning:""}],!1)})},J=function(e,t){e(function(e){return e.filter(function(e){return e.id!==t})})},N=function(t,r,n){t(function(t){return t.map(function(t){return String(t.id)===String(r)?e.__assign(e.__assign({},t),{text:n}):t})})},D=[e.__assign({key:"order_rules",label:"Order"},A.order_rules),e.__assign({key:"advertiser_rules",label:"Advertiser"},A.advertiser_rules)],E=[{key:"inventory_rules",label:"Inventory code",enabled:A.inventory_rules.respect_inventory_code},{key:"break_code_rules",label:"Break Code",enabled:A.break_code_rules.respect_break_code},{key:"is_default_enabled",label:"Default Variant",enabled:A.is_default_enabled}];return t.jsx(i.default,{open:p,closeFunction:function(){return d(!1)},chatAssistantName:"defaultAssistant",organizationName:"techolution",baseUrl:"https://devllmstudio.creativeworkspace.ai",baseWebsocketUrl:"wss://devllmstudio.creativeworkspace.ai/graphql",ThinkingBulbIconComponent:t.jsx(n.Lightbulb,{}),customSections:t.jsx(t.Fragment,{}),isUseNormalChat:!0,chatTitle:"Create New Learning",formTitle:"Learning Details",initialChatMessage:"Hey! How can I assist you?",template:a.TemplateList.BaseTemplate,templateProps:{state:{title:m,description:b,scopeData:y,whenToApplyConditions:L,whenNotToApplyConditions:j,configData:A,citations:[],citation:{}},handlers:{onTitleChange:function(e){var t,r;return f(null!==(r=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)&&void 0!==r?r:e)},onDescriptionChange:function(e){var t,r;return v(null!==(r=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)&&void 0!==r?r:e)},onAddWhenToApply:function(){return M(k)},onRemoveWhenToApply:function(e){return J(k,e)},onEditWhenToApply:function(e,t){return N(k,e,t)},onAddWhenNotToApply:function(){return M(x)},onRemoveWhenNotToApply:function(e){return J(x,e)},onEditWhenNotToApply:function(e,t){return N(x,e,t)},onScopeChange:I,onConfigChange:O},uiState:{showScope:!1,showConfiguration:!0,titleLabel:"Main Rule Name",scopeLabel:"Define Scope",tierLabel:"Select Tier",descriptionLabel:"Learning Explanation",whenToApplyLabel:"Trigger Events (When to Apply)",whenNotToApplyLabel:"Exclusion Events (When NOT to Apply)",configLabel:"Advanced Settings",stationOptions:l,tierOptions:u,separationItems:D,toggles:E},customNodes:{afterDescription:t.jsx(o.default,e.__assign({title:{type:"other",label:"Extra Context Panel"}},{children:t.jsx("p",e.__assign({style:{padding:"12px",fontSize:"14px",color:"#64748b"}},{children:"Because you decoupled the template, I can inject anything I want here without touching BaseTemplate logic!"}))})),afterTitle:t.jsxs("div",e.__assign({style:{marginBottom:"12px",padding:"8px",backgroundColor:"#f0f4ff",borderRadius:"4px"}},{children:[t.jsx("strong",{children:"Tip:"})," Use a clear and descriptive title for your rule to make it easily identifiable later."]}))}}})};
|
|
2
|
+
//# sourceMappingURL=DefaultTeachMeRenderer.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),r=require("lucide-react");require("../../../features/IL-OTJ/_components/atoms/Textarea/Textarea.js"),require("../../../features/IL-OTJ/_components/InputDataReasoningCard.js"),require("../../../features/IL-OTJ/_components/TooltipComponent.js");var a=require("../../../features/IL-OTJ/_components/templates/TemplatesMap/templatesMap.js");require("../../../features/IL-OTJ/store/CitationsContext.js"),require("@mui/material"),require("uuid"),require("@mui/material/Tooltip"),require("react-markdown"),require("rehype-raw"),require("axios"),require("@e-llm-studio/streaming-response"),require("@e-llm-studio/watch-me-work"),require("../../../features/IL-OTJ/_components/ChatComponents/ChatHeader.js"),require("remark-gfm"),require("../../../features/IL-OTJ/_components/MarkdownComponents/MarkdownElements.js"),require("../../../features/IL-OTJ/_components/CitationLink.js"),require("@e-llm-studio/citation"),require("../../../features/IL-OTJ/_components/templates/RuleComparison/RuleComparison.js"),require("../../../features/LearningManagement/store/useLearningTemplateStore.js"),require("primereact/toast"),require("../../../features/LearningManagement/apis/scopeApis.js"),require("../../../features/LearningManagement/components/ToolTip.js"),require("../../../features/LearningManagement/store/useAuthStore.js"),require("date-fns"),require("framer-motion"),require("@mui/icons-material/Close");var o=require("../../../features/IL-OTJ/_components/AccordianSection.js"),i=require("../../../features/IL-OTJ/ILOTJ.js");require("../../../features/LearningManagement/store/useConfigStore.js"),require("../../../features/LearningManagement/config.js"),require("@radix-ui/react-tooltip"),require("../../../features/LearningManagement/components/StationOnboarding/InputField.js"),require("../../../features/LearningManagement/store/useEnvStore.js"),require("react-router-dom");var s={order_rules:{enabled:!1,global_min_separation_seconds:0},advertiser_rules:{enabled:!1,global_min_separation_seconds:0},inventory_rules:{respect_inventory_code:!1},break_code_rules:{respect_break_code:!1},is_default_enabled:!1},u=[{label:"Global Scope",value:"global"},{label:"Genre Scope",value:"genre"},{label:"Custom Scope",value:"custom"}],l=["Tier 1"];exports.default=function(){var c=n.useState(!0),d=c[0],p=c[1],_=n.useState(""),m=_[0],f=_[1],b=n.useState(""),g=b[0],y=b[1],h=n.useState({station:"",tiers:["Tier 1"]}),v=h[0],T=h[1],q=n.useState([]),k=q[0],L=q[1],C=n.useState([]),j=C[0],S=C[1],w=n.useState(s),A=w[0],x=w[1],I=n.useCallback(function(t,n){T(function(r){var a;return e.__assign(e.__assign({},r),((a={})[t]=n,a))})},[]),O=n.useCallback(function(t,n){x(function(r){var a=e.__assign({},r);switch(t){case"order_rules":case"advertiser_rules":a[t]="boolean"==typeof n?e.__assign(e.__assign({},r[t]),{enabled:n}):{enabled:n.enabled,global_min_separation_seconds:n.global_min_separation_seconds};break;case"inventory_rules":a.inventory_rules={respect_inventory_code:"boolean"==typeof n?n:n.respect_inventory_code};break;case"break_code_rules":a.break_code_rules={respect_break_code:"boolean"==typeof n?n:n.respect_break_code};break;case"is_default_enabled":a.is_default_enabled="boolean"==typeof n?n:!!n}return a})},[]),G=function(t){t(function(t){return e.__spreadArray(e.__spreadArray([],t,!0),[{id:Date.now(),text:"",reasoning:""}],!1)})},M=function(e,t){e(function(e){return e.filter(function(e){return e.id!==t})})},J=function(t,n,r){t(function(t){return t.map(function(t){return String(t.id)===String(n)?e.__assign(e.__assign({},t),{text:r}):t})})},N=[e.__assign({key:"order_rules",label:"Order"},A.order_rules),e.__assign({key:"advertiser_rules",label:"Advertiser"},A.advertiser_rules)],W=[{key:"inventory_rules",label:"Inventory code",enabled:A.inventory_rules.respect_inventory_code},{key:"break_code_rules",label:"Break Code",enabled:A.break_code_rules.respect_break_code},{key:"is_default_enabled",label:"Default Variant",enabled:A.is_default_enabled}],D={"Add Guideline":"I would want to add a separation rule","Search Guideline":"I would want to set a max priority rule","Type your query":"I would want to add a break code matching rule"},R="<p><span>Hi! 👋 I'm your Instant Learning Concierge.</span>\n <span>How would you like to get started? You can select an option below or describe the Guideline you’d like to create.</span>\n ".concat(["Add Guideline","Search Guideline","Type your query"].map(function(e){return'<button class="clickable-button" data-value="'.concat(D[e],'">').concat(e,"</button>")}).join(""),"</p>");return t.jsx(i.default,{open:d,closeFunction:function(){return p(!1)},chatAssistantName:"defaultAssistant",organizationName:"techolution",baseUrl:"https://devllmstudio.creativeworkspace.ai",baseWebsocketUrl:"wss://devllmstudio.creativeworkspace.ai/graphql",ThinkingBulbIconComponent:t.jsx(r.Lightbulb,{}),customSections:t.jsx(t.Fragment,{}),isUseNormalChat:!0,chatTitle:"Create New Guideline",formTitle:"Guideline Details",initialChatMessage:R,template:a.TemplateList.BaseTemplate,templateProps:{state:{title:m,description:g,scopeData:v,whenToApplyConditions:k,whenNotToApplyConditions:j,configData:A,citations:[],citation:{}},handlers:{onTitleChange:function(e){var t,n;return f(null!==(n=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)&&void 0!==n?n:e)},onDescriptionChange:function(e){var t,n;return y(null!==(n=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)&&void 0!==n?n:e)},onAddWhenToApply:function(){return G(L)},onRemoveWhenToApply:function(e){return M(L,e)},onEditWhenToApply:function(e,t){return J(L,e,t)},onAddWhenNotToApply:function(){return G(S)},onRemoveWhenNotToApply:function(e){return M(S,e)},onEditWhenNotToApply:function(e,t){return J(S,e,t)},onScopeChange:I,onConfigChange:O},uiState:{showScope:!1,showConfiguration:!1,titleLabel:"Guideline Name",scopeLabel:"Define Scope",tierLabel:"Select Tier",descriptionLabel:"Guideline Description",whenToApplyLabel:"When to apply this Guideline (When to Apply)",whenNotToApplyLabel:"When not to apply this Guideline (When NOT to Apply)",configLabel:"Advanced Settings",stationOptions:u,tierOptions:l,separationItems:N,toggles:W},customNodes:{afterTitle:t.jsx(o.default,e.__assign({title:{type:"other",label:"Guideline"}},{children:t.jsx("p",e.__assign({style:{padding:"12px",fontSize:"14px",color:"#64748b"}},{children:"HealthCare"}))})),top:t.jsxs("div",e.__assign({style:{marginBottom:"12px",padding:"8px",backgroundColor:"#f0f4ff",borderRadius:"4px"}},{children:[t.jsx("strong",{children:"Guideline Template:"})," This is an ILOTJ TeachMe customized for Guideline Value Type"]}))}}})};
|
|
2
|
+
//# sourceMappingURL=GuidelinesTeachMeRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GuidelinesTeachMeRenderer.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../features/LearningManagement/components/InstantLearningModal.js");exports.default=function(i){var a=i.pluginPayload||{},n=a.editingRule,r=a.editingTier,o=a.editingVariants,d=a.focusedVariantIndex,u=a.setFocusedVariantIndex,c=a.triggerAddVariant,s=a.triggerFixGaps,l=a.copiedRule,p=a.copiedSourceTier,g=a.copiedTargetTier,I=a.initialDraftMessage,m=a.app_integration_id,w=a.modeId,x={"Separation rule":"I would want to add a separation rule","Max priority rule":"I would want to set a max priority rule","Break code matching":"I would want to add a break code matching rule","Inventory code matching":"I would want to add a inventory window matching rule","Enter a rule description":"I want to add a rule description","Tester Genie":"Loading prompt..."},y="<p><span>Hi! 👋 I'm your Instant Learning Concierge.</span>\n <span>How would you like to get started? You can select an option below or describe the rule you’d like to create.</span>\n ".concat(["Separation rule","Max priority rule","Break code matching","Inventory code matching","Enter a rule description","Tester Genie"].map(function(e){return'<button class="clickable-button" data-value="'.concat(x[e],'">').concat(e,"</button>")}).join(""),"</p>");return e.jsx(t.default,{isOpen:i.isOpen,onClose:i.onClose,initialScope:i.initialScope,ruleSet:i.ruleSet,editingRule:n,editingTier:r,editingVariants:o,focusedVariantIndex:d,setFocusedVariantIndex:u,triggerAddVariant:c,triggerFixGaps:s,copiedRule:l,copiedSourceTier:p,copiedTargetTier:g,initialDraftMessage:I,initialChatMessage:y,applicationIntegrationId:m,modeId:w})};
|
|
2
|
+
//# sourceMappingURL=RadioTrafficLearningRenderer.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as n,jsxs as o}from"react/jsx-runtime";import{Dialog as t,DialogContent as i,Box as a}from"@mui/material";import s,{useState as r,useEffect as l,useCallback as d}from"react";import
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as n,jsxs as o}from"react/jsx-runtime";import{Dialog as t,DialogContent as i,Box as a}from"@mui/material";import s,{useState as r,useEffect as l,useCallback as d}from"react";import u from"./_components/ChatComponents/ChatComponent.js";import c from"./_components/ILPopup.js";import m from"./_components/VariantLoadingOverlay.js";import h from"./_components/templates/RuleComparison/RuleComparison.js";import g from"./_components/templates/RuleComparison/AgentComposerRuleComparison.js";import p from"./_components/ChatComponents/NormalChat.js";var f=function(f){var C=f.open,v=f.chatAssistantName,S=f.organizationName,x=f.baseUrl,b=f.baseWebsocketUrl,k=f.closeFunction,w=f.ThinkingBulbIconComponent,M=f.customSections,y=f.customMetaData,R=f.chatTitle,I=void 0===R?"Instant Learning On-The-Job":R,F=f.formTitle,T=void 0===F?"Instant Learning On-The-Job Form":F,V=f.onSave,A=f.headerMessageHandlers,L=f.aiResponse,D=f.setAIResponse,W=f.width,E=void 0===W?"90vw":W,B=f.height,P=void 0===B?"90vh":B,z=f.sendMessageInChat,O=void 0===z?"":z,N=f.setSendMessageInChat,j=f.validateCustom,U=f.onResetChat,J=f.template,_=f.templateProps,q=f.initialChatMessage,H=f.setCitations,G=f.isLoading,X=void 0!==G&&G,Y=f.isLocked,K=void 0!==Y&&Y,Q=f.saveButtonConfig,Z=void 0===Q?{label:"Save Learning",loadingLabel:"Saving Learning..."}:Q,$=f.saveButtonColor,ee=f.saveWithoutValBtnConfig,ne=void 0===ee?{label:"Save Without Validation",loadingLabel:"Saving Without Validation..."}:ee,oe=f.textareaPlaceholder,te=f.setCurrentRequestId,ie=f.showSavedMessage,ae=void 0!==ie&&ie,se=f.savedMessage,re=void 0===se?"Thank you teacher for teaching me, your learning has been saved successfully.":se,le=f.isError,de=void 0!==le&&le,ue=f.errorMessage,ce=void 0===ue?"I'm sorry, I couldn't save your changes. Please try again.":ue,me=f.isSaving,he=void 0!==me&&me,ge=f.isAiStreaming,pe=f.setIsAiStreaming,fe=f.showConfirmReset,Ce=void 0!==fe&&fe,ve=f.setShowConfirmReset,Se=f.confirmReset,xe=f.isLoadingVariants,be=f.isFormDirty,ke=f.onResetRequest,we=f.mainText,Me=void 0===we?"Adding a variant":we,ye=f.subText,Re=void 0===ye?"This may take a moment as we update the learning with the new variant.":ye,Ie=f.showComparison,Fe=void 0!==Ie&&Ie,Te=f.setShowComparison,Ve=f.showAgentComposerRuleComparison,Ae=void 0!==Ve&&Ve,Le=f.setShowAgentComposerRuleComparison,De=f.isFetchingComparison,We=f.handleOpenComparison,Ee=f.proposedRule,Be=f.variants,Pe=f.onAddAsVariant,ze=f.isCopyEnabled,Oe=f.showSaveWithoutValidation,Ne=void 0!==Oe&&Oe,je=f.onSaveWithoutValidation,Ue=f.onComparisonLinkClick,Je=f.targetComparisonVariantId,_e=f.highlightedComparisonField,qe=f.onSubmitFeedback,He=f.isUseNormalChat,Ge=void 0!==He&&He,Xe=f.userDetails,Ye=f.handleGlobalClickCapture,Ke=f.isGlobalEditActive,Qe=f.socketTimeOutInMilliSeconds,Ze=f.initialDraftMessage,$e=f.onValidateSession,en=r(C),nn=en[0],on=en[1],tn=r(!1);tn[0];var an=tn[1],sn=r(!1),rn=sn[0],ln=sn[1],dn=r(!1),un=dn[0];dn[1];var cn=r(45),mn=cn[0],hn=cn[1],gn=r("right"),pn=gn[0],fn=gn[1],Cn=s.useRef(pn),vn=r(!1),Sn=vn[0],xn=vn[1],bn=r(0),kn=bn[0],wn=bn[1],Mn=r(40),yn=Mn[0],Rn=Mn[1];l(function(){Cn.current=pn},[pn]),l(function(){on(C)},[C]);var In=d(function(e){e.preventDefault(),xn(!0),wn(e.clientX),Rn(mn)},[mn]),Fn=d(function(e){if(Sn){var n=document.querySelector("[data-dialog-content]");if(n){var o=n.getBoundingClientRect(),t=(e.clientX-kn)/o.width*100,i=Math.max(20,Math.min(80,yn+t));hn(i),i>yn&&fn("right"),i<yn&&fn("left")}}},[Sn,kn,yn]),Tn=d(function(){xn(!1)},[]);l(function(){if(Sn)return document.addEventListener("mousemove",Fn),document.addEventListener("mouseup",Tn),function(){document.removeEventListener("mousemove",Fn),document.removeEventListener("mouseup",Tn)}},[Sn,Fn,Tn]);var Vn=function(e,n){K&&"backdropClick"===n||("escapeKeyDown"!==n&&"manualClose"!==n||!(null==be?void 0:be())?(on(!1),k()):null==ke||ke())},An=d(function(e){hn(function(n){var o;if("number"==typeof e)return e>n&&fn("right"),e<n&&fn("left"),e;var t=Cn.current,i=null!==(o={20:30,30:"left"===t?20:50,50:"left"===t?30:75,75:"left"===t?50:100,100:75}[n])&&void 0!==o?o:40;return 100===i&&fn("left"),20===i&&fn("right"),i})},[]),Ln=d(function(){We&&(An(30),We())},[An,We]);return n(t,e({open:nn,onClose:Vn,maxWidth:!1,fullWidth:!0,PaperProps:{sx:{width:E,height:P,display:"flex",flexDirection:"column",padding:0,margin:0,maxWidth:"100vw",borderRadius:"10px"}}},{children:o(i,e({"data-dialog-content":!0,onClickCapture:Ye,sx:{flex:1,overflow:"hidden",display:"flex",flexDirection:"row",gap:0,padding:0,fontFamily:'"Plus Jakarta Sans", sans-serif',"& *":{fontFamily:'"Plus Jakarta Sans", sans-serif !important'}}},{children:[n(a,e({sx:{width:"".concat(mn,"%"),maxWidth:"".concat(mn,"%"),transition:Sn?"none":"width 0.3s ease-in-out, max-width 0.3s ease-in-out",bgcolor:"#ffffff",p:0,display:0===mn?"none":"flex",flexDirection:"column"}},{children:Ge?n(p,{chatAssistantName:v,organizationName:S,baseUrl:x,baseWebsocketUrl:b,setIsNewChatClicked:an,ThinkingBulbIconComponent:w,isFormSaveClicked:rn,setIsFormSavedClicked:ln,onResetLearningData:function(){},sendMessageInChat:O,setSendMessageInChat:N,isFormValidating:un,chatTitle:I,customMetaData:y,headerMessageHandlers:A,aiResponse:L,setAIResponse:D,onResetChat:U,initialChatMessage:q,onSave:V,chatSize:mn,movingTowards:pn,setChatSize:An,setCitations:H,textareaPlaceholder:oe,setCurrentRequestId:te,showSavedMessage:ae,savedMessage:re,isError:de,errorMessage:ce,isSaving:he,onStreamingStateChange:pe,onViewComparison:Ln,isCopyEnabled:ze,onComparisonLinkClick:Ue,onSubmitFeedback:qe}):n(u,{chatAssistantName:v,organizationName:S,baseUrl:x,baseWebsocketUrl:b,setIsNewChatClicked:an,ThinkingBulbIconComponent:w,isFormSaveClicked:rn,setIsFormSavedClicked:ln,onResetLearningData:function(){},sendMessageInChat:O,setSendMessageInChat:N,isFormValidating:un,chatTitle:I,customMetaData:y,headerMessageHandlers:A,aiResponse:L,setAIResponse:D,onResetChat:U,initialChatMessage:q,onSave:V,chatSize:mn,movingTowards:pn,setChatSize:An,setCitations:H,textareaPlaceholder:oe,setCurrentRequestId:te,showSavedMessage:ae,savedMessage:re,isError:de,errorMessage:ce,isSaving:he,onStreamingStateChange:pe,onViewComparison:Ln,isCopyEnabled:ze,onComparisonLinkClick:Ue,onSubmitFeedback:qe,userDetails:Xe,isGlobalEditActive:Ke,socketTimeOutInMilliSeconds:Qe,initialDraftMessage:Ze,onValidateSession:$e,onCloseSessionModal:Se})})),n(a,{sx:{width:"2px",cursor:"col-resize",backgroundColor:Sn?"#1976d2":"#e0e0e0",transition:"background-color 0.2s ease","&:hover":{backgroundColor:"#1976d2"},flexShrink:0},onMouseDown:In}),o(a,e({sx:{width:"".concat(100-mn,"%"),maxWidth:"".concat(100-mn,"%"),transition:Sn?"none":"width 0.3s ease-in-out, max-width 0.3s ease-in-out",display:100===mn?"none":"flex",flexDirection:"column",overflowY:"hidden",position:"relative"}},{children:[n(m,{isLoading:De||!1,mainText:"Fetching differences between rules",subText:"This may take a moment..."}),n(m,{isLoading:xe||!1,mainText:Me,subText:Re}),Ae?n(g,{proposedRule:Ee,variants:Be,onSelectVariant:function(e){console.log("Selected Variant ID:",e.id)},onAddAsVariant:function(){null==Pe||Pe(),An(40),null==Le||Le(!1)},onSkip:function(){An(40),null==Le||Le(!1)},onBack:function(){An(40),null==Le||Le(!1)},targetVariantId:Je,highlightedField:_e}):Fe?n(h,{proposedRule:Ee,variants:Be,onSelectVariant:function(e){console.log("Selected Variant ID:",e.id)},onAddAsVariant:function(){null==Pe||Pe(),An(40),null==Te||Te(!1)},onSkip:function(){An(40),null==Te||Te(!1)},onBack:function(){An(40),null==Te||Te(!1)},targetVariantId:Je,highlightedField:_e}):n(c,{setIsFormSavedClicked:ln,customSections:M,onSave:V,formHeader:T,onClose:function(){return Vn(0,"manualClose")},validateCustom:j,template:J,templateProps:_,isLoading:X,isAiStreaming:ge,saveButtonConfig:Z,saveButtonColor:$,showSaveWithoutValidation:Ne,saveWithoutValBtnConfig:ne,onSaveWithoutValidation:je}),n(t,e({open:Ce,onClose:function(){return null==ve?void 0:ve(!1)},PaperProps:{sx:{borderRadius:"12px",padding:"8px",maxWidth:"400px"}}},{children:o(a,e({sx:{p:3,textAlign:"center",fontFamily:"'Plus Jakarta Sans', sans-serif"}},{children:[n("h3",e({style:{fontSize:"18px",fontWeight:600,color:"#0F172A",marginBottom:"6px"}},{children:"Exit Teach Me OTJ?"})),n("p",e({style:{fontSize:"14px",color:"#64748B",lineHeight:"1.5",marginBottom:"10px"}},{children:"Exiting will discard any unsaved changes and end your session."})),o(a,e({sx:{display:"flex",gap:2,justifyContent:"center"}},{children:[n("button",e({onClick:function(){return null==ve?void 0:ve(!1)},style:{flex:1,padding:"10px 16px",cursor:"pointer",backgroundColor:"white",border:"1px solid #E2E8F0",borderRadius:"8px",fontSize:"14px",fontWeight:500,color:"#475569",transition:"all 0.2s"},onMouseOver:function(e){return e.currentTarget.style.backgroundColor="#F8FAFC"},onMouseOut:function(e){return e.currentTarget.style.backgroundColor="white"}},{children:"Cancel"})),n("button",e({onClick:Se,style:{flex:1,padding:"10px 16px",backgroundColor:"#EF4444",color:"white",border:"none",borderRadius:"8px",fontSize:"14px",fontWeight:500,cursor:"pointer",transition:"background-color 0.2s"},onMouseOver:function(e){return e.currentTarget.style.backgroundColor="#DC2626"},onMouseOut:function(e){return e.currentTarget.style.backgroundColor="#EF4444"}},{children:"Yes, Discard"}))]}))]}))}))]}))]}))}))};export{f as default};
|
|
2
2
|
//# sourceMappingURL=ILOTJ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as o}from"tslib";import"react/jsx-runtime";import"@mui/material";import"lucide-react";import"react";import"uuid";import"./_components/templates/TemplatesMap/templatesMap.js";import"@mui/material/Tooltip";import"react-markdown";import"rehype-raw";import r from"axios";import"@e-llm-studio/streaming-response";import"@e-llm-studio/watch-me-work";import"./_components/ChatComponents/ChatHeader.js";import"remark-gfm";import"./_components/MarkdownComponents/MarkdownElements.js";import"./_components/CitationLink.js";import"@e-llm-studio/citation";import"./store/CitationsContext.js";import"
|
|
1
|
+
import{__awaiter as t,__generator as o}from"tslib";import"react/jsx-runtime";import"@mui/material";import"lucide-react";import"react";import"uuid";import"./_components/templates/TemplatesMap/templatesMap.js";import"@mui/material/Tooltip";import"react-markdown";import"rehype-raw";import r from"axios";import"@e-llm-studio/streaming-response";import"@e-llm-studio/watch-me-work";import"./_components/ChatComponents/ChatHeader.js";import"remark-gfm";import"./_components/MarkdownComponents/MarkdownElements.js";import"./_components/CitationLink.js";import"@e-llm-studio/citation";import"./store/CitationsContext.js";import"./_components/templates/RuleComparison/RuleComparison.js";var e=function(e){return t(void 0,void 0,void 0,function(){var t;return o(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,r.post("https://devllmstudio.creativeworkspace.ai/instant_learning/give-variant-info",e)];case 1:return[2,o.sent().data];case 2:throw t=o.sent(),console.error("Error getting variant info:",t),t;case 3:return[2]}})})};export{e as getVariantInfo};
|
|
2
2
|
//# sourceMappingURL=ILOTJTest.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as i}from"react/jsx-runtime";import r from"./TeachMeWrapper.js";import n from"../../../plugins/ValueTypes/Default/DefaultTeachMeRenderer.js";import a from"../../../plugins/ValueTypes/RadioTrafficLearning/RadioTrafficLearningRenderer.js";import o from"../../../plugins/ValueTypes/Guidelines/GuidelinesTeachMeRenderer.js";var l={Default:n,"Radio Traffic Learning":a,Guidelines:o},t=function(n){var a,o=n.app_integration_id,t=n.isOpen,p=n.onClose,u=n.pluginPayload,s=n.token,d=n.mode;return i(r,{app_integration_id:o,isOpen:t,onClose:p,token:s,templateRegistry:l,initialScope:null!==(a=null==u?void 0:u.initialScope)&&void 0!==a?a:"",ruleSet:null==u?void 0:u.ruleSet,pluginPayload:e(e({},u),{mode:d})})};export{l as TemplateRegistry,t as default};
|
|
2
|
+
//# sourceMappingURL=TeachMePlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TeachMePlugin.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as
|
|
1
|
+
import{__assign as e,__awaiter as t,__generator as r}from"tslib";import{jsx as i,jsxs as n}from"react/jsx-runtime";import{useState as a,useEffect as o}from"react";import{Box as s,CircularProgress as l,Dialog as c,DialogTitle as p,Typography as u,IconButton as d,DialogContent as f}from"@mui/material";import m from"@mui/icons-material/Close";import{useLearningTemplateStore as h}from"../../LearningManagement/store/useLearningTemplateStore.js";import g from"../../../plugins/ValueTypes/Default/DefaultTeachMeRenderer.js";import v from"../../../plugins/ValueTypes/RadioTrafficLearning/RadioTrafficLearningRenderer.js";import y from"../../../plugins/ValueTypes/Guidelines/GuidelinesTeachMeRenderer.js";var _=function(){var t=a(!0),r=t[0],o=t[1];return n(c,e({open:r,onClose:function(){return o(!1)},fullWidth:!0,maxWidth:"lg",PaperProps:{sx:{borderRadius:"16px",minHeight:"70vh",overflow:"hidden"}}},{children:[n(p,e({sx:{display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e0e0e0",px:3,py:2}},{children:[i(u,e({variant:"h6",fontWeight:600},{children:"Teach Me"})),i(d,e({onClick:function(){return o(!1)}},{children:i(m,{})}))]})),i(f,e({dividers:!0,sx:{p:3,backgroundColor:"#fafafa"}},{children:"There is some issue with the selected template. Kindly check steps to resolve."}))]}))},T={Default:g,"Radio Traffic Learning":v,Guidelines:y,Category:function(){return i("div",{children:"Category Template - Coming Soon!"})}},b=function(n){var c=h(function(e){return e.backwardCompatibility}),p=h(function(e){return n.app_integration_id?e.templateMap[n.app_integration_id]:void 0}),u=h(function(e){return e.setTemplateData}),d=c?"Radio Traffic Learning":p,f=a(!d),m=f[0],g=f[1],v=a(!1),y=v[0],b=v[1];if(o(function(){if(n.isOpen){if(!c&&!n.app_integration_id)return console.error("TeachMeWrapper requires an app_integration_id when backward compatibility is disabled."),b(!0),void g(!1);if(d)g(!1);else{t(void 0,void 0,void 0,function(){var e,i;return r(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,3,4]),g(!0),b(!1),[4,(o=n.app_integration_id,s=n.token,t(void 0,void 0,void 0,function(){var e,t;return r(this,function(r){switch(r.label){case 0:return[4,fetch("".concat("https://devllmstudio.creativeworkspace.ai","/instant_learning/ilotj/application/getValueType/").concat(o),{headers:{Authorization:"Bearer ".concat(s)}})];case 1:if(!(e=r.sent()).ok)throw new Error("Failed to fetch value type");return[4,e.json()];case 2:return t=r.sent(),console.log("Fetched value type data:",t),!t||Array.isArray(t.data)&&0===t.data.length?[2,null]:[2,t.data[0].value_type_name||t.valueTypeName||t.templateName]}})}))];case 1:return e=a.sent(),u(n.app_integration_id,e),[3,4];case 2:return i=a.sent(),console.error(i),b(!0),n.app_integration_id&&u(n.app_integration_id,"ERROR"),[3,4];case 3:return g(!1),[7];case 4:return[2]}var o,s})})}}},[n.isOpen,n.app_integration_id,d,n.token,u,c]),m)return i(s,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:i(l,{size:32})}));if(y||!d)return i(_,{});var w=T[d];return w?i(w,e({},n)):(console.warn("No renderer found for template: ".concat(d)),i(_,{}))};export{b as default};
|
|
2
2
|
//# sourceMappingURL=TeachMeWrapper.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as i,jsx as t}from"react/jsx-runtime";import{useState as n}from"react";import o from"../_svg/InfoIcon.js";var l=function(l){var r=l.validationType,d=l.decisionStrength,
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as i,jsx as t}from"react/jsx-runtime";import{useState as n}from"react";import o from"../_svg/InfoIcon.js";var l=function(l){var r=l.validationType,d=l.decisionStrength,s=l.ruleId,a=l.title,p=l.tier,c=l.descriptionText,x=l.reasoningNode,g=l.customStyles,f=l.onViewComparison,h=l.disabled,u=n(!1),y=u[0],m=u[1],F="100%"===d?"Exact Rule Found":"duplicate"===r?"Existing Rule Found":"Similar Rule Found",v=e({display:"flex",flexDirection:"column",border:"1px solid #E3E6EA",borderRadius:"8px",padding:"14px 16px",gap:"8px",backgroundColor:"#fff"},null==g?void 0:g.container),b=e({display:"flex",alignItems:"center",gap:"4px",backgroundColor:"#E0F2FE80",color:"#0369A1",padding:"0.5px 9px",borderRadius:"9999px",fontSize:"12px",fontWeight:500},null==g?void 0:g.headerTag),D=e({display:"flex",alignItems:"center",gap:"4px",backgroundColor:"#FEE2E2",color:"#B91C1C",padding:"0.5px 7px",borderRadius:"6px",fontSize:"12px",fontWeight:500},null==g?void 0:g.strengthBadgeStyle),E=e({display:"flex",flexDirection:"row",alignItems:"center",padding:"8px",gap:"8px",width:"100%",maxWidth:"140px",height:"44px",backgroundColor:h?"#F2F4F7":y?"#EFF4FF":"transparent",border:h?"1px solid #D0D5DD":y?"1px solid #B2CCFF":"1px solid transparent",borderRadius:"8px",cursor:h?"not-allowed":"pointer",opacity:h?.6:1,boxSizing:"border-box",transition:"all 0.2s ease"},null==g?void 0:g.button);return i("div",e({style:v},{children:[i("div",e({style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},{children:[i("div",e({style:b},{children:[t(o,{})," ",F]})),d&&t("div",e({style:D},{children:t("span",{children:d})}))]})),i("div",e({style:{display:"flex",flexDirection:"column",gap:"12px"}},{children:[i("div",e({style:{display:"flex",flexDirection:"column",gap:"6px"}},{children:[i("h3",e({style:e({fontSize:"14px",fontWeight:500,color:"#19213D",margin:0},null==g?void 0:g.title)},{children:[a," ",p?"— ".concat(p):""]})),i("div",e({style:e({fontSize:"14px",fontWeight:400,color:"#666F8D",lineHeight:"1.5"},null==g?void 0:g.description)},{children:[t("span",{children:c}),x]}))]})),i("button",e({style:E,onClick:function(){m(!0),f(s,d)},disabled:h},{children:[i("svg",e({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[t("rect",{x:"0.5",y:"0.5",width:"27",height:"27",rx:"13.5",fill:y?"#D1E0FF":"transparent",stroke:y?"#D1E0FF":"#D0D5DD",style:{transition:"all 0.2s ease"}}),t("path",{d:"M9.33399 13.9974L18.6673 13.9974M18.6673 13.9974L14.0007 18.6641M18.6673 13.9974L14.0007 9.33073",stroke:y?"#004EEB":"#667085",strokeWidth:"1.52381",strokeLinecap:"round",strokeLinejoin:"round",style:{transition:"stroke 0.2s ease"}})]})),t("span",e({style:{fontSize:"14px",fontWeight:500,fontFamily:"'Inter', sans-serif",color:"#1D2939",lineHeight:"20px",display:"flex",alignItems:"center"}},{children:"Compare"}))]}))]}))]}))};export{l as default};
|
|
2
2
|
//# sourceMappingURL=RuleValidationCard.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as i,jsx as n}from"react/jsx-runtime";import{useState as r,useRef as t,useEffect as o,useMemo as l}from"react";import{Box as a,IconButton as s,Typography as c,Skeleton as d}from"@mui/material";import{ArrowLeft as p,ArrowRight as x}from"lucide-react";import{CognitiveCompare as f}from"@viswa-test/test-citation";var h=function(r){var t=r.data,o=r.isSelected,l=r.onClick;return i(a,e({id:"variant-card-".concat(t.id),onClick:l,sx:{minWidth:"280px",maxWidth:"280px",p:2,m:.5,bgcolor:o?"#EFF6FF99":"#FFFFFF",borderRadius:"8px",cursor:"pointer",transition:"all 0.2s",display:"flex",flexDirection:"column",gap:1,flexShrink:0,opacity:t.isLoading?.7:1,border:o?"1.4px solid #2563EB":"1.4px solid transparent",boxShadow:o?"none":"0px 2px 4px 0px #19213D14","&:hover":{borderColor:o?"#2563EB":"#CBD5E1",boxShadow:o?"none":"0px 4px 8px 0px #19213D1F"}}},{children:[n(a,e({sx:{display:"flex",alignItems:"center",gap:1.5}},{children:t.isLoading?n(d,{variant:"rounded",width:80,height:20}):n(a,e({sx:{bgcolor:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:600,px:1,py:.5,borderRadius:"100px",border:"1px solid #FFE1E1",textTransform:"capitalize"}},{children:t.similarityScoreText||"0% Similarity"}))})),n(a,e({sx:{display:"flex",flexDirection:"column",gap:1}},{children:i(a,e({sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"nowrap"}},{children:[t.isLoading?n(d,{width:"90%"}):n(c,e({title:t.title,sx:{fontWeight:500,fontSize:"14px",color:"#19213D",lineHeight:1.2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"block"}},{children:t.title})),t.scope&&n(a,e({sx:{flexShrink:0,fontSize:"10px",fontWeight:600,color:"#19213D",bgcolor:"#FFF",border:"1px solid #EDEFF2",px:.75,py:.25,borderRadius:"6px",lineHeight:1.4,whiteSpace:"nowrap"}},{children:t.scope}))]}))}))]}))},g=function(d){var g=d.variants,u=void 0===g?[]:g,m=d.onSelectVariant,b=d.onSkip,F=d.onBack,v=d.targetVariantId,y=r(v||null),w=y[0],S=y[1],k=t(null);o(function(){v&&S(v)},[v]);var E=function(e){k.current&&k.current.scrollBy({left:"left"===e?-300:300,behavior:"smooth"})},C=l(function(){if(w){var e=String(w).trim();return u.find(function(i){return i.id&&String(i.id).trim()===e})||u[0]}return u.length>0?u[0]:null},[w,u]);o(function(){if(w&&k.current){var e=w.trim();setTimeout(function(){var i=document.getElementById("variant-card-".concat(e)),n=k.current;if(i&&n){var r=i.offsetLeft-n.offsetLeft-n.clientWidth/2+i.clientWidth/2;n.scrollTo({left:r,behavior:"smooth"})}},150)}},[w,u]);o(function(){!w&&!v&&u.length>0&&!u[0].isLoading&&S(u[0].id)},[u,w,v]);var z=r(!1),D=z[0],L=z[1],B=r(!1),W=B[0],I=B[1];o(function(){var e=k.current;if(e){var i=function(){L(e.scrollLeft>0),I(e.scrollLeft+e.clientWidth<e.scrollWidth-1)};return i(),e.addEventListener("scroll",i),window.addEventListener("resize",i),function(){e.removeEventListener("scroll",i),window.removeEventListener("resize",i)}}},[u]);var T=(null==C?void 0:C.intentTreeData)||null,R=(null==C?void 0:C.behaviorTreeData)||null;return i(a,e({sx:{display:"flex",flexDirection:"column",height:"100%",bgcolor:"#FFFFFF",fontFamily:'"Plus Jakarta Sans", sans-serif',overflow:"hidden"}},{children:[i(a,e({sx:{px:2,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#FFFFFF"}},{children:[i(a,e({sx:{display:"flex",alignItems:"center",gap:1}},{children:[n(s,e({onClick:F,size:"small"},{children:n(p,{})})),n(c,e({sx:{fontSize:"16px",fontWeight:450,color:"#0F172A"}},{children:"Learning Comparison"}))]})),n(s,e({onClick:b,size:"small"},{children:n(a,e({sx:{fontSize:24,lineHeight:.5}},{children:"×"}))}))]})),n(a,e({sx:{bgcolor:"#F6F7F9B2"}},{children:u.length>1&&i(a,e({sx:{pb:2}},{children:[i(a,e({sx:{px:3,display:"flex",alignItems:"center",justifyContent:"space-between",py:1}},{children:[n(c,e({sx:{fontSize:"13px",color:"#475569"}},{children:"Choose the Learning you want to compare with the rule you are creating."})),i(a,e({sx:{display:"flex",gap:.5,flexShrink:0,ml:1}},{children:[n(s,e({onClick:function(){return E("left")},size:"small",disabled:!D},{children:n(p,{size:18})})),n(s,e({onClick:function(){return E("right")},size:"small",disabled:!W},{children:n(x,{size:18})}))]}))]})),n(a,e({ref:k,sx:{display:"flex",gap:1,overflowX:"auto",px:3,"&::-webkit-scrollbar":{display:"none"}}},{children:u.map(function(e){return n(h,{data:e,isSelected:(null==C?void 0:C.id)===e.id,onClick:function(){return S((i=e).id),void m(i);var i}},e.id)})}))]}))})),i(a,e({sx:{display:"flex",flexDirection:"column",gap:3,margin:3,overflowY:"auto",backgroundColor:"#fff","&::-webkit-scrollbar":{height:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"#CBD5E1",borderRadius:"10px"}}},{children:[T&&i(a,e({sx:{display:"flex",flexDirection:"column",borderRadius:"8px",border:"1px solid #E2E8F0"}},{children:[i(a,e({sx:{px:3,py:1.5,bgcolor:"#F8F9FB",borderBottom:"1px solid #E2E8F0",textAlign:"center"}},{children:[n(c,e({sx:{fontSize:"15px",fontWeight:600,color:"#0F172A",mb:.5}},{children:"Is the learning's intent matching?"})),n(c,e({sx:{fontSize:"13px",color:"#64748B"}},{children:"Checking if the learning you are creating is same as the existing learning."}))]})),n(f,{treeData:T,componentHeaderText:"Is the learning's intent matching?",displayConfig:{isHeaderVisible:!1,isToggleVisible:!1,maintainRelativeOrder:!1,isLoading:!1}})]})),R&&i(a,e({sx:{display:"flex",flexDirection:"column",borderRadius:"8px",border:"1px solid #E2E8F0"}},{children:[i(a,e({sx:{px:3,py:1.5,bgcolor:"#F8F9FB",borderBottom:"1px solid #E2E8F0",textAlign:"center"}},{children:[n(c,e({sx:{fontSize:"15px",fontWeight:600,color:"#0F172A",mb:.5}},{children:"Is the learning behavior matching?"})),n(c,e({sx:{fontSize:"13px",color:"#64748B"}},{children:"Checking if the variant you are trying to add is similar, overlapping or conflicting with the existing variant."}))]})),n(f,{treeData:R,componentHeaderText:"Is the learning behavior matching?",displayConfig:{isHeaderVisible:!1,isToggleVisible:!1,maintainRelativeOrder:!1,isLoading:!1}})]}))]}))]}))};export{g as default};
|
|
1
|
+
import{__assign as e,__spreadArray as n,__rest as t}from"tslib";import{jsxs as i,jsx as r}from"react/jsx-runtime";import o,{useState as l,useRef as a,useEffect as s,useMemo as d}from"react";import{Box as c,Typography as p,IconButton as h,Skeleton as g}from"@mui/material";import{ArrowLeft as u,ArrowRight as x}from"lucide-react";import f from"../../_svg/SparkleIcon.js";import{CognitiveDecisioningCard as m}from"@e-llm-studio/citation";import{ButtonCognitiveIcon as b}from"../../_svg/ButtonCognitiveIcon.js";var v=function(e,n){if(!n)return null;var t=new RegExp("<".concat(e,"[^>]*>([\\s\\S]*?)<\\/").concat(e,">"),"i"),i=n.match(t);return i?i[1].replace(/\\n/g,"\n"):null},y=function(e,n,t){var i=100*e;if(!t)return{bg:"#FFFFFF",border:"#E2E8F0",badgeBg:"#F1F5F9",badgeBorder:"#CBD5E1",badgeText:"#64748B",highlightBg:"transparent",label:"Not Defined"};var r=function(e){return e.split("_").map(function(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}).join(" ")}(n);return i>=70?{bg:"#FEF2F2",border:"#FEE2E2",badgeBg:"#FEF2F2",badgeBorder:"#FECACA",badgeText:"#B91C1C",highlightBg:"#FECACA",label:r}:i>=40?{bg:"#FFFCF6",border:"#FFDD80",badgeBg:"#FEF9C3",badgeBorder:"#FEF08A",badgeText:"#A16207",highlightBg:"#FDDEB3",label:r}:{bg:"#FFFFFF",border:"#E2E8F0",badgeBg:"#F1F5F9",badgeBorder:"#CBD5E1",badgeText:"#64748B",highlightBg:"transparent",label:r}},w=o.forwardRef(function(n,t){var o=n.label,l=n.content,a=n.highlights,s=void 0===a?[]:a,d=n.styleVariant,h=n.isHighlighted,g=void 0!==h&&h,u=Array.isArray(l)?l.join("\n"):l||"",x="#B91C1C"===d.badgeText?{borderColor:"#EF4444",shadow:"rgba(239, 68, 68, 0.25)"}:"#A16207"===d.badgeText?{borderColor:"#F59E0B",shadow:"rgba(245, 158, 11, 0.25)"}:{borderColor:"#6366F1",shadow:"rgba(99, 102, 241, 0.25)"};return i(c,e({sx:{mb:1.5}},{children:[r(p,e({sx:{fontSize:"12px",color:"#19213D",mb:.5,fontWeight:500,lineHeight:"130%"}},{children:o})),r(c,e({ref:t,sx:{p:"4px 12px",borderRadius:"6px",border:g?"1.5px solid ".concat(x.borderColor):"1px solid ".concat(d.border),boxShadow:g?"0px 0px 0px 2px ".concat(x.shadow):"none",bgcolor:d.bg,fontSize:"13px",color:"#0B0E1A",lineHeight:1.4,minHeight:"24px",display:"flex",alignItems:"center",whiteSpace:"pre-line",wordBreak:"break-word"}},{children:r(c,{children:function(){if(!u)return r(p,e({sx:{color:"#94A3B8",fontSize:"12px",fontStyle:"italic"}},{children:"Not Defined"}));if(!s||0===s.length)return u;var n=s.filter(function(e){return e&&e.length>0}).map(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")});if(0===n.length)return u;var t=new RegExp("(".concat(n.join("|"),")"),"gi");return u.split(t).map(function(n,t){return s.some(function(e){return e&&e.toLowerCase()===n.toLowerCase()})?r(c,e({component:"span",sx:{bgcolor:d.highlightBg,borderRadius:"2px",px:"2px"}},{children:n}),t):n})}()})}))]}))}),F=function(n){var t=n.data,o=n.isSelected,l=n.isCognitiveOpen,a=n.onToggleCognitive,s=n.onClick,d=t.summaryText||t.description||"",h=d.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),u=h?d.replace(h[0],"").trim():d,x=!!h;return i(c,e({id:"variant-card-".concat(t.id),onClick:s,sx:{minWidth:"280px",maxWidth:"280px",p:2,m:.5,bgcolor:o?"#EFF6FF99":"#FFFFFF",borderRadius:"8px",cursor:"pointer",transition:"all 0.2s",display:"flex",flexDirection:"column",gap:1,flexShrink:0,opacity:t.isLoading?.7:1,border:o?"1.4px solid #2563EB":null,boxShadow:o?"none":"0px 2px 4px 0px #19213D14","&:hover":{borderColor:o?"#2563EB":"#CBD5E1",boxShadow:o?"none":"0px 4px 8px 0px #19213D1F"}}},{children:[r(c,e({sx:{display:"flex",alignItems:"center",gap:1.5}},{children:t.isLoading?r(g,{variant:"rounded",width:80,height:20}):i(c,e({sx:{bgcolor:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:600,px:1,py:.5,borderRadius:"100px",border:"1px solid #FFE1E1"}},{children:[void 0!==t.similarity?t.similarity:0,"% Similarity"]}))})),i(c,e({sx:{display:"flex",flexDirection:"column",gap:1}},{children:[i(c,e({sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"nowrap"}},{children:[r(p,e({title:t.title,sx:{fontWeight:500,fontSize:"14px",color:"#19213D",lineHeight:1.2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"block"}},{children:t.title})),t.scope&&r(c,e({sx:{flexShrink:0,fontSize:"10px",fontWeight:600,color:"#19213D",bgcolor:"#FFF",border:"1px solid #EDEFF2",px:.75,py:.25,borderRadius:"6px",lineHeight:1.4,whiteSpace:"nowrap"}},{children:t.scope}))]})),t.isLoading?i(c,{children:[r(g,{width:"90%"}),r(g,{width:"60%"})]}):i(c,e({title:u,sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[r(p,e({sx:{fontWeight:400,fontSize:"13px",color:"#666F8D",lineHeight:1.4,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis"}},{children:u})),x&&i(c,e({onClick:function(e){e.stopPropagation(),o||s(),a()},sx:{display:"inline-flex",alignItems:"center",alignSelf:"flex-start",gap:"4px",padding:"2px 6px",borderRadius:"4px",cursor:"pointer",transition:"all 0.2s ease",marginLeft:"-4px","&:hover":{backgroundColor:"#F1F5F9"}}},{children:[r("div",e({style:{width:"13px",height:"13px",display:"flex",alignItems:"center"}},{children:r(b,{})})),r("svg",e({width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#4B5563",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:o&&l?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}},{children:r("path",{d:"M6 9l6 6 6-6"})}))]}))]}))]}))]}))},_=function(o){var g,_,C=o.proposedRule,B=o.variants,E=void 0===B?[]:B,k=o.onSelectVariant;o.onAddAsVariant;var S=o.onSkip,A=o.onBack,L=o.targetVariantId,D=o.highlightedField,W=l(L||null),z=W[0],T=W[1],I=l(!1),R=I[0],j=I[1],H=l(null),O=H[0],M=H[1],V=a(null),N=a(null);s(function(){if(L&&T(L),M(null!=D?D:null),D){var e=setTimeout(function(){return M(null)},6e3);return function(){return clearTimeout(e)}}},[L,D]);var U=function(e){V.current&&V.current.scrollBy({left:"left"===e?-300:300,behavior:"smooth"})},P=d(function(){return n([],E,!0).sort(function(e,n){return(n.similarity||0)-(e.similarity||0)})},[E]),Y=d(function(){if(z){var e=String(z).trim();return E.find(function(n){return n.id&&String(n.id).trim()===e})||P[0]}return P.length>0?P[0]:null},[z,E,P]);s(function(){if(z&&V.current){var e=z.trim();setTimeout(function(){var n=document.getElementById("variant-card-".concat(e)),t=V.current;if(n&&t){var i=n.offsetLeft-t.offsetLeft-t.clientWidth/2+n.clientWidth/2;t.scrollTo({left:i,behavior:"smooth"})}},150)}},[z,P]);var $=Y||{title:"",scope:"",description:"",wta:"",wnta:"",variantType:"Default"},q=null==Y?void 0:Y.analysis,J=(null===(_=null===(g=null==q?void 0:q.rule_difference_comparison)||void 0===g?void 0:g.summary)||void 0===_?void 0:_.overall_summary)||"",X=J.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),G=!!X,K=X?X[1]:"",Q=v("reason",K)||"",Z=v("gap",K)||"",ee=v("relevance_score",K)||"",ne=d(function(){return{ul:function(n){n.node;var i=t(n,["node"]);return r("ol",e({},i,{style:{paddingLeft:"1.25rem",listStyleType:"decimal",margin:0}}))},li:function(n){n.node;var i=t(n,["node"]);return r("li",e({},i,{style:{marginBottom:"4px",listStyleType:"decimal"}},{children:i.children}))},ol:function(n){n.node;var i=t(n,["node"]);return r("li",e({},i,{style:{marginBottom:"4px",listStyleType:"decimal"}},{children:i.children}))},a:function(n){var o=n.href,l=n.children,a=t(n,["href","children"]);if(!o)return r("a",e({},a,{children:l}));var s=o||"";try{s=decodeURIComponent(o)}catch(e){console.error("Error decoding href",e)}if(s.includes("variant_id=")){var d="",c="",p=s.match(/variant_id=([^?&]+)/);p&&(d=p[1]);var h=s.match(/field_name=([^&]+)/);return h&&(c=h[1]),i("button",e({type:"button",onClick:function(e){e.preventDefault(),e.stopPropagation(),T(d),M(c),setTimeout(function(){return M(null)},6e3)},style:{background:"none",border:"none",outline:"none",borderRadius:"6px",padding:"1px 4px",color:"#0F172A",cursor:"pointer",fontSize:"13px",fontWeight:500,display:"inline-flex",alignItems:"center",gap:"2px",margin:"0 1px",verticalAlign:"baseline",textDecoration:"none",boxShadow:"none",WebkitAppearance:"none",MozAppearance:"none"},title:"View Comparison"},{children:[l,r("svg",e({width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:r("path",{d:"M10.2082 8.67708H2.0415M2.0415 8.67708L4.08317 6.63542M2.0415 8.67708L4.08317 10.7188M2.0415 3.57292H10.2082M10.2082 3.57292L8.1665 1.53125M10.2082 3.57292L8.1665 5.61458",stroke:"#0F172A",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})}))]}))}return r("a",e({href:o,target:"_blank",rel:"noopener noreferrer",style:{color:"#7C3AED"}},a,{children:l}))}}},[]);s(function(){!z&&!L&&P.length>0&&!P[0].isLoading&&T(P[0].id)},[P,z,L]);var te=a(null),ie=l([]),re=ie[0],oe=ie[1],le=l(!1),ae=le[0],se=le[1],de=l(!1),ce=de[0],pe=de[1];s(function(){var e=V.current;if(e){var n=function(){se(e.scrollLeft>0),pe(e.scrollLeft+e.clientWidth<e.scrollWidth-1)};return n(),e.addEventListener("scroll",n),window.addEventListener("resize",n),function(){e.removeEventListener("scroll",n),window.removeEventListener("resize",n)}}},[P]);var he={title:a(null),scope:a(null),description:a(null),wta:a(null),wnta:a(null)},ge={title:a(null),scope:a(null),description:a(null),wta:a(null),wnta:a(null)};s(function(){if(O){var e="when_to_apply"===O?"wta":"when_not_to_apply"===O?"wnta":O,n=he[e]||ge[e];n&&n.current&&setTimeout(function(){n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}},[O]);var ue=function(e){var n,t,i,r,o,l=null===(n=null==q?void 0:q.rule_difference_comparison)||void 0===n?void 0:n.fields,a="when_to_apply"===e?"wta":"when_not_to_apply"===e?"wnta":e,s=!(!C[a]&&!$[a]);if(!l||!l[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var d=l[e];if(d.mappings){var c=d.mappings[0]||{};return{score:d.score,relation:c.relation||"",highlightsA:(null===(t=c.highlights)||void 0===t?void 0:t.ruleA_spans)||[],highlightsB:(null===(i=c.highlights)||void 0===i?void 0:i.ruleB_spans)||[],hasContent:s}}return{score:d.score,relation:d.relation||"",highlightsA:(null===(r=d.highlights)||void 0===r?void 0:r.ruleA_spans)||[],highlightsB:(null===(o=d.highlights)||void 0===o?void 0:o.ruleB_spans)||[],hasContent:s}},xe=["title","scope","description","when_to_apply","when_not_to_apply"],fe=function(){if(te.current){var e=te.current.getBoundingClientRect(),n=[];xe.forEach(function(t){var i="when_to_apply"===t?he.wta:"when_not_to_apply"===t?he.wnta:he[t],r="when_to_apply"===t?ge.wta:"when_not_to_apply"===t?ge.wnta:ge[t];if(i.current&&r.current){i.current.style.height="auto",r.current.style.height="auto";var o=i.current.getBoundingClientRect(),l=r.current.getBoundingClientRect(),a=Math.max(o.height,l.height);i.current.style.height="".concat(a,"px"),r.current.style.height="".concat(a,"px");var s=i.current.getBoundingClientRect(),d=r.current.getBoundingClientRect(),c=ue(t),p=y(c.score,c.relation,c.hasContent),h=s.top+s.height/2-e.top;n.push({x1:s.right-e.left,y1:h,x2:d.left-e.left,y2:h,style:p})}}),oe(n)}};return s(function(){var e=setTimeout(fe,250);window.addEventListener("resize",fe);var n=null;return te.current&&(n=new ResizeObserver(function(){window.requestAnimationFrame(function(){fe()})})).observe(te.current),function(){clearTimeout(e),window.removeEventListener("resize",fe),n&&n.disconnect()}},[C,$,q,R]),i(c,e({sx:{display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif',overflow:"hidden"}},{children:[i(c,e({sx:{px:2,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#FFFFFF",border:"1.5px solid #EEF0F4"}},{children:[i(c,e({sx:{display:"flex",alignItems:"center",gap:1}},{children:[r(h,e({onClick:A,size:"small"},{children:r(u,{})})),r(p,e({sx:{fontSize:"16px",fontWeight:450,color:"#0F172A"}},{children:"Learning Comparison"}))]})),r(h,e({onClick:S,size:"small"},{children:r(c,e({sx:{fontSize:24,lineHeight:.5}},{children:"×"}))}))]})),P.length>1&&i(c,e({sx:{px:3,pb:.25}},{children:[i(c,e({sx:{display:"flex",alignItems:"center",justifyContent:"space-between",py:1}},{children:[r(p,e({sx:{fontSize:"13px",color:"#475569"}},{children:"Choose the Learning you want to compare with the rule you are creating."})),i(c,e({sx:{display:"flex",gap:.5,flexShrink:0,ml:1}},{children:[r(h,e({onClick:function(){return U("left")},size:"small",disabled:!ae},{children:r(u,{size:18})})),r(h,e({onClick:function(){return U("right")},size:"small",disabled:!ce},{children:r(x,{size:18})}))]}))]})),r(c,e({ref:V,sx:{display:"flex",gap:1,overflowX:"auto",pb:.05,"&::-webkit-scrollbar":{height:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"transparent",borderRadius:"10px"},"&::-webkit-scrollbar-thumb:hover":{background:"transparent"}}},{children:P.map(function(e){return r(F,{data:e,isSelected:(null==Y?void 0:Y.id)===e.id,isCognitiveOpen:R,onToggleCognitive:function(){j(function(e){var n=!e;return n&&N.current&&N.current.scrollTo({top:0,behavior:"smooth"}),n})},onClick:function(){return T((n=e).id),k(n),void j(!1);var n}},e.id)})}))]})),r(c,e({ref:N,sx:{flex:1,overflowY:"auto",py:1.5,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",borderTop:J&&G&&R?"none":"1.5px solid #EEF0F4"}},{children:i(c,e({sx:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"}},{children:[J&&G&&R&&r(c,e({sx:{width:"100%",pb:1,animation:"fadeIn 0.2s ease-out","& > div > button":{display:"none !important"},"& > div > div":{marginTop:"0px"}}},{children:r(m,{headerIcon:r(b,{}),reasoning:Q,gap:Z,score:ee,mdComponents:ne,isOpen:!0,onToggle:function(){return j(!1)}})})),i(c,e({ref:te,sx:{display:"grid",gridTemplateColumns:"1fr auto 1fr",gap:"60px",maxWidth:"1200px",width:"100%",position:"relative"}},{children:[r("svg",e({style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:10}},{children:re.map(function(n,t){var o=(n.x1+n.x2)/2,l=n.y1;return i("g",{children:[r("line",{x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2,stroke:n.style.badgeBorder,strokeWidth:"1"}),r("foreignObject",e({x:o-125,y:l-16,width:"250",height:"32"},{children:r(c,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:r(c,e({sx:{fontSize:"11px",bgcolor:n.style.badgeBg,color:n.style.badgeText,border:"1px solid ".concat(n.style.badgeBorder),borderRadius:"12px",px:1.5,py:.25,fontWeight:500,textAlign:"center",whiteSpace:"nowrap"}},{children:n.style.label}))}))}))]},t)})})),i(c,e({sx:{border:"1px dashed #B0B0B0",borderRadius:"8px",bgcolor:"#FFFFFF",display:"flex",flexDirection:"column",position:"relative",zIndex:2,filter:"drop-shadow(0px 2px 4px #F2F2F2)",minWidth:0}},{children:[r(c,e({sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px dashed #B0B0B0",borderRadius:"8px 8px 0 0",display:"flex",minHeight:"24px",alignItems:"center"}},{children:r(p,e({sx:{fontSize:"16px",fontWeight:500,color:"#19213D"}},{children:"Learning You’re Creating"}))})),r(c,e({sx:{p:"12px",display:"flex",flexDirection:"column"}},{children:xe.map(function(e){var n=ue(e),t=y(n.score,n.relation,n.hasContent),i="when_to_apply"===e?he.wta:"when_not_to_apply"===e?he.wnta:he[e],o=C["when_to_apply"===e?"wta":"when_not_to_apply"===e?"wnta":e];return r(w,{ref:i,label:"when_to_apply"===e?"When to apply":"when_not_to_apply"===e?"When NOT to Apply":e.charAt(0).toUpperCase()+e.slice(1).replace("_"," "),content:o,highlights:n.highlightsA,styleVariant:t,isHighlighted:O===e},"left-".concat(e))})}))]})),r(c,{sx:{width:"1px"}}),i(c,e({sx:{border:"1px solid #E3E6EA",borderRadius:"8px",bgcolor:"#FFFFFF",boxShadow:"0px 1px 4px #F7F4FE",position:"relative",zIndex:2,display:"flex",flexDirection:"column",minWidth:0}},{children:[r(c,e({sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E3E6EA",borderRadius:"8px 8px 0 0",minHeight:"24px",display:"flex",alignItems:"center"}},{children:i(p,e({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",display:"flex",alignItems:"center",gap:1}},{children:[r("div",e({style:{width:"18px",height:"18px",display:"flex",alignItems:"center",justifyContent:"center"}},{children:r(f,{})})),"Existing Learning"]}))})),r(c,e({sx:{p:"12px",display:"flex",flexDirection:"column"}},{children:xe.map(function(e){var n=ue(e),t=y(n.score,n.relation,n.hasContent),i="when_to_apply"===e?ge.wta:"when_not_to_apply"===e?ge.wnta:ge[e],o=$["when_to_apply"===e?"wta":"when_not_to_apply"===e?"wnta":e];return r(w,{ref:i,label:"when_to_apply"===e?"When to apply":"when_not_to_apply"===e?"When NOT to Apply":e.charAt(0).toUpperCase()+e.slice(1).replace("_"," "),content:o,highlights:n.highlightsB,styleVariant:t,isHighlighted:O===e},"right-".concat(e))})}))]}))]}))]}))}))]}))};export{_ as default};
|
|
2
2
|
//# sourceMappingURL=RuleComparison.js.map
|