import{i as g,Z as _,k as y,r as p,c as r,a as f,b as e,d as x,t as s,e as i,h as b,F as v,j as w,w as k,o as n}from"./app-CK3cEAAe.js";import{I as C}from"./moment-BywspGD9.js";import{L}from"./Layout-DIVdUaBZ.js";import{P as I}from"./Pagination-MejnxKj7.js";import{T as N}from"./TextInput-DDvOh0mT.js";import{S as B}from"./SelectInput-CJrVPIBV.js";import{L as S}from"./LoadingButton-DQHYFAIm.js";import{_ as P}from"./FlashMessages-ByEdcHWZ.js";import"./v4-SoommWqA.js";const V={metaInfo:{title:"Priorities"},components:{Icon:C,Link:g,Head:_,Pagination:I,TextInput:N,SelectInput:B,LoadingButton:S},layout:L,props:{title:String,demo:Boolean,current_version:{required:!1}},remember:"form",data(){return{files:[],latest_version:"",form:this.$inertia.form({processing:!1})}},methods:{update(){this.form.processing=!0,y.post(this.route("settings.update.check"),{}).then(o=>{const t=o.data;this.files=[].concat(t.files),t.version&&(this.latest_version=t.version),this.form.processing=!1}).catch(o=>{console.log(o)})}},created(){console.log(this.demo)}},H={class:"sec-cont"},T={class:"bg-white rounded-md shadow overflow-hidden mr-2"},E={class:"py-8 px-6 flex m-auto flex-col gap-4 text-sm"},F={class:"flex flex-col"},M={class:"font-bold"},U={key:0,class:"flex flex-col"},Y={class:"font-bold pb-3"},j={key:0,class:"relative overflow-x-auto"},q={class:"w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400"},A={scope:"row",class:"px-6 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white"},D={class:"px-6 py-4"},J={class:"px-6 py-4"},W={key:1,class:"py-2 px-6"},Z={class:"mt-5 px-8 py-4 bg-gray-50 border-t border-gray-100 flex gap-2 items-center"};function z(o,t,d,G,l,c){const m=p("Head"),u=p("loading-button");return n(),r("div",H,[f(m,{title:d.title},null,8,["title"]),e("div",T,[e("form",{onSubmit:t[0]||(t[0]=x((...a)=>c.update&&c.update(...a),["prevent"]))},[e("div",E,[e("div",F,[e("span",M,"Your current version: "+s(d.current_version),1)]),t[3]||(t[3]=e("p",{class:"leading-6"},' Please click on the "Check update" button to get the latest update information. ',-1)),l.latest_version?(n(),r("div",U,[e("span",Y,"Latest Envato version: "+s(l.latest_version),1),t[1]||(t[1]=e("h4",{class:"font-bold underline pb-1"},"Manual update instruction",-1)),t[2]||(t[2]=e("p",{class:"leading-6"},[i(" We don't want to auto update all files to messed up your changes if you made your own. You will see here all of the files that made changes on the latest releases. "),e("hr",{class:"my-1"}),i(" Just download the latest files from the CodeCanyon and replace the following changed files from those downloaded files. After replace the file please set the version number to your `.env` file. ")],-1))])):b("",!0)]),l.files.length?(n(),r("div",j,[e("table",q,[t[4]||(t[4]=e("thead",{class:"text-xs text-gray-700 bg-gray-50 dark:bg-gray-700 dark:text-gray-400"},[e("tr",null,[e("th",{scope:"col",class:"px-6 py-3"}," Changes files "),e("th",{scope:"col",class:"px-6 py-3"}," New file? "),e("th",{scope:"col",class:"px-6 py-3"}," Is the file deleted? ")])],-1)),e("tbody",null,[(n(!0),r(v,null,w(this.files,(a,h)=>(n(),r("tr",{key:h,class:"bg-white border-b dark:bg-gray-800 dark:border-gray-700"},[e("th",A,s(a.new_path||a.old_path),1),e("td",D,s(a.new_file),1),e("td",J,s(a.deleted_file),1)]))),128))])])])):(n(),r("div",W,s(o.$t("No new update found!")),1)),e("div",Z,[f(u,{loading:l.form.processing,class:"btn-indigo",type:"submit"},{default:k(()=>[i(s(o.$t("Check Update")),1)]),_:1},8,["loading"])])],32)])])}const oe=P(V,[["render",z]]);export{oe as default};
