@e-llm-studio/instant-learning 0.1.1-alpha.44 → 0.1.1-alpha.46
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/_components/templates/RuleComparison/RuleComparison.js +1 -1
- package/dist/cjs/features/LearningManagement/LearningManagement.js +1 -1
- 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/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/assets/Search-result(add new).svg.js +2 -0
- package/dist/cjs/features/LearningManagement/assets/Search-result(add new).svg.js.map +1 -0
- package/dist/cjs/features/LearningManagement/components/CreateRuleSetLegacyModal.js +1 -1
- package/dist/cjs/features/LearningManagement/components/InstantLearningModal.js +1 -1
- package/dist/cjs/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.js +2 -0
- package/dist/cjs/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.js.map +1 -0
- package/dist/cjs/features/LearningManagement/store/usePermissionsStore.js +2 -0
- package/dist/cjs/features/LearningManagement/store/usePermissionsStore.js.map +1 -0
- package/dist/cjs/plugins/ValueTypes/Default/DefaultTeachMeRenderer.js +1 -1
- package/dist/cjs/plugins/ValueTypes/Guidelines/GuidelinesTeachMeRenderer.js +1 -1
- package/dist/features/IL-OTJ/ILOTJ.js +1 -1
- package/dist/features/IL-OTJ/ILOTJTest.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/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/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/assets/Search-result(add new).svg.js +2 -0
- package/dist/features/LearningManagement/assets/Search-result(add new).svg.js.map +1 -0
- package/dist/features/LearningManagement/components/CreateRuleSetLegacyModal.js +1 -1
- package/dist/features/LearningManagement/components/InstantLearningModal.js +1 -1
- package/dist/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.js +2 -0
- package/dist/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.js.map +1 -0
- package/dist/features/LearningManagement/store/usePermissionsStore.js +2 -0
- package/dist/features/LearningManagement/store/usePermissionsStore.js.map +1 -0
- package/dist/plugins/ValueTypes/Default/DefaultTeachMeRenderer.js +1 -1
- package/dist/plugins/ValueTypes/Guidelines/GuidelinesTeachMeRenderer.js +1 -1
- 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/_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.map +1 -1
- package/dist/types/src/features/LearningManagement/RBAC/AccessPanel.d.ts +10 -0
- package/dist/types/src/features/LearningManagement/RBAC/AccessPanel.d.ts.map +1 -0
- package/dist/types/src/features/LearningManagement/RBAC/index.d.ts +3 -0
- package/dist/types/src/features/LearningManagement/RBAC/index.d.ts.map +1 -0
- package/dist/types/src/features/LearningManagement/apis/apiConfig.d.ts +2 -0
- package/dist/types/src/features/LearningManagement/apis/apiConfig.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/apis/scopeApis.d.ts +1 -0
- package/dist/types/src/features/LearningManagement/apis/scopeApis.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/CreateRuleSetLegacyModal.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/InstantLearningModal.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.d.ts +12 -0
- package/dist/types/src/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.d.ts.map +1 -0
- package/dist/types/src/features/LearningManagement/store/usePermissionsStore.d.ts +32 -0
- package/dist/types/src/features/LearningManagement/store/usePermissionsStore.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("@mui/material"),a=require("react"),o=require("./_components/ChatComponents/ChatComponent.js"),i=require("./_components/ILPopup.js"),s=require("./_components/VariantLoadingOverlay.js"),r=require("./_components/templates/RuleComparison/RuleComparison.js"),l=require("./_components/templates/RuleComparison/AgentComposerRuleComparison.js"),d=require("./_components/ChatComponents/NormalChat.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=u(a);exports.default=function(u){var g=u.open,h=u.chatAssistantName,m=u.organizationName,p=u.baseUrl,f=u.baseWebsocketUrl,C=u.closeFunction,v=u.ThinkingBulbIconComponent,x=u.customSections,S=u.customMetaData,b=u.chatTitle,k=void 0===b?"Instant Learning On-The-Job":b,w=u.formTitle,M=void 0===w?"Instant Learning On-The-Job Form":w,y=u.onSave,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("@mui/material"),a=require("react"),o=require("./_components/ChatComponents/ChatComponent.js"),i=require("./_components/ILPopup.js"),s=require("./_components/VariantLoadingOverlay.js"),r=require("./_components/templates/RuleComparison/RuleComparison.js"),l=require("./_components/templates/RuleComparison/AgentComposerRuleComparison.js"),d=require("./_components/ChatComponents/NormalChat.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=u(a);exports.default=function(u){var g=u.open,h=u.chatAssistantName,m=u.organizationName,p=u.baseUrl,f=u.baseWebsocketUrl,C=u.closeFunction,v=u.ThinkingBulbIconComponent,x=u.customSections,S=u.customMetaData,b=u.chatTitle,k=void 0===b?"Instant Learning On-The-Job":b,w=u.formTitle,M=void 0===w?"Instant Learning On-The-Job Form":w,y=u.onSave,R=u.headerMessageHandlers,I=u.aiResponse,_=u.setAIResponse,j=u.width,F=void 0===j?"90vw":j,T=u.height,V=void 0===T?"90vh":T,A=u.sendMessageInChat,D=void 0===A?"":A,L=u.setSendMessageInChat,E=u.validateCustom,B=u.onResetChat,W=u.template,q=u.templateProps,P=u.initialChatMessage,z=u.setCitations,O=u.isLoading,N=void 0!==O&&O,U=u.isLocked,J=void 0!==U&&U,H=u.saveButtonConfig,G=void 0===H?{label:"Save Learning",loadingLabel:"Saving Learning..."}:H,X=u.saveButtonColor,Y=u.saveWithoutValBtnConfig,K=void 0===Y?{label:"Save Without Validation",loadingLabel:"Saving Without Validation..."}:Y,Q=u.textareaPlaceholder,Z=u.setCurrentRequestId,$=u.showSavedMessage,ee=void 0!==$&&$,ne=u.savedMessage,te=void 0===ne?"Thank you teacher for teaching me, your learning has been saved successfully.":ne,ae=u.isError,oe=void 0!==ae&&ae,ie=u.errorMessage,se=void 0===ie?"I'm sorry, I couldn't save your changes. Please try again.":ie,re=u.isSaving,le=void 0!==re&&re,de=u.isAiStreaming,ue=u.setIsAiStreaming,ce=u.showConfirmReset,ge=void 0!==ce&&ce,he=u.setShowConfirmReset,me=u.confirmReset,pe=u.isLoadingVariants,fe=u.isFormDirty,Ce=u.onResetRequest,ve=u.mainText,xe=void 0===ve?"Adding a variant":ve,Se=u.subText,be=void 0===Se?"This may take a moment as we update the learning with the new variant.":Se,ke=u.showComparison,we=void 0!==ke&&ke,Me=u.setShowComparison,ye=u.showAgentComposerRuleComparison,Re=void 0!==ye&&ye,Ie=u.setShowAgentComposerRuleComparison,_e=u.isFetchingComparison,je=u.handleOpenComparison,Fe=u.proposedRule,Te=u.variants,Ve=u.onAddAsVariant,Ae=u.isCopyEnabled,De=u.showSaveWithoutValidation,Le=void 0!==De&&De,Ee=u.onSaveWithoutValidation,Be=u.onComparisonLinkClick,We=u.targetComparisonVariantId,qe=u.highlightedComparisonField,Pe=u.onSubmitFeedback,ze=u.isUseNormalChat,Oe=void 0!==ze&&ze,Ne=u.userDetails,Ue=u.handleGlobalClickCapture,Je=u.isGlobalEditActive,He=u.socketTimeOutInMilliSeconds,Ge=u.initialDraftMessage,Xe=u.onValidateSession,Ye=a.useState(g),Ke=Ye[0],Qe=Ye[1],Ze=a.useState(!1);Ze[0];var $e=Ze[1],en=a.useState(!1),nn=en[0],tn=en[1],an=a.useState(!1),on=an[0];an[1];var sn=a.useState(45),rn=sn[0],ln=sn[1],dn=a.useState("right"),un=dn[0],cn=dn[1],gn=c.default.useRef(un),hn=a.useState(!1),mn=hn[0],pn=hn[1],fn=a.useState(0),Cn=fn[0],vn=fn[1],xn=a.useState(40),Sn=xn[0],bn=xn[1];a.useEffect(function(){gn.current=un},[un]),a.useEffect(function(){Qe(g)},[g]);var kn=a.useCallback(function(e){e.preventDefault(),pn(!0),vn(e.clientX),bn(rn)},[rn]),wn=a.useCallback(function(e){if(mn){var n=document.querySelector("[data-dialog-content]");if(n){var t=n.getBoundingClientRect(),a=(e.clientX-Cn)/t.width*100,o=Math.max(20,Math.min(80,Sn+a));ln(o),o>Sn&&cn("right"),o<Sn&&cn("left")}}},[mn,Cn,Sn]),Mn=a.useCallback(function(){pn(!1)},[]);a.useEffect(function(){if(mn)return document.addEventListener("mousemove",wn),document.addEventListener("mouseup",Mn),function(){document.removeEventListener("mousemove",wn),document.removeEventListener("mouseup",Mn)}},[mn,wn,Mn]);var yn=function(e,n){J&&"backdropClick"===n||("escapeKeyDown"!==n&&"manualClose"!==n||!(null==fe?void 0:fe())?(Qe(!1),C()):null==Ce||Ce())},Rn=a.useCallback(function(e){ln(function(n){var t;if("number"==typeof e)return e>n&&cn("right"),e<n&&cn("left"),e;var a=gn.current,o=null!==(t={20:30,30:"left"===a?20:50,50:"left"===a?30:75,75:"left"===a?50:100,100:75}[n])&&void 0!==t?t:40;return 100===o&&cn("left"),20===o&&cn("right"),o})},[]),In=a.useCallback(function(){je&&(Rn(30),je())},[Rn,je]);return n.jsx(t.Dialog,e.__assign({open:Ke,onClose:yn,maxWidth:!1,fullWidth:!0,PaperProps:{sx:{width:F,height:V,display:"flex",flexDirection:"column",padding:0,margin:0,maxWidth:"100vw",borderRadius:"10px"}}},{children:n.jsxs(t.DialogContent,e.__assign({"data-dialog-content":!0,onClickCapture:Ue,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.jsx(t.Box,e.__assign({sx:{width:"".concat(rn,"%"),maxWidth:"".concat(rn,"%"),transition:mn?"none":"width 0.3s ease-in-out, max-width 0.3s ease-in-out",bgcolor:"#ffffff",p:0,display:0===rn?"none":"flex",flexDirection:"column"}},{children:Oe?n.jsx(d.default,{chatAssistantName:h,organizationName:m,baseUrl:p,baseWebsocketUrl:f,setIsNewChatClicked:$e,ThinkingBulbIconComponent:v,isFormSaveClicked:nn,setIsFormSavedClicked:tn,onResetLearningData:function(){},sendMessageInChat:D,setSendMessageInChat:L,isFormValidating:on,chatTitle:k,customMetaData:S,headerMessageHandlers:R,aiResponse:I,setAIResponse:_,onResetChat:B,initialChatMessage:P,onSave:y,chatSize:rn,movingTowards:un,setChatSize:Rn,setCitations:z,textareaPlaceholder:Q,setCurrentRequestId:Z,showSavedMessage:ee,savedMessage:te,isError:oe,errorMessage:se,isSaving:le,onStreamingStateChange:ue,onViewComparison:In,isCopyEnabled:Ae,onComparisonLinkClick:Be,onSubmitFeedback:Pe}):n.jsx(o.default,{chatAssistantName:h,organizationName:m,baseUrl:p,baseWebsocketUrl:f,setIsNewChatClicked:$e,ThinkingBulbIconComponent:v,isFormSaveClicked:nn,setIsFormSavedClicked:tn,onResetLearningData:function(){},sendMessageInChat:D,setSendMessageInChat:L,isFormValidating:on,chatTitle:k,customMetaData:S,headerMessageHandlers:R,aiResponse:I,setAIResponse:_,onResetChat:B,initialChatMessage:P,onSave:y,chatSize:rn,movingTowards:un,setChatSize:Rn,setCitations:z,textareaPlaceholder:Q,setCurrentRequestId:Z,showSavedMessage:ee,savedMessage:te,isError:oe,errorMessage:se,isSaving:le,onStreamingStateChange:ue,onViewComparison:In,isCopyEnabled:Ae,onComparisonLinkClick:Be,onSubmitFeedback:Pe,userDetails:Ne,isGlobalEditActive:Je,socketTimeOutInMilliSeconds:He,initialDraftMessage:Ge,onValidateSession:Xe,onCloseSessionModal:me})})),n.jsx(t.Box,{sx:{width:"2px",cursor:"col-resize",backgroundColor:mn?"#1976d2":"#e0e0e0",transition:"background-color 0.2s ease","&:hover":{backgroundColor:"#1976d2"},flexShrink:0},onMouseDown:kn}),n.jsxs(t.Box,e.__assign({sx:{width:"".concat(100-rn,"%"),maxWidth:"".concat(100-rn,"%"),transition:mn?"none":"width 0.3s ease-in-out, max-width 0.3s ease-in-out",display:100===rn?"none":"flex",flexDirection:"column",overflowY:"hidden",position:"relative"}},{children:[n.jsx(s.default,{isLoading:_e||!1,mainText:"Fetching differences between rules",subText:"This may take a moment..."}),n.jsx(s.default,{isLoading:pe||!1,mainText:xe,subText:be}),Re?n.jsx(l.default,{proposedRule:Fe,variants:Te,onSelectVariant:function(e){console.log("Selected Variant ID:",e.id)},onAddAsVariant:function(){null==Ve||Ve(),Rn(40),null==Ie||Ie(!1)},onSkip:function(){Rn(40),null==Ie||Ie(!1)},onBack:function(){Rn(40),null==Ie||Ie(!1)},targetVariantId:We,highlightedField:qe}):we?n.jsx(r.default,{proposedRule:Fe,variants:Te,onSelectVariant:function(e){console.log("Selected Variant ID:",e.id)},onAddAsVariant:function(){null==Ve||Ve(),Rn(40),null==Me||Me(!1)},onSkip:function(){Rn(40),null==Me||Me(!1)},onBack:function(){Rn(40),null==Me||Me(!1)},targetVariantId:We,highlightedField:qe}):n.jsx(i.default,{setIsFormSavedClicked:tn,customSections:x,onSave:y,formHeader:M,onClose:function(){return yn(0,"manualClose")},validateCustom:E,template:W,templateProps:q,isLoading:N,isAiStreaming:de,saveButtonConfig:G,saveButtonColor:X,showSaveWithoutValidation:Le,saveWithoutValBtnConfig:K,onSaveWithoutValidation:Ee}),n.jsx(t.Dialog,e.__assign({open:ge,onClose:function(){return null==he?void 0:he(!1)},PaperProps:{sx:{borderRadius:"12px",padding:"8px",maxWidth:"400px"}}},{children:n.jsxs(t.Box,e.__assign({sx:{p:3,textAlign:"center",fontFamily:"'Plus Jakarta Sans', sans-serif"}},{children:[n.jsx("h3",e.__assign({style:{fontSize:"18px",fontWeight:600,color:"#0F172A",marginBottom:"6px"}},{children:"Exit Teach Me OTJ?"})),n.jsx("p",e.__assign({style:{fontSize:"14px",color:"#64748B",lineHeight:"1.5",marginBottom:"10px"}},{children:"Exiting will discard any unsaved changes and end your session."})),n.jsxs(t.Box,e.__assign({sx:{display:"flex",gap:2,justifyContent:"center"}},{children:[n.jsx("button",e.__assign({onClick:function(){return null==he?void 0:he(!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.jsx("button",e.__assign({onClick:me,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"}))]}))]}))}))]}))]}))}))};
|
|
2
2
|
//# sourceMappingURL=ILOTJ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib");require("react/jsx-runtime"),require("@mui/material"),require("lucide-react"),require("react"),require("uuid"),require("./_components/templates/TemplatesMap/templatesMap.js"),require("@mui/material/Tooltip"),require("react-markdown"),require("rehype-raw");var r=require("axios");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("@e-llm-studio/streaming-response"),require("@e-llm-studio/watch-me-work"),require("./_components/ChatComponents/ChatHeader.js"),require("remark-gfm"),require("./_components/MarkdownComponents/MarkdownElements.js"),require("./_components/CitationLink.js"),require("@e-llm-studio/citation"),require("./store/CitationsContext.js"),require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib");require("react/jsx-runtime"),require("@mui/material"),require("lucide-react"),require("react"),require("uuid"),require("./_components/templates/TemplatesMap/templatesMap.js"),require("@mui/material/Tooltip"),require("react-markdown"),require("rehype-raw");var r=require("axios");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("@e-llm-studio/streaming-response"),require("@e-llm-studio/watch-me-work"),require("./_components/ChatComponents/ChatHeader.js"),require("remark-gfm"),require("./_components/MarkdownComponents/MarkdownElements.js"),require("./_components/CitationLink.js"),require("@e-llm-studio/citation"),require("./store/CitationsContext.js"),require("./_components/templates/RuleComparison/RuleComparison.js");var i=t(r);exports.getVariantInfo=function(r){return e.__awaiter(void 0,void 0,void 0,function(){var t;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,i.default.post("https://devllmstudio.creativeworkspace.ai/instant_learning/give-variant-info",r)];case 1:return[2,e.sent().data];case 2:throw t=e.sent(),console.error("Error getting variant info:",t),t;case 3:return[2]}})})};
|
|
2
2
|
//# sourceMappingURL=ILOTJTest.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("react"),r=require("@mui/material"),s=require("lucide-react"),t=require("@viswa-test/test-citation"),o=function(n){var s=n.data,t=n.isSelected,o=n.onClick;return i.jsxs(r.Box,e.__assign({id:"variant-card-".concat(s.id),onClick:o,sx:{minWidth:"280px",maxWidth:"280px",p:2,m:.5,bgcolor:t?"#EFF6FF99":"#FFFFFF",borderRadius:"8px",cursor:"pointer",transition:"all 0.2s",display:"flex",flexDirection:"column",gap:1,flexShrink:0,opacity:s.isLoading?.7:1,border:t?"1.4px solid #2563EB":"1.4px solid transparent",boxShadow:t?"none":"0px 2px 4px 0px #19213D14","&:hover":{borderColor:t?"#2563EB":"#CBD5E1",boxShadow:t?"none":"0px 4px 8px 0px #19213D1F"}}},{children:[i.jsx(r.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:1.5}},{children:s.isLoading?i.jsx(r.Skeleton,{variant:"rounded",width:80,height:20}):i.jsx(r.Box,e.__assign({sx:{bgcolor:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:600,px:1,py:.5,borderRadius:"100px",border:"1px solid #FFE1E1",textTransform:"capitalize"}},{children:s.similarityScoreText||"0% Similarity"}))})),i.jsx(r.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:1}},{children:i.jsxs(r.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"nowrap"}},{children:[s.isLoading?i.jsx(r.Skeleton,{width:"90%"}):i.jsx(r.Typography,e.__assign({title:s.title,sx:{fontWeight:500,fontSize:"14px",color:"#19213D",lineHeight:1.2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"block"}},{children:s.title})),s.scope&&i.jsx(r.Box,e.__assign({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:s.scope}))]}))}))]}))};exports.default=function(a){var l=a.variants,x=void 0===l?[]:l,c=a.onSelectVariant,d=a.onSkip,g=a.onBack,p=a.targetVariantId,f=n.useState(p||null),h=f[0],u=f[1],_=n.useRef(null);n.useEffect(function(){p&&u(p)},[p]);var m=function(e){_.current&&_.current.scrollBy({left:"left"===e?-300:300,behavior:"smooth"})},b=n.useMemo(function(){if(h){var e=String(h).trim();return x.find(function(i){return i.id&&String(i.id).trim()===e})||x[0]}return x.length>0?x[0]:null},[h,x]);n.useEffect(function(){if(h&&_.current){var e=h.trim();setTimeout(function(){var i=document.getElementById("variant-card-".concat(e)),n=_.current;if(i&&n){var r=i.offsetLeft-n.offsetLeft-n.clientWidth/2+i.clientWidth/2;n.scrollTo({left:r,behavior:"smooth"})}},150)}},[h,x]);n.useEffect(function(){!h&&!p&&x.length>0&&!x[0].isLoading&&u(x[0].id)},[x,h,p]);var y=n.useState(!1),F=y[0],v=y[1],j=n.useState(!1),B=j[0],w=j[1];n.useEffect(function(){var e=_.current;if(e){var i=function(){v(e.scrollLeft>0),w(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)}}},[x]);var S=(null==b?void 0:b.intentTreeData)||null,E=(null==b?void 0:b.behaviorTreeData)||null;return i.jsxs(r.Box,e.__assign({sx:{display:"flex",flexDirection:"column",height:"100%",bgcolor:"#FFFFFF",fontFamily:'"Plus Jakarta Sans", sans-serif',overflow:"hidden"}},{children:[i.jsxs(r.Box,e.__assign({sx:{px:2,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#FFFFFF"}},{children:[i.jsxs(r.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:1}},{children:[i.jsx(r.IconButton,e.__assign({onClick:g,size:"small"},{children:i.jsx(s.ArrowLeft,{})})),i.jsx(r.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:450,color:"#0F172A"}},{children:"Learning Comparison"}))]})),i.jsx(r.IconButton,e.__assign({onClick:d,size:"small"},{children:i.jsx(r.Box,e.__assign({sx:{fontSize:24,lineHeight:.5}},{children:"×"}))}))]})),i.jsx(r.Box,e.__assign({sx:{bgcolor:"#F6F7F9B2"}},{children:x.length>1&&i.jsxs(r.Box,e.__assign({sx:{pb:2}},{children:[i.jsxs(r.Box,e.__assign({sx:{px:3,display:"flex",alignItems:"center",justifyContent:"space-between",py:1}},{children:[i.jsx(r.Typography,e.__assign({sx:{fontSize:"13px",color:"#475569"}},{children:"Choose the Learning you want to compare with the rule you are creating."})),i.jsxs(r.Box,e.__assign({sx:{display:"flex",gap:.5,flexShrink:0,ml:1}},{children:[i.jsx(r.IconButton,e.__assign({onClick:function(){return m("left")},size:"small",disabled:!F},{children:i.jsx(s.ArrowLeft,{size:18})})),i.jsx(r.IconButton,e.__assign({onClick:function(){return m("right")},size:"small",disabled:!B},{children:i.jsx(s.ArrowRight,{size:18})}))]}))]})),i.jsx(r.Box,e.__assign({ref:_,sx:{display:"flex",gap:1,overflowX:"auto",px:3,"&::-webkit-scrollbar":{display:"none"}}},{children:x.map(function(e){return i.jsx(o,{data:e,isSelected:(null==b?void 0:b.id)===e.id,onClick:function(){return u((i=e).id),void c(i);var i}},e.id)})}))]}))})),i.jsxs(r.Box,e.__assign({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:[S&&i.jsxs(r.Box,e.__assign({sx:{display:"flex",flexDirection:"column",borderRadius:"8px",border:"1px solid #E2E8F0"}},{children:[i.jsxs(r.Box,e.__assign({sx:{px:3,py:1.5,bgcolor:"#F8F9FB",borderBottom:"1px solid #E2E8F0",textAlign:"center"}},{children:[i.jsx(r.Typography,e.__assign({sx:{fontSize:"15px",fontWeight:600,color:"#0F172A",mb:.5}},{children:"Is the learning's intent matching?"})),i.jsx(r.Typography,e.__assign({sx:{fontSize:"13px",color:"#64748B"}},{children:"Checking if the learning you are creating is same as the existing learning."}))]})),i.jsx(t.CognitiveCompare,{treeData:S,componentHeaderText:"Is the learning's intent matching?",displayConfig:{isHeaderVisible:!1,isToggleVisible:!1,maintainRelativeOrder:!1,isLoading:!1}})]})),E&&i.jsxs(r.Box,e.__assign({sx:{display:"flex",flexDirection:"column",borderRadius:"8px",border:"1px solid #E2E8F0"}},{children:[i.jsxs(r.Box,e.__assign({sx:{px:3,py:1.5,bgcolor:"#F8F9FB",borderBottom:"1px solid #E2E8F0",textAlign:"center"}},{children:[i.jsx(r.Typography,e.__assign({sx:{fontSize:"15px",fontWeight:600,color:"#0F172A",mb:.5}},{children:"Is the learning behavior matching?"})),i.jsx(r.Typography,e.__assign({sx:{fontSize:"13px",color:"#64748B"}},{children:"Checking if the variant you are trying to add is similar, overlapping or conflicting with the existing variant."}))]})),i.jsx(t.CognitiveCompare,{treeData:E,componentHeaderText:"Is the learning behavior matching?",displayConfig:{isHeaderVisible:!1,isToggleVisible:!1,maintainRelativeOrder:!1,isLoading:!1}})]}))]}))]}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),i=require("@mui/material"),r=require("lucide-react"),o=require("../../_svg/SparkleIcon.js"),s=require("@e-llm-studio/citation"),l=require("../../_svg/ButtonCognitiveIcon.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=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},d=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}},p=a(t).default.forwardRef(function(t,r){var o=t.label,s=t.content,l=t.highlights,a=void 0===l?[]:l,c=t.styleVariant,d=t.isHighlighted,p=void 0!==d&&d,x=Array.isArray(s)?s.join("\n"):s||"",g="#B91C1C"===c.badgeText?{borderColor:"#EF4444",shadow:"rgba(239, 68, 68, 0.25)"}:"#A16207"===c.badgeText?{borderColor:"#F59E0B",shadow:"rgba(245, 158, 11, 0.25)"}:{borderColor:"#6366F1",shadow:"rgba(99, 102, 241, 0.25)"};return n.jsxs(i.Box,e.__assign({sx:{mb:1.5}},{children:[n.jsx(i.Typography,e.__assign({sx:{fontSize:"12px",color:"#19213D",mb:.5,fontWeight:500,lineHeight:"130%"}},{children:o})),n.jsx(i.Box,e.__assign({ref:r,sx:{p:"4px 12px",borderRadius:"6px",border:p?"1.5px solid ".concat(g.borderColor):"1px solid ".concat(c.border),boxShadow:p?"0px 0px 0px 2px ".concat(g.shadow):"none",bgcolor:c.bg,fontSize:"13px",color:"#0B0E1A",lineHeight:1.4,minHeight:"24px",display:"flex",alignItems:"center",whiteSpace:"pre-line",wordBreak:"break-word"}},{children:n.jsx(i.Box,{children:function(){if(!x)return n.jsx(i.Typography,e.__assign({sx:{color:"#94A3B8",fontSize:"12px",fontStyle:"italic"}},{children:"Not Defined"}));if(!a||0===a.length)return x;var t=a.filter(function(e){return e&&e.length>0}).map(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")});if(0===t.length)return x;var r=new RegExp("(".concat(t.join("|"),")"),"gi");return x.split(r).map(function(t,r){return a.some(function(e){return e&&e.toLowerCase()===t.toLowerCase()})?n.jsx(i.Box,e.__assign({component:"span",sx:{bgcolor:c.highlightBg,borderRadius:"2px",px:"2px"}},{children:t}),r):t})}()})}))]}))}),x=function(t){var r=t.data,o=t.isSelected,s=t.isCognitiveOpen,a=t.onToggleCognitive,c=t.onClick,d=r.summaryText||r.description||"",p=d.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),x=p?d.replace(p[0],"").trim():d,g=!!p;return n.jsxs(i.Box,e.__assign({id:"variant-card-".concat(r.id),onClick:c,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:r.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:[n.jsx(i.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:1.5}},{children:r.isLoading?n.jsx(i.Skeleton,{variant:"rounded",width:80,height:20}):n.jsxs(i.Box,e.__assign({sx:{bgcolor:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:600,px:1,py:.5,borderRadius:"100px",border:"1px solid #FFE1E1"}},{children:[void 0!==r.similarity?r.similarity:0,"% Similarity"]}))})),n.jsxs(i.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:1}},{children:[n.jsxs(i.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"nowrap"}},{children:[n.jsx(i.Typography,e.__assign({title:r.title,sx:{fontWeight:500,fontSize:"14px",color:"#19213D",lineHeight:1.2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"block"}},{children:r.title})),r.scope&&n.jsx(i.Box,e.__assign({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:r.scope}))]})),r.isLoading?n.jsxs(i.Box,{children:[n.jsx(i.Skeleton,{width:"90%"}),n.jsx(i.Skeleton,{width:"60%"})]}):n.jsxs(i.Box,e.__assign({title:x,sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[n.jsx(i.Typography,e.__assign({sx:{fontWeight:400,fontSize:"13px",color:"#666F8D",lineHeight:1.4,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis"}},{children:x})),g&&n.jsxs(i.Box,e.__assign({onClick:function(e){e.stopPropagation(),o||c(),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:[n.jsx("div",e.__assign({style:{width:"13px",height:"13px",display:"flex",alignItems:"center"}},{children:n.jsx(l.ButtonCognitiveIcon,{})})),n.jsx("svg",e.__assign({width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#4B5563",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:o&&s?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}},{children:n.jsx("path",{d:"M6 9l6 6 6-6"})}))]}))]}))]}))]}))};exports.default=function(a){var g,h,u=a.proposedRule,f=a.variants,_=void 0===f?[]:f,y=a.onSelectVariant;a.onAddAsVariant;var b=a.onSkip,m=a.onBack,v=a.targetVariantId,w=a.highlightedField,F=t.useState(v||null),B=F[0],j=F[1],C=t.useState(!1),E=C[0],S=C[1],k=t.useState(null),A=k[0],R=k[1],T=t.useRef(null),L=t.useRef(null);t.useEffect(function(){if(v&&j(v),R(null!=w?w:null),w){var e=setTimeout(function(){return R(null)},6e3);return function(){return clearTimeout(e)}}},[v,w]);var D=function(e){T.current&&T.current.scrollBy({left:"left"===e?-300:300,behavior:"smooth"})},I=t.useMemo(function(){return e.__spreadArray([],_,!0).sort(function(e,n){return(n.similarity||0)-(e.similarity||0)})},[_]),W=t.useMemo(function(){if(B){var e=String(B).trim();return _.find(function(n){return n.id&&String(n.id).trim()===e})||I[0]}return I.length>0?I[0]:null},[B,_,I]);t.useEffect(function(){if(B&&T.current){var e=B.trim();setTimeout(function(){var n=document.getElementById("variant-card-".concat(e)),t=T.current;if(n&&t){var i=n.offsetLeft-t.offsetLeft-t.clientWidth/2+n.clientWidth/2;t.scrollTo({left:i,behavior:"smooth"})}},150)}},[B,I]);var z=W||{title:"",scope:"",description:"",wta:"",wnta:"",variantType:"Default"},H=null==W?void 0:W.analysis,M=(null===(h=null===(g=null==H?void 0:H.rule_difference_comparison)||void 0===g?void 0:g.summary)||void 0===h?void 0:h.overall_summary)||"",O=M.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),q=!!O,V=O?O[1]:"",N=c("reason",V)||"",P=c("gap",V)||"",U=c("relevance_score",V)||"",Y=t.useMemo(function(){return{ul:function(t){t.node;var i=e.__rest(t,["node"]);return n.jsx("ol",e.__assign({},i,{style:{paddingLeft:"1.25rem",listStyleType:"decimal",margin:0}}))},li:function(t){t.node;var i=e.__rest(t,["node"]);return n.jsx("li",e.__assign({},i,{style:{marginBottom:"4px",listStyleType:"decimal"}},{children:i.children}))},ol:function(t){t.node;var i=e.__rest(t,["node"]);return n.jsx("li",e.__assign({},i,{style:{marginBottom:"4px",listStyleType:"decimal"}},{children:i.children}))},a:function(t){var i=t.href,r=t.children,o=e.__rest(t,["href","children"]);if(!i)return n.jsx("a",e.__assign({},o,{children:r}));var s=i||"";try{s=decodeURIComponent(i)}catch(e){console.error("Error decoding href",e)}if(s.includes("variant_id=")){var l="",a="",c=s.match(/variant_id=([^?&]+)/);c&&(l=c[1]);var d=s.match(/field_name=([^&]+)/);return d&&(a=d[1]),n.jsxs("button",e.__assign({type:"button",onClick:function(e){e.preventDefault(),e.stopPropagation(),j(l),R(a),setTimeout(function(){return R(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:[r,n.jsx("svg",e.__assign({width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:n.jsx("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 n.jsx("a",e.__assign({href:i,target:"_blank",rel:"noopener noreferrer",style:{color:"#7C3AED"}},o,{children:r}))}}},[]);t.useEffect(function(){!B&&!v&&I.length>0&&!I[0].isLoading&&j(I[0].id)},[I,B,v]);var $=t.useRef(null),J=t.useState([]),X=J[0],G=J[1],K=t.useState(!1),Q=K[0],Z=K[1],ee=t.useState(!1),ne=ee[0],te=ee[1];t.useEffect(function(){var e=T.current;if(e){var n=function(){Z(e.scrollLeft>0),te(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)}}},[I]);var ie={title:t.useRef(null),scope:t.useRef(null),description:t.useRef(null),wta:t.useRef(null),wnta:t.useRef(null)},re={title:t.useRef(null),scope:t.useRef(null),description:t.useRef(null),wta:t.useRef(null),wnta:t.useRef(null)};t.useEffect(function(){if(A){var e="when_to_apply"===A?"wta":"when_not_to_apply"===A?"wnta":A,n=ie[e]||re[e];n&&n.current&&setTimeout(function(){n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}},[A]);var oe=function(e){var n,t,i,r,o,s=null===(n=null==H?void 0:H.rule_difference_comparison)||void 0===n?void 0:n.fields,l="when_to_apply"===e?"wta":"when_not_to_apply"===e?"wnta":e,a=!(!u[l]&&!z[l]);if(!s||!s[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var c=s[e];if(c.mappings){var d=c.mappings[0]||{};return{score:c.score,relation:d.relation||"",highlightsA:(null===(t=d.highlights)||void 0===t?void 0:t.ruleA_spans)||[],highlightsB:(null===(i=d.highlights)||void 0===i?void 0:i.ruleB_spans)||[],hasContent:a}}return{score:c.score,relation:c.relation||"",highlightsA:(null===(r=c.highlights)||void 0===r?void 0:r.ruleA_spans)||[],highlightsB:(null===(o=c.highlights)||void 0===o?void 0:o.ruleB_spans)||[],hasContent:a}},se=["title","scope","description","when_to_apply","when_not_to_apply"],le=function(){if($.current){var e=$.current.getBoundingClientRect(),n=[];se.forEach(function(t){var i="when_to_apply"===t?ie.wta:"when_not_to_apply"===t?ie.wnta:ie[t],r="when_to_apply"===t?re.wta:"when_not_to_apply"===t?re.wnta:re[t];if(i.current&&r.current){i.current.style.height="auto",r.current.style.height="auto";var o=i.current.getBoundingClientRect(),s=r.current.getBoundingClientRect(),l=Math.max(o.height,s.height);i.current.style.height="".concat(l,"px"),r.current.style.height="".concat(l,"px");var a=i.current.getBoundingClientRect(),c=r.current.getBoundingClientRect(),p=oe(t),x=d(p.score,p.relation,p.hasContent),g=a.top+a.height/2-e.top;n.push({x1:a.right-e.left,y1:g,x2:c.left-e.left,y2:g,style:x})}}),G(n)}};return t.useEffect(function(){var e=setTimeout(le,250);window.addEventListener("resize",le);var n=null;return $.current&&(n=new ResizeObserver(function(){window.requestAnimationFrame(function(){le()})})).observe($.current),function(){clearTimeout(e),window.removeEventListener("resize",le),n&&n.disconnect()}},[u,z,H,E]),n.jsxs(i.Box,e.__assign({sx:{display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif',overflow:"hidden"}},{children:[n.jsxs(i.Box,e.__assign({sx:{px:2,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#FFFFFF",border:"1.5px solid #EEF0F4"}},{children:[n.jsxs(i.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:1}},{children:[n.jsx(i.IconButton,e.__assign({onClick:m,size:"small"},{children:n.jsx(r.ArrowLeft,{})})),n.jsx(i.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:450,color:"#0F172A"}},{children:"Learning Comparison"}))]})),n.jsx(i.IconButton,e.__assign({onClick:b,size:"small"},{children:n.jsx(i.Box,e.__assign({sx:{fontSize:24,lineHeight:.5}},{children:"×"}))}))]})),I.length>1&&n.jsxs(i.Box,e.__assign({sx:{px:3,pb:.25}},{children:[n.jsxs(i.Box,e.__assign({sx:{display:"flex",alignItems:"center",justifyContent:"space-between",py:1}},{children:[n.jsx(i.Typography,e.__assign({sx:{fontSize:"13px",color:"#475569"}},{children:"Choose the Learning you want to compare with the rule you are creating."})),n.jsxs(i.Box,e.__assign({sx:{display:"flex",gap:.5,flexShrink:0,ml:1}},{children:[n.jsx(i.IconButton,e.__assign({onClick:function(){return D("left")},size:"small",disabled:!Q},{children:n.jsx(r.ArrowLeft,{size:18})})),n.jsx(i.IconButton,e.__assign({onClick:function(){return D("right")},size:"small",disabled:!ne},{children:n.jsx(r.ArrowRight,{size:18})}))]}))]})),n.jsx(i.Box,e.__assign({ref:T,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:I.map(function(e){return n.jsx(x,{data:e,isSelected:(null==W?void 0:W.id)===e.id,isCognitiveOpen:E,onToggleCognitive:function(){S(function(e){var n=!e;return n&&L.current&&L.current.scrollTo({top:0,behavior:"smooth"}),n})},onClick:function(){return j((n=e).id),y(n),void S(!1);var n}},e.id)})}))]})),n.jsx(i.Box,e.__assign({ref:L,sx:{flex:1,overflowY:"auto",py:1.5,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",borderTop:M&&q&&E?"none":"1.5px solid #EEF0F4"}},{children:n.jsxs(i.Box,e.__assign({sx:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"}},{children:[M&&q&&E&&n.jsx(i.Box,e.__assign({sx:{width:"100%",pb:1,animation:"fadeIn 0.2s ease-out","& > div > button":{display:"none !important"},"& > div > div":{marginTop:"0px"}}},{children:n.jsx(s.CognitiveDecisioningCard,{headerIcon:n.jsx(l.ButtonCognitiveIcon,{}),reasoning:N,gap:P,score:U,mdComponents:Y,isOpen:!0,onToggle:function(){return S(!1)}})})),n.jsxs(i.Box,e.__assign({ref:$,sx:{display:"grid",gridTemplateColumns:"1fr auto 1fr",gap:"60px",maxWidth:"1200px",width:"100%",position:"relative"}},{children:[n.jsx("svg",e.__assign({style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:10}},{children:X.map(function(t,r){var o=(t.x1+t.x2)/2,s=t.y1;return n.jsxs("g",{children:[n.jsx("line",{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:t.style.badgeBorder,strokeWidth:"1"}),n.jsx("foreignObject",e.__assign({x:o-125,y:s-16,width:"250",height:"32"},{children:n.jsx(i.Box,e.__assign({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:n.jsx(i.Box,e.__assign({sx:{fontSize:"11px",bgcolor:t.style.badgeBg,color:t.style.badgeText,border:"1px solid ".concat(t.style.badgeBorder),borderRadius:"12px",px:1.5,py:.25,fontWeight:500,textAlign:"center",whiteSpace:"nowrap"}},{children:t.style.label}))}))}))]},r)})})),n.jsxs(i.Box,e.__assign({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:[n.jsx(i.Box,e.__assign({sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px dashed #B0B0B0",borderRadius:"8px 8px 0 0",display:"flex",minHeight:"24px",alignItems:"center"}},{children:n.jsx(i.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:500,color:"#19213D"}},{children:"Learning You’re Creating"}))})),n.jsx(i.Box,e.__assign({sx:{p:"12px",display:"flex",flexDirection:"column"}},{children:se.map(function(e){var t=oe(e),i=d(t.score,t.relation,t.hasContent),r="when_to_apply"===e?ie.wta:"when_not_to_apply"===e?ie.wnta:ie[e],o=u["when_to_apply"===e?"wta":"when_not_to_apply"===e?"wnta":e];return n.jsx(p,{ref:r,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:t.highlightsA,styleVariant:i,isHighlighted:A===e},"left-".concat(e))})}))]})),n.jsx(i.Box,{sx:{width:"1px"}}),n.jsxs(i.Box,e.__assign({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:[n.jsx(i.Box,e.__assign({sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E3E6EA",borderRadius:"8px 8px 0 0",minHeight:"24px",display:"flex",alignItems:"center"}},{children:n.jsxs(i.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",display:"flex",alignItems:"center",gap:1}},{children:[n.jsx("div",e.__assign({style:{width:"18px",height:"18px",display:"flex",alignItems:"center",justifyContent:"center"}},{children:n.jsx(o.default,{})})),"Existing Learning"]}))})),n.jsx(i.Box,e.__assign({sx:{p:"12px",display:"flex",flexDirection:"column"}},{children:se.map(function(e){var t=oe(e),i=d(t.score,t.relation,t.hasContent),r="when_to_apply"===e?re.wta:"when_not_to_apply"===e?re.wnta:re[e],o=z["when_to_apply"===e?"wta":"when_not_to_apply"===e?"wnta":e];return n.jsx(p,{ref:r,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:t.highlightsB,styleVariant:i,isHighlighted:A===e},"right-".concat(e))})}))]}))]}))]}))}))]}))};
|
|
2
2
|
//# sourceMappingURL=RuleComparison.js.map
|
|
@@ -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"),r=require("lucide-react"),a=require("./store/useLearningTemplateStore.js"),s=require("primereact/toast"),i=require("./styles/LearningTemplateManagement.module.css.js"),o=require("./LearningTemplateLayout.js"),l=require("./components/EmptyLearningState.js"),u=require("./store/useAuthStore.js"),c=require("./apis/scopeApis.js"),d=require("./components/ConfirmationModal.js"),p=require("./components/LearningTemplateManagementSkeleton.js"),g=require("./utils/treeUtils.js"),S=require("./components/CreateLearningSetModal.js"),f=require("./store/useEnvStore.js"),m=require("./store/useConfigStore.js"),h=require("./components/ToolTip.js"),_=require("./components/CreateRuleSetLegacyModal.js"),v=require("react-router-dom"),y=[{id:"learnings",label:"Learnings",icon:r.BookOpen,badgeKey:"learningsCount"}],L=[{type:"GLOBAL",label:"Global",addChildLabel:"Add Scope",addChildType:"SCOPE"},{type:"SCOPE",label:"Scope"}];exports.default=function(r){var b,T=this,C=r.userDetails,E=r.llmStudioUrl,O=r.audacyBackendUrl,w=r.ilLabels,j=r.config,A=r.app_integration_id,N=r.backwardCompatibility,I=void 0!==N&&N,B=a.useLearningTemplateStore(function(e){return e.selectedRuleSetId}),k=a.useLearningTemplateStore(function(e){return e.setSelectedRuleSetId}),R=a.useLearningTemplateStore(function(e){return e.error}),P=a.useLearningTemplateStore(function(e){return e.setError}),D=a.useLearningTemplateStore(function(e){return e.setStations}),q=a.useLearningTemplateStore(function(e){return e.scopeTreeData}),x=a.useLearningTemplateStore(function(e){return e.setScopeTreeData}),G=n.useState({isOpen:!1,type:"GLOBAL"}),M=G[0],U=G[1],F=n.useState(!1),V=F[0],z=F[1],H=n.useState(!1),K=H[0],W=H[1],J=n.useState("learnings"),Q=J[0],X=J[1],Y=n.useState(null),Z=Y[0],$=Y[1],ee=n.useRef(null),te=n.useRef(null),ne=n.useRef(null),re=u.default();re.user;var ae=re.setUser,se=m.useConfigStore(),ie=se.setConfig,oe=se.setIlLabels,le=function(){try{return v.useLocation()}catch(e){return{search:""}}}();n.useEffect(function(){var e=new URLSearchParams(le.search).get("rulesetid");(null==e?void 0:e.length)&&k&&X&&(k(e),X("learnings"))},[null==le?void 0:le.search,X,k]),n.useEffect(function(){var e;console.log("userDetails",C),ae(C),console.log("llmStudioUrl",E),console.log("audacyBackendUrl",O),f.default.getState().setLlmStudioUrl(E),f.default.getState().setAudacyBackendUrl(O),ie(j),oe(w),a.useLearningTemplateStore.getState().setAppIntegrationId(null!=A?A:null),a.useLearningTemplateStore.getState().setBackwardCompatibility(I),a.useLearningTemplateStore.getState().setToken(null!==(e=C.accessToken)&&void 0!==e?e:null)},[C,ae,E,O,j,ie,w,oe]),n.useEffect(function(){if(A&&(null==C?void 0:C.accessToken)&&E){e.__awaiter(T,void 0,void 0,function(){var t,n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),[4,fetch("".concat(E,"/instant_learning/ilotj/tier/").concat(A),{headers:{Authorization:"Bearer ".concat(C.accessToken)}})];case 1:return[4,e.sent().json()];case 2:return"success"===(t=e.sent()).status&&a.useLearningTemplateStore.getState().setTiers(t.data.map(function(e){return{tier_id:e.id,tier_name:e.name,tier_priority:e.tier_priority}})),[3,4];case 3:return n=e.sent(),console.error("Failed to fetch tiers:",n),[3,4];case 4:return[2]}})})}},[A,null==C?void 0:C.accessToken,E]);var ue=function(t){return void 0===t&&(t=!0),e.__awaiter(T,void 0,void 0,function(){var n,r,s;return e.__generator(this,function(e){switch(e.label){case 0:t&&z(!0),P(null),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,c.fetchScopes(A,C.accessToken)];case 2:return(n=e.sent())&&n.data&&n.data.data&&(r=n.data.data,Array.isArray(r)&&(r=r.length>0?r[0]:null),r?(x({data:r}),te.current?(k(te.current),X("learnings"),te.current=null):a.useLearningTemplateStore.getState().selectedRuleSetId||k(r.id)):x(null)),[3,5];case 3:return s=e.sent(),console.error("Failed to fetch rule sets",s),P("Failed to load rule sets. Please try again later."),[3,5];case 4:return z(!1),[7];case 5:return[2]}})})};n.useEffect(function(){var e;(null===(e=null==C?void 0:C.accessToken)||void 0===e?void 0:e.length)?ue(!0):console.warn("Error: Trying to fetch rules without access token",C)},[null==C?void 0:C.accessToken,P,D]);var ce=function(t){return e.__awaiter(T,void 0,void 0,function(){var n,r,s,i,o,l,u,d,p,g,S,f,m,h,_,v,y,L,b,T;return e.__generator(this,function(E){switch(E.label){case 0:W(!0),n=a.useLearningTemplateStore.getState().backwardCompatibility,E.label=1;case 1:return E.trys.push([1,12,13,14]),r=void 0,n&&"object"==typeof t?r=t:(s=t,i="SCOPE"===M.type&&M.parentId,o=i?"genreRuleSet":M.type,r={topic:o,scope_reference_id:null,scopeDescription:"demo",parentScopeId:M.parentId||null,scopeName:s,scopeReferenceMetadata:{},applicationMappingId:A}),[4,c.createRuleSet(r,C.accessToken)];case 2:if(l=E.sent(),!(u=null===(h=null==l?void 0:l.data)||void 0===h?void 0:h.scopeId))return[3,10];if(te.current=u,d=n&&(null===(_=r.topic)||void 0===_?void 0:_.toLowerCase().includes("genre")),p=!n&&"GLOBAL"!==M.type&&M.parentId,!d&&!p)return[3,10];if(!(g=n?null===(y=null===(v=a.useLearningTemplateStore.getState().scopeTreeData)||void 0===v?void 0:v.data)||void 0===y?void 0:y.id:M.parentId))return[3,10];if(!I)return[3,7];E.label=3;case 3:return E.trys.push([3,5,,6]),[4,c.inheritScopeBackwardCompatible({source_scope_id:g,target_scope_id:u})];case 4:return E.sent(),[3,6];case 5:return S=E.sent(),console.error("Failed to inherit rules for the new scope:",S),[3,6];case 6:return[3,10];case 7:return E.trys.push([7,9,,10]),[4,c.inheritScope({source_scope_id:g,target_scope_id:u,application_mapping_id:A||"",is_copy_parent_variant_id:!1})];case 8:return E.sent(),[3,10];case 9:return f=E.sent(),console.error("Failed to inherit rules for the new scope:",f),[3,10];case 10:return[4,ue(!0)];case 11:return E.sent(),U(function(t){return e.__assign(e.__assign({},t),{isOpen:!1})}),[3,14];case 12:throw m=E.sent(),console.error("An error occurred during scope creation.",m),null===(L=ne.current)||void 0===L||L.show({severity:"error",summary:"Creation Failed",detail:(null===(T=null===(b=null==m?void 0:m.response)||void 0===b?void 0:b.data)||void 0===T?void 0:T.message)||"There was an error creating the scope. Please try again."}),m;case 13:return W(!1),[7];case 14:return[2]}})})},de=function(t,n,r){return e.__awaiter(T,void 0,void 0,function(){var s,i,o,l,u,d,p,S,f;return e.__generator(this,function(m){switch(m.label){case 0:W(!0),m.label=1;case 1:return m.trys.push([1,8,9,10]),[4,c.deleteRuleSet(t,C.accessToken)];case 2:if(m.sent(),a.useLearningTemplateStore.getState().selectedRuleSetId===t&&(s=a.useLearningTemplateStore.getState().scopeTreeData,(i=g.findNodePathById((null==s?void 0:s.data)||null,t))&&i.length>1&&(o=i[i.length-2],k(o),X("learnings"))),!r||!n)return[3,6];m.label=3;case 3:return m.trys.push([3,5,,6]),[4,c.updateStation({station_name:n,ruleset_id:""})];case 4:return m.sent(),[3,6];case 5:return l=m.sent(),console.error("Error unlinking station on subscope delete:",l),[3,6];case 6:return[4,ue(!0)];case 7:return m.sent(),U(function(t){return e.__assign(e.__assign({},t),{isOpen:!1})}),null===(d=ne.current)||void 0===d||d.show({severity:"success",summary:"Deleted Successfully",detail:"The scope was permanently removed."}),[3,10];case 8:return u=m.sent(),console.error("An error occurred during scope deletion.",u),null===(p=ne.current)||void 0===p||p.show({severity:"error",summary:"Delete Failed",detail:(null===(f=null===(S=null==u?void 0:u.response)||void 0===S?void 0:S.data)||void 0===f?void 0:f.message)||"There was an error deleting the scope. Please try again."}),[3,10];case 9:return W(!1),[7];case 10:return[2]}})})},pe=q,ge=Z?{data:{id:Z.stationId,name:Z.stationName,type:"STATION",metrics:{learningsCount:Z.learningsCount,stationsCount:0},children:[]}}:pe,Se=!!(null==ge?void 0:ge.data),fe="GLOBAL"===(null===(b=null==ge?void 0:ge.data)||void 0===b?void 0:b.type),me=Z?y.filter(function(e){return"stations"!==e.id}):y;return t.jsx(h.TooltipProvider,{children:t.jsxs("div",e.__assign({className:i.default.learningManagementContainer},{children:[t.jsx("div",e.__assign({className:i.default.mainWrapper},{children:V?t.jsx(p.default,{}):R?t.jsxs("div",e.__assign({className:i.default.errorContainer},{children:[t.jsx("div",e.__assign({className:i.default.errorTitle},{children:"Error Loading Data"})),t.jsx("p",e.__assign({className:i.default.errorDesc},{children:R})),t.jsx("button",e.__assign({onClick:function(){return ue(!0)},className:i.default.tryAgainBtn},{children:"Try Again"}))]})):Se?t.jsx(o.default,{onOpenCreateModal:function(){return U({isOpen:!0,type:"GLOBAL"})},onAddChild:function(e,t,n){return U({isOpen:!0,type:t,parentId:e,parentName:n})},onRenameChild:function(e,t){return U({isOpen:!0,type:"RENAME",scopeId:e,initialName:t})},onDeleteChild:function(t,n,r){return e.__awaiter(T,void 0,void 0,function(){var s,i,o;return e.__generator(this,function(e){switch(e.label){case 0:return s=a.useLearningTemplateStore.getState().scopeTreeData,i=g.findNodePathById((null==s?void 0:s.data)||null,t),o=!!i&&3===i.length,0!==r?[3,2]:[4,de(t,n,o)];case 1:return e.sent(),[3,3];case 2:U({isOpen:!0,type:"DELETE",scopeId:t,initialName:n,isSubscope:o}),e.label=3;case 3:return[2]}})})},onSectionSelect:function(e,t){console.log("Section Selected:",{scopeId:e,sectionId:t}),X(t),k(e)},activeSectionId:Q,scopeTreeData:ge,sectionsConfig:me,onViewStation:function(e){ee.current=B,$(e),X("learnings"),k(e.stationId)},onRefreshRuleSets:function(e,t){void 0===e&&(e=!0),t&&(te.current=t),ue(e)},nodeTypesConfig:L,app_integration_id:A,token:C.accessToken}):t.jsx(l.default,{onCreate:function(){return U({isOpen:!0,type:"GLOBAL"})},title:"No Global Scope has been added!",desc:"Start by creating a Global scope to define base learnings that apply across all stations.",button:"Create Global Scope"})})),t.jsx(s.Toast,{ref:ne}),I&&M.isOpen&&"DELETE"!==M.type&&"RENAME"!==M.type?t.jsx(_.default,{isOpen:!0,onClose:function(){return U(e.__assign(e.__assign({},M),{isOpen:!1}))},onSubmit:ce,hasGlobalRuleSet:fe}):t.jsx(S.default,{isOpen:M.isOpen&&"DELETE"!==M.type,onClose:function(){return U(e.__assign(e.__assign({},M),{isOpen:!1}))},onSubmit:"RENAME"===M.type?function(t){return e.__awaiter(T,void 0,void 0,function(){var n,r,a,s;return e.__generator(this,function(i){switch(i.label){case 0:W(!0),i.label=1;case 1:return i.trys.push([1,4,5,6]),M.scopeId?[4,c.renameScope({scope_id:M.scopeId,scope_name:t})]:[2];case 2:return i.sent(),[4,ue(!0)];case 3:return i.sent(),U(function(t){return e.__assign(e.__assign({},t),{isOpen:!1})}),[3,6];case 4:throw n=i.sent(),console.error("An error occurred during scope rename.",n),null===(r=ne.current)||void 0===r||r.show({severity:"error",summary:"Rename Failed",detail:(null===(s=null===(a=null==n?void 0:n.response)||void 0===a?void 0:a.data)||void 0===s?void 0:s.message)||"There was an error renaming the scope. Please try again."}),n;case 5:return W(!1),[7];case 6:return[2]}})})}:ce,isLoading:K,title:"GLOBAL"===M.type?"Create Global Scope":"SCOPE"===M.type?"Add Scope":"SUBSCOPE"===M.type?"Add Subscope":"Rename Scope",description:"GLOBAL"===M.type?"Create the Global scope to define base learnings that apply across all stations.":"SCOPE"===M.type?"This scope will be created under ".concat(M.parentName||"Global"," and will inherit its Learnings by default."):"SUBSCOPE"===M.type?"This subscope will be created under ".concat(M.parentName||"Scope"," and will inherit ").concat(M.parentName||"Scope","'s Learnings and Stations by default."):"",inputLabel:"GLOBAL"===M.type||"SCOPE"===M.type?"Scope Name":"SUBSCOPE"===M.type?"Subscope Name":"Scope Name",submitLabel:"GLOBAL"===M.type?"Create Scope":"SCOPE"===M.type?"Add Scope":"SUBSCOPE"===M.type?"Add Subscope":"Save",placeholder:"GLOBAL"===M.type?"Enter the global scope name":"SCOPE"===M.type?"Enter the scope name":"SUBSCOPE"===M.type?"Enter the subscope name":"Enter the new name",initialValue:"RENAME"===M.type?M.initialName:""}),t.jsx(d.default,{isOpen:M.isOpen&&"DELETE"===M.type,onCancel:function(){return U(e.__assign(e.__assign({},M),{isOpen:!1}))},onConfirm:function(){return de(M.scopeId,M.initialName,M.isSubscope)},title:"Delete Scope",description:t.jsxs(t.Fragment,{children:["Deleting ",t.jsx("span",e.__assign({className:i.default.highlight},{children:M.initialName||"this scope"}))," will permanently remove all Learnings, Access rules, and Change History inside it. This cannot be undone."]}),confirmText:"Delete",confirmBgColor:"#EF4444",isLoading:K})]}))})};
|
|
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"),a=require("./store/useLearningTemplateStore.js"),s=require("primereact/toast"),i=require("./styles/LearningTemplateManagement.module.css.js"),o=require("./LearningTemplateLayout.js"),l=require("./components/EmptyLearningState.js"),u=require("./store/useAuthStore.js"),c=require("./apis/scopeApis.js"),d=require("./components/ConfirmationModal.js"),p=require("./components/LearningTemplateManagementSkeleton.js"),g=require("./utils/treeUtils.js"),S=require("./components/CreateLearningSetModal.js"),f=require("./store/useEnvStore.js"),m=require("./store/useConfigStore.js"),h=require("./components/ToolTip.js"),v=require("./components/CreateRuleSetLegacyModal.js"),y=require("react-router-dom"),_=[{id:"learnings",label:"Learnings",icon:r.BookOpen,badgeKey:"learningsCount"}],L=[{type:"GLOBAL",label:"Global",addChildLabel:"Add Scope",addChildType:"SCOPE"},{type:"SCOPE",label:"Scope"}];exports.default=function(r){var b,T=this,C=r.userDetails,E=r.llmStudioUrl,O=r.audacyBackendUrl,w=r.ilLabels,j=r.config,A=r.app_integration_id,N=r.backwardCompatibility,I=void 0!==N&&N,B=a.useLearningTemplateStore(function(e){return e.selectedRuleSetId}),k=a.useLearningTemplateStore(function(e){return e.setSelectedRuleSetId}),R=a.useLearningTemplateStore(function(e){return e.error}),P=a.useLearningTemplateStore(function(e){return e.setError}),D=a.useLearningTemplateStore(function(e){return e.setStations}),q=a.useLearningTemplateStore(function(e){return e.scopeTreeData}),x=a.useLearningTemplateStore(function(e){return e.setScopeTreeData}),G=n.useState({isOpen:!1,type:"GLOBAL"}),M=G[0],U=G[1],F=n.useState(!1),V=F[0],H=F[1],K=n.useState(!1),W=K[0],z=K[1],J=n.useState("learnings"),Q=J[0],X=J[1],Y=n.useState(null),Z=Y[0],$=Y[1],ee=n.useRef(null),te=n.useRef(null),ne=n.useRef(null),re=u.default();re.user;var ae=re.setUser,se=m.useConfigStore(),ie=se.setConfig,oe=se.setIlLabels,le=function(){try{return y.useLocation()}catch(e){return{search:""}}}();n.useEffect(function(){var e=new URLSearchParams(le.search).get("rulesetid");(null==e?void 0:e.length)&&k&&X&&(k(e),X("learnings"))},[null==le?void 0:le.search,X,k]),n.useEffect(function(){var e;console.log("userDetails",C),ae(C),console.log("llmStudioUrl",E),console.log("audacyBackendUrl",O),f.default.getState().setLlmStudioUrl(E),f.default.getState().setAudacyBackendUrl(O),ie(j),oe(w),a.useLearningTemplateStore.getState().setAppIntegrationId(null!=A?A:null),a.useLearningTemplateStore.getState().setBackwardCompatibility(I),a.useLearningTemplateStore.getState().setToken(null!==(e=C.accessToken)&&void 0!==e?e:null)},[C,ae,E,O,j,ie,w,oe]),n.useEffect(function(){(null==C?void 0:C.accessToken)&&E&&c.fetchTiers()},[A,null==C?void 0:C.accessToken,E]);var ue=function(t){return void 0===t&&(t=!0),e.__awaiter(T,void 0,void 0,function(){var n,r,s;return e.__generator(this,function(e){switch(e.label){case 0:t&&H(!0),P(null),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,c.fetchScopes(A,C.accessToken)];case 2:return(n=e.sent())&&n.data&&n.data.data&&(r=n.data.data,Array.isArray(r)&&(r=r.length>0?r[0]:null),r?(x({data:r}),te.current?(k(te.current),X("learnings"),te.current=null):a.useLearningTemplateStore.getState().selectedRuleSetId||k(r.id)):x(null)),[3,5];case 3:return s=e.sent(),console.error("Failed to fetch rule sets",s),P("Failed to load rule sets. Please try again later."),[3,5];case 4:return H(!1),[7];case 5:return[2]}})})};n.useEffect(function(){var e;(null===(e=null==C?void 0:C.accessToken)||void 0===e?void 0:e.length)?ue(!0):console.warn("Error: Trying to fetch rules without access token",C)},[null==C?void 0:C.accessToken,P,D]);var ce=function(t){return e.__awaiter(T,void 0,void 0,function(){var n,r,s,i,o,l,u,d,p,g,S,f,m,h,v,y,_,L,b,T;return e.__generator(this,function(E){switch(E.label){case 0:z(!0),n=a.useLearningTemplateStore.getState().backwardCompatibility,E.label=1;case 1:return E.trys.push([1,12,13,14]),r=void 0,n&&"object"==typeof t?r=t:(s=t,i="SCOPE"===M.type&&M.parentId,o=i?"genreRuleSet":M.type,r={topic:o,scope_reference_id:null,scopeDescription:"demo",parentScopeId:M.parentId||null,scopeName:s,scopeReferenceMetadata:{},applicationMappingId:A}),[4,c.createRuleSet(r,C.accessToken)];case 2:if(l=E.sent(),!(u=null===(h=null==l?void 0:l.data)||void 0===h?void 0:h.scopeId))return[3,10];if(te.current=u,d=n&&(null===(v=r.topic)||void 0===v?void 0:v.toLowerCase().includes("genre")),p=!n&&"GLOBAL"!==M.type&&M.parentId,!d&&!p)return[3,10];if(!(g=n?null===(_=null===(y=a.useLearningTemplateStore.getState().scopeTreeData)||void 0===y?void 0:y.data)||void 0===_?void 0:_.id:M.parentId))return[3,10];if(!I)return[3,7];E.label=3;case 3:return E.trys.push([3,5,,6]),[4,c.inheritScopeBackwardCompatible({source_scope_id:g,target_scope_id:u})];case 4:return E.sent(),[3,6];case 5:return S=E.sent(),console.error("Failed to inherit rules for the new scope:",S),[3,6];case 6:return[3,10];case 7:return E.trys.push([7,9,,10]),[4,c.inheritScope({source_scope_id:g,target_scope_id:u,application_mapping_id:A||"",is_copy_parent_variant_id:!1})];case 8:return E.sent(),[3,10];case 9:return f=E.sent(),console.error("Failed to inherit rules for the new scope:",f),[3,10];case 10:return[4,ue(!0)];case 11:return E.sent(),U(function(t){return e.__assign(e.__assign({},t),{isOpen:!1})}),[3,14];case 12:throw m=E.sent(),console.error("An error occurred during scope creation.",m),null===(L=ne.current)||void 0===L||L.show({severity:"error",summary:"Creation Failed",detail:(null===(T=null===(b=null==m?void 0:m.response)||void 0===b?void 0:b.data)||void 0===T?void 0:T.message)||"There was an error creating the scope. Please try again."}),m;case 13:return z(!1),[7];case 14:return[2]}})})},de=function(t,n,r){return e.__awaiter(T,void 0,void 0,function(){var s,i,o,l,u,d,p,S,f;return e.__generator(this,function(m){switch(m.label){case 0:z(!0),m.label=1;case 1:return m.trys.push([1,8,9,10]),[4,c.deleteRuleSet(t,C.accessToken)];case 2:if(m.sent(),a.useLearningTemplateStore.getState().selectedRuleSetId===t&&(s=a.useLearningTemplateStore.getState().scopeTreeData,(i=g.findNodePathById((null==s?void 0:s.data)||null,t))&&i.length>1&&(o=i[i.length-2],k(o),X("learnings"))),!r||!n)return[3,6];m.label=3;case 3:return m.trys.push([3,5,,6]),[4,c.updateStation({station_name:n,ruleset_id:""})];case 4:return m.sent(),[3,6];case 5:return l=m.sent(),console.error("Error unlinking station on subscope delete:",l),[3,6];case 6:return[4,ue(!0)];case 7:return m.sent(),U(function(t){return e.__assign(e.__assign({},t),{isOpen:!1})}),null===(d=ne.current)||void 0===d||d.show({severity:"success",summary:"Deleted Successfully",detail:"The scope was permanently removed."}),[3,10];case 8:return u=m.sent(),console.error("An error occurred during scope deletion.",u),null===(p=ne.current)||void 0===p||p.show({severity:"error",summary:"Delete Failed",detail:(null===(f=null===(S=null==u?void 0:u.response)||void 0===S?void 0:S.data)||void 0===f?void 0:f.message)||"There was an error deleting the scope. Please try again."}),[3,10];case 9:return z(!1),[7];case 10:return[2]}})})},pe=q,ge=Z?{data:{id:Z.stationId,name:Z.stationName,type:"STATION",metrics:{learningsCount:Z.learningsCount,stationsCount:0},children:[]}}:pe,Se=!!(null==ge?void 0:ge.data);null===(b=null==ge?void 0:ge.data)||void 0===b||b.type;var fe=Z?_.filter(function(e){return"stations"!==e.id}):_;return t.jsx(h.TooltipProvider,{children:t.jsxs("div",e.__assign({className:i.default.learningManagementContainer},{children:[t.jsx("div",e.__assign({className:i.default.mainWrapper},{children:V?t.jsx(p.default,{}):R?t.jsxs("div",e.__assign({className:i.default.errorContainer},{children:[t.jsx("div",e.__assign({className:i.default.errorTitle},{children:"Error Loading Data"})),t.jsx("p",e.__assign({className:i.default.errorDesc},{children:R})),t.jsx("button",e.__assign({onClick:function(){return ue(!0)},className:i.default.tryAgainBtn},{children:"Try Again"}))]})):Se?t.jsx(o.default,{onOpenCreateModal:function(){return U({isOpen:!0,type:"GLOBAL"})},onAddChild:function(e,t,n){return U({isOpen:!0,type:t,parentId:e,parentName:n})},onRenameChild:function(e,t){return U({isOpen:!0,type:"RENAME",scopeId:e,initialName:t})},onDeleteChild:function(t,n,r){return e.__awaiter(T,void 0,void 0,function(){var s,i,o;return e.__generator(this,function(e){switch(e.label){case 0:return s=a.useLearningTemplateStore.getState().scopeTreeData,i=g.findNodePathById((null==s?void 0:s.data)||null,t),o=!!i&&3===i.length,0!==r?[3,2]:[4,de(t,n,o)];case 1:return e.sent(),[3,3];case 2:U({isOpen:!0,type:"DELETE",scopeId:t,initialName:n,isSubscope:o}),e.label=3;case 3:return[2]}})})},onSectionSelect:function(e,t){console.log("Section Selected:",{scopeId:e,sectionId:t}),X(t),k(e)},activeSectionId:Q,scopeTreeData:ge,sectionsConfig:fe,onViewStation:function(e){ee.current=B,$(e),X("learnings"),k(e.stationId)},onRefreshRuleSets:function(e,t){void 0===e&&(e=!0),t&&(te.current=t),ue(e)},nodeTypesConfig:L,app_integration_id:A,token:C.accessToken}):t.jsx(l.default,{onCreate:function(){return U({isOpen:!0,type:"GLOBAL"})},title:"No Global Scope has been added!",desc:"Start by creating a Global scope to define base learnings that apply across all stations.",button:"Create Global Scope"})})),t.jsx(s.Toast,{ref:ne}),I&&M.isOpen&&"DELETE"!==M.type&&"RENAME"!==M.type?t.jsx(v.default,{isOpen:!0,onClose:function(){return U(e.__assign(e.__assign({},M),{isOpen:!1}))},onSubmit:ce,hasGlobalRuleSet:Se}):t.jsx(S.default,{isOpen:M.isOpen&&"DELETE"!==M.type,onClose:function(){return U(e.__assign(e.__assign({},M),{isOpen:!1}))},onSubmit:"RENAME"===M.type?function(t){return e.__awaiter(T,void 0,void 0,function(){var n,r,a,s;return e.__generator(this,function(i){switch(i.label){case 0:z(!0),i.label=1;case 1:return i.trys.push([1,4,5,6]),M.scopeId?[4,c.renameScope({scope_id:M.scopeId,scope_name:t})]:[2];case 2:return i.sent(),[4,ue(!0)];case 3:return i.sent(),U(function(t){return e.__assign(e.__assign({},t),{isOpen:!1})}),[3,6];case 4:throw n=i.sent(),console.error("An error occurred during scope rename.",n),null===(r=ne.current)||void 0===r||r.show({severity:"error",summary:"Rename Failed",detail:(null===(s=null===(a=null==n?void 0:n.response)||void 0===a?void 0:a.data)||void 0===s?void 0:s.message)||"There was an error renaming the scope. Please try again."}),n;case 5:return z(!1),[7];case 6:return[2]}})})}:ce,isLoading:W,title:"GLOBAL"===M.type?"Create Global Scope":"SCOPE"===M.type?"Add Scope":"SUBSCOPE"===M.type?"Add Subscope":"Rename Scope",description:"GLOBAL"===M.type?"Create the Global scope to define base learnings that apply across all stations.":"SCOPE"===M.type?"This scope will be created under ".concat(M.parentName||"Global"," and will inherit its Learnings by default."):"SUBSCOPE"===M.type?"This subscope will be created under ".concat(M.parentName||"Scope"," and will inherit ").concat(M.parentName||"Scope","'s Learnings and Stations by default."):"",inputLabel:"GLOBAL"===M.type||"SCOPE"===M.type?"Scope Name":"SUBSCOPE"===M.type?"Subscope Name":"Scope Name",submitLabel:"GLOBAL"===M.type?"Create Scope":"SCOPE"===M.type?"Add Scope":"SUBSCOPE"===M.type?"Add Subscope":"Save",placeholder:"GLOBAL"===M.type?"Enter the global scope name":"SCOPE"===M.type?"Enter the scope name":"SUBSCOPE"===M.type?"Enter the subscope name":"Enter the new name",initialValue:"RENAME"===M.type?M.initialName:""}),t.jsx(d.default,{isOpen:M.isOpen&&"DELETE"===M.type,onCancel:function(){return U(e.__assign(e.__assign({},M),{isOpen:!1}))},onConfirm:function(){return de(M.scopeId,M.initialName,M.isSubscope)},title:"Delete Scope",description:t.jsxs(t.Fragment,{children:["Deleting ",t.jsx("span",e.__assign({className:i.default.highlight},{children:M.initialName||"this scope"}))," will permanently remove all Learnings, Access rules, and Change History inside it. This cannot be undone."]}),confirmText:"Delete",confirmBgColor:"#EF4444",isLoading:W})]}))})};
|
|
2
2
|
//# sourceMappingURL=LearningManagement.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),r=require("appsec-ui"),c=require("../store/useAuthStore.js"),a=require("../store/usePermissionsStore.js"),o=require("./AccessPanel.module.css.js");exports.default=function(t){var i=t.ruleSetId,u=t.moduleId,n=t.mode,d=void 0===n?"both":n,l=c.default(function(e){return e.user}),p=null==l?void 0:l.accessToken,m=a.usePermissionsStore(function(e){return e.hasPermission}),j=i||void 0,f=Boolean(j),h=f&&m("ilotj.scope.access.user.add",j),v=f&&m("ilotj.scope.access.user.edit",j),g=f&&m("ilotj.scope.access.user.remove",j),P=f&&m("ilotj.scope.access.group.add",j),_=f&&m("ilotj.scope.access.group.role.change",j),x=f&&m("ilotj.scope.access.group.remove",j);return j?s.jsx("div",e.__assign({className:o.default.accessPanel},{children:s.jsx(r.RbacQueryProvider,{children:s.jsx(r.AppsecProvider,e.__assign({appId:"Traffic Manager Mode",baseUrl:"https://dev-cw-appsec.techo.camp/granularApi",appsecUrl:"https://dev-cw-appsec.techo.camp",mode:"manage",getAuthToken:function(){return null!=p?p:""}},{children:s.jsx(r.AccessListPanel,{resourceId:j,moduleId:u||"6a0c337a0f031cf769642b23",mode:d,canAddUser:h,canEditUser:v,canDeleteUser:g,canAddGroup:P,canEditGroup:_,canDeleteGroup:x})}))})})):s.jsx("div",e.__assign({className:o.default.accessPanel},{children:s.jsx("p",e.__assign({className:o.default.emptyState},{children:"Waiting for Rule Set ID..."}))}))};
|
|
2
|
+
//# sourceMappingURL=AccessPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccessPanel.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});require("../../../node_modules/style-inject/dist/style-inject.es.js").default(".AccessPanel-module_accessPanel__RXDzY{--appsec-bg:#fff;--appsec-surface:#f9fafb;--appsec-surface-alt:#f2f4f7;--appsec-border:#d0d5dd;--appsec-text:#101828;--appsec-text-secondary:#475467;--appsec-text-tertiary:#667085;--appsec-primary:#2563eb;--appsec-primary-light:#eff6ff;--appsec-danger:#dc2626;--appsec-danger-light:#fef2f2;--appsec-success:#16a34a;--appsec-success-light:#f0fdf4;--appsec-warning:#d97706;--appsec-warning-light:#fffbeb;box-sizing:border-box;color:#101828;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;height:100%;overflow:auto;padding:16px;width:100%}.AccessPanel-module_emptyState__EAuao{color:#667085;font-size:14px;margin:0}.AccessPanel-module_accessPanel__RXDzY *{box-sizing:border-box}.AccessPanel-module_accessPanel__RXDzY button,.AccessPanel-module_accessPanel__RXDzY input,.AccessPanel-module_accessPanel__RXDzY select{font:inherit}.AccessPanel-module_accessPanel__RXDzY button{background:#0000;border:0}.AccessPanel-module_accessPanel__RXDzY p{margin:0}.AccessPanel-module_accessPanel__RXDzY .flex{display:flex}.AccessPanel-module_accessPanel__RXDzY .inline-flex{display:inline-flex}.AccessPanel-module_accessPanel__RXDzY .flex-col{flex-direction:column}.AccessPanel-module_accessPanel__RXDzY .flex-wrap{flex-wrap:wrap}.AccessPanel-module_accessPanel__RXDzY .flex-1{flex:1 1 0%}.AccessPanel-module_accessPanel__RXDzY .shrink-0{flex-shrink:0}.AccessPanel-module_accessPanel__RXDzY .items-center{align-items:center}.AccessPanel-module_accessPanel__RXDzY .items-start{align-items:flex-start}.AccessPanel-module_accessPanel__RXDzY .justify-center{justify-content:center}.AccessPanel-module_accessPanel__RXDzY .justify-between{justify-content:space-between}.AccessPanel-module_accessPanel__RXDzY .justify-end{justify-content:flex-end}.AccessPanel-module_accessPanel__RXDzY .gap-0\\\\.5{gap:2px}.AccessPanel-module_accessPanel__RXDzY .gap-1{gap:4px}.AccessPanel-module_accessPanel__RXDzY .gap-1\\\\.5{gap:6px}.AccessPanel-module_accessPanel__RXDzY .gap-2{gap:8px}.AccessPanel-module_accessPanel__RXDzY .gap-3{gap:12px}.AccessPanel-module_accessPanel__RXDzY .gap-4{gap:16px}.AccessPanel-module_accessPanel__RXDzY .space-y-4>:not([hidden])~:not([hidden]){margin-top:16px}.AccessPanel-module_accessPanel__RXDzY .relative{position:relative}.AccessPanel-module_accessPanel__RXDzY .absolute{position:absolute}.AccessPanel-module_accessPanel__RXDzY .left-3{left:12px}.AccessPanel-module_accessPanel__RXDzY .right-2\\\\.5{right:10px}.AccessPanel-module_accessPanel__RXDzY .pointer-events-none{pointer-events:none}.AccessPanel-module_accessPanel__RXDzY .z-50{z-index:50}.AccessPanel-module_accessPanel__RXDzY .w-full{width:100%}.AccessPanel-module_accessPanel__RXDzY .w-8{width:32px}.AccessPanel-module_accessPanel__RXDzY .w-14{width:56px}.AccessPanel-module_accessPanel__RXDzY .w-16{width:64px}.AccessPanel-module_accessPanel__RXDzY .w-24{width:96px}.AccessPanel-module_accessPanel__RXDzY .w-28{width:112px}.AccessPanel-module_accessPanel__RXDzY .h-3{height:12px}.AccessPanel-module_accessPanel__RXDzY .w-3{width:12px}.AccessPanel-module_accessPanel__RXDzY .h-3\\\\.5{height:14px}.AccessPanel-module_accessPanel__RXDzY .w-3\\\\.5{width:14px}.AccessPanel-module_accessPanel__RXDzY .h-4{height:16px}.AccessPanel-module_accessPanel__RXDzY .w-4{width:16px}.AccessPanel-module_accessPanel__RXDzY .h-6{height:24px}.AccessPanel-module_accessPanel__RXDzY .w-6{width:24px}.AccessPanel-module_accessPanel__RXDzY .h-7{height:28px}.AccessPanel-module_accessPanel__RXDzY .h-8{height:32px}.AccessPanel-module_accessPanel__RXDzY .h-9{height:36px}.AccessPanel-module_accessPanel__RXDzY .min-w-32{min-width:128px}.AccessPanel-module_accessPanel__RXDzY .min-w-40{min-width:160px}.AccessPanel-module_accessPanel__RXDzY .max-w-xs{max-width:320px}.AccessPanel-module_accessPanel__RXDzY .rounded{border-radius:4px}.AccessPanel-module_accessPanel__RXDzY .rounded-full{border-radius:9999px}.AccessPanel-module_accessPanel__RXDzY .rounded-appsec{border-radius:8px}.AccessPanel-module_accessPanel__RXDzY .border{border:1px solid var(--appsec-border)}.AccessPanel-module_accessPanel__RXDzY .border-appsec-border{border-color:var(--appsec-border)}.AccessPanel-module_accessPanel__RXDzY .border-appsec-primary{border-color:var(--appsec-primary)}.AccessPanel-module_accessPanel__RXDzY .divide-y>:not([hidden])~:not([hidden]){border-top:1px solid var(--appsec-border)}.AccessPanel-module_accessPanel__RXDzY .overflow-hidden{overflow:hidden}.AccessPanel-module_accessPanel__RXDzY .overflow-y-auto{overflow-y:auto}.AccessPanel-module_accessPanel__RXDzY .truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.AccessPanel-module_accessPanel__RXDzY .appearance-none{appearance:none}.AccessPanel-module_accessPanel__RXDzY .outline-none{outline:0}.AccessPanel-module_accessPanel__RXDzY .cursor-pointer{cursor:pointer}.AccessPanel-module_accessPanel__RXDzY .cursor-not-allowed{cursor:not-allowed}.AccessPanel-module_accessPanel__RXDzY .select-none{user-select:none}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-bg{background-color:var(--appsec-bg)}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-surface{background-color:var(--appsec-surface)}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-surface-alt{background-color:var(--appsec-surface-alt)}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-primary{background-color:var(--appsec-primary)}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-primary-light{background-color:var(--appsec-primary-light)}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-danger{background-color:var(--appsec-danger)}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-danger-light{background-color:var(--appsec-danger-light)}.AccessPanel-module_accessPanel__RXDzY .bg-transparent{background-color:initial}.AccessPanel-module_accessPanel__RXDzY .bg-blue-500{background-color:#3b82f6}.AccessPanel-module_accessPanel__RXDzY .bg-purple-500{background-color:#a855f7}.AccessPanel-module_accessPanel__RXDzY .bg-green-600{background-color:#16a34a}.AccessPanel-module_accessPanel__RXDzY .bg-orange-500{background-color:#f97316}.AccessPanel-module_accessPanel__RXDzY .bg-pink-500{background-color:#ec4899}.AccessPanel-module_accessPanel__RXDzY .bg-teal-500{background-color:#14b8a6}.AccessPanel-module_accessPanel__RXDzY .bg-indigo-500{background-color:#6366f1}.AccessPanel-module_accessPanel__RXDzY .bg-rose-500{background-color:#f43f5e}.AccessPanel-module_accessPanel__RXDzY .text-white{color:#fff}.AccessPanel-module_accessPanel__RXDzY .text-appsec-text{color:var(--appsec-text)}.AccessPanel-module_accessPanel__RXDzY .text-appsec-text-secondary{color:var(--appsec-text-secondary)}.AccessPanel-module_accessPanel__RXDzY .text-appsec-text-tertiary{color:var(--appsec-text-tertiary)}.AccessPanel-module_accessPanel__RXDzY .text-appsec-primary{color:var(--appsec-primary)}.AccessPanel-module_accessPanel__RXDzY .text-appsec-danger{color:var(--appsec-danger)}.AccessPanel-module_accessPanel__RXDzY .text-gray-500{color:#667085}.AccessPanel-module_accessPanel__RXDzY .text-xs{font-size:12px;line-height:18px}.AccessPanel-module_accessPanel__RXDzY .text-sm{font-size:14px;line-height:20px}.AccessPanel-module_accessPanel__RXDzY .text-\\\\[\\31 0px\\\\]{font-size:10px;line-height:14px}.AccessPanel-module_accessPanel__RXDzY .text-\\\\[\\31 1px\\\\]{font-size:11px;line-height:16px}.AccessPanel-module_accessPanel__RXDzY .font-medium{font-weight:500}.AccessPanel-module_accessPanel__RXDzY .font-semibold{font-weight:600}.AccessPanel-module_accessPanel__RXDzY .capitalize{text-transform:capitalize}.AccessPanel-module_accessPanel__RXDzY .text-center{text-align:center}.AccessPanel-module_accessPanel__RXDzY .text-left{text-align:left}.AccessPanel-module_accessPanel__RXDzY .px-1{padding-left:4px;padding-right:4px}.AccessPanel-module_accessPanel__RXDzY .px-2{padding-left:8px;padding-right:8px}.AccessPanel-module_accessPanel__RXDzY .px-2\\\\.5{padding-left:10px;padding-right:10px}.AccessPanel-module_accessPanel__RXDzY .px-3{padding-left:12px;padding-right:12px}.AccessPanel-module_accessPanel__RXDzY .px-4{padding-left:16px;padding-right:16px}.AccessPanel-module_accessPanel__RXDzY .py-0\\\\.5{padding-bottom:2px;padding-top:2px}.AccessPanel-module_accessPanel__RXDzY .py-1{padding-bottom:4px;padding-top:4px}.AccessPanel-module_accessPanel__RXDzY .py-2{padding-bottom:8px;padding-top:8px}.AccessPanel-module_accessPanel__RXDzY .py-2\\\\.5{padding-bottom:10px;padding-top:10px}.AccessPanel-module_accessPanel__RXDzY .py-4{padding-bottom:16px;padding-top:16px}.AccessPanel-module_accessPanel__RXDzY .py-8{padding-bottom:32px;padding-top:32px}.AccessPanel-module_accessPanel__RXDzY .p-0\\\\.5{padding:2px}.AccessPanel-module_accessPanel__RXDzY .p-1{padding:4px}.AccessPanel-module_accessPanel__RXDzY .p-2{padding:8px}.AccessPanel-module_accessPanel__RXDzY .pl-9{padding-left:36px}.AccessPanel-module_accessPanel__RXDzY .pr-6{padding-right:24px}.AccessPanel-module_accessPanel__RXDzY .pr-8{padding-right:32px}.AccessPanel-module_accessPanel__RXDzY .ml-auto{margin-left:auto}.AccessPanel-module_accessPanel__RXDzY .shadow-sm{box-shadow:0 1px 2px #1018280f}.AccessPanel-module_accessPanel__RXDzY .transition-all,.AccessPanel-module_accessPanel__RXDzY .transition-colors{transition:all .15s ease}.AccessPanel-module_accessPanel__RXDzY .opacity-30{opacity:.3}.AccessPanel-module_accessPanel__RXDzY .opacity-50{opacity:.5}.AccessPanel-module_accessPanel__RXDzY .disabled\\\\:opacity-30:disabled{opacity:.3}.AccessPanel-module_accessPanel__RXDzY .disabled\\\\:opacity-50:disabled{opacity:.5}.AccessPanel-module_accessPanel__RXDzY .disabled\\\\:cursor-not-allowed:disabled{cursor:not-allowed}.AccessPanel-module_accessPanel__RXDzY input[type=search],.AccessPanel-module_accessPanel__RXDzY select{background-color:var(--appsec-bg);border:1px solid var(--appsec-border);border-radius:8px;color:var(--appsec-text)}.AccessPanel-module_accessPanel__RXDzY input[type=search]::placeholder{color:var(--appsec-text-tertiary)}.AccessPanel-module_accessPanel__RXDzY input[type=checkbox]{accent-color:var(--appsec-primary);height:16px;width:16px}.AccessPanel-module_accessPanel__RXDzY button:hover:not(:disabled){opacity:.92}.AccessPanel-module_accessPanel__RXDzY .focus\\\\:border-appsec-primary:focus{border-color:var(--appsec-primary)}.AccessPanel-module_accessPanel__RXDzY .focus\\\\:ring-2:focus{box-shadow:0 0 0 3px var(--appsec-primary-light)}"),exports.default={accessPanel:"AccessPanel-module_accessPanel__RXDzY",emptyState:"AccessPanel-module_emptyState__EAuao"};
|
|
2
|
+
//# sourceMappingURL=AccessPanel.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccessPanel.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -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"),r=require("../store/useLearningTemplateStore.js"),i=require("../components/EmptyLearningState.js"),a=require("../apis/scopeApis.js"),o=require("../components/RuleContentSkeleton.js"),u=require("primereact/toast"),s=require("./ContentLogic.js"),l=require("../components/ErrorStateDisplay.js"),d=require("../shared/SuccessToastContent.js"),c=require("../shared/ErrorToastContent.js"),f=require("../utils/treeUtils.js"),v=require("../styles/LearningContent.module.css.js"),p=require("../components/ConfirmationModal.js");require("../../IL-OTJ/_components/atoms/Textarea/Textarea.js"),require("lucide-react"),require("../../IL-OTJ/_components/InputDataReasoningCard.js"),require("../../IL-OTJ/_components/TooltipComponent.js"),require("../../IL-OTJ/_components/templates/TemplatesMap/templatesMap.js");var m=require("../../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("../../IL-OTJ/_components/ChatComponents/ChatHeader.js"),require("remark-gfm"),require("../../IL-OTJ/_components/MarkdownComponents/MarkdownElements.js"),require("../../IL-OTJ/_components/CitationLink.js"),require("@e-llm-studio/citation"),require("@viswa-test/test-citation");var g=require("../../IL-OTJ/ValueTypeWrappers/TeachMeWrapper.js");require("@radix-ui/react-tooltip"),require("../components/StationOnboarding/InputField.js"),require("../store/useAuthStore.js"),require("../store/useConfigStore.js"),require("../config.js"),require("../store/useEnvStore.js"),require("../components/ToolTip.js"),require("react-router-dom");exports.default=function(h){var T,S=h.noRulesTitle,y=void 0===S?"No rules have been added !":S,_=h.noRulesDesc,j=void 0===_?"Start by adding rules that should apply across all stations.":_,w=h.noRulesButtonText,x=void 0===w?"Create New Rule":w,q=h.deleteRuleSuccessMessage,C=void 0===q?"Rule deleted successfully!":q,b=h.deleteVariantSuccessMessage,I=void 0===b?"Variant deleted successfully!":b,R=h.deleteRuleErrorMessage,L=void 0===R?"Failed to delete rule. Please try again.":R,O=h.deleteVariantErrorMessage,k=void 0===O?"Failed to delete variant. Please try again.":O,M=h.deleteModalTitle,D=void 0===M?"Delete":M,E=h.deleteRuleModalWarning,N=void 0===E?"This will permanently delete the rule configuration.":E,F=h.deleteVariantModalWarning,V=void 0===F?"This will permanently delete the variant configuration.":F,A=h.deleteConfirmText,P=void 0===A?"Delete":A,B=h.onRefreshRuleSets,J=h.app_integration_id,U=h.token,W=r.useLearningTemplateStore(function(e){return e.selectedRuleSetId}),G=r.useLearningTemplateStore(function(e){return e.scopeTreeData}),Q=r.useLearningTemplateStore(function(e){return e.sidebarTab}),H=r.useLearningTemplateStore(function(e){return e.setInitialRules}),$=r.useLearningTemplateStore(function(e){return e.currentRules});r.useLearningTemplateStore(function(e){return e.createdVariantInfo});var z=r.useLearningTemplateStore(function(e){return e.resetCreatedVariantInfo}),K=r.useLearningTemplateStore(function(e){return e.isILModalTriggered}),X=r.useLearningTemplateStore(function(e){return e.setIsILModalTriggered}),Y=n.useRef(null),Z=n.useState(!1),ee=Z[0],te=Z[1],ne=n.useState(null),re=ne[0],ie=ne[1],ae=n.useState(null),oe=ae[0],ue=ae[1],se=n.useState(null),le=se[0],de=se[1],ce=n.useState(null),fe=ce[0],ve=ce[1],pe=n.useState(!1),me=pe[0],ge=pe[1],he=n.useState(null),Te=he[0],Se=he[1],ye=n.useState(!1),_e=ye[0],je=ye[1],we=n.useState(""),xe=we[0],qe=we[1],Ce=n.useState(null),be=Ce[0],Ie=Ce[1],Re=n.useState(!1),Le=Re[0],Oe=Re[1],ke=n.useState(!1),Me=ke[0],De=ke[1],Ee=n.useState("ruleDeletion"),Ne=Ee[0],Fe=Ee[1],Ve=n.useState(null),Ae=Ve[0],Pe=Ve[1],Be=n.useState(!1),Je=Be[0],Ue=Be[1],We=n.useState(!1),Ge=We[0],Qe=We[1],He=r.useLearningTemplateStore.getState().tiers,$e=n.useState(null),ze=$e[0],Ke=$e[1],Xe=n.useState(null),Ye=Xe[0],Ze=Xe[1],et=n.useState(null),tt=et[0],nt=et[1],rt=function(){ie(null),ue(null),te(!0),ve(0)},it=function(){te(!1),X(!1),ie(null),ue(null),de(null),ve(null),De(!1),Qe(!1),at(),Ke(null),Ze(null),nt(null),B&&B(!1,W||void 0)};n.useEffect(function(){at()},[W,H]),n.useEffect(function(){K&&te(!0)},[K]);var at=function(t){return void 0===t&&(t=!1),e.__awaiter(void 0,void 0,void 0,function(){var n,i,o,u,s,l,d,c,f,v,p,m,g,h,T,S,y,_,j;return e.__generator(this,function(w){switch(w.label){case 0:if(!W)return H([]),[2];t||ge(!0),Se(null),w.label=1;case 1:return w.trys.push([1,3,4,5]),[4,a.getRulesInRuleSetById(W,U)];case 2:return n=w.sent(),console.log("response==",n),(null==n?void 0:n.data)&&0!==Object.keys(n.data).length?(i=n.data,console.log("rulesData==",i),o=new Set(["ruleSetName","ruleSetDesc","created_at","updated_at","created_by","updated_by"]),u=Object.entries(i).filter(function(e){var t=e[0],n=e[1];return!o.has(t)&&Array.isArray(n)}),s=u.map(function(e){var t=e[1];return new Set(t.flatMap(function(e){var t,n;return null!==(n=null===(t=e.variants)||void 0===t?void 0:t.map(function(e){return e.link_id}).filter(Boolean))&&void 0!==n?n:[]}))}),l=s.flatMap(function(e){return Array.from(e)}),d=l.reduce(function(e,t){var n;return e[t]=(null!==(n=e[t])&&void 0!==n?n:0)+1,e},{}),c=new Set(Object.entries(d).filter(function(e){return e[1]>1}).map(function(e){return e[0]})),f=function(t){return t.map(function(t){var n;return e.__assign(e.__assign({},t),{variants:null===(n=t.variants)||void 0===n?void 0:n.map(function(t){return e.__assign(e.__assign({},t),{isLinked:!!t.link_id&&c.has(t.link_id)})})})})},v=u.map(function(e,t){var n,r=e[0],i=e[1],a=He.find(function(e){return e.tier_name===r}),o=r.replace(/tier(\d+)/i,"tier_$1");return{id:null!==(n=null==a?void 0:a.tier_id)&&void 0!==n?n:String(t+1),name:o.replace(/_/g," ").replace(/\b\w/g,function(e){return e.toUpperCase()}),ruleCount:i.length,description:0===t?"These are the system-wide learnings applied across all stations.":"These learnings apply after higher-priority tiers and may refine or relax default behavior.",isOpen:0===t,rules:f(i)}}),(p=r.useLearningTemplateStore.getState().createdVariantInfo)&&p.length>0?(m=Object.fromEntries(u.map(function(e,t){return[e[0],String(t+1)]})),g=new Set(p.map(function(e){return m[e.tierName]}).filter(Boolean)),h=v.map(function(t){return e.__assign(e.__assign({},t),{isOpen:t.isOpen||g.has(t.id)})}),H(h),(T=null===(j=null===(_=null===(y=p[0])||void 0===y?void 0:y.variants)||void 0===_?void 0:_[0])||void 0===j?void 0:j.id)?setTimeout(function(){var e=document.querySelector('[data-variant-id="'.concat(T,'"]'));e&&e.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(function(){return z()},1e4)},500):z()):H(v),[3,5]):(H([]),[2]);case 3:return S=w.sent(),console.error("Failed to fetch rule details",S),404!==(null==S?void 0:S.status)&&Se((null==S?void 0:S.message)||"Failed to load rules. Please try again."),H([]),[3,5];case 4:return t||ge(!1),[7];case 5:return[2]}})})},ot=W?f.findNodeById((null==G?void 0:G.data)||null,W):null,ut=ot?{ruleSetId:ot.id,ruleSetName:ot.name,ruleSetDesc:"",ruleCount:null===(T=null==ot?void 0:ot.metrics)||void 0===T?void 0:T.learningsCount}:void 0,st=function(){if("stations"===Q)return"custom";if(!ot)return"global";switch(ot.type){case"GLOBAL":default:return"global";case"SCOPE":return"genre";case"SUBSCOPE":case"Custom":return"custom"}},lt=function(n){if(!n)return t.jsx("p",{children:"Are you sure you want to delete this rule? This action cannot be undone."});var r=null==$?void 0:$.flatMap(function(e){var t;return null!==(t=e.rules)&&void 0!==t?t:[]}).find(function(e){return e.ruleId===n});return t.jsxs("p",{children:["Are you sure you want to delete"," ",t.jsx("span",e.__assign({className:v.default.semibold},{children:null==r?void 0:r.ruleTitle}))," rule? This action cannot be undone."]})},dt={editingRule:re,editingTier:oe,editingVariants:le,focusedVariantIndex:fe,setFocusedVariantIndex:ve,triggerAddVariant:Me,triggerFixGaps:Ge,copiedRule:ze,copiedSourceTier:Ye,copiedTargetTier:tt,initialDraftMessage:xe,app_integration_id:J,modeId:"019dde79-0494-78d7-ba5b-54a35d20f0fc"};return ut?t.jsxs(t.Fragment,{children:[t.jsx(u.Toast,{ref:Y}),t.jsx("div",e.__assign({className:v.default.container},{children:me?t.jsx(o.default,{}):Te?t.jsx(l.default,{errorMessage:Te,onRetry:at}):t.jsx(s.default,{onAddRule:rt,onDeleteRule:function(e){Ie(e)},onEditRule:function(e,t){ie(e),ue(t||null),de(e.variants||null),ve(null),De(!0),te(!0)},onEditVariant:function(e,t,n,r){var i,a,o,u,s=null!==(o=null===(a=null===(i=null==$?void 0:$.find(function(e){return e.name===n}))||void 0===i?void 0:i.rules)||void 0===a?void 0:a.find(function(e){return e.ruleId===t}))&&void 0!==o?o:null==$?void 0:$.flatMap(function(e){return e.rules}).find(function(e){return e.ruleId===t});if(s){var l=null===(u=s.variants)||void 0===u?void 0:u.findIndex(function(t){return t.variantId===e.variantId}),d=void 0!==l&&-1!==l?l:0;ie(s),ue(n||null),de(s.variants||null),ve(d),te(!0),"resolve_gaps"===r&&Qe(!0)}},onDeleteVariant:function(e,t){Pe({variantId:e,ruleId:t})},onExportRule:function(){return e.__awaiter(void 0,void 0,void 0,function(){var n,r,i,o,u,s,l;return e.__generator(this,function(e){switch(e.label){case 0:if(!W)return[2];je(!0),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,a.exportRuleSet(W)];case 2:return n=e.sent(),r=window.URL.createObjectURL(n),(i=document.createElement("a")).href=r,o=(null==ut?void 0:ut.ruleSetName)?"".concat(ut.ruleSetName.replace(/\s+/g,"_"),"_rules.csv"):"ruleset_".concat(W,".csv"),i.download=o,document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(r),null===(s=Y.current)||void 0===s||s.show({severity:"success",sticky:!1,life:3e3,className:v.default.successToast,content:t.jsx(d.default,{message:"Ruleset exported successfully!"})}),[3,5];case 3:return u=e.sent(),console.error("Export error:",u),null===(l=Y.current)||void 0===l||l.show({severity:"error",sticky:!1,className:v.default.errorToast,content:t.jsx(c.default,{message:u.message||"Failed to export ruleset. Please try again."})}),[3,5];case 4:return je(!1),[7];case 5:return[2]}})})},isExporting:_e,onToggleSuccess:function(){return at(!0)},onReorderRules:function(n,r,i,o,u){return e.__awaiter(void 0,void 0,void 0,function(){var s,l,f;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,a.alterQuestionPriority(n,r,i,o,u)];case 1:return e.sent(),at(!0),null===(l=Y.current)||void 0===l||l.show({severity:"success",sticky:!1,life:3e3,className:v.default.successToast,content:t.jsx(d.default,{message:"Rule order changed successfully. Future rule applications will follow the updated order."})}),[3,3];case 2:return s=e.sent(),console.error("Failed to reorder rules:",s),at(!0),null===(f=Y.current)||void 0===f||f.show({severity:"error",sticky:!1,className:v.default.errorToast,content:t.jsx(c.default,{message:"Failed to update rule order. Please try again."})}),[3,3];case 3:return[2]}})})},onRefreshRuleSets:B,setDeleteConfirmationUsedFor:Fe,onCopyToTier:function(e,t,n,r,i){var a,o,u=null===(o=null===(a=null==$?void 0:$.find(function(e){return e.name===r}))||void 0===a?void 0:a.rules)||void 0===o?void 0:o.find(function(e){return e.ruleId===t});if(u){var s=["Add a new learning with the following details:","- Rule Title: ".concat(n),"- Description: ".concat(e.description),"- When to apply: ".concat(e.whenToApply),"- When NOT to apply: ".concat(e.whenNotToApply),"- Tier information: ".concat(i)].join("\n");qe(s),Ke(u),Ze(r),nt(i),ie(null),ue(null),de(null),ve(null),te(!0)}}})})),ee&&t.jsx(m.CitationProvider,{children:t.jsx(g.default,{isOpen:ee,onClose:it,initialScope:st(),ruleSet:ut,app_integration_id:J,pluginPayload:dt,token:U})}),t.jsx(p.default,{isOpen:!!be,title:D,description:lt(be),warning:N,confirmText:P,confirmBgColor:"#EF4444",onConfirm:function(){return e.__awaiter(void 0,void 0,void 0,function(){var n,r,i,o,u;return e.__generator(this,function(e){switch(e.label){case 0:if(!be)return[2];Oe(!0),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,a.deleteRule(be)];case 2:return e.sent(),Ie(null),null===(r=Y.current)||void 0===r||r.show({severity:"success",sticky:!1,life:3e3,className:v.default.successToast,content:t.jsx(d.default,{message:C})}),at(),B&&B(!1,W||void 0),[3,5];case 3:return n=e.sent(),console.error("Failed to delete rule",n),null===(i=Y.current)||void 0===i||i.show({severity:"error",sticky:!1,className:v.default.errorToast,content:t.jsx(c.default,{message:(null===(u=null===(o=null==n?void 0:n.response)||void 0===o?void 0:o.data)||void 0===u?void 0:u.detail)||L})}),[3,5];case 4:return Oe(!1),[7];case 5:return[2]}})})},onCancel:function(){return Ie(null)},isLoading:Le}),t.jsx(p.default,{isOpen:!!Ae,title:D,description:"variantDeletion"===Ne?t.jsx("span",{children:"Are you sure you want to delete this variant? This action cannot be undone."}):lt((null==Ae?void 0:Ae.ruleId)||null),warning:"ruleDeletion"===Ne?N:V,confirmText:P,confirmBgColor:"#EF4444",onConfirm:function(){return e.__awaiter(void 0,void 0,void 0,function(){var n,r,i,o,u;return e.__generator(this,function(e){switch(e.label){case 0:if(!Ae)return[2];Ue(!0),e.label=1;case 1:return e.trys.push([1,6,7,8]),"ruleDeletion"!==Ne?[3,3]:[4,a.deleteQuestion(Ae.ruleId)];case 2:return e.sent(),[3,5];case 3:return[4,a.deleteRule(Ae.variantId)];case 4:e.sent(),e.label=5;case 5:return Pe(null),null===(r=Y.current)||void 0===r||r.show({severity:"success",sticky:!1,life:3e3,className:v.default.successToast,content:t.jsx(d.default,{message:"ruleDeletion"===Ne?C:I})}),at(),B&&B(!1,W||void 0),[3,8];case 6:return n=e.sent(),console.error("Failed to delete variant",n),null===(i=Y.current)||void 0===i||i.show({severity:"error",sticky:!1,className:v.default.errorToast,content:t.jsx(c.default,{message:(null===(u=null===(o=null==n?void 0:n.response)||void 0===o?void 0:o.data)||void 0===u?void 0:u.detail)||("ruleDeletion"===Ne?L:k)})}),[3,8];case 7:return Ue(!1),[7];case 8:return[2]}})})},onCancel:function(){return Pe(null)},isLoading:Je})]}):t.jsxs(t.Fragment,{children:[t.jsx(i.default,{onCreate:rt,title:y,desc:j,button:x}),ee&&t.jsx(m.CitationProvider,{children:t.jsx(g.default,{isOpen:ee,onClose:it,initialScope:st(),ruleSet:ut,app_integration_id:J,pluginPayload:dt,token:U})})]})};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),r=require("../store/useLearningTemplateStore.js"),i=require("../components/EmptyLearningState.js"),a=require("../apis/scopeApis.js"),o=require("../components/RuleContentSkeleton.js"),u=require("primereact/toast"),s=require("./ContentLogic.js"),l=require("../components/ErrorStateDisplay.js"),d=require("../shared/SuccessToastContent.js"),c=require("../shared/ErrorToastContent.js"),f=require("../utils/treeUtils.js"),p=require("../styles/LearningContent.module.css.js"),v=require("../components/ConfirmationModal.js");require("../../IL-OTJ/_components/atoms/Textarea/Textarea.js"),require("lucide-react"),require("../../IL-OTJ/_components/InputDataReasoningCard.js"),require("../../IL-OTJ/_components/TooltipComponent.js"),require("../../IL-OTJ/_components/templates/TemplatesMap/templatesMap.js");var m=require("../../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("../../IL-OTJ/_components/ChatComponents/ChatHeader.js"),require("remark-gfm"),require("../../IL-OTJ/_components/MarkdownComponents/MarkdownElements.js"),require("../../IL-OTJ/_components/CitationLink.js"),require("@e-llm-studio/citation"),require("../../IL-OTJ/_components/templates/RuleComparison/RuleComparison.js");var g=require("../../IL-OTJ/ValueTypeWrappers/TeachMeWrapper.js");require("@radix-ui/react-tooltip"),require("../components/StationOnboarding/InputField.js"),require("../store/useAuthStore.js"),require("../store/useConfigStore.js"),require("../config.js"),require("../store/useEnvStore.js"),require("../components/ToolTip.js"),require("react-router-dom");exports.default=function(h){var T,S=h.noRulesTitle,y=void 0===S?"No rules have been added !":S,_=h.noRulesDesc,j=void 0===_?"Start by adding rules that should apply across all stations.":_,w=h.noRulesButtonText,x=void 0===w?"Create New Rule":w,q=h.deleteRuleSuccessMessage,C=void 0===q?"Rule deleted successfully!":q,R=h.deleteVariantSuccessMessage,b=void 0===R?"Variant deleted successfully!":R,I=h.deleteRuleErrorMessage,L=void 0===I?"Failed to delete rule. Please try again.":I,O=h.deleteVariantErrorMessage,k=void 0===O?"Failed to delete variant. Please try again.":O,M=h.deleteModalTitle,D=void 0===M?"Delete":M,E=h.deleteRuleModalWarning,N=void 0===E?"This will permanently delete the rule configuration.":E,F=h.deleteVariantModalWarning,V=void 0===F?"This will permanently delete the variant configuration.":F,A=h.deleteConfirmText,P=void 0===A?"Delete":A,J=h.onRefreshRuleSets,B=h.app_integration_id,U=h.token,W=r.useLearningTemplateStore(function(e){return e.selectedRuleSetId}),G=r.useLearningTemplateStore(function(e){return e.scopeTreeData}),Q=r.useLearningTemplateStore(function(e){return e.sidebarTab}),H=r.useLearningTemplateStore(function(e){return e.setInitialRules}),$=r.useLearningTemplateStore(function(e){return e.currentRules});r.useLearningTemplateStore(function(e){return e.createdVariantInfo});var z=r.useLearningTemplateStore(function(e){return e.resetCreatedVariantInfo}),K=r.useLearningTemplateStore(function(e){return e.isILModalTriggered}),X=r.useLearningTemplateStore(function(e){return e.setIsILModalTriggered}),Y=n.useRef(null),Z=n.useState(!1),ee=Z[0],te=Z[1],ne=n.useState(null),re=ne[0],ie=ne[1],ae=n.useState(null),oe=ae[0],ue=ae[1],se=n.useState(null),le=se[0],de=se[1],ce=n.useState(null),fe=ce[0],pe=ce[1],ve=n.useState(!1),me=ve[0],ge=ve[1],he=n.useState(null),Te=he[0],Se=he[1],ye=n.useState(!1),_e=ye[0],je=ye[1],we=n.useState(""),xe=we[0],qe=we[1],Ce=n.useState(null),Re=Ce[0],be=Ce[1],Ie=n.useState(!1),Le=Ie[0],Oe=Ie[1],ke=n.useState(!1),Me=ke[0],De=ke[1],Ee=n.useState("ruleDeletion"),Ne=Ee[0],Fe=Ee[1],Ve=n.useState(null),Ae=Ve[0],Pe=Ve[1],Je=n.useState(!1),Be=Je[0],Ue=Je[1],We=n.useState(!1),Ge=We[0],Qe=We[1],He=r.useLearningTemplateStore.getState().tiers,$e=n.useState(null),ze=$e[0],Ke=$e[1],Xe=n.useState(null),Ye=Xe[0],Ze=Xe[1],et=n.useState(null),tt=et[0],nt=et[1],rt=function(){ie(null),ue(null),te(!0),pe(0)},it=function(){te(!1),X(!1),ie(null),ue(null),de(null),pe(null),De(!1),Qe(!1),at(),Ke(null),Ze(null),nt(null),J&&J(!1,W||void 0)};n.useEffect(function(){at()},[W,H]),n.useEffect(function(){K&&te(!0)},[K]);var at=function(t){return void 0===t&&(t=!1),e.__awaiter(void 0,void 0,void 0,function(){var n,i,o,u,s,l,d,c,f,p,v,m,g,h,T,S,y,_,j;return e.__generator(this,function(w){switch(w.label){case 0:if(!W)return H([]),[2];t||ge(!0),Se(null),w.label=1;case 1:return w.trys.push([1,3,4,5]),[4,a.getRulesInRuleSetById(W,U)];case 2:return n=w.sent(),console.log("response==",n),(null==n?void 0:n.data)&&0!==Object.keys(n.data).length?(i=n.data,console.log("rulesData==",i),o=new Set(["ruleSetName","ruleSetDesc","created_at","updated_at","created_by","updated_by"]),u=Object.entries(i).filter(function(e){var t=e[0],n=e[1];return!o.has(t)&&Array.isArray(n)}),s=u.map(function(e){var t=e[1];return new Set(t.flatMap(function(e){var t,n;return null!==(n=null===(t=e.variants)||void 0===t?void 0:t.map(function(e){return e.link_id}).filter(Boolean))&&void 0!==n?n:[]}))}),l=s.flatMap(function(e){return Array.from(e)}),d=l.reduce(function(e,t){var n;return e[t]=(null!==(n=e[t])&&void 0!==n?n:0)+1,e},{}),c=new Set(Object.entries(d).filter(function(e){return e[1]>1}).map(function(e){return e[0]})),f=function(t){return t.map(function(t){var n;return e.__assign(e.__assign({},t),{variants:null===(n=t.variants)||void 0===n?void 0:n.map(function(t){return e.__assign(e.__assign({},t),{isLinked:!!t.link_id&&c.has(t.link_id)})})})})},p=u.map(function(e,t){var n,r=e[0],i=e[1],a=He.find(function(e){return e.tier_name===r}),o=r.replace(/tier(\d+)/i,"tier_$1");return{id:null!==(n=null==a?void 0:a.tier_id)&&void 0!==n?n:String(t+1),name:o.replace(/_/g," ").replace(/\b\w/g,function(e){return e.toUpperCase()}),ruleCount:i.length,description:0===t?"These are the system-wide learnings applied across all stations.":"These learnings apply after higher-priority tiers and may refine or relax default behavior.",isOpen:0===t,rules:f(i)}}),(v=r.useLearningTemplateStore.getState().createdVariantInfo)&&v.length>0?(m=Object.fromEntries(u.map(function(e,t){return[e[0],String(t+1)]})),g=new Set(v.map(function(e){return m[e.tierName]}).filter(Boolean)),h=p.map(function(t){return e.__assign(e.__assign({},t),{isOpen:t.isOpen||g.has(t.id)})}),H(h),(T=null===(j=null===(_=null===(y=v[0])||void 0===y?void 0:y.variants)||void 0===_?void 0:_[0])||void 0===j?void 0:j.id)?setTimeout(function(){var e=document.querySelector('[data-variant-id="'.concat(T,'"]'));e&&e.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(function(){return z()},1e4)},500):z()):H(p),[3,5]):(H([]),[2]);case 3:return S=w.sent(),console.error("Failed to fetch rule details",S),404!==(null==S?void 0:S.status)&&Se((null==S?void 0:S.message)||"Failed to load rules. Please try again."),H([]),[3,5];case 4:return t||ge(!1),[7];case 5:return[2]}})})},ot=W?f.findNodeById((null==G?void 0:G.data)||null,W):null,ut=ot?{ruleSetId:ot.id,ruleSetName:ot.name,ruleSetDesc:"",ruleCount:null===(T=null==ot?void 0:ot.metrics)||void 0===T?void 0:T.learningsCount}:void 0,st=function(){if("stations"===Q)return"custom";if(!ot)return"global";switch(ot.type){case"GLOBAL":default:return"global";case"SCOPE":return"genre";case"SUBSCOPE":case"Custom":return"custom"}},lt=function(n){if(!n)return t.jsx("p",{children:"Are you sure you want to delete this rule? This action cannot be undone."});var r=null==$?void 0:$.flatMap(function(e){var t;return null!==(t=e.rules)&&void 0!==t?t:[]}).find(function(e){return e.ruleId===n});return t.jsxs("p",{children:["Are you sure you want to delete"," ",t.jsx("span",e.__assign({className:p.default.semibold},{children:null==r?void 0:r.ruleTitle}))," rule? This action cannot be undone."]})},dt={editingRule:re,editingTier:oe,editingVariants:le,focusedVariantIndex:fe,setFocusedVariantIndex:pe,triggerAddVariant:Me,triggerFixGaps:Ge,copiedRule:ze,copiedSourceTier:Ye,copiedTargetTier:tt,initialDraftMessage:xe,app_integration_id:B,modeId:"019dde79-0494-78d7-ba5b-54a35d20f0fc"};return ut?t.jsxs(t.Fragment,{children:[t.jsx(u.Toast,{ref:Y}),t.jsx("div",e.__assign({className:p.default.container},{children:me?t.jsx(o.default,{}):Te?t.jsx(l.default,{errorMessage:Te,onRetry:at}):t.jsx(s.default,{onAddRule:rt,onDeleteRule:function(e){be(e)},onEditRule:function(e,t){ie(e),ue(t||null),de(e.variants||null),pe(null),De(!0),te(!0)},onEditVariant:function(e,t,n,r){var i,a,o,u,s=null!==(o=null===(a=null===(i=null==$?void 0:$.find(function(e){return e.name===n}))||void 0===i?void 0:i.rules)||void 0===a?void 0:a.find(function(e){return e.ruleId===t}))&&void 0!==o?o:null==$?void 0:$.flatMap(function(e){return e.rules}).find(function(e){return e.ruleId===t});if(s){var l=null===(u=s.variants)||void 0===u?void 0:u.findIndex(function(t){return t.variantId===e.variantId}),d=void 0!==l&&-1!==l?l:0;ie(s),ue(n||null),de(s.variants||null),pe(d),te(!0),"resolve_gaps"===r&&Qe(!0)}},onDeleteVariant:function(e,t){Pe({variantId:e,ruleId:t})},onExportRule:function(){return e.__awaiter(void 0,void 0,void 0,function(){var n,r,i,o,u,s,l;return e.__generator(this,function(e){switch(e.label){case 0:if(!W)return[2];je(!0),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,a.exportRuleSet(W)];case 2:return n=e.sent(),r=window.URL.createObjectURL(n),(i=document.createElement("a")).href=r,o=(null==ut?void 0:ut.ruleSetName)?"".concat(ut.ruleSetName.replace(/\s+/g,"_"),"_rules.csv"):"ruleset_".concat(W,".csv"),i.download=o,document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(r),null===(s=Y.current)||void 0===s||s.show({severity:"success",sticky:!1,life:3e3,className:p.default.successToast,content:t.jsx(d.default,{message:"Ruleset exported successfully!"})}),[3,5];case 3:return u=e.sent(),console.error("Export error:",u),null===(l=Y.current)||void 0===l||l.show({severity:"error",sticky:!1,className:p.default.errorToast,content:t.jsx(c.default,{message:u.message||"Failed to export ruleset. Please try again."})}),[3,5];case 4:return je(!1),[7];case 5:return[2]}})})},isExporting:_e,onToggleSuccess:function(){return at(!0)},onReorderRules:function(n,r,i,o,u){return e.__awaiter(void 0,void 0,void 0,function(){var s,l,f;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,a.alterQuestionPriority(n,r,i,o,u)];case 1:return e.sent(),at(!0),null===(l=Y.current)||void 0===l||l.show({severity:"success",sticky:!1,life:3e3,className:p.default.successToast,content:t.jsx(d.default,{message:"Rule order changed successfully. Future rule applications will follow the updated order."})}),[3,3];case 2:return s=e.sent(),console.error("Failed to reorder rules:",s),at(!0),null===(f=Y.current)||void 0===f||f.show({severity:"error",sticky:!1,className:p.default.errorToast,content:t.jsx(c.default,{message:"Failed to update rule order. Please try again."})}),[3,3];case 3:return[2]}})})},onRefreshRuleSets:J,setDeleteConfirmationUsedFor:Fe,onCopyToTier:function(e,t,n,r,i){var a,o,u=null===(o=null===(a=null==$?void 0:$.find(function(e){return e.name===r}))||void 0===a?void 0:a.rules)||void 0===o?void 0:o.find(function(e){return e.ruleId===t});if(u){var s=["Add a new learning with the following details:","- Rule Title: ".concat(n),"- Description: ".concat(e.description),"- When to apply: ".concat(e.whenToApply),"- When NOT to apply: ".concat(e.whenNotToApply),"- Tier information: ".concat(i)].join("\n");qe(s),Ke(u),Ze(r),nt(i),ie(null),ue(null),de(null),pe(null),te(!0)}}})})),ee&&t.jsx(m.CitationProvider,{children:t.jsx(g.default,{isOpen:ee,onClose:it,initialScope:st(),ruleSet:ut,app_integration_id:B,pluginPayload:dt,token:U})}),t.jsx(v.default,{isOpen:!!Re,title:D,description:lt(Re),warning:N,confirmText:P,confirmBgColor:"#EF4444",onConfirm:function(){return e.__awaiter(void 0,void 0,void 0,function(){var n,r,i,o,u;return e.__generator(this,function(e){switch(e.label){case 0:if(!Re)return[2];Oe(!0),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,a.deleteRule(Re)];case 2:return e.sent(),be(null),null===(r=Y.current)||void 0===r||r.show({severity:"success",sticky:!1,life:3e3,className:p.default.successToast,content:t.jsx(d.default,{message:C})}),at(),J&&J(!1,W||void 0),[3,5];case 3:return n=e.sent(),console.error("Failed to delete rule",n),null===(i=Y.current)||void 0===i||i.show({severity:"error",sticky:!1,className:p.default.errorToast,content:t.jsx(c.default,{message:(null===(u=null===(o=null==n?void 0:n.response)||void 0===o?void 0:o.data)||void 0===u?void 0:u.detail)||L})}),[3,5];case 4:return Oe(!1),[7];case 5:return[2]}})})},onCancel:function(){return be(null)},isLoading:Le}),t.jsx(v.default,{isOpen:!!Ae,title:D,description:"variantDeletion"===Ne?t.jsx("span",{children:"Are you sure you want to delete this variant? This action cannot be undone."}):lt((null==Ae?void 0:Ae.ruleId)||null),warning:"ruleDeletion"===Ne?N:V,confirmText:P,confirmBgColor:"#EF4444",onConfirm:function(){return e.__awaiter(void 0,void 0,void 0,function(){var n,r,i,o,u;return e.__generator(this,function(e){switch(e.label){case 0:if(!Ae)return[2];Ue(!0),e.label=1;case 1:return e.trys.push([1,6,7,8]),"ruleDeletion"!==Ne?[3,3]:[4,a.deleteQuestion(Ae.ruleId)];case 2:return e.sent(),[3,5];case 3:return[4,a.deleteRule(Ae.variantId)];case 4:e.sent(),e.label=5;case 5:return Pe(null),null===(r=Y.current)||void 0===r||r.show({severity:"success",sticky:!1,life:3e3,className:p.default.successToast,content:t.jsx(d.default,{message:"ruleDeletion"===Ne?C:b})}),at(),J&&J(!1,W||void 0),[3,8];case 6:return n=e.sent(),console.error("Failed to delete variant",n),null===(i=Y.current)||void 0===i||i.show({severity:"error",sticky:!1,className:p.default.errorToast,content:t.jsx(c.default,{message:(null===(u=null===(o=null==n?void 0:n.response)||void 0===o?void 0:o.data)||void 0===u?void 0:u.detail)||("ruleDeletion"===Ne?L:k)})}),[3,8];case 7:return Ue(!1),[7];case 8:return[2]}})})},onCancel:function(){return Pe(null)},isLoading:Be})]}):t.jsxs(t.Fragment,{children:[t.jsx(i.default,{onCreate:rt,title:y,desc:j,button:x}),ee&&t.jsx(m.CitationProvider,{children:t.jsx(g.default,{isOpen:ee,onClose:it,initialScope:st(),ruleSet:ut,app_integration_id:B,pluginPayload:dt,token:U})})]})};
|
|
2
2
|
//# sourceMappingURL=RuleContent.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.API_ENDPOINTS={publishFeedback:"/instant_learning/ilotj/variants",submitChatFeedback:"/instant_learning/feedback/teachme_otj",saveInstantLearningQuestion:"/instant_learning/getLearningQuestionId",fetchScopes:"/instant_learning/ilotj/scope",renameScope:"/instant_learning/scope",getRulesInRuleSetById:"/instant_learning/ilotj/rules/scope",createRuleSet:"/instant_learning/ilotj/scope",fetchStationsByKeyword:"/backend/traffic-manager/station/search/{keyword}",saveRuleSet:"/backend/traffic-manager/station/ruleset",getRuleOverrideHistory:"/instant_learning/learnings/inheritance/change_log",deleteRuleSet:"/instant_learning/ilotj/scope/{ruleSetId}",deleteRule:"/instant_learning/learning/{ruleId}/delete",deleteQuestion:"/instant_learning/question/{questionId}",deleteTier:"instant_learning/scopes/{scopeId}/tiers/{tierId}",updateVariant:"/instant_learning/v2/update/rule",inheritScope:"/instant_learning/ilotj/inherit-scope",updateStation:"/backend/traffic-manager/station/update",exportRuleSet:"/instant_learning/export-ruleset",toggleVariant:"/instant_learning/ilotj/toggle_variant",alterRulePriority:"/instant_learning/v2/alterPriority",fetchRulesByQuestionId:"/instant_learning/learnings/rules/fetch_by_rule_id/{questionId}/{scopeId}?include_config=True",retrieveGenreScopes:"/instant_learning/learnings/retrieve_genre_scopes",searchScopes:"/instant_learning/learnings/search_scopes",sessionValidation:"/instant_learning/session-validation"},exports.LEGACY_API_ENDPOINTS={fetchScopes:"/instant_learning/learning/fetch_by_scope/v2?custom_scope_group_name=Audacy-Traffic-Manager",createRuleSet:"/instant_learning/create-scope",deleteRuleSet:"/instant_learning/scope/{ruleSetId}/delete",getRulesInRuleSetById:"/instant_learning/learnings/rules/fetch_by_scope",publishFeedback:"/instant_learning/save",inheritScope:"/instant_learning/learnings/rules/inherit-scope",toggleVariant:"/instant_learning/toggle_variant"};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.API_ENDPOINTS={publishFeedback:"/instant_learning/ilotj/variants",submitChatFeedback:"/instant_learning/feedback/teachme_otj",saveInstantLearningQuestion:"/instant_learning/getLearningQuestionId",fetchScopes:"/instant_learning/ilotj/scope",renameScope:"/instant_learning/scope",getRulesInRuleSetById:"/instant_learning/ilotj/rules/scope",createRuleSet:"/instant_learning/ilotj/scope",fetchStationsByKeyword:"/backend/traffic-manager/station/search/{keyword}",saveRuleSet:"/backend/traffic-manager/station/ruleset",getRuleOverrideHistory:"/instant_learning/learnings/inheritance/change_log",deleteRuleSet:"/instant_learning/ilotj/scope/{ruleSetId}",deleteRule:"/instant_learning/learning/{ruleId}/delete",deleteQuestion:"/instant_learning/question/{questionId}",deleteTier:"instant_learning/scopes/{scopeId}/tiers/{tierId}",updateVariant:"/instant_learning/v2/update/rule",inheritScope:"/instant_learning/ilotj/inherit-scope",updateStation:"/backend/traffic-manager/station/update",exportRuleSet:"/instant_learning/export-ruleset",toggleVariant:"/instant_learning/ilotj/toggle_variant",alterRulePriority:"/instant_learning/v2/alterPriority",fetchRulesByQuestionId:"/instant_learning/learnings/rules/fetch_by_rule_id/{questionId}/{scopeId}?include_config=True",retrieveGenreScopes:"/instant_learning/learnings/retrieve_genre_scopes",searchScopes:"/instant_learning/learnings/search_scopes",sessionValidation:"/instant_learning/session-validation",getTiers:"/instant_learning/ilotj/tier/{appIntegrationId}"},exports.LEGACY_API_ENDPOINTS={fetchScopes:"/instant_learning/learning/fetch_by_scope/v2?custom_scope_group_name=Audacy-Traffic-Manager",createRuleSet:"/instant_learning/create-scope",deleteRuleSet:"/instant_learning/scope/{ruleSetId}/delete",getRulesInRuleSetById:"/instant_learning/learnings/rules/fetch_by_scope",publishFeedback:"/instant_learning/save",inheritScope:"/instant_learning/learnings/rules/inherit-scope",toggleVariant:"/instant_learning/toggle_variant",getTiers:"/instant_learning/retrieve_tiers"};
|
|
2
2
|
//# sourceMappingURL=apiConfig.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("axios"),r=require("./apiConfig.js"),n=require("../store/useAuthStore.js"),o=require("../store/useEnvStore.js"),a=require("../store/useLearningTemplateStore.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=s(t),c=function(e){return e.interceptors.request.use(function(e){var t=n.default.getState().user,r=null==t?void 0:t.accessToken;return r&&(e.headers.Authorization="Bearer ".concat(r)),e}),e},u=function(e,t){return e.interceptors.request.use(function(e){return e.baseURL=t(),e}),e},l=u(c(i.default.create({headers:{"Content-Type":"application/json"}})),function(){return o.default.getState().audacyBackendUrl||""}),d=u(c(i.default.create({headers:{"Content-Type":"application/json"}})),function(){return o.default.getState().llmStudioUrl||""}),p=function(e){return u(c(i.default.create({headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},withCredentials:!0})),function(){return o.default.getState().llmStudioUrl||""})};exports.alterQuestionPriority=function(t,n,o,a,s){return e.__awaiter(void 0,void 0,void 0,function(){var i,c;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),i={scopeId:t,tierId:n,move:{movedRuleId:o,prevRuleId:a,nextRuleId:s}},[4,d.put(r.API_ENDPOINTS.alterRulePriority,i)];case 1:return[2,e.sent().data];case 2:throw c=e.sent(),console.error("Error altering question priority:",c),c;case 3:return[2]}})})},exports.audacyApi=l,exports.createRuleSet=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var o,s,i;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),o=a.useLearningTemplateStore.getState().backwardCompatibility,s=o?r.LEGACY_API_ENDPOINTS.createRuleSet:r.API_ENDPOINTS.createRuleSet,[4,p(n).post(s,t)];case 1:return[2,e.sent().data];case 2:throw i=e.sent(),console.error("Error creating rule set:",i),i;case 3:return[2]}})})},exports.default=d,exports.deleteQuestion=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n,o;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),n=r.API_ENDPOINTS.deleteQuestion.replace("{questionId}",t),[4,d.delete(n)];case 1:return[2,e.sent().data];case 2:throw o=e.sent(),console.error("Error deleting question:",o),o;case 3:return[2]}})})},exports.deleteRule=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n,o;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),n=r.API_ENDPOINTS.deleteRule.replace("{ruleId}",t),[4,d.delete(n)];case 1:return[2,e.sent().data];case 2:throw o=e.sent(),console.error("Error deleting rule:",o),o;case 3:return[2]}})})},exports.deleteRuleSet=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var o,s,i;return e.__generator(this,function(e){switch(e.label){case 0:o=a.useLearningTemplateStore.getState().backwardCompatibility,e.label=1;case 1:return e.trys.push([1,3,,4]),s=o?r.LEGACY_API_ENDPOINTS.deleteRuleSet.replace("{ruleSetId}",t):r.API_ENDPOINTS.deleteRuleSet.replace("{ruleSetId}",t),[4,p(n).delete(s)];case 2:return[2,e.sent().data];case 3:throw i=e.sent(),console.error("Error deleting rule set:",i),i;case 4:return[2]}})})},exports.deleteTier=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var o,a;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),o=r.API_ENDPOINTS.deleteTier.replace("{scopeId}",t).replace("{tierId}",n),[4,d.delete(o)];case 1:return[2,e.sent().data];case 2:throw a=e.sent(),console.error("Error deleting tier:",a),a;case 3:return[2]}})})},exports.exportRuleSet=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:if(!t)throw new Error("scopeId is required for exporting rule sets");e.label=1;case 1:return e.trys.push([1,3,,4]),[4,d.post(r.API_ENDPOINTS.exportRuleSet,{scope_id:t},{responseType:"blob"})];case 2:return[2,e.sent().data];case 3:throw n=e.sent(),console.error("Error exporting rule set:",n),n;case 4:return[2]}})})},exports.fetchRulesByQuestionId=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var o,a;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),o=r.API_ENDPOINTS.fetchRulesByQuestionId.replace("{questionId}",t).replace("{scopeId}",n),[4,d.get(o)];case 1:return[2,e.sent().data];case 2:throw a=e.sent(),console.error("Error fetching rules by question id:",a),a;case 3:return[2]}})})},exports.fetchScopes=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var o,s,i;return e.__generator(this,function(e){switch(e.label){case 0:o=a.useLearningTemplateStore.getState().backwardCompatibility,e.label=1;case 1:if(e.trys.push([1,3,,4]),!t&&!1===o)throw new Error("App Integration ID is not provided. Falling back to legacy endpoint for fetching scopes.");return s=o?r.LEGACY_API_ENDPOINTS.fetchScopes:"".concat(r.API_ENDPOINTS.fetchScopes,"/").concat(t),[4,p(n).get(s)];case 2:return[2,e.sent().data];case 3:throw i=e.sent(),console.error("Error fetching rule sets:",i),i;case 4:return[2]}})})},exports.fetchStationsByKeyword=function(t,n){return void 0===n&&(n=!1),e.__awaiter(void 0,void 0,void 0,function(){var o,a;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),o="".concat(r.API_ENDPOINTS.fetchStationsByKeyword.replace("{keyword}",t),"?allow_existing=").concat(n),[4,l.get(o)];case 1:return[2,e.sent().data];case 2:throw a=e.sent(),console.error("Error fetching station name by keyword:",a),a;case 3:return[2]}})})},exports.getRuleOverrideHistory=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n,o;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),n="".concat(r.API_ENDPOINTS.getRuleOverrideHistory,"/").concat(t),[4,d.get(n)];case 1:return[2,e.sent().data];case 2:throw o=e.sent(),console.error("Error getting rule override history:",o),o;case 3:return[2]}})})},exports.getRulesInRuleSetById=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var o,s,i;return e.__generator(this,function(e){switch(e.label){case 0:o=a.useLearningTemplateStore.getState().backwardCompatibility,e.label=1;case 1:return e.trys.push([1,3,,4]),s=o?"".concat(r.LEGACY_API_ENDPOINTS.getRulesInRuleSetById,"/").concat(t,"?include_config=True&sort_variant_by=createdAt"):"".concat(r.API_ENDPOINTS.getRulesInRuleSetById,"/").concat(t),[4,p(n).get(s)];case 2:return[2,e.sent().data];case 3:return i=e.sent(),console.error("Error fetching rules in rule set:",i),[3,4];case 4:return[2]}})})},exports.getStationsByScopeId=function(t){return e.__awaiter(void 0,void 0,void 0,function(){return e.__generator(this,function(e){return[2,new Promise(function(e){setTimeout(function(){e({data:[{stationId:"reetrtdfsds",stationName:"Hot 98.7",stationDesc:"Learnings that apply for Hot 98.7 Station",learningsCount:5},{stationId:"sta-102",stationName:"Smooth Jazz 102.1",stationDesc:"Learnings that apply for Smooth Jazz 102.1 Station",learningsCount:12},{stationId:"sta-103",stationName:"Rock 94",stationDesc:"Learnings that apply for Rock 94 Station",learningsCount:8}]})},500)})]})})},exports.inheritScope=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,4,,5]),(null==t?void 0:t.application_mapping_id)?[4,d.post(r.API_ENDPOINTS.inheritScope,t)]:[3,2];case 1:return[2,e.sent().data];case 2:throw Error("Fatal Error: Trying to call inherit API without appintegration ID");case 3:return[3,5];case 4:throw n=e.sent(),console.error("Error inheriting scope:",n),n;case 5:return[2]}})})},exports.inheritScopeBackwardCompatible=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,d.post(r.LEGACY_API_ENDPOINTS.inheritScope,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error inheriting scope:",n),n;case 3:return[2]}})})},exports.llmApiWithToken=p,exports.publishFeedback=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var n,o,s;return e.__generator(this,function(e){switch(e.label){case 0:n=a.useLearningTemplateStore.getState().backwardCompatibility,e.label=1;case 1:return e.trys.push([1,3,,4]),o=n?r.LEGACY_API_ENDPOINTS.publishFeedback:"".concat(r.API_ENDPOINTS.publishFeedback),[4,d.post(o,t)];case 2:return[2,e.sent().data];case 3:throw s=e.sent(),console.error("Error publishing feedback to LLM Studio:",s),s;case 4:return[2]}})})},exports.renameScope=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n,o;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),n="".concat(r.API_ENDPOINTS.renameScope),[4,d.put(n,t)];case 1:return[2,e.sent().data];case 2:throw o=e.sent(),console.error("Error renaming scope:",o),o;case 3:return[2]}})})},exports.retrieveGenreScopes=function(t){return void 0===t&&(t={limit:"50",offset:"0"}),e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,d.post(r.API_ENDPOINTS.retrieveGenreScopes,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error retrieving genre scopes:",n),n;case 3:return[2]}})})},exports.saveInstantLearningQuestion=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,d.post(r.API_ENDPOINTS.saveInstantLearningQuestion,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error saving instant learning question:",n),n;case 3:return[2]}})})},exports.searchScopes=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,d.post(r.API_ENDPOINTS.searchScopes,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error searching scopes:",n),n;case 3:return[2]}})})},exports.submitChatFeedback=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,d.post(r.API_ENDPOINTS.submitChatFeedback,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error submitting chat feedback:",n),n;case 3:return[2]}})})},exports.toggleVariant=function(t,n,o){return e.__awaiter(void 0,void 0,void 0,function(){var o,s,i,c;return e.__generator(this,function(e){switch(e.label){case 0:o=a.useLearningTemplateStore.getState().backwardCompatibility,s=a.useLearningTemplateStore.getState().app_integration_id,i=a.useLearningTemplateStore.getState().token,e.label=1;case 1:return e.trys.push([1,6,,7]),o?[4,p(i).patch(r.LEGACY_API_ENDPOINTS.toggleVariant,{variant_ids:t,is_enabled:n})]:[3,3];case 2:return[2,e.sent().data];case 3:return[4,p(i).patch(r.API_ENDPOINTS.toggleVariant,{variant_ids:t,application_mapping_id:s,is_enabled:n})];case 4:return[2,e.sent().data];case 5:return[3,7];case 6:throw c=e.sent(),console.error("Error toggling variant status:",c),c;case 7:return[2]}})})},exports.updateStation=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,l.post(r.API_ENDPOINTS.updateStation,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error updating station:",n),n;case 3:return[2]}})})},exports.updateVariant=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,d.put(r.API_ENDPOINTS.updateVariant,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error updating variant:",n),n;case 3:return[2]}})})};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("axios"),r=require("./apiConfig.js"),n=require("../store/useAuthStore.js"),a=require("../store/useEnvStore.js"),o=require("../store/useLearningTemplateStore.js"),i=require("../config.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=s(t),c=function(e){return e.interceptors.request.use(function(e){var t=n.default.getState().user,r=null==t?void 0:t.accessToken;return r&&(e.headers.Authorization="Bearer ".concat(r)),e}),e},l=function(e,t){return e.interceptors.request.use(function(e){return e.baseURL=t(),e}),e},d=l(c(u.default.create({headers:{"Content-Type":"application/json"}})),function(){return a.default.getState().audacyBackendUrl||""}),p=l(c(u.default.create({headers:{"Content-Type":"application/json"}})),function(){return a.default.getState().llmStudioUrl||""}),_=function(e){return l(c(u.default.create({headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},withCredentials:!0})),function(){return a.default.getState().llmStudioUrl||""})};exports.alterQuestionPriority=function(t,n,a,o,i){return e.__awaiter(void 0,void 0,void 0,function(){var s,u;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),s={scopeId:t,tierId:n,move:{movedRuleId:a,prevRuleId:o,nextRuleId:i}},[4,p.put(r.API_ENDPOINTS.alterRulePriority,s)];case 1:return[2,e.sent().data];case 2:throw u=e.sent(),console.error("Error altering question priority:",u),u;case 3:return[2]}})})},exports.audacyApi=d,exports.createRuleSet=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var a,i,s;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),a=o.useLearningTemplateStore.getState().backwardCompatibility,i=a?r.LEGACY_API_ENDPOINTS.createRuleSet:r.API_ENDPOINTS.createRuleSet,[4,_(n).post(i,t)];case 1:return[2,e.sent().data];case 2:throw s=e.sent(),console.error("Error creating rule set:",s),s;case 3:return[2]}})})},exports.default=p,exports.deleteQuestion=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n,a;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),n=r.API_ENDPOINTS.deleteQuestion.replace("{questionId}",t),[4,p.delete(n)];case 1:return[2,e.sent().data];case 2:throw a=e.sent(),console.error("Error deleting question:",a),a;case 3:return[2]}})})},exports.deleteRule=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n,a;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),n=r.API_ENDPOINTS.deleteRule.replace("{ruleId}",t),[4,p.delete(n)];case 1:return[2,e.sent().data];case 2:throw a=e.sent(),console.error("Error deleting rule:",a),a;case 3:return[2]}})})},exports.deleteRuleSet=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var a,i,s;return e.__generator(this,function(e){switch(e.label){case 0:a=o.useLearningTemplateStore.getState().backwardCompatibility,e.label=1;case 1:return e.trys.push([1,3,,4]),i=a?r.LEGACY_API_ENDPOINTS.deleteRuleSet.replace("{ruleSetId}",t):r.API_ENDPOINTS.deleteRuleSet.replace("{ruleSetId}",t),[4,_(n).delete(i)];case 2:return[2,e.sent().data];case 3:throw s=e.sent(),console.error("Error deleting rule set:",s),s;case 4:return[2]}})})},exports.deleteTier=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var a,o;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),a=r.API_ENDPOINTS.deleteTier.replace("{scopeId}",t).replace("{tierId}",n),[4,p.delete(a)];case 1:return[2,e.sent().data];case 2:throw o=e.sent(),console.error("Error deleting tier:",o),o;case 3:return[2]}})})},exports.exportRuleSet=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:if(!t)throw new Error("scopeId is required for exporting rule sets");e.label=1;case 1:return e.trys.push([1,3,,4]),[4,p.post(r.API_ENDPOINTS.exportRuleSet,{scope_id:t},{responseType:"blob"})];case 2:return[2,e.sent().data];case 3:throw n=e.sent(),console.error("Error exporting rule set:",n),n;case 4:return[2]}})})},exports.fetchRulesByQuestionId=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var a,o;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),a=r.API_ENDPOINTS.fetchRulesByQuestionId.replace("{questionId}",t).replace("{scopeId}",n),[4,p.get(a)];case 1:return[2,e.sent().data];case 2:throw o=e.sent(),console.error("Error fetching rules by question id:",o),o;case 3:return[2]}})})},exports.fetchScopes=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var a,i,s;return e.__generator(this,function(e){switch(e.label){case 0:a=o.useLearningTemplateStore.getState().backwardCompatibility,e.label=1;case 1:if(e.trys.push([1,3,,4]),!t&&!1===a)throw new Error("App Integration ID is not provided. Falling back to legacy endpoint for fetching scopes.");return i=a?r.LEGACY_API_ENDPOINTS.fetchScopes:"".concat(r.API_ENDPOINTS.fetchScopes,"/").concat(t),[4,_(n).get(i)];case 2:return[2,e.sent().data];case 3:throw s=e.sent(),console.error("Error fetching rule sets:",s),s;case 4:return[2]}})})},exports.fetchStationsByKeyword=function(t,n){return void 0===n&&(n=!1),e.__awaiter(void 0,void 0,void 0,function(){var a,o;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),a="".concat(r.API_ENDPOINTS.fetchStationsByKeyword.replace("{keyword}",t),"?allow_existing=").concat(n),[4,d.get(a)];case 1:return[2,e.sent().data];case 2:throw o=e.sent(),console.error("Error fetching station name by keyword:",o),o;case 3:return[2]}})})},exports.fetchTiers=function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,n,a,s,u,c,l,d;return e.__generator(this,function(e){switch(e.label){case 0:t=o.useLearningTemplateStore.getState().backwardCompatibility,n=o.useLearningTemplateStore.getState().app_integration_id,a=o.useLearningTemplateStore.getState().token,e.label=1;case 1:return e.trys.push([1,6,,7]),t?(s=i.IL_CONFIG_CONSTANTS.CUSTOM_SCOPE_GROUP_NAME,[4,_(a).post(r.LEGACY_API_ENDPOINTS.getTiers,{tier_group_name:s})]):[3,3];case 2:return u=e.sent(),o.useLearningTemplateStore.getState().setTiers((null===(l=u.data)||void 0===l?void 0:l.response)||[]),[3,5];case 3:return[4,_(a).get(r.API_ENDPOINTS.getTiers.replace("{appIntegrationId}",null!=n?n:""))];case 4:u=e.sent(),"success"===(null===(d=u.data)||void 0===d?void 0:d.status)&&o.useLearningTemplateStore.getState().setTiers(u.data.data.map(function(e){return{tier_id:e.id,tier_name:e.name,tier_priority:e.tier_priority}})),e.label=5;case 5:return[3,7];case 6:throw c=e.sent(),console.error("Error fetching tiers:",c),c;case 7:return[2]}})})},exports.getRuleOverrideHistory=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n,a;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),n="".concat(r.API_ENDPOINTS.getRuleOverrideHistory,"/").concat(t),[4,p.get(n)];case 1:return[2,e.sent().data];case 2:throw a=e.sent(),console.error("Error getting rule override history:",a),a;case 3:return[2]}})})},exports.getRulesInRuleSetById=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var a,i,s;return e.__generator(this,function(e){switch(e.label){case 0:a=o.useLearningTemplateStore.getState().backwardCompatibility,e.label=1;case 1:return e.trys.push([1,3,,4]),i=a?"".concat(r.LEGACY_API_ENDPOINTS.getRulesInRuleSetById,"/").concat(t,"?include_config=True&sort_variant_by=createdAt"):"".concat(r.API_ENDPOINTS.getRulesInRuleSetById,"/").concat(t),[4,_(n).get(i)];case 2:return[2,e.sent().data];case 3:return s=e.sent(),console.error("Error fetching rules in rule set:",s),[3,4];case 4:return[2]}})})},exports.getStationsByScopeId=function(t){return e.__awaiter(void 0,void 0,void 0,function(){return e.__generator(this,function(e){return[2,new Promise(function(e){setTimeout(function(){e({data:[{stationId:"reetrtdfsds",stationName:"Hot 98.7",stationDesc:"Learnings that apply for Hot 98.7 Station",learningsCount:5},{stationId:"sta-102",stationName:"Smooth Jazz 102.1",stationDesc:"Learnings that apply for Smooth Jazz 102.1 Station",learningsCount:12},{stationId:"sta-103",stationName:"Rock 94",stationDesc:"Learnings that apply for Rock 94 Station",learningsCount:8}]})},500)})]})})},exports.inheritScope=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,4,,5]),(null==t?void 0:t.application_mapping_id)?[4,p.post(r.API_ENDPOINTS.inheritScope,t)]:[3,2];case 1:return[2,e.sent().data];case 2:throw Error("Fatal Error: Trying to call inherit API without appintegration ID");case 3:return[3,5];case 4:throw n=e.sent(),console.error("Error inheriting scope:",n),n;case 5:return[2]}})})},exports.inheritScopeBackwardCompatible=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,p.post(r.LEGACY_API_ENDPOINTS.inheritScope,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error inheriting scope:",n),n;case 3:return[2]}})})},exports.llmApiWithToken=_,exports.publishFeedback=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var n,a,i;return e.__generator(this,function(e){switch(e.label){case 0:n=o.useLearningTemplateStore.getState().backwardCompatibility,e.label=1;case 1:return e.trys.push([1,3,,4]),a=n?r.LEGACY_API_ENDPOINTS.publishFeedback:"".concat(r.API_ENDPOINTS.publishFeedback),[4,p.post(a,t)];case 2:return[2,e.sent().data];case 3:throw i=e.sent(),console.error("Error publishing feedback to LLM Studio:",i),i;case 4:return[2]}})})},exports.renameScope=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n,a;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),n="".concat(r.API_ENDPOINTS.renameScope),[4,p.put(n,t)];case 1:return[2,e.sent().data];case 2:throw a=e.sent(),console.error("Error renaming scope:",a),a;case 3:return[2]}})})},exports.retrieveGenreScopes=function(t){return void 0===t&&(t={limit:"50",offset:"0"}),e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,p.post(r.API_ENDPOINTS.retrieveGenreScopes,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error retrieving genre scopes:",n),n;case 3:return[2]}})})},exports.saveInstantLearningQuestion=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,p.post(r.API_ENDPOINTS.saveInstantLearningQuestion,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error saving instant learning question:",n),n;case 3:return[2]}})})},exports.searchScopes=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,p.post(r.API_ENDPOINTS.searchScopes,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error searching scopes:",n),n;case 3:return[2]}})})},exports.submitChatFeedback=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,p.post(r.API_ENDPOINTS.submitChatFeedback,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error submitting chat feedback:",n),n;case 3:return[2]}})})},exports.toggleVariant=function(t,n,a){return e.__awaiter(void 0,void 0,void 0,function(){var a,i,s,u;return e.__generator(this,function(e){switch(e.label){case 0:a=o.useLearningTemplateStore.getState().backwardCompatibility,i=o.useLearningTemplateStore.getState().app_integration_id,s=o.useLearningTemplateStore.getState().token,e.label=1;case 1:return e.trys.push([1,6,,7]),a?[4,_(s).patch(r.LEGACY_API_ENDPOINTS.toggleVariant,{variant_ids:t,is_enabled:n})]:[3,3];case 2:return[2,e.sent().data];case 3:return[4,_(s).patch(r.API_ENDPOINTS.toggleVariant,{variant_ids:t,application_mapping_id:i,is_enabled:n})];case 4:return[2,e.sent().data];case 5:return[3,7];case 6:throw u=e.sent(),console.error("Error toggling variant status:",u),u;case 7:return[2]}})})},exports.updateStation=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,d.post(r.API_ENDPOINTS.updateStation,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error updating station:",n),n;case 3:return[2]}})})},exports.updateVariant=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,p.put(r.API_ENDPOINTS.updateVariant,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error updating variant:",n),n;case 3:return[2]}})})};
|
|
2
2
|
//# sourceMappingURL=scopeApis.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("react");exports.default="data:image/svg+xml,%3Csvg%20width%3D%22160%22%20height%3D%22153%22%20viewBox%3D%220%200%20160%20153%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M79.2744%20143.735C116.627%20143.735%20146.909%20113.508%20146.909%2076.223C146.909%2038.9359%20116.627%208.71106%2079.2744%208.71106C41.9192%208.71106%2011.6367%2038.9359%2011.6367%2076.223C11.6367%20113.508%2041.9192%20143.735%2079.2744%20143.735Z%22%20fill%3D%22%23F8FAFC%22%2F%3E%3Cpath%20d%3D%22M116.902%2030.8984H43.3269C38.7417%2030.8984%2035.0234%2034.7993%2035.0234%2039.6097H125.205C125.205%2034.7993%20121.489%2030.8984%20116.902%2030.8984Z%22%20fill%3D%22%23D0D9E4%22%2F%3E%3Cpath%20d%3D%22M35.0234%2039.6094H125.205V109.239C125.205%20112.335%20123.994%20115.304%20121.834%20117.494C119.674%20119.684%20116.745%20120.914%20113.692%20120.914H46.5394C43.4834%20120.914%2040.555%20119.684%2038.3973%20117.494C36.2372%20115.304%2035.0234%20112.335%2035.0234%20109.239V39.6094Z%22%20fill%3D%22%23F1F5F9%22%2F%3E%3Cpath%20d%3D%22M125.155%2039.6592V109.239C125.155%20112.322%20123.949%20115.279%20121.798%20117.459C119.647%20119.639%20116.731%20120.864%20113.691%20120.864H46.5391C43.4967%20120.864%2040.5809%20119.639%2038.4326%20117.459C36.2818%20115.279%2035.0732%20112.322%2035.0732%20109.239V39.6592H125.155Z%22%20stroke%3D%22%2364748B%22%20stroke-opacity%3D%220.1%22%20stroke-width%3D%220.1%22%2F%3E%3Cpath%20d%3D%22M70.571%2048.3203H48.9307C48.4799%2048.3203%2048.1133%2049.295%2048.1133%2050.4981C48.1133%2051.7012%2048.4799%2052.6759%2048.9307%2052.6759H70.571C71.0218%2052.6759%2071.386%2051.7012%2071.386%2050.4981C71.386%2049.295%2071.0218%2048.3203%2070.571%2048.3203Z%22%20fill%3D%22url%28%23paint0_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%2067.1953H48.9307C48.4799%2067.1953%2048.1133%2068.17%2048.1133%2069.3731C48.1133%2070.5762%2048.4799%2071.5509%2048.9307%2071.5509H70.571C71.0218%2071.5509%2071.386%2070.5762%2071.386%2069.3731C71.386%2068.17%2071.0218%2067.1953%2070.571%2067.1953Z%22%20fill%3D%22url%28%23paint1_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%2086.0703H48.9307C48.4799%2086.0703%2048.1133%2087.0468%2048.1133%2088.2493C48.1133%2089.4517%2048.4799%2090.4259%2048.9307%2090.4259H70.571C71.0218%2090.4259%2071.386%2089.4517%2071.386%2088.2493C71.386%2087.0468%2071.0218%2086.0703%2070.571%2086.0703Z%22%20fill%3D%22url%28%23paint2_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%20104.945H48.9307C48.4799%20104.945%2048.1133%20105.922%2048.1133%20107.124C48.1133%20108.327%2048.4799%20109.301%2048.9307%20109.301H70.571C71.0218%20109.301%2071.386%20108.327%2071.386%20107.124C71.386%20105.922%2071.0218%20104.945%2070.571%20104.945Z%22%20fill%3D%22url%28%23paint3_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2048.3203H78.6367C77.8481%2048.3203%2077.207%2049.295%2077.207%2050.4981C77.207%2051.7012%2077.8481%2052.6759%2078.6367%2052.6759H116.507C117.296%2052.6759%20117.934%2051.7012%20117.934%2050.4981C117.934%2049.295%20117.296%2048.3203%20116.507%2048.3203Z%22%20fill%3D%22url%28%23paint4_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2086.0703H78.6367C77.8481%2086.0703%2077.207%2087.045%2077.207%2088.2481C77.207%2089.4512%2077.8481%2090.4259%2078.6367%2090.4259H116.507C117.296%2090.4259%20117.934%2089.4512%20117.934%2088.2481C117.934%2087.045%20117.296%2086.0703%20116.507%2086.0703Z%22%20fill%3D%22url%28%23paint5_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2067.1953H78.6367C77.8481%2067.1953%2077.207%2068.17%2077.207%2069.3731C77.207%2070.5762%2077.8481%2071.5509%2078.6367%2071.5509H116.507C117.296%2071.5509%20117.934%2070.5762%20117.934%2069.3731C117.934%2068.17%20117.296%2067.1953%20116.507%2067.1953Z%22%20fill%3D%22url%28%23paint6_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%20104.945H78.6367C77.8481%20104.945%2077.207%20105.92%2077.207%20107.123C77.207%20108.326%2077.8481%20109.301%2078.6367%20109.301H116.507C117.296%20109.301%20117.934%20108.326%20117.934%20107.123C117.934%20105.92%20117.296%20104.945%20116.507%20104.945Z%22%20fill%3D%22url%28%23paint7_linear_1020_82405%29%22%2F%3E%3CforeignObject%20x%3D%2270.7116%22%20y%3D%2260.6843%22%20width%3D%2279.8961%22%20height%3D%2279.81%22%3E%3Cdiv%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20style%3D%22backdrop-filter%3Ablur%288.34px%29%3Bclip-path%3Aurl%28%23bgblur_0_1020_82405_clip_path%29%3Bheight%3A100%25%3Bwidth%3A100%25%22%3E%3C%2Fdiv%3E%3C%2FforeignObject%3E%3Cpath%20data-figma-bg-blur-radius%3D%2216.6751%22%20d%3D%22M110.659%20123.819C123.513%20123.819%20133.932%20113.419%20133.932%20100.589C133.932%2087.7597%20123.513%2077.3594%20110.659%2077.3594C97.8062%2077.3594%2087.3867%2087.7597%2087.3867%20100.589C87.3867%20113.419%2097.8062%20123.819%20110.659%20123.819Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M110.659%2085.3419C111.63%2085.3458%20112.413%2086.1299%20112.411%2087.0961L112.395%2098.2651L123.584%2098.2817C124.555%2098.2856%20125.338%2099.0696%20125.339%20100.038C125.335%20101.007%20124.55%20101.789%20123.579%20101.79L112.39%20101.773L112.373%20112.942C112.372%20113.908%20111.586%20114.69%20110.615%20114.691C109.645%20114.687%20108.862%20113.903%20108.861%20112.935L108.877%20101.766L97.6878%20101.749C96.7198%20101.748%2095.9366%20100.964%2095.9355%2099.9948C95.9395%2099.0261%2096.725%2098.2443%2097.693%2098.2458L108.883%2098.2623L108.899%2087.0934C108.903%2086.1247%20109.689%2085.3429%20110.659%2085.3419Z%22%20fill%3D%22%23CBD5E1%22%2F%3E%3Cdefs%3E%3CclipPath%20id%3D%22bgblur_0_1020_82405_clip_path%22%20transform%3D%22translate%28-70.7116%20-60.6843%29%22%3E%3Cpath%20d%3D%22M110.659%20123.819C123.513%20123.819%20133.932%20113.419%20133.932%20100.589C133.932%2087.7597%20123.513%2077.3594%20110.659%2077.3594C97.8062%2077.3594%2087.3867%2087.7597%2087.3867%20100.589C87.3867%20113.419%2097.8062%20123.819%20110.659%20123.819Z%22%2F%3E%3C%2FclipPath%3E%3ClinearGradient%20id%3D%22paint0_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2252.497%22%20x2%3D%2272.7628%22%20y2%3D%2252.497%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint1_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2271.372%22%20x2%3D%2272.7628%22%20y2%3D%2271.372%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint2_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2290.247%22%20x2%3D%2272.7628%22%20y2%3D%2290.247%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint3_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%22109.122%22%20x2%3D%2272.7628%22%20y2%3D%22109.122%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint4_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2252.497%22%20x2%3D%22120.344%22%20y2%3D%2252.497%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint5_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2290.247%22%20x2%3D%22120.344%22%20y2%3D%2290.247%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint6_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2271.372%22%20x2%3D%22120.344%22%20y2%3D%2271.372%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint7_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%22109.122%22%20x2%3D%22120.344%22%20y2%3D%22109.122%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E";
|
|
2
|
+
//# sourceMappingURL=Search-result(add new).svg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Search-result(add new).svg.js","sources":["../../../../../src/features/LearningManagement/assets/Search-result(add new).svg"],"sourcesContent":["export default \"data:image/svg+xml,%3Csvg%20width%3D%22160%22%20height%3D%22153%22%20viewBox%3D%220%200%20160%20153%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M79.2744%20143.735C116.627%20143.735%20146.909%20113.508%20146.909%2076.223C146.909%2038.9359%20116.627%208.71106%2079.2744%208.71106C41.9192%208.71106%2011.6367%2038.9359%2011.6367%2076.223C11.6367%20113.508%2041.9192%20143.735%2079.2744%20143.735Z%22%20fill%3D%22%23F8FAFC%22%2F%3E%3Cpath%20d%3D%22M116.902%2030.8984H43.3269C38.7417%2030.8984%2035.0234%2034.7993%2035.0234%2039.6097H125.205C125.205%2034.7993%20121.489%2030.8984%20116.902%2030.8984Z%22%20fill%3D%22%23D0D9E4%22%2F%3E%3Cpath%20d%3D%22M35.0234%2039.6094H125.205V109.239C125.205%20112.335%20123.994%20115.304%20121.834%20117.494C119.674%20119.684%20116.745%20120.914%20113.692%20120.914H46.5394C43.4834%20120.914%2040.555%20119.684%2038.3973%20117.494C36.2372%20115.304%2035.0234%20112.335%2035.0234%20109.239V39.6094Z%22%20fill%3D%22%23F1F5F9%22%2F%3E%3Cpath%20d%3D%22M125.155%2039.6592V109.239C125.155%20112.322%20123.949%20115.279%20121.798%20117.459C119.647%20119.639%20116.731%20120.864%20113.691%20120.864H46.5391C43.4967%20120.864%2040.5809%20119.639%2038.4326%20117.459C36.2818%20115.279%2035.0732%20112.322%2035.0732%20109.239V39.6592H125.155Z%22%20stroke%3D%22%2364748B%22%20stroke-opacity%3D%220.1%22%20stroke-width%3D%220.1%22%2F%3E%3Cpath%20d%3D%22M70.571%2048.3203H48.9307C48.4799%2048.3203%2048.1133%2049.295%2048.1133%2050.4981C48.1133%2051.7012%2048.4799%2052.6759%2048.9307%2052.6759H70.571C71.0218%2052.6759%2071.386%2051.7012%2071.386%2050.4981C71.386%2049.295%2071.0218%2048.3203%2070.571%2048.3203Z%22%20fill%3D%22url%28%23paint0_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%2067.1953H48.9307C48.4799%2067.1953%2048.1133%2068.17%2048.1133%2069.3731C48.1133%2070.5762%2048.4799%2071.5509%2048.9307%2071.5509H70.571C71.0218%2071.5509%2071.386%2070.5762%2071.386%2069.3731C71.386%2068.17%2071.0218%2067.1953%2070.571%2067.1953Z%22%20fill%3D%22url%28%23paint1_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%2086.0703H48.9307C48.4799%2086.0703%2048.1133%2087.0468%2048.1133%2088.2493C48.1133%2089.4517%2048.4799%2090.4259%2048.9307%2090.4259H70.571C71.0218%2090.4259%2071.386%2089.4517%2071.386%2088.2493C71.386%2087.0468%2071.0218%2086.0703%2070.571%2086.0703Z%22%20fill%3D%22url%28%23paint2_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%20104.945H48.9307C48.4799%20104.945%2048.1133%20105.922%2048.1133%20107.124C48.1133%20108.327%2048.4799%20109.301%2048.9307%20109.301H70.571C71.0218%20109.301%2071.386%20108.327%2071.386%20107.124C71.386%20105.922%2071.0218%20104.945%2070.571%20104.945Z%22%20fill%3D%22url%28%23paint3_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2048.3203H78.6367C77.8481%2048.3203%2077.207%2049.295%2077.207%2050.4981C77.207%2051.7012%2077.8481%2052.6759%2078.6367%2052.6759H116.507C117.296%2052.6759%20117.934%2051.7012%20117.934%2050.4981C117.934%2049.295%20117.296%2048.3203%20116.507%2048.3203Z%22%20fill%3D%22url%28%23paint4_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2086.0703H78.6367C77.8481%2086.0703%2077.207%2087.045%2077.207%2088.2481C77.207%2089.4512%2077.8481%2090.4259%2078.6367%2090.4259H116.507C117.296%2090.4259%20117.934%2089.4512%20117.934%2088.2481C117.934%2087.045%20117.296%2086.0703%20116.507%2086.0703Z%22%20fill%3D%22url%28%23paint5_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2067.1953H78.6367C77.8481%2067.1953%2077.207%2068.17%2077.207%2069.3731C77.207%2070.5762%2077.8481%2071.5509%2078.6367%2071.5509H116.507C117.296%2071.5509%20117.934%2070.5762%20117.934%2069.3731C117.934%2068.17%20117.296%2067.1953%20116.507%2067.1953Z%22%20fill%3D%22url%28%23paint6_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%20104.945H78.6367C77.8481%20104.945%2077.207%20105.92%2077.207%20107.123C77.207%20108.326%2077.8481%20109.301%2078.6367%20109.301H116.507C117.296%20109.301%20117.934%20108.326%20117.934%20107.123C117.934%20105.92%20117.296%20104.945%20116.507%20104.945Z%22%20fill%3D%22url%28%23paint7_linear_1020_82405%29%22%2F%3E%3CforeignObject%20x%3D%2270.7116%22%20y%3D%2260.6843%22%20width%3D%2279.8961%22%20height%3D%2279.81%22%3E%3Cdiv%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20style%3D%22backdrop-filter%3Ablur%288.34px%29%3Bclip-path%3Aurl%28%23bgblur_0_1020_82405_clip_path%29%3Bheight%3A100%25%3Bwidth%3A100%25%22%3E%3C%2Fdiv%3E%3C%2FforeignObject%3E%3Cpath%20data-figma-bg-blur-radius%3D%2216.6751%22%20d%3D%22M110.659%20123.819C123.513%20123.819%20133.932%20113.419%20133.932%20100.589C133.932%2087.7597%20123.513%2077.3594%20110.659%2077.3594C97.8062%2077.3594%2087.3867%2087.7597%2087.3867%20100.589C87.3867%20113.419%2097.8062%20123.819%20110.659%20123.819Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M110.659%2085.3419C111.63%2085.3458%20112.413%2086.1299%20112.411%2087.0961L112.395%2098.2651L123.584%2098.2817C124.555%2098.2856%20125.338%2099.0696%20125.339%20100.038C125.335%20101.007%20124.55%20101.789%20123.579%20101.79L112.39%20101.773L112.373%20112.942C112.372%20113.908%20111.586%20114.69%20110.615%20114.691C109.645%20114.687%20108.862%20113.903%20108.861%20112.935L108.877%20101.766L97.6878%20101.749C96.7198%20101.748%2095.9366%20100.964%2095.9355%2099.9948C95.9395%2099.0261%2096.725%2098.2443%2097.693%2098.2458L108.883%2098.2623L108.899%2087.0934C108.903%2086.1247%20109.689%2085.3429%20110.659%2085.3419Z%22%20fill%3D%22%23CBD5E1%22%2F%3E%3Cdefs%3E%3CclipPath%20id%3D%22bgblur_0_1020_82405_clip_path%22%20transform%3D%22translate%28-70.7116%20-60.6843%29%22%3E%3Cpath%20d%3D%22M110.659%20123.819C123.513%20123.819%20133.932%20113.419%20133.932%20100.589C133.932%2087.7597%20123.513%2077.3594%20110.659%2077.3594C97.8062%2077.3594%2087.3867%2087.7597%2087.3867%20100.589C87.3867%20113.419%2097.8062%20123.819%20110.659%20123.819Z%22%2F%3E%3C%2FclipPath%3E%3ClinearGradient%20id%3D%22paint0_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2252.497%22%20x2%3D%2272.7628%22%20y2%3D%2252.497%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint1_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2271.372%22%20x2%3D%2272.7628%22%20y2%3D%2271.372%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint2_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2290.247%22%20x2%3D%2272.7628%22%20y2%3D%2290.247%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint3_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%22109.122%22%20x2%3D%2272.7628%22%20y2%3D%22109.122%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint4_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2252.497%22%20x2%3D%22120.344%22%20y2%3D%2252.497%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint5_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2290.247%22%20x2%3D%22120.344%22%20y2%3D%2290.247%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint6_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2271.372%22%20x2%3D%22120.344%22%20y2%3D%2271.372%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint7_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%22109.122%22%20x2%3D%22120.344%22%20y2%3D%22109.122%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E\""],"names":[],"mappings":"qGA0Ke"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),r=require("react"),i=require("uuid"),n=require("../config.js"),s=require("../store/useAuthStore.js");exports.default=function(o){var a=o.isOpen,l=o.onClose,d=o.onSubmit,p=o.hasGlobalRuleSet,c=void 0!==p&&p,u=r.useState("");u[0];var x=u[1],g=r.useState(""),_=g[0],f=g[1],b=r.useState(""),h=b[0],m=b[1],y=r.useState(!1),v=y[0],S=y[1],j=r.useState({}),C=j[0],B=j[1],E=s.default(),z=E.user;if(E.setUser,r.useEffect(function(){a&&(x(""),f(""),m(""),B({}))},[a]),!a)return null;var k={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.3)"},modal:{position:"relative",width:"600px",borderRadius:"12px",backgroundColor:"#ffffff",padding:"24px",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)"},header:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"24px"},title:{margin:0,fontSize:"18px",fontWeight:500,color:"#19213D"},subtitle:{marginTop:"4px",fontSize:"14px",fontWeight:400,color:"#666F8D"},closeButton:{background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#9CA3AF"},formGroup:{display:"flex",flexDirection:"column",marginBottom:"20px",gap:"6px"},label:{fontSize:"14px",fontWeight:500,color:"#19213D"},asterisk:{color:"#8F2C23",marginRight:"4px",fontSize:"16px",fontWeight:600},input:{width:"100%",padding:"8px 12px",borderRadius:"6px",border:"1px solid #E2E8F0",outline:"none",fontSize:"14px"},inputError:{border:"1px solid #8F2C23"},errorText:{margin:0,marginTop:"4px",fontSize:"12px",color:"#8F2C23"},textarea:{width:"100%",padding:"8px 12px",borderRadius:"6px",border:"1px solid #E2E8F0",outline:"none",fontSize:"14px",minHeight:"100px",maxHeight:"200px",overflowY:"auto",resize:"vertical"},footer:{display:"flex",justifyContent:"flex-end",gap:"12px",marginTop:"32px"},cancelBtn:{padding:"8px 16px",borderRadius:"6px",border:"1px solid #E2E8F0",backgroundColor:"transparent",color:"#64748B",fontSize:"14px",fontWeight:500,cursor:"pointer"},submitBtn:{padding:"8px 16px",borderRadius:"6px",border:"none",backgroundColor:"#2563EB",color:"#ffffff",fontSize:"14px",fontWeight:500,cursor:"pointer"},disabledBtn:{opacity:.5,cursor:"not-allowed"}};return t.jsx("div",e.__assign({style:k.overlay},{children:t.jsxs("div",e.__assign({style:k.modal},{children:[t.jsxs("div",e.__assign({style:k.header},{children:[t.jsxs("div",{children:[t.jsx("h2",e.__assign({style:k.title},{children:"Create Scope"})),t.jsx("p",e.__assign({style:k.subtitle},{children:"Create a scope to group and manage rules."}))]}),t.jsx("button",e.__assign({onClick:l,style:k.closeButton},{children:"✕"}))]})),t.jsxs("div",{children:[t.jsxs("div",e.__assign({style:k.formGroup},{children:[t.jsxs("label",e.__assign({style:k.label},{children:[t.jsx("span",e.__assign({style:k.asterisk},{children:"*"})),"Scope Name"]})),t.jsx("input",{type:"text",value:_,onChange:function(t){f(t.target.value),C.name&&B(function(t){return e.__assign(e.__assign({},t),{name:void 0})})},placeholder:"e.g. Global Learnings",style:e.__assign(e.__assign({},k.input),C.name?k.inputError:{})}),C.name&&t.jsx("p",e.__assign({style:k.errorText},{children:C.name}))]})),t.jsxs("div",e.__assign({style:k.formGroup},{children:[t.jsxs("label",e.__assign({style:k.label},{children:[t.jsx("span",e.__assign({style:k.asterisk},{children:"*"})),"Description"]})),t.jsx("textarea",{value:h,onChange:function(t){m(t.target.value),C.description&&B(function(t){return e.__assign(e.__assign({},t),{description:void 0})})},placeholder:"Enter short description for scope",style:e.__assign(e.__assign({},k.textarea),C.description?k.inputError:{})}),C.description&&t.jsx("p",e.__assign({style:k.errorText},{children:C.description}))]}))]}),t.jsxs("div",e.__assign({style:k.footer},{children:[t.jsx("button",e.__assign({onClick:l,disabled:v,style:e.__assign(e.__assign({},k.cancelBtn),v?k.disabledBtn:{})},{children:"Cancel"})),t.jsx("button",e.__assign({onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,r;return e.__generator(this,function(e){switch(e.label){case 0:if(s={},o=!0,_.trim()||(s.name="Scope Name is required",o=!1),h.trim()||(s.description="Description is required",o=!1),B(s),!o)return[2];S(!0),t={topic:c?"genreRuleSet":"globalRuleSet",customScopeGroupName:n.IL_CONFIG_CONSTANTS.CUSTOM_SCOPE_GROUP_NAME,scopeDescription:h,parentScopeId:null,customScopeName:_,customScopeId:i.v4(),createByName:null==z?void 0:z.firstname,createdBy:null==z?void 0:z.email},e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,d(t)];case 2:return e.sent(),l(),[3,5];case 3:return r=e.sent(),console.error("Error in submission",r),[3,5];case 4:return S(!1),[7];case 5:return[2]}var s,o})})},disabled:v,style:e.__assign(e.__assign({},k.submitBtn),v?k.disabledBtn:{})},{children:v?"Creating...":"Create Scope"}))]}))]}))}))};
|
|
2
2
|
//# sourceMappingURL=CreateRuleSetLegacyModal.js.map
|