OwlCyberSecurity - MANAGER
Edit File: playbooks.12f3c88b.js
"use strict";(self["webpackChunkoptinmonster_wordpress_plugin_vue_app"]=self["webpackChunkoptinmonster_wordpress_plugin_vue_app"]||[]).push([[938],{81036:function(t,e,s){s.r(e),s.d(e,{default:function(){return h}});var a=function(){var t=this,e=t._self._c;return t.reachedCampaignLimit?e("templates-limit-exceeded",{attrs:{"is-playbooks":!0}}):e("core-page",[e("div",{staticClass:"playbooks-page-wrapper dashboard-wrapper",class:{previewing:!1}},[e("common-page-tabnav",{attrs:{current:"playbooks",tabs:t.tabs}}),t.alerts.length?e("div",{staticClass:"container",staticStyle:{margin:"46px auto 40px"}},[e("core-alerts",{attrs:{alerts:t.alerts}})],1):t._e(),e("div",{staticClass:"playbooks-content"},[e("playbooks-intro"),t.isLoading?e("core-loading",{staticClass:"playbooks-loading"}):e("div",[t.hasRecommendations?e("playbooks-recommendations"):t._e(),e("playbooks-table")],1)],1),e("playbooks-upgrade-modal",[e("core-upgrade-button",{staticClass:"button primary",staticStyle:{margin:"0 0 15px"},attrs:{slot:"button","utm-medium":"Playbooks",target:"_blank"},slot:"button"},[t._v(" Unlock Access Now ")])],1),e("campaigns-modal-create-campaign",{attrs:{"from-playbook":!0}}),e("templates-modal-not-connected")],1)])},o=[],i=(s(57658),s(33948),s(20629)),n=s(86430),l=s(591),r=s(30727),p=s(7268),c={mixins:[n.G,p.s,r.v,l.j],computed:{...(0,i.rn)(["alerts"]),...(0,i.rn)("playbooks",["playbooks","previewing","filterOptions","selectedPlaybook"]),...(0,i.Se)(["connected","reachedCampaignLimit"]),...(0,i.Se)("playbooks",["hasRecommendations"]),isLoading(){return this.$store.getters.isLoading(["playbooks","rules","filterOptions"])},unavailableRules(){return this.selectedPlaybook.rules.filter((t=>!this.ruleAvailable(t)))||[]}},watch:{selectedPlaybook(t){t&&this.handleUsePlaybook()}},created(){this.$store.dispatch("campaigns/fetchRulesetData").then((t=>{let e=t.rules;e.push(...t.bigCommerceRules),e.push(...t.eddRules),e.push(...t.shopifyRules),e.push(...t.wooCommerceRules),this.setRules(e)})).catch((()=>{})),this.filterOptions.length||this.$store.dispatch("templates/fetchFilterOptions").then((t=>{let{body:e}=t;this.setFilterOptions(e)})).catch((()=>{})),this.playbooks.length||this.$store.dispatch("playbooks/fetchPlaybooksData").then((()=>{this.$store.getters.connected&&this.$store.dispatch("playbooks/fetchRecommendationsData").catch((()=>{}))})).catch((()=>{})),this.setDismissedRecommendations(),this.loadApiScript("omwpapi-playbooks-apijs",this.$constants.PLAYBOOKS_PREVIEW_ACCOUNT,this.$constants.PLAYBOOKS_PREVIEW_USER)},methods:{...(0,i.OI)("playbooks",["setDismissedRecommendations","setRules","setFilterOptions","setUpgradeRule"]),handleUsePlaybook(){if(this.$store.commit("templates/setActiveTemplate",this.selectedPlaybook),!this.$store.getters.connected)return this.$modal.show("not-connected");if(this.unavailableRules.length){const t=["exit-intent","inactivity-time"].find((t=>this.unavailableRules.includes(t)));return t&&this.setUpgradeRule(t),this.$modal.show("upgrade-modal")}this.$modal.show("create-campaign-modal")}}},d=c,m=s(1001),u=(0,m.Z)(d,a,o,!1,null,null,null),h=u.exports},30727:function(t,e,s){s.d(e,{v:function(){return a}});const a={data(){return{tabs:{templates:{name:"Templates",route:{path:"templates",params:{tab:"popup"}}},playbooks:{name:"Playbooks",route:{path:"playbooks",params:{}}}}}}}},7268:function(t,e,s){s.d(e,{s:function(){return l}});var a=s(73421),o=s(64777),i=s(7977);const n=(t,e,s,a)=>{let o=document.getElementById(e);if(o)return o;if(!t)return void console.error("apiJsUrl not provided to loadApiScript");const n=document.getElementsByTagName("head")[0]||document.documentElement;return o=document.createElement("script"),o.type="text/javascript",o.id=e,o.src=t,o.async=!0,o.dataset.account=s,o.dataset.user=a,(0,i.isProduction)()||(o.dataset.env=(0,i.isDevelopment)()?"dev":i.currentEnv),n.appendChild(o),o},l={created(){this.listenApiLoaded(),(0,a.of)(),(0,a.ge)(),(0,a.O0)(),(0,a.vY)(),(0,a.Kp)(),this.$store.subscribe((t=>{const e=["templates/setLoadingPreview","templates/setPreviewing","templates/filterOptions","templates/templates","templates/permittedTypes","templates/recentTemplates","templates/popular","templates/setApiLoaded"],s=["route/ROUTE_CHANGED"];let a=t.type.startsWith("templates/")&&!e.includes(t.type);a||(a=s.includes(t.type)),a&&this.closeAllPreviews()}))},beforeDestroy(){(0,a.of)(!1),(0,a.ge)(!1),(0,a.vY)(!1),(0,a.O0)(!1),(0,a.Kp)(!1)},methods:{listenApiLoaded(t="addEventListener"){["om.Api.init","om.Main.init","om.Campaigns.init","om.Campaign.init"].forEach((e=>document[t](e,this.setApiLoaded)))},setApiLoaded(){this.listenApiLoaded("removeEventListener"),this.$store.commit("templates/setApiLoaded")},closeAllPreviews(){(0,a.IC)(),this.$store.commit("templates/setLoadingPreview",""),this.$store.commit("templates/setPreviewing","")},loadApiScript(t,e,s){return n(o.jk.apiJs(),t,e,s)}}}}}]); //# sourceMappingURL=playbooks.12f3c88b.js.map