import{_ as C}from"./D_7E8SMU.js";import{_ as L}from"./BOhf1Bbf.js";import{s as S,j as u,l as R,d as x,w as B,m as s,o as m,b as o,f as r,t as n,G as g,c as K,e as T,D as V,I as D,K as P}from"./Bgmy51Qv.js";import{u as j}from"./DFDXfcnr.js";import{u as M}from"./7pZkuj9N.js";import{u as N}from"./DKgjlGGV.js";import"./CNIrc0EA.js";import"./DZl4_Bww.js";import"./AmaTRG5a.js";import"./BHvLfWtM.js";import"./DuSynPle.js";import"./B2895E6R.js";const O={class:"input-wrapper single-line"},I={class:"mb-0"},U={class:"input-wrapper dply-felx start gap-10"},q={class:"mb-0"},z=["placeholder"],E={key:0,class:"error"},G={class:"input-wrapper dply-felx start gap-10"},A={class:"mb-0"},F={class:"input-wrapper dply-felx start gap-10"},H={for:"default",class:"mb-0 dply-felx start gap-10"},J={class:"label"},Q={class:"input-wrapper dply-felx start gap-10"},W={class:"mb-0"},ce={__name:"[id]",setup(X){const{getById:_}=M(),c=j(),{setLanguageList:f}=c,{languageList:p}=S(c),{statusObj:y}=N(),b=u({ltr:{title:"LTR"},rtl:{title:"RTL"}}),t=u({id:"",name:"English",code:"en",direction:"",default:!1,status:2}),v=()=>{setTimeout(()=>{window.location.reload()},500)},k=e=>{var a;t.value.code=e.key,t.value.name=(a=e.value)==null?void 0:a.name},h=e=>{t.value.direction=e.key},w=e=>{t.value.status=e.key};return R(async()=>{if(!p.value){const e=await _({params:null,id:"languages",api:"resource"});f(e)}}),(e,a)=>{const i=C,$=L;return m(),x($,{ref:"dataPageRef","set-api":"setLanguage","get-api":"getLanguage","route-name":"setting/languages",name:e.$t("dataPage.lang"),"validation-keys":["name"],result:s(t),gate:"language",onResult:a[2]||(a[2]=l=>t.value=l),onOnSuccess:v},{form:B(({hasError:l})=>[o("div",O,[o("label",I,n(e.$t("profile.lang")),1),r(i,{"selected-key":s(t).code,options:s(p),"key-name":"name",searching:!0,onClicked:k},null,8,["selected-key","options"])]),o("div",U,[o("label",q,n(e.$t("setting.code")),1),g(o("input",{type:"text",placeholder:e.$t("setting.code"),"onUpdate:modelValue":a[0]||(a[0]=d=>s(t).code=d),disabled:"",class:V({invalid:!s(t).code&&l})},null,10,z),[[D,s(t).code]]),!s(t).code&&l?(m(),K("span",E,n(e.$t("category.req",{type:e.$t("setting.code")})),1)):T("",!0)]),o("div",G,[o("label",A,n(e.$t("setting.dir")),1),r(i,{selectedKey:`${s(t).direction}`,options:s(b),onClicked:h},null,8,["selectedKey","options"])]),o("div",F,[o("label",H,[o("span",J,n(e.$t("admin.default")),1),g(o("input",{type:"checkbox",id:"default","onUpdate:modelValue":a[1]||(a[1]=d=>s(t).default=d)},null,512),[[P,s(t).default]])])]),o("div",Q,[o("label",W,n(e.$t("category.status")),1),r(i,{selectedKey:`${s(t).status}`,options:s(y),onClicked:w},null,8,["selectedKey","options"])])]),_:1},8,["name","result"])}}};export{ce as default};
