2 lines
30 KiB
JavaScript
2 lines
30 KiB
JavaScript
import{n as l,m as h,U as r,L as P,M as E}from"./index-DDNMzpZj.js";import{C as x}from"./Checkbox-Dc2UYqO9.js";import{D as w}from"./Dropdown-Cks-nQIq.js";import{L as M,C as S,G as A,a as O,b as B,c as T}from"./LikeButton-DcDWMLsp.js";import{D as _}from"./DataFilter-CJCQVhjM.js";import{M as F}from"./ModalConfirm-q8xWqw9X.js";import{M as L}from"./BoxSummon-B3nklIl7.js";import"./mixins-CpCP8hE3.js";import"./StarsLine-CReD_mDq.js";import"./icon_pring-bV6Un94l.js";import"./StatInput-BU1s-zba.js";import"./raids-h8ynLJMQ.js";const U={methods:{clickAttack(){this.$store.commit("addActionAttack")},clickUndo(){this.$store.commit("undoAction")},clickClear(){this.$store.commit("clearActions")}},computed:{...h({party_mode:a=>a.party_builder.party_mode}),getActionsText(){return this.$store.getters.getActionsText}}};var V=function(){var t=this,e=t._self._c;return e("div",{staticClass:"flex flex-col"},[e("span",{staticClass:"flex flex-row justify-between items-center mt-1"},[e("button",{staticClass:"btn btn-blue",on:{click:t.clickAttack}},[t._v("Attack")]),t.party_mode===t.$MODE.Edit?e("p",{staticClass:"text-sm text-center mx-2"},[t._v("Uncheck "),e("i",[t._v("Edit Grid")]),t._v(" to click and add skills and summons below")]):t._e(),e("span",{staticClass:"flex flex-row"},[e("button",{staticClass:"btn btn-white mr-1",on:{click:t.clickUndo}},[t._v("Undo")]),e("button",{staticClass:"btn btn-red",on:{click:t.clickClear}},[t._v("Clear")])])]),e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.getActionsText,expression:"getActionsText"}],staticClass:"w-full h-full appearance-none text-primary bg-primary",attrs:{readonly:""},domProps:{value:t.getActionsText},on:{input:function(s){s.target.composing||(t.getActionsText=s.target.value)}}})])},j=[],N=l(U,V,j,!1,null,null);const R=N.exports,D={computed:{description:{get(){return this.$store.state.party_builder.description},set(a){this.$store.commit("setDescription",a)}}}};var I=function(){var t=this,e=t._self._c;return e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.description,expression:"description"}],staticClass:"w-full h-full appearance-none text-primary bg-secondary",domProps:{value:t.description},on:{input:function(s){s.target.composing||(t.description=s.target.value)}}})},G=[],Y=l(D,I,G,!1,null,null);const q=Y.exports,g=new r.LocalStorageMgt("PartyBuilder"),i={atk:0,atk_cap:0,hp:0,da:0,ta:0,crit:0,ca_dmg:0,ca_cap:0,chainburst_dmg:0,chainburst_cap:0,stamina:0,enmity:0,supplemental_dmg:0},k={fire:{superior:"wind",weak:"water"},wind:{superior:"earth",weak:"fire"},earth:{superior:"water",weak:"wind"},water:{superior:"fire",weak:"earth"},light:{superior:"dark",weak:""},dark:{superior:"light",weak:""},none:{superior:"",weak:""}},W={components:{Dropdown:w},data(){return{enemy_element:"water"}},methods:{getElemSuperiority(a){return this.enemy_element==="none"?0:k[a].superior===this.enemy_element?.5:k[a].weak===this.enemy_element?-.25:0},getSummonAuras(a){let t={elemental:Object.assign({},i),normal:Object.assign({},i),optimus:Object.assign({},i),omega:Object.assign({},i),mysterious:Object.assign({},i),seraphic:Object.assign({},i),ranko:Object.assign({},i)};return[this.summons[0],this.summons[5]].forEach(e=>{if(!r.isEmpty(e)&&e.current_data!==void 0)for(let s of e.data[e.current_data])(a===s.element||s.element==="any")&&(t[s.aura_type][s.stat]+=s.percent/100)}),this.summons.slice(1,5).forEach(e=>{if(!r.isEmpty(e)&&e.current_data!==void 0)for(let s of e.data[e.current_data])s.slot==="sub"&&(a===s.element||s.element==="any")&&(t[s.aura_type][s.stat]+=s.percent/100)}),this.summons.slice(6,8).forEach(e=>{if(!r.isEmpty(e)&&e.current_data!==void 0)for(let s of e.data[e.current_data])s.slot==="sub"&&(a===s.element||s.element==="any")&&(t[s.aura_type][s.stat]+=s.percent/100)}),t}},computed:{...h({characters:a=>a.party_builder.characters,summons:a=>a.party_builder.summons,weapons:a=>a.party_builder.weapons}),percentHP:{get(){return this.$store.state.party_builder.percent_HP},set(a){this.$store.commit("setPercentHP",a)}},getStatsForCharacters(){let a=[];for(let t of this.characters)if(!r.isEmpty(t)){let e={name:t.nameen,ratio:{elemental:Object.assign({},i),normal:Object.assign({},i),optimus:Object.assign({},i),omega:Object.assign({},i),ex:Object.assign({},i),mysterious:Object.assign({},i),seraphic:Object.assign({},i)}},s=_.e.data[t.elementid].name.toLowerCase();s==="any"&&(r.isEmpty(this.weapons[0])?s="dark":s=_.e.data[this.weapons[0].elementid].name.toLowerCase());const u=_.ra.data[t.raceid].name.toLowerCase(),f=t.weapontypeid.flatMap(c=>[_.w.data[c].name.toLowerCase()]);for(let c=0;c<this.weapons.length;c++){const C=this.weapons[c];if(!r.isEmpty(C))for(let m of this.$store.getters.getWeaponsCurrentData[c].flat()){let d=!0;if(m.restriction){for(let[v,y]of Object.entries(m.restriction))if(v==="element"){if(!y.some(p=>p===s)){d=!1;break}}else if(v==="race"){if(!y.some(p=>p===u)){d=!1;break}}else if(v==="weapon"&&!y.some(p=>f.some($=>p===$))){d=!1;break}}d===!0&&(e.ratio[m.aura_type][m.stat]+=m.value)}}const o=this.getSummonAuras(s),b=this.getElemSuperiority(s);e.elem_atk=1+b+o.elemental.atk,e.normal_atk=(1+e.ratio.optimus.atk*(1+o.optimus.atk)+e.ratio.normal.atk+e.ratio.normal.enmity+e.ratio.normal.stamina+o.normal.atk)*(1+e.ratio.optimus.enmity*(1+o.optimus.atk))*(1+e.ratio.optimus.stamina*(1+o.optimus.atk)),e.omega_atk=(1+e.ratio.omega.atk*(1+o.omega.atk))*(1+e.ratio.omega.enmity*(1+o.omega.atk))*(1+e.ratio.omega.stamina*(1+o.omega.atk)),e.ex_atk=(1+e.ratio.ex.atk+e.ratio.mysterious.atk*(1+o.ranko.atk))*(1+e.ratio.ex.enmity)*(1+e.ratio.ex.stamina),e.fixed_atk_mod=0,e.normal_omega_ex_atk=e.normal_atk*e.omega_atk*e.ex_atk-e.fixed_atk_mod,e.chara_atk=1*(1+(t.haspring===!0?.1:0)),e.crit=0,(b>0||this.enemy_element==="none")&&(e.crit=e.ratio.omega.crit*(1+o.omega.atk)+e.ratio.optimus.crit*(1+o.optimus.atk)+e.ratio.normal.crit),e.da=e.ratio.omega.da*(1+o.omega.atk)+e.ratio.optimus.da*(1+o.optimus.atk)+e.ratio.normal.da,e.ta=e.ratio.omega.ta*(1+o.omega.atk)+e.ratio.optimus.ta*(1+o.optimus.atk)+e.ratio.normal.ta,a.push(e)}return a}},watch:{enemy_element(){g.setValue("enemy_element",this)}},mounted(){g.getValue(this,"enemy_element")}};var H=function(){var t=this,e=t._self._c;return e("div",{staticClass:"flex flex-col"},[e("div",{staticClass:"flex flex-row flex-wrap items-center"},[e("label",{staticClass:"mr-2"},[t._v(" Enemy Element "),e("dropdown",{model:{value:t.enemy_element,callback:function(s){t.enemy_element=s},expression:"enemy_element"}},[e("option",{attrs:{value:"fire"}},[t._v("Fire")]),e("option",{attrs:{value:"wind"}},[t._v("Wind")]),e("option",{attrs:{value:"earth"}},[t._v("Earth")]),e("option",{attrs:{value:"water"}},[t._v("Water")]),e("option",{attrs:{value:"light"}},[t._v("Light")]),e("option",{attrs:{value:"dark"}},[t._v("Dark")]),e("option",{attrs:{value:"none"}},[t._v("None")])])],1),e("label",[t._v(" HP% "),e("input",{directives:[{name:"model",rawName:"v-model.number",value:t.percentHP,expression:"percentHP",modifiers:{number:!0}}],staticClass:"input",staticStyle:{width:"5ch"},domProps:{value:t.percentHP},on:{keydown:[function(s){if(!s.type.indexOf("key")&&t._k(s.keyCode,"arrow-up",void 0,s.key,void 0))return null;t.percentHP++},function(s){if(!s.type.indexOf("key")&&t._k(s.keyCode,"arrow-down",void 0,s.key,void 0))return null;t.percentHP--}],input:function(s){s.target.composing||(t.percentHP=t._n(s.target.value))},blur:function(s){return t.$forceUpdate()}}})])]),t.getStatsForCharacters.length>0?e("div",{staticClass:"overflow-y-auto"},[e("table",{staticClass:"table"},[t._m(0),e("tbody",t._l(t.getStatsForCharacters,function(s,u){return e("tr",{key:u},[e("td",{staticClass:"truncate",staticStyle:{"max-width":"4rem"}},[t._v(t._s(s.name))]),e("td",[t._v(t._s((s.elem_atk*100).toFixed(0))+"%")]),e("td",[t._v(t._s((s.normal_atk*100).toFixed(0))+"%")]),e("td",[t._v(t._s((s.omega_atk*100).toFixed(0))+"%")]),e("td",[t._v(t._s((s.ex_atk*100).toFixed(0))+"%")]),e("td",[t._v(t._s((s.chara_atk*100).toFixed(0))+"%")]),e("td",[t._v(t._s(Math.floor(s.crit*100))+"%")]),e("td",[t._v(t._s(Math.min(75,(s.da*100).toFixed(0)))+"%")]),e("td",[t._v(t._s(Math.min(75,(s.ta*100).toFixed(0)))+"%")])])}),0)])]):t._e(),t._m(1)])},K=[function(){var a=this,t=a._self._c;return t("thead",[t("tr",[t("th"),t("th",[a._v("Elem")]),t("th",[t("abbr",{attrs:{title:"Normal and Optimus modifiers ratio"}},[a._v("Norm")])]),t("th",[t("abbr",{attrs:{title:"Omega"}},[a._v("Ω")])]),t("th",[a._v("Ex")]),t("th",[t("abbr",{attrs:{title:"Character-specific unique attack ratio"}},[a._v("Chara")])]),t("th",[t("abbr",{attrs:{title:"Critical damage ratio"}},[a._v("Crit")])]),t("th",[t("abbr",{attrs:{title:"Double attack ratio"}},[a._v("DA")])]),t("th",[t("abbr",{attrs:{title:"Triple attack ratio"}},[a._v("TA")])])])])},function(){var a=this,t=a._self._c;return t("div",{staticClass:"mt-4"},[t("span",{staticClass:"tag bg-red-500"},[a._v("Warning")]),a._v(" Some things might still be missing. Mouse over the skills and summons to see what's already implemented. ")])}],z=l(W,H,K,!1,null,null);const J=z.exports,Q={computed:{...h({weapons:a=>a.party_builder.weapons}),englishNames(){return this.$store.getters.getLang===P.EN},getWeaponKeys(){let a=[];for(const t of this.weapons)if(!r.isEmpty(t)){let e={name:this.englishNames?t.nameen:t.namejp,keys:[]};for(const s of t.keys)r.isEmpty(s)||e.keys.push(s.desc);e.keys.length>0&&a.push(e)}return a}}};var X=function(){var t=this,e=t._self._c;return e("div",[t._l(t.getWeaponKeys,function(s,u){return e("div",{key:"w"+u,staticClass:"mb-3"},[e("b",[t._v(t._s(s.name))]),e("ul",{staticClass:"list-disc ml-4"},t._l(s.keys,function(f,o){return e("li",{key:"k"+o},[t._v(t._s(f))])}),0)])}),e("br")],2)},Z=[],tt=l(Q,X,Z,!1,null,null);const et=tt.exports;if(VUE_ENV!=="server"){let a=document.createElement("script");a.src="https://www.youtube.com/iframe_api";let t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(a,t)}const at={model:{prop:"show",event:"close"},components:{Modal:E},props:{show:{type:Boolean,required:!0},url:{type:String}},data(){return{input_url:"",video_id:null,player:null,error_message:""}},methods:{fetchVideo(){if(this.input_url.length>0){if(this.video_id=this.getYouTubeId(this.input_url),this.video_id==null){this.error_message="Invalid URL",this.closePlayer();return}this.error_message="",this.player===null?this.player=new YT.Player("player",{height:"360",width:"640",videoId:this.video_id,rel:0}):this.player.cueVideoById(this.video_id)}},getYouTubeId(a){const t=/^(https?:)?(\/\/)?((www\.|m\.)?youtube(-nocookie)?\.com\/((watch)?\?(feature=\w*&)?vi?=|embed\/|vi?\/|e\/)|youtu.be\/)([\w\-]{10,20})/i,e=a.match(t);return e?e[9]:null},addVideo(){this.closePlayer(),this.video_id=this.getYouTubeId(this.input_url),this.$emit("add",this.video_id),this.$emit("close",!1)},removeVideo(){this.video_id=null,this.addVideo()},closePlayer(){this.player&&(this.player.destroy(),this.player=null)}},watch:{show(){if(this.show===!0){this.url?(this.video_id=this.url,this.input_url="https://www.youtube.com/watch?v="+this.url):(this.video_id=null,this.input_url=null);let a=this;this.$nextTick().then(()=>{a.$refs.url.focus()})}}}};var st=function(){var t=this,e=t._self._c;return e("modal",{attrs:{show:t.show},on:{close:function(s){return t.$emit("close",!1)}},scopedSlots:t._u([{key:"header",fn:function(){return[e("h2",[t._v("Add a YouTube video")])]},proxy:!0}])},[e("form",{staticClass:"flex flex-row m-1 gap-x-4",on:{submit:function(s){return s.preventDefault(),t.fetchVideo()}}},[e("label",{staticClass:"flex flex-row whitespace-nowrap items-center gap-x-2 grow"},[t._v("URL "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.input_url,expression:"input_url"}],ref:"url",staticClass:"input w-full",attrs:{type:"text",placeholder:"YouTube URL",required:"",autofocus:""},domProps:{value:t.input_url},on:{input:function(s){s.target.composing||(t.input_url=s.target.value)}}})]),e("input",{staticClass:"btn btn-blue pt-2",attrs:{type:"submit",value:"Fetch"}})]),e("div",{staticClass:"flex justify-center",staticStyle:{height:"360px"}},[t._v(" "+t._s(t.error_message)+" "),e("div",{attrs:{id:"player"}})]),e("input",{staticClass:"btn btn-blue pt-2",attrs:{type:"button",value:"Add"},on:{click:function(s){return t.addVideo()}}}),t.url?e("input",{staticClass:"btn btn-red pt-2",attrs:{type:"button",value:"Remove"},on:{click:function(s){return t.removeVideo()}}}):t._e()])},rt=[],ot=l(at,st,rt,!1,null,null);const it=ot.exports,nt=6,lt={components:{Checkbox:x,ContentCategories:S,Dropdown:w,LikeButton:M,ModalConfirm:F,ModalSelector:L,ModalYoutube:it},data(){return{clipboard_text:"",new_party_modal:!1,save_as_modal:!1,delete_party_modal:!1,show_parties_modal:!1,add_video_modal:!1,reload_route:0}},methods:{clickPartyNew(){this.$store.commit("resetParty"),this.cleanURL()},cleanURL(){VUE_ENV!=="server"&&history.pushState(null,null,window.location.origin+window.location.pathname)},loadPartyFromModal(a){this.axios.get("/party/load/"+a).then(t=>this.loadParty(r.getPartyResponse(t))).catch(t=>this.$store.dispatch("addAxiosErrorMessage",t))},clickPartyShare(){const a="?p="+this.current_party+"#";this.clipboard_text=window.location.href.split("?")[0]+a;let t=this;this.$nextTick().then(()=>{document.getElementById("clipboardInput").select(),document.execCommand("copy"),t.clipboard_text="",t.$store.dispatch("addMessage",{message:"URL copied to clipboard"})})},clickPartyDelete(){this.current_party&&this.axios.post("/party/delete",{id:this.current_party}).then(()=>{this.clickPartyNew(),this.reloadParties(),this.$store.dispatch("addMessage",{message:"Party deleted successfully"})}).catch(a=>this.$store.dispatch("addAxiosErrorMessage",a))},addVideo(a){this.video_id=a&&a.length>0?a:null},clickPartySave(a=null){let t={classe:this.classe.classid,class_skills:r.isEmpty(this.classe.skills)?null:this.classe.skills.map(e=>e?e.skillid:null),characters:this.characters.map(e=>r.isEmpty(e)?null:e.characterid),characters_stars:this.characters.map(e=>r.isEmpty(e)?null:e.stars),characters_levels:this.characters.map(e=>r.isEmpty(e)?null:e.level),characters_pluses:this.characters.map(e=>r.isEmpty(e)?null:e.pluses),characters_prings:this.characters.map(e=>r.isEmpty(e)?null:e.haspring),summons:this.summons.map(e=>r.isEmpty(e)?null:e.summonid),summons_levels:this.summons.map(e=>r.isEmpty(e)?null:e.level),summons_pluses:this.summons.map(e=>r.isEmpty(e)?null:e.pluses),summons_stars:this.summons.map(e=>r.isEmpty(e)?null:e.stars),weapons:this.weapons.map(e=>r.isEmpty(e)?null:e.weaponid),weapons_levels:this.weapons.map(e=>r.isEmpty(e)?null:e.level),weapons_pluses:this.weapons.map(e=>r.isEmpty(e)?null:e.pluses),weapons_skill_levels:this.weapons.map(e=>r.isEmpty(e)?null:e.sklevel),weapons_skill_names:this.weapons.map(e=>r.isEmpty(e)?null:e.keys.map(s=>s?s.name:null)),weapons_stars:this.weapons.map(e=>r.isEmpty(e)?null:e.stars),actions:this.actions.map(e=>[e.sourceSlot-1,e.skillSlot-1,e.type])};this.axios.post("/party/save",{id:a,name:this.party_name,data:t,content:this.content,isPublic:this.isPublic,desc:this.description,video:this.video_id}).then(e=>{this.current_party=e.data.id,this.team_owner=this.$store.getters.getUserId,this.reloadParties(),this.$store.dispatch("addMessage",{message:"Party saved successfully"})}).catch(e=>this.$store.dispatch("addAxiosErrorMessage",e))},reloadParties(){this.reload_route++},loadParty(a){if(!r.isEmpty(this.$route.query.p)){const t=parseInt(this.$route.query.p,10);a.id!==t&&this.cleanURL()}this.$store.dispatch("loadParty",a)}},computed:{...h({classe:a=>a.party_builder.classe,characters:a=>a.party_builder.characters,summons:a=>a.party_builder.summons,weapons:a=>a.party_builder.weapons,actions:a=>a.party_builder.actions,description:a=>a.party_builder.description}),isUserLogged(){return this.$store.getters.getUserId!==null},content:{get(){return this.$store.state.party_builder.content},set(a){this.$store.commit("setContent",a)}},isPublic:{get(){return this.$store.state.party_builder.isPublic},set(a){this.$store.commit("setPublic",a)}},team_owner:{get(){return this.$store.state.party_builder.team_owner},set(a){this.$store.commit("setTeamOwner",a)}},party_name:{get(){return this.$store.state.party_builder.party_name},set(a){this.$store.commit("setPartyName",a)}},current_party:{get(){return this.$store.state.party_builder.current_party},set(a){this.$store.commit("setCurrentParty",a)}},video_id:{get(){return this.$store.state.party_builder.video_id},set(a){this.$store.commit("setVideoId",a)}},isMyParty(){return this.team_owner===this.$store.getters.getUserId},cannotBePublic(){return this.content===null||r.isEmpty(this.weapons[0])},getCategories(){return[{name:"Name",isColumn:!0,isFilter:!1,key:"n"},{name:"Element",isColumn:!0,isFilter:!0,key:"e"},{name:"Public",isColumn:!0,isFilter:!0,key:"pub"}]}},watch:{"$store.getters.getUserId"(a){a!==null&&this.reloadParties()}},serverPrefetch(){let a=[];if(r.isEmpty(this.$route.query.l)){if(!r.isEmpty(this.$route.query.p)){const t=parseInt(this.$route.query.p,10);a.push(this.axios.get("/party/load/"+t).then(e=>{this.loadParty(r.getPartyResponse(e));const s=e.data.updated?e.data.updated:"0";this.$ssrContext.head_image="https://www.granblue.party/previews/party/party_"+t+"."+s+".jpg"}).catch(e=>this.$store.dispatch("addMessage",{title:"Error",message:"Party not found"})))}}else{const t=JSON.parse(this.$route.query.l),e={classe:t.p,class_skills:t.ps,characters:t.c,summons:t.s,weapons:t.w};(!t.v||t.v<nt)&&this.$emit("update-bookmarklet"),a.push(this.axios.post("/party/load",e).then(s=>this.loadParty({data:s.data,characters_levels:t.cl,characters_stars:t.cs,characters_pluses:t.cp,characters_prings:t.cwr,summons_levels:t.sl,summons_stars:t.ss,summons_pluses:t.sp,weapons_levels:t.wll,weapons_skill_levels:t.wl,weapons_skill_names:t.wsn,weapons_pluses:t.wp})).catch(s=>this.$store.dispatch("addAxiosErrorMessage",s)))}return Promise.all(a)}};var ct=function(){var t=this,e=t._self._c;return e("div",{staticClass:"flex flex-col gap-4"},[t.isUserLogged?e("div",{staticClass:"flex flex-row flex-wrap items-center gap-2"},[e("button",{staticClass:"btn btn-red",on:{click:function(s){t.new_party_modal=!0}}},[e("fa-icon",{staticClass:"text-xl",attrs:{icon:["fas","file"]}}),t._v(" New Party ")],1),e("button",{staticClass:"btn btn-blue",on:{click:function(s){t.show_parties_modal=!0}}},[e("fa-icon",{staticClass:"text-xl",attrs:{icon:["fas","folder-open"]}}),t._v(" Load… ")],1),e("button",{staticClass:"btn btn-blue",attrs:{disabled:!t.isMyParty},on:{click:function(s){return t.clickPartySave(t.current_party)}}},[e("fa-icon",{staticClass:"text-xl",attrs:{icon:["fas","save"]}}),t._v(" Save ")],1),e("button",{staticClass:"btn btn-blue",on:{click:function(s){t.save_as_modal=!0}}},[e("fa-icon",{staticClass:"text-xl",attrs:{icon:["fas","file-pen"]}}),t._v(" Save As… ")],1),e("button",{staticClass:"btn btn-red",attrs:{disabled:!t.isMyParty},on:{click:function(s){t.delete_party_modal=!0}}},[e("fa-icon",{staticClass:"text-xl",attrs:{icon:["fas","trash"]}}),t._v(" Delete ")],1),e("button",{staticClass:"btn btn-blue",attrs:{disabled:!t.isMyParty},on:{click:function(s){t.add_video_modal=!0}}},[e("fa-icon",{staticClass:"text-xl",attrs:{icon:["fab","youtube"]}}),t._v(" Add Video ")],1),e("button",{staticClass:"btn btn-blue",attrs:{disabled:!t.isMyParty},on:{click:function(s){return t.clickPartyShare()}}},[e("fa-icon",{staticClass:"text-xl",attrs:{icon:["fas","share-alt"]}}),t._v(" Share ")],1),t.current_party===null?e("span",[t._v("(unsaved)")]):t._e()]):t._e(),e("div",{staticClass:"flex flex-row flex-wrap items-center gap-2"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.party_name,expression:"party_name"}],staticClass:"input w-52",attrs:{type:"text",placeholder:"Party name",maxlength:"64"},domProps:{value:t.party_name},on:{input:function(s){s.target.composing||(t.party_name=s.target.value)}}}),e("label",[t._v(" Category "),e("content-categories",{model:{value:t.content,callback:function(s){t.content=t._n(s)},expression:"content"}})],1),t.isUserLogged?e("checkbox",{attrs:{disabled:t.cannotBePublic,title:t.cannotBePublic?"Parties uncategorized or without a main weapon cannot be made public":"Make this team visible in the Teams section"},model:{value:t.isPublic,callback:function(s){t.isPublic=s},expression:"isPublic"}},[t._v(" Public Team ")]):t._e(),t.video_id?e("a",{attrs:{href:"https://www.youtube.com/watch?v="+t.video_id,target:"_blank",title:"Open YouTube video"}},[e("fa-icon",{staticClass:"text-4xl",attrs:{icon:["fab","youtube"]}})],1):t._e(),e("like-button",{attrs:{teamId:this.current_party}})],1),e("modal-selector",{key:t.reload_route,attrs:{route:"/party/list",categories:t.getCategories,canUnselect:!1},on:{"item-selected":t.loadPartyFromModal},model:{value:t.show_parties_modal,callback:function(s){t.show_parties_modal=s},expression:"show_parties_modal"}}),e("modal-confirm",{attrs:{confirm:t.clickPartyNew,text:"This will clear the current party and start a new one.",button:"New Party"},model:{value:t.new_party_modal,callback:function(s){t.new_party_modal=s},expression:"new_party_modal"}}),e("modal-confirm",{attrs:{confirm:t.clickPartySave,text:"This will create a new "+(this.isPublic?"public":"private")+" Party"+(this.party_name?" called '"+this.party_name+"'.":" with no name."),button:"Save new Party"},model:{value:t.save_as_modal,callback:function(s){t.save_as_modal=s},expression:"save_as_modal"}}),e("modal-confirm",{attrs:{confirm:t.clickPartyDelete,text:"This will permanently delete this party from your account.",button:"Delete Party"},model:{value:t.delete_party_modal,callback:function(s){t.delete_party_modal=s},expression:"delete_party_modal"}}),e("modal-youtube",{attrs:{url:t.video_id},on:{add:t.addVideo},model:{value:t.add_video_modal,callback:function(s){t.add_video_modal=s},expression:"add_video_modal"}}),e("input",{directives:[{name:"show",rawName:"v-show",value:t.clipboard_text.length>0,expression:"clipboard_text.length > 0"}],attrs:{id:"clipboardInput",readonly:"",type:"text"},domProps:{value:t.clipboard_text}})],1)},ut=[],mt=l(lt,ct,ut,!1,null,null);const pt=mt.exports,n=new r.LocalStorageMgt("PartyBuilder"),dt={components:{Checkbox:x,Dropdown:w,GroupActions:R,GroupClass:T,GroupDescription:q,GroupCharacters:B,GroupPartyStats:J,GroupSummons:O,GroupWeapons:A,GroupWeaponKeys:et,MyParties:pt},head:{title:"Granblue.Party - Party Builder",desc:"Build and share Granblue Fantasy teams and grids with your friends.",image:"https://www.granblue.party/img/card_party.jpg",keywords:"party builder, team builder, grid, characters, summons, weapons, share, import, bookmarklet, damage calculator, OTK"},data(){return{show_help:!1,show_level:!0,show_rings:!0,arcarum_weapons:!1,show_tab:3,layout:"square"}},methods:{updateBookmarklet(){this.show_bookmarklet=!0,this.show_update_bookmarklet=!0}},computed:{party_mode:{get(){return this.$store.state.party_builder.party_mode},set(a){this.$store.commit("setPartyMode",a)}},show_bookmarklet:{get(){return this.$store.state.party_builder.show_bookmarklet},set(a){this.$store.commit("setShowBookmarklet",a)}},show_update_bookmarklet:{get(){return this.$store.state.party_builder.show_update_bookmarklet},set(a){this.$store.commit("setShowUpdateBookmarklet",a)}}},watch:{show_tab(){n.setValue("show_tab",this)},show_level(){n.setValue("show_level",this)},show_rings(){n.setValue("show_rings",this)},arcarum_weapons(){n.setValue("arcarum_weapons",this)},layout(){n.setValue("layout",this)}},mounted(){n.getValue(this,"show_tab"),n.getValue(this,"show_level"),n.getValue(this,"show_rings"),n.getValue(this,"arcarum_weapons"),n.getValue(this,"layout"),this.$store.commit("setPartyMode",this.$MODE.Edit)}};var _t=function(){var t=this,e=t._self._c;return e("div",{staticClass:"flex flex-col"},[e("div",{staticClass:"flex flex-row flex-wrap items-center gap-2 mb-4"},[e("button",{staticClass:"btn",class:t.show_bookmarklet?"btn-blue":"btn-white",on:{click:function(s){t.show_bookmarklet=!t.show_bookmarklet,t.show_help=!1}}},[e("fa-icon",{staticClass:"text-xl",attrs:{icon:["fas","info-circle"]}}),t._v(" Get Export Bookmarklet ")],1),e("button",{staticClass:"btn",class:t.show_help?"btn-blue":"btn-white",on:{click:function(s){t.show_help=!t.show_help,t.show_bookmarklet=!1}}},[e("fa-icon",{staticClass:"text-xl",attrs:{icon:["fas","info-circle"]}}),t._v(" Usage ")],1),e("label",{staticClass:"flex flex-row items-center gap-2"},[e("span",[t._v("Layout")]),e("dropdown",{model:{value:t.layout,callback:function(s){t.layout=s},expression:"layout"}},[e("option",{attrs:{value:"square"}},[t._v("Square")]),e("option",{attrs:{value:"wide"}},[t._v("Wide")]),e("option",{attrs:{value:"compact"}},[t._v("Compact")])])],1),e("checkbox",{attrs:{value:t.party_mode===t.$MODE.Edit},on:{input:function(s){t.party_mode=s?t.$MODE.Edit:t.$MODE.Action}}},[t._v("Edit Grid")]),e("checkbox",{model:{value:t.show_level,callback:function(s){t.show_level=s},expression:"show_level"}},[t._v("Levels and pluses")]),e("checkbox",{model:{value:t.show_rings,callback:function(s){t.show_rings=s},expression:"show_rings"}},[t._v("Perpetuity Rings")]),e("checkbox",{model:{value:t.arcarum_weapons,callback:function(s){t.arcarum_weapons=s},expression:"arcarum_weapons"}},[t._v("Arcarum weapon slots")])],1),t.show_bookmarklet?e("div",{staticClass:"bg-secondary self-center rounded p-4 mb-2"},[t.show_update_bookmarklet?e("div",[e("h2",[t._v("A new version of the Bookmarklet is available")]),t._m(0)]):e("div",[e("h2",[t._v("What is this")]),e("p",{staticClass:"pb-4"},[t._v(" Open a Party page in GBF and export the class, characters, summons and weapons here in a single click. ")]),e("h2",[t._v("How to install")]),t._m(1)]),e("h2",[t._v("More information")]),t._m(2)]):e("div"),t.show_help?e("div",{staticClass:"bg-secondary self-center rounded p-4 mb-2"},[e("h2",[t._v("My Parties")]),t._m(3),e("h2",[t._v("The Edit checkbox")]),t._m(4),e("h2",[t._v("Drag and Drop support")]),t._m(5),e("h2",[t._v("Customize your party")]),t._m(6)]):t._e(),e("my-parties",{on:{"update-bookmarklet":function(s){return t.updateBookmarklet()}}}),e("div",{staticClass:"flex flex-row flex-wrap justify-center items-start gap-2"},[e("div",{staticClass:"flex flex-wrap justify-center items-center gap-2",class:t.layout==="compact"?"flex-col":"flex-row"},[e("div",{staticClass:"flex flex-row gap-2"},[e("group-class"),e("group-characters",{attrs:{showLevel:t.show_level,showRing:t.show_rings}})],1),e("group-summons",{attrs:{showLevel:t.show_level}})],1),t.layout==="square"?e("hr",{staticClass:"w-full invisible"}):t._e(),e("group-weapons",{attrs:{showLevel:t.show_level,showArcarum:t.arcarum_weapons}}),t.layout==="wide"?e("hr",{staticClass:"w-full invisible"}):t._e(),e("span",{staticClass:"flex flex-col w-full self-stretch",class:t.layout==="wide"?"":"md:w-128"},[e("div",{staticClass:"self-start flex flex-row flex-wrap border-primary border-b font-bold w-full"},[e("a",{staticClass:"px-4 py-2 text-primary cursor-pointer rounded-t whitespace-nowrap",class:t.show_tab===0?"bg-secondary":"",on:{click:function(s){t.show_tab=0}}},[t._v("Actions")]),e("a",{staticClass:"px-4 py-2 text-primary cursor-pointer rounded-t whitespace-nowrap",class:t.show_tab===1?"bg-secondary":"",on:{click:function(s){t.show_tab=1}}},[t._v("Stats")]),e("a",{staticClass:"px-4 py-2 text-primary cursor-pointer rounded-t whitespace-nowrap",class:t.show_tab===2?"bg-secondary":"",on:{click:function(s){t.show_tab=2}}},[t._v("Weapon Keys")]),e("a",{staticClass:"px-4 py-2 text-primary cursor-pointer rounded-t whitespace-nowrap",class:t.show_tab===3?"bg-secondary":"",on:{click:function(s){t.show_tab=3}}},[t._v("Description")])]),t.show_tab===0?e("group-actions",{staticClass:"grow w-full md:w-128"}):t.show_tab===1?e("div",{staticClass:"grow"},[e("group-party-stats")],1):t.show_tab===2?e("div",{staticClass:"grow"},[e("group-weapon-keys")],1):t.show_tab===3?e("div",{staticClass:"grow"},[e("group-description")],1):t._e()],1)],1)],1)},ht=[function(){var a=this,t=a._self._c;return t("p",{staticClass:"pb-4"},[a._v(" You should update to the last version to benefit from an improved export."),t("br"),a._v(" All you need to do is to update your Bookmark in Chrome with the following JavaScript code: "),t("a",{attrs:{href:"https://github.com/Minimalist3/GBF-Bookmarklet/raw/master/bookmarklet.min.js",target:"_blank"}},[a._v("bookmarklet.min.js")]),a._v(". ")])},function(){var a=this,t=a._self._c;return t("p",{staticClass:"pb-4"},[a._v(" All you need is to create a new Bookmark in Chrome with the following JavaScript code: "),t("a",{attrs:{href:"https://github.com/Minimalist3/GBF-Bookmarklet/raw/master/bookmarklet.min.js",target:"_blank"}},[a._v("bookmarklet.min.js")]),a._v(". ")])},function(){var a=this,t=a._self._c;return t("p",{staticClass:"pb-4"},[a._v(" You can find the source code and a comprehensive Readme here: "),t("a",{attrs:{href:"https://github.com/Minimalist3/GBF-Bookmarklet",target:"_blank"}},[a._v("GBF-Bookmarklet")]),a._v(". ")])},function(){var a=this,t=a._self._c;return t("p",{staticClass:"pb-4"},[a._v(" By logging into your account, you can save and load as many parties as you want, then share the link to your friends."),t("br"),a._v(" Only you can modify your parties. When you click the Save button, people will automatically see the updated version. ")])},function(){var a=this,t=a._self._c;return t("p",{staticClass:"pb-4"},[a._v(" When the Edit checkbox is checked, you can add elements to your party."),t("br"),a._v(" Uncheck it to click on character skills and summons to add Actions. ")])},function(){var a=this,t=a._self._c;return t("p",{staticClass:"pb-4"},[a._v(" You can drag and drop character, summons and weapons to other slots."),t("br"),a._v(" If something is already at the destination, the two items will swap places. ")])},function(){var a=this,t=a._self._c;return t("p",{staticClass:"pb-4"},[a._v(" Set the uncap level of your party by clicking on the stars."),t("br"),a._v(" You can set a Perpetuity Ring on each character by clicking on the lower right corner of the portrait."),t("br"),a._v(" Click on the lock icon of the weapon skills to select a skill key. ")])}],ft=l(dt,_t,ht,!1,null,null);const St=ft.exports;export{St as default};
|