1import{A as me,a as fe}from"./AdminHeader-CxaYCU54.js";import{d as q,e as f,g as n,w as t,i as r,s as l,aj as ve,r as _,c as I,o as ge,n as i,W as w,f as c,P as Y,j as m,a3 as ye,t as u,A as d,u as k,b0 as be,aR as he,af as we,F as Z,k as ke,b6 as Se,Z as Pe,ab as xe,a9 as Ce}from"./index-C6DB0I7I.js";import{_ as G}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{g as Me,a as Ae,c as Ee,b as ze,r as Le}from"./subscription-BJmfEDEa.js";import"./client-CRttDGue.js";import"./index-D5lHaTRS.js";import"./authApi-gU8Bzwv7.js";import"./employeeClient-DfmVny7z.js";const Be={class:"admin-layout"},Ne=q({__name:"AdminLayout",props:{title:{}},setup(U){return(v,P)=>{const s=r("el-header"),p=r("el-main"),g=r("el-container");return l(),f("div",Be,[n(g,null,{default:t(()=>[n(me),n(g,null,{default:t(()=>[n(s,null,{default:t(()=>[n(fe,{title:U.title},null,8,["title"])]),_:1}),n(p,null,{default:t(()=>[ve(v.$slots,"default",{},void 0,!0)]),_:3})]),_:3})]),_:3})])}}}),je=G(Ne,[["__scopeId","data-v-e330834d"]]),Te={class:"subscription-page"},De={key:0,style:{"min-height":"400px"}},Fe={class:"card-header"},Ie={class:"plan-details"},Ue={class:"plan-name"},Ve={class:"plan-description"},$e={key:0,class:"plan-price"},Je={class:"price-amount"},We={key:0,class:"action-buttons"},He={class:"feature-item"},Oe={key:1},Re=q({__name:"Subscription",setup(U){const v=_(!0),P=_(""),s=_(null),p=I(()=>{var e;return s.value&&(((e=s.value.subscription)==null?void 0:e.plan)||s.value.plan)||null}),g=I(()=>{var e;return!!((e=s.value)!=null&&e.subscription)}),Q=["timeTracking","leaveManagement","overtimeCalculation","approvalWorkflow","reports","apiAccess","customBranding","prioritySupport","dataExport"],X=I(()=>{var a;if(!((a=p.value)!=null&&a.features))return{};const e=p.value.features;return Object.fromEntries(Object.entries(e).filter(([y])=>Q.includes(y)))}),V=_([]),M=_(!1),A=_(1),E=_(10),z=_({total:0,page:1,limit:10,totalPages:0}),L=_(!1),B=async()=>{var e,a;try{v.value=!0,s.value=await Me()}catch(y){P.value=((a=(e=y.response)==null?void 0:e.data)==null?void 0:a.message)||"ãµãã¹ã¯ãªãã·ã§ã³æ
å ±ã®åå¾ã«å¤±æãã¾ãã"}finally{v.value=!1}},N=async()=>{try{M.value=!0;const e=await Ae({page:A.value,limit:E.value});V.value=e.payments,z.value=e.pagination}catch{w.error("æ¯æãå±¥æ´ã®åå¾ã«å¤±æãã¾ãã")}finally{M.value=!1}},ee=async()=>
1{try{L.value=!0;const e=await Ee();window.location.href=e}catch{w.error("ãã¼ã¿ã«ã»ãã·ã§ã³ã®ä½æã«å¤±æãã¾ãã"),L.value=!1}},te=async()=>{try{await Ce.confirm("ãµãã¹ã¯ãªãã·ã§ã³ããã£ã³ã»ã«ããã¨ãç¾å¨ã®èª²éæéçµäºæã«ãµã¼ãã¹ãå©ç¨ã§ããªããªãã¾ããæ¬å½ã«ãã£ã³ã»ã«ãã¾ããï¼","確èª",{confirmButtonText:"ãã£ã³ã»ã«ãã",cancelButtonText:"æ»ã",type:"warning"}),await ze(),w.success("ãµãã¹ã¯ãªãã·ã§ã³ããã£ã³ã»ã«ãã¾ãã"),await B()}catch(e){e!=="cancel"&&w.error("ãµãã¹ã¯ãªãã·ã§ã³ã®ãã£ã³ã»ã«ã«å¤±æãã¾ãã")}},ae=async()=>{try{await Le(),w.success("ãµãã¹ã¯ãªãã·ã§ã³ãåéãã¾ãã"),await B()}catch{w.error("ãµãã¹ã¯ãªãã·ã§ã³ã®åéã«å¤±æãã¾ãã")}},ne=e=>{window.open(e,"_blank")},le=e=>({active:"success",trialing:"info",past_due:"warning",suspended:"danger",canceled:"info"})[e]||"",oe=e=>({active:"ã¢ã¯ãã£ã",trialing:"ãã©ã¤ã¢ã«ä¸",past_due:"æ¯æãæéåã",suspended:"忢ä¸",canceled:"ãã£ã³ã»ã«æ¸ã¿"})[e]||e,se=e=>({succeeded:"success",failed:"danger",pending:"warning",refunded:"info"})[e]||"",re=e=>({succeeded:"æå",failed:"失æ",pending:"ä¿çä¸",refunded:"è¿éæ¸ã¿"})[e]||e,ie=e=>({timeTracking:"夿 管ç",leaveManagement:"ä¼æç®¡ç",overtimeCalculation:"æ®æ¥è¨ç®",approvalWorkflow:"æ¿èªã¯ã¼ã¯ããã¼",reports:"ã¬ãã¼ã",apiAccess:"API ã¢ã¯ã»ã¹",customBranding:"ã«ã¹ã¿ã ãã©ã³ãã£ã³ã°",prioritySupport:"åªå
ãµãã¼ã",dataExport:"ãã¼ã¿ã¨ã¯ã¹ãã¼ã"})[e]||e,$=e=>new Intl.NumberFormat("ja-JP").format(e),x=e=>new Date(e).toLocaleDateString("ja-JP");return ge(()=>{B(),N()}),(e,a)=>{const y=r("el-alert"),j=r("el-tag"),T=r("el-col"),D=r("el-descriptions-item"),ce=r("el-descriptions"),J=r("el-row"),ue=r("el-divider"),C=r("el-button"),F=r("el-card"),W=r("el-icon"),b=r("el-table-column"),de=r("el-tooltip"),pe=r("el-table"),_e=r("el-pagination"),H=ye("loading");return l(),i(je,{title:"ãµãã¹ã¯ãªãã·ã§ã³ç®¡ç"},{default:t(()=>{var O;return[c("div",Te,[a[10]||(a[10]=c("div",{class:"page-header"},[c("h1",null,"ãµãã¹ã¯ãªãã·ã§ã³ç®¡ç"),c("p",null,"ãã©ã³ã®ç¢ºèªãæ¯æãå±¥æ´ã®é²è¦§ããµãã¹ã¯ãªãã·ã§ã³ã®ç®¡çãã§ãã¾ã")],-1)),v.value?Y((l(),f("div",De,null,512)),[[H,v.value]]):P.value?(l(),i(y,{key:1,type:"error",title:P.value,"show-icon":"",closable:!1,style:{"margin-bottom":"24px"}},null,8,["title"])):s.value?(l(),f(Z,{key:2},[n(F,{class:"plan-card",shadow:"hover"},{header:t(()=>[c("div",Fe,[a[2]||(a[2]=c("h2",null,"ç¾å¨ã®ãã©ã³",-1)),n(j,{type:le(s.value.tenant.subscriptionStatus),size:"large"},{default:t(()=>[d(u(oe(s.value.tenant.subscriptionStatus)),1)]),_:1},8,["type"])])]),default:t(()=>{var o,h;return[n(J,{gutter:24},{default:t(()=>[n(T,{xs:24,md:12},{default:t(()=>{var S,R,K;return[c("div",Ie,[c("h3",Ue,u(((S=p.value)==null?void 0:S.displayName)||"æªè¨å®"),1),c("p",Ve,u(((R=p.value)==null?void 0:R.description)||""),1),p.value?(l(),f("div",$e,[c("span",Je,u(((K=p.value.currency)==null?void 0:K.toUpperCase())||"JPY")+" "+u($(p.value.monthlyPrice||0)),1),a[3]||(a[3]=c("span",{class:"price-period"},"/ æ",-1))])):m("",!0)])]}),_:1}),n(T,{xs:24,md:12},{default:t(()=>[n(ce,{column:1,border:""},{default:t(()=>{var S;return[s.value.tenant.currentPeriodStart?(l(),i(D,{key:0,label:"課éæééå§"},{default:t(()=>[d(u(x(s.value.tenant.currentPeriodStart)),1)]),_:1})):m("",!0),s.value.tenant.currentPeriodEnd?(l(),i(D,{key:1,label:"課éæéçµäº"},{default:t(()=>[d(u(x(s.value.tenant.currentPeriodEnd)),1)]),_:1})):m("",!0),g.value&&((S=s.value.subscription)!=null&&S.cancelAtPeriodEnd)?(l(),i(D,{key:2,label:"ãã£ã³ã»ã«äºå®"},{default:t(()=>[n(j,{type:"danger"},{default:t(()=>[...a[4]||(a[4]=[d("æéçµäºæã«åæ¢äºå®",-1)])]),_:1})]),_:1})):m("",!0)]}),_:1})]),_:1})]),_:1}),n(ue),g.value?(l(),f("div",We,[n(C,{type:"primary",icon:k(be),onClick:ee,loading:L.value},{default:t(()=>[...a[5]||(a[5]=[d(" æ¯æãæ¹æ³ã夿´ ",-1)])]),_:1},8,["icon","loading"]),(o=s.value.subscription)!=null&&o.cancelAtPeriodEnd?(l(),i(C,{key:1,type:"success",icon:k(we),onClick:ae},{default:t(()=>[...a[7]||(a[7]=[d(" ãã£ã³ã»ã«ãåãæ¶ã ",-1)])]),_:1}
1,8,["icon"])):(l(),i(C,{key:0,type:"danger",icon:k(he),onClick:te},{default:t(()=>[...a[6]||(a[6]=[d(" ãµãã¹ã¯ãªãã·ã§ã³ããã£ã³ã»ã« ",-1)])]),_:1},8,["icon"]))])):m("",!0),g.value&&((h=s.value.subscription)!=null&&h.cancelAtPeriodEnd)?(l(),i(y,{key:1,type:"warning",closable:!1,style:{"margin-top":"16px"}},{title:t(()=>[d(" ãµãã¹ã¯ãªãã·ã§ã³ã¯ãã£ã³ã»ã«äºå®ã§ãã "+u(x(s.value.tenant.currentPeriodEnd))+" 以éããµã¼ãã¹ããå©ç¨ããã ããªããªãã¾ãã ",1)]),_:1})):m("",!0)]}),_:1}),(O=p.value)!=null&&O.features?(l(),i(F,{key:0,class:"features-card",shadow:"hover",style:{"margin-top":"24px"}},{header:t(()=>[...a[8]||(a[8]=[c("h2",null,"ãã©ã³æ©è½",-1)])]),default:t(()=>[n(J,{gutter:16},{default:t(()=>[(l(!0),f(Z,null,ke(X.value,(o,h)=>(l(),i(T,{key:h,xs:24,sm:12,md:8},{default:t(()=>[c("div",He,[o?(l(),i(W,{key:0,color:"#67c23a",size:20},{default:t(()=>[n(k(Se))]),_:1})):(l(),i(W,{key:1,color:"#909399",size:20},{default:t(()=>[n(k(Pe))]),_:1})),c("span",null,u(ie(String(h))),1)])]),_:2},1024))),128))]),_:1})]),_:1})):m("",!0),n(F,{class:"payment-card",shadow:"hover",style:{"margin-top":"24px"}},{header:t(()=>[...a[9]||(a[9]=[c("h2",null,"æ¯æãå±¥æ´",-1)])]),default:t(()=>[Y((l(),i(pe,{data:V.value,stripe:"",style:{width:"100%"}},{default:t(()=>[n(b,{label:"è«æ±æ¥",width:"120"},{default:t(({row:o})=>[d(u(x(o.createdAt)),1)]),_:1}),n(b,{prop:"subscription.plan.displayName",label:"ãã©ã³",width:"150"}),n(b,{label:"éé¡",width:"120"},{default:t(({row:o})=>[d(u(o.currency.toUpperCase())+" "+u($(o.amount)),1)]),_:1}),n(b,{label:"ã¹ãã¼ã¿ã¹",width:"100"},{default:t(({row:o})=>[n(j,{type:se(o.status),size:"small"},{default:t(()=>[d(u(re(o.status)),1)]),_:2},1032,["type"])]),_:1}),n(b,{prop:"failureMessage",label:"ã¨ã©ã¼ã¡ãã»ã¼ã¸","min-width":"200","show-overflow-tooltip":""}),n(b,{label:"æä½",width:"60",fixed:"right",align:"center"},{default:t(({row:o})=>[o.invoicePdfUrl?(l(),i(de,{key:0,content:"è«æ±æ¸",placement:"top"},{default:t(()=>[n(C,{size:"small",circle:"",type:"primary",icon:k(xe),onClick:h=>ne(o.invoicePdfUrl)},null,8,["icon","onClick"])]),_:2},1024)):(l(),f("span",Oe,"-"))]),_:1})]),_:1},8,["data"])),[[H,M.value]]),z.value.total>0?(l(),i(_e,{key:0,"current-page":A.value,"onUpdate:currentPage":a[0]||(a[0]=o=>A.value=o),"page-size":E.value,"onUpdate:pageSize":a[1]||(a[1]=o=>E.value=o),total:z.value.total,"page-sizes":[10,20,50],layout:"total, sizes, prev, pager, next",style:{"margin-top":"16px","justify-content":"center"},onCurrentChange:N,onSizeChange:N},null,8,["current-page","page-size","total"])):m("",!0)]),_:1})],64)):m("",!0)])]}),_:1})}}}),tt=G(Re,[["__scopeId","data-v-5fd25590"]]);export{tt as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.