var app=new Vue({el:"#app",data:{cardShow:!0,selectedData:null,characterData:null,currentCards:null,currCard:null,currCardName:null,currCardTarget:null,currCardAction:null,currCardAction2:null,currCardEtc:null,disableButton:!1,showHelp:!1,helpContent:null,splash:!0,prevCard:"B1"},methods:{randomizer:function(t){return Math.floor(Math.random()*t)},shuffle:function(){console.log(this.characterData),this.getData("basic")},formatText:function(t){if(t)for(var a=0;a").replace(/(\[\/b\])/g,"").replace(/(\[em\])/g,"").replace(/(\[\/em\])/g,"");return t},getData:function(t){var a=this,r=t||a.selectedData;fetch("app/data/"+r+".deckdata.json").then(function(t){return t.json()}).then(function(t){a.characterData=t,a.getCard("basic",a.prevCard),setTimeout(function(){a.splash=!1},1500)})},getCard:function(t,a){var r,e,n,c,o=this;r=t&&a?(e=a,o.characterData[t][a]):(c=(n=Object.keys(o.characterData))[o.randomizer(n.length)],o.currentCards=o.characterData[c],data=Object.keys(o.currentCards),e=data[o.randomizer(data.length)],o.currentCards[e]),o.currCard=e,o.currCardName=o.formatText(r.name),o.currCardTarget=o.formatText(r.target),o.currCardAction=o.formatText(r.action),o.currCardAction2=o.formatText(r.actionSecondary),o.currCardEtc=o.formatText(r.actionEtc)},getAICard:function(t){var a=this;a.getCard(),a.cardShow=!1,a.disableButton=!0,setTimeout(function(){a.disableButton=!1,a.cardShow=!0},500)},launchHelp:function(t){this.showHelp=!0},closeHelp:function(t){this.showHelp=!1},loadHelp:function(){var r=this;fetch("../HELP.md").then(function(t){return t.text()}).then(function(t){var a=window.markdownit();r.helpContent=a.render(t)})}},mounted:function(){this.$nextTick(function(){this.loadHelp(),this.getData("basic")})}});