"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("zustand"),r=require("../hooks/useLearningTemplateQueryParams.js"),n={globalRuleSet:[],genreRuleSet:[],customRuleSet:[]},a=t.create(function(t){return{sidebarTab:"rule-sets",selectedRuleSetId:null,ruleSets:n,isStationModalOpen:!1,isILModalTriggered:"true"===r.getQueryParam(r.QUERY_PARAM_KEYS.OPEN_IL),isStationOnboardModalTriggered:"true"===r.getQueryParam(r.QUERY_PARAM_KEYS.ONBOARD_STATION),scopeTreeData:null,urlVariantId:r.getQueryParam(r.QUERY_PARAM_KEYS.VARIANT_ID),urlApprovalAction:(a=r.getQueryParam(r.QUERY_PARAM_KEYS.APPROVAL_ACTION),"approve"===a||"reject"===a?a:null),stationNameParam:r.getQueryParam(r.QUERY_PARAM_KEYS.STATION_NAME),stations:[],selectedStationId:null,currentRules:[],createdVariantInfo:null,templateMap:{},setTemplateData:function(r,n){return t(function(t){var a;return{templateMap:e.__assign(e.__assign({},t.templateMap),(a={},a[r]=n,a))}})},setRuleSets:function(e){return t({ruleSets:e})},setScopeTreeData:function(e){return t({scopeTreeData:e})},setStationModalOpen:function(e){return t({isStationModalOpen:e})},setIsILModalTriggered:function(e){var n;r.setQueryParams(((n={})[r.QUERY_PARAM_KEYS.OPEN_IL]=e?"true":null,n)),t({isILModalTriggered:e})},setIsStationOnboardModalTriggered:function(n){var a,u;r.setQueryParams(e.__assign(((a={})[r.QUERY_PARAM_KEYS.ONBOARD_STATION]=n?"true":null,a),n?{}:((u={})[r.QUERY_PARAM_KEYS.STATION_NAME]=null,u))),t(e.__assign({isStationOnboardModalTriggered:n},n?{}:{stationNameParam:null}))},setStationNameParam:function(e){var n;r.setQueryParams(((n={})[r.QUERY_PARAM_KEYS.STATION_NAME]=e,n)),t({stationNameParam:e})},setInitialRules:function(e){return t({currentRules:e})},setCreatedVariantInfo:function(e){return t({createdVariantInfo:e})},resetCreatedVariantInfo:function(){return t({createdVariantInfo:null})},clearUrlApprovalParams:function(){var e;r.setQueryParams(((e={})[r.QUERY_PARAM_KEYS.VARIANT_ID]=null,e[r.QUERY_PARAM_KEYS.APPROVAL_ACTION]=null,e)),t({urlVariantId:null,urlApprovalAction:null})},rawAuditRuleData:null,setRawAuditRuleData:function(e){return t({rawAuditRuleData:e})},setSelectedRuleSetId:function(e){var n;r.setQueryParams(((n={})[r.QUERY_PARAM_KEYS.RULESET_ID]=e,n)),t({selectedRuleSetId:e})},toggleRuleTier:function(r){return t(function(t){return{currentRules:t.currentRules.map(function(t){return t.id===r?e.__assign(e.__assign({},t),{isOpen:!t.isOpen}):t})}})},deleteRule:function(r,n){return t(function(t){return{currentRules:t.currentRules.map(function(t){return t.id===r?e.__assign(e.__assign({},t),{rules:t.rules.filter(function(e){return e.id!==n}),ruleCount:t.ruleCount-1}):t})}})},setStations:function(e){return t({stations:e})},addStation:function(r){return t(function(t){return{stations:e.__spreadArray(e.__spreadArray([],t.stations,!0),[r],!1)}})},deleteStation:function(e){return t(function(t){return{stations:t.stations.filter(function(t){return t.stationId!==e}),selectedStationId:t.selectedStationId===e?null:t.selectedStationId}})},error:null,setError:function(e){return t({error:e})},tiers:[],setTiers:function(e){return t({tiers:e})},backwardCompatibility:!1,setBackwardCompatibility:function(e){return t({backwardCompatibility:e})},app_integration_id:null,setAppIntegrationId:function(e){return t({app_integration_id:e})},token:"",setToken:function(e){return t({token:e})}};var a});exports.INITIAL_RULE_SETS=n,exports.useLearningTemplateStore=a;
//# sourceMappingURL=useLearningTemplateStore.js.map
