import{_ as h}from"./AdminLayout-DeT_GLTC.js";import{d as v,T as f,k as y,m as b,c as a,o as n,a as e,i as u,t as s,h as m}from"./app-Do7K7VDV.js";import"./AssetModal-C18ToIEK.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./InputFieldError-0BmYlL24.js";import"./ToastrContainer-CtYDvNPN.js";const w={class:"mx-auto max-w-7xl py-6 sm:px-6 lg:px-8"},k={class:"px-4 py-6 sm:px-0"},g={class:"card card-body mb-6"},x={class:"mb-4 flex items-center justify-between"},j={class:"text-xl font-semibold"},C={class:"mb-4"},U={class:"label mb-1",for:"purchase_key"},V=["value"],z=["disabled"],N={key:0},B={key:1,class:"inline-flex items-center"},D={class:"alert alert-info mb-6",role:"alert"},M={class:"font-bold"},S={key:0,class:"card card-body"},O={class:"mb-4 flex items-center justify-between text-lg font-semibold"},P={class:"flex items-center justify-between"},A={class:"text-lg text-green-600"},E=["disabled"],H={key:0},T={key:1,class:"inline-flex items-center"},I={key:0,class:"alert alert-info mt-4"},K=v({layout:h}),J=Object.assign(K,{__name:"ModuleUpdate",props:{module_json:Object,updateData:Object},setup(l){const r=l,d=f({}),o=y(!1),p=()=>{d.post(route("admin.module-settings-check-update",r.module_json.modules_core_name))},_=()=>{o.value=!0,d.put(route("admin.module-developer-settings.update",r.module_json.modules_core_name),{preserveState:!0,preserveScroll:!0,onSuccess:()=>{o.value=!1},onError:t=>{o.value=!1}})},i=b(()=>r.updateData[r.module_json.modules_core_name]);return(t,c)=>(n(),a("div",w,[e("div",k,[e("div",g,[e("div",x,[e("h2",j,s(t.trans("Modules Update"))+" - "+s(l.module_json.name),1),e("p",null,s(t.trans("Current Version"))+": "+s(l.module_json.version),1)]),e("div",C,[e("label",U,s(t.trans("Purchase Key")),1),e("input",{id:"purchase_key",type:"text",value:l.module_json.module_key,readonly:"",class:"input"},null,8,V)]),e("button",{onClick:p,disabled:o.value,class:"btn btn-primary"},[o.value?(n(),a("span",B,[c[0]||(c[0]=e("svg",{class:"-ml-1 mr-3 h-5 w-5 animate-spin text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)),m(" "+s(t.trans("Please wait...")),1)])):(n(),a("span",N,s(t.trans("Check New Update")),1))],8,z)]),e("div",D,[e("p",M,s(t.trans("Note")),1),e("p",null,s(t.trans(`If you have customized the script from codebase, do not use this option. You will lose
          your customization.`)),1)]),l.updateData&&i.value?(n(),a("div",S,[e("div",O,[e("p",null,s(t.trans("Version")),1),e("p",null,s(t.trans("Update")),1)]),e("div",P,[e("p",A,"v"+s(i.value.version),1),e("button",{onClick:_,disabled:o.value,class:"btn btn-primary"},[o.value?(n(),a("span",T,[c[1]||(c[1]=e("svg",{class:"-ml-1 mr-3 h-5 w-5 animate-spin text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)),m(" "+s(t.trans("Please wait...")),1)])):(n(),a("span",H,s(t.trans("Update now")),1))],8,E)]),i.value.message?(n(),a("p",I,s(t.trans("Note"))+": "+s(i.value.message),1)):u("",!0)])):u("",!0)])]))}});export{J as default};
