(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-ecedfa6a"],{"2dd8":function(e,t,a){"use strict";a.r(t);var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("el-form-item",{directives:[{name:"loading",rawName:"v-loading",value:e.loadData,expression:"loadData"}],class:{"is-required":e.field.required},attrs:{label:e.field.label,prop:e.fieldSlug,"label-width":"230px"}},[0!==Object.keys(e.freespinsInfo).length?[e._l(e.freespinsInfo,(function(t,s){return["_help_text"!==s?a("div",[e._v(" "+e._s(e.formatTitle(s))+": "),"float"===t||"number"===typeof t?[a("el-input-number",{model:{value:e.data[s],callback:function(t){e.$set(e.data,s,t)},expression:"data[config_slug]"}})]:Array.isArray(t)?[a("el-select",{model:{value:e.data[s],callback:function(t){e.$set(e.data,s,t)},expression:"data[config_slug]"}},e._l(t,(function(e){return a("el-option",{key:JSON.stringify(e),attrs:{label:JSON.stringify(e),value:JSON.stringify(e)}})})),1)]:[a("el-input",{staticClass:"string",model:{value:e.data[s],callback:function(t){e.$set(e.data,s,t)},expression:"data[config_slug]"}})],e.data[s]?a("div",{staticClass:"choice-button",on:{click:function(t){return e.data[s]=null}}},[a("i",{staticClass:"el-icon-delete"})]):e._e(),a("div",{staticClass:"el-form-item-delimiter"})],2):e._e()]})),e.freespinsInfo._help_text?a("span",{staticClass:"freespin-setting-help-text"},[e._v(e._s(e.freespinsInfo._help_text))]):e._e()]:e.errorMessage?[a("span",{staticClass:"error-text"},[e._v(e._s(e.errorMessage))])]:[e._v(" --- ")],e.field.help_text?a("span",{staticClass:"help-text"},[e._v(e._s(e.field.help_text))]):e._e(),e.error?a("div",{staticClass:"errors"},e._l(e.error,(function(t,s){return a("span",{staticClass:"error-text"},[e._v(e._s(t))])})),0):e._e()],2),a("div",{staticClass:"el-form-item-delimiter"})],1)},n=[],r=a("53ca"),i=(a("99af"),a("fb6a"),a("b64b"),a("ac1f"),a("5319"),a("b775")),l=a("5c96"),o=a("d369"),c={name:"freespinssettings",props:["field","fieldSlug","error"],emits:["changed"],data:function(){return{hallGameInfo:null,bonusCurrency:null,freespinsInfo:{},loadData:!1,errorMessage:null,data:{}}},methods:{updateFormData:function(e){var t=e["hall_game_info"],a=e["bonus_currency"],s=e["freespin_config"],n="string"==typeof s?JSON.parse(s):s;this.updateTrigger(t,a,n)},change:function(e){this.$emit("changed",this.data)},updateTrigger:function(e,t,a){e&&t?e===this.hallGameInfo&&t==this.bonusCurrency||this.getJackpotsInfo(e,t,a):(this.freespinsInfo={},this.data=a||{},this.change(a)),this.hallGameInfo=e,this.bonusCurrency=t},formatTitle:function(e){return"string"!==typeof e?e:(e.charAt(0).toUpperCase()+e.slice(1)).replace("_"," ")},getJackpotsInfo:function(e,t,a){var s=this;this.errorMessage=null;var n=o["a"].backend_prefix.replace("custom_admin/",""),c="object"===Object(r["a"])(e)?e.id:e,f="".concat(n,"api/v1/nodes/freespins/").concat(c,"/bets/?bonus_currency=").concat(t.id||t);this.freespinsInfo={},this.data=a||{},this.change(a),this.loadData=!0,Object(i["a"])({url:f,method:"get",headers:{Accept:"application/json"}}).then((function(e){s.freespinsInfo=e.data,s.loadData=!1})).catch((function(e){if(e.response&&e.response.data&&e.response.data.errors){var t=e.response.data.errors[0];t.message?s.errorMessage=t.message:s.errorMessage=t}else Object(l["Message"])({message:e,type:"error",duration:5e3});s.loadData=!1}))}}},f=c,d=(a("4cd9"),a("2877")),u=Object(d["a"])(f,s,n,!1,null,null,null);t["default"]=u.exports},"4cd9":function(e,t,a){"use strict";a("9e00")},"9e00":function(e,t,a){}}]);