import{V as d,u as n,ay as g,F as o,p as l,n as m,L as E}from"./client-BmVmnFEC.js";import{P as h}from"./PvLogger-Bfc8O67g.js";import{I as C}from"./IconPaypay-WqwB5i8Z.js";import{m as v}from"./makeReservationFormCompletedHead-BZ83L86r.js";import{V as f,g as A}from"./makeGtmScript-B8HLg2s0.js";import{d as B}from"./reservationForm-B9eBhzRa.js";import"./loginSession-CK-JZbKZ.js";const P=d.extend({components:{IconPaypay:C},props:{isRequested:{type:Boolean,default:!1},restaurantId:{type:String,default:null},reservationHash:{type:String,default:null},reservationId:{type:Number,default:null},restaurantUrl:{type:String,default:null},unregisteredRettyEmail:{type:Boolean,default:!1},unregisteredPaypay:{type:Boolean,default:!1},paypayAmount:{type:Number,default:0},isLoggedIn:{type:Boolean,default:!1},isWebView:{type:Boolean,default:!1}},computed:{shouldShowPleaseRegisterEmail(){return this.shouldShowPleaseRegisterPaypay?!1:this.isLoggedIn&&this.unregisteredRettyEmail},shouldShowPleaseRegisterPaypay(){return this.paypayAmount===0?!1:this.isLoggedIn&&this.unregisteredPaypay},paypayAmountText(){return this.paypayAmount.toLocaleString()},registRettyEmailUrl(){return`${n()}/mypage/account-setting/`},reserveDetailUrl(){const u="/restaurant/v2/reserve-status/detail",t=`?hash=${this.reservationHash}`;return this.isLoggedIn?`${n()}/my-reservation/list/`:`${g()}${u}${t}`},paypayPageUrl(){const u=`${n()}/auth/paypay-link/?redirect_url=${n()}/link-reservation-to-bonus/`;return this.isWebView?`retty://?page=reservation_paypay_link&hash=${this.reservationHash}`:`${u}?hash=${this.reservationHash}`},emailSettingUrl(){return"/mypage/email-setting/"},buttonClasses(){return{email:{"button--priority-in-page":this.unregisteredRettyEmail},paypay:{"button--priority-in-page":this.unregisteredPaypay},toDetail:{"button--priority-in-page":!this.unregisteredRettyEmail&&!this.unregisteredPaypay||this.isRequested||!this.isLoggedIn},toRestaurant:{"button--priority-in-page":!1}}},clickDetailActionType(){return o.CLICK_RESERVATION_LOGIN_EBISU_FORM_MOBILE},clickMailRegistrationActionType(){return o.CLICK_RESERVATION_MAIL_REGISTRATION_MOBILE},clickPayPayLinkActionType(){return o.CLICK_RESERVATION_PAYPAY_LINK_MOBILE},inViewMailRegistrationActionType(){return o.INVIEW_RESERVATION_MAIL_REGISTRATION}},methods:{pushMailRegistrationInViewLog(){l({type:"action",actionType:this.inViewMailRegistrationActionType})},onClickToMailRegistration(){l({type:"action",actionType:this.clickMailRegistrationActionType})},onClickToPaypayConnect(){l({type:"action",actionType:this.clickPayPayLinkActionType})},onClickToDetail(){l({type:"action",actionType:this.clickDetailActionType})}}});var R=function(){var t=this,e=t._self._c;return t._self._setupProxy,e("div",[t.isRequested?e("div",[t._m(1)]):e("div",[t._m(0),t.shouldShowPleaseRegisterEmail?e("div",{staticClass:"please-resister-email"},[e("p",{staticClass:"please-resister-email__title"},[t._v("Retty用メールアドレスが未登録です")]),e("p",{staticClass:"please-resister-email__description"},[t._v("メールアドレスを登録いただくと、PayPayポイント獲得時にメールでお知らせします。")]),e("div",{staticClass:"please-resister-email__footer"},[e("in-view",{on:{enter:t.pushMailRegistrationInViewLog}},[e("anchor-link",{staticClass:"button",class:t.buttonClasses.email,attrs:{to:t.emailSettingUrl},nativeOn:{click:function(a){return t.onClickToMailRegistration.apply(null,arguments)}}},[t._v("メールアドレスを登録する")])],1)],1)]):t._e(),t.shouldShowPleaseRegisterPaypay?e("div",{staticClass:"please-resister-paypay"},[e("p",{staticClass:"please-resister-paypay__description"},[t._v("このまま終了するとPayPayポイントは獲得できません")]),e("div",{staticClass:"paypay-information"},[e("icon-paypay",{staticClass:"paypay-information__icon",attrs:{width:24,height:24}}),e("p",{staticClass:"paypay-information__text"},[e("span",{staticClass:"paypay-information__text-head"},[t._v("PayPay連携すると")]),e("span",{staticClass:"paypay-information__text-em"},[t._v("来店で "),e("em",{staticClass:"paypay-information__text-em-number paypay-information__text-point"},[t._v(t._s(t.paypayAmountText))]),e("span",{staticClass:"paypay-information__text-point"},[t._v("円相当")]),t._v("獲得できます")])])],1),e("div",{staticClass:"please-resister-email__footer"},[e("anchor-link",{staticClass:"button",class:t.buttonClasses.paypay,attrs:{to:t.paypayPageUrl},nativeOn:{click:function(a){return t.onClickToPaypayConnect.apply(null,arguments)}}},[t._v("PayPay連携する")])],1)]):t._e(),t.shouldShowPleaseRegisterPaypay?e("ul",{staticClass:"attentions"},[e("li",{staticClass:"attentions__item"},[t._v("ご来店から7日前後でPayPayポイントが付与されます")]),e("li",{staticClass:"attentions__item"},[t._v("PayPayポイントの付与額は、ご予約の条件によって変動する場合があります。"),e("anchor-link",{staticClass:"attentions__link",attrs:{to:"/announce/paypay-bonus/",target:"_blank"}},[t._v("詳しくはこちら")]),t._v("をご覧ください")],1),e("li",{staticClass:"attentions__item"},[t._v("PayPayポイントは出金・譲渡はできません。PayPay公式ストアでも利用可能です")])]):t._e()]),e("ul",{staticClass:"link-list"},[e("li",{staticClass:"link-list__item"},[e("anchor-link",{staticClass:"button",class:t.buttonClasses.toDetail,attrs:{to:t.reserveDetailUrl},nativeOn:{click:function(a){return t.onClickToDetail.apply(null,arguments)}}},[t._v("予約内容を確認する")])],1),e("li",{staticClass:"link-list__item"},[e("anchor-link",{staticClass:"button",class:t.buttonClasses.toRestaurant,attrs:{to:t.restaurantUrl}},[t._v("店舗TOPへ")])],1)])])},F=[function(){var u=this,t=u._self._c;return u._self._setupProxy,t("div",{staticClass:"completed"},[t("p",{staticClass:"completed__thank-you-text"},[u._v("ご予約ありがとうございました")]),t("p",{staticClass:"completed__description"},[u._v("ご連絡先に予約完了のメールをお送りしました。ご予約内容は、予約管理ページからも確認できます。")])])},function(){var u=this,t=u._self._c;return u._self._setupProxy,t("div",{staticClass:"completed"},[t("p",{staticClass:"completed__thank-you-text"},[u._v("お店からの連絡をお待ち下さい")]),t("p",{staticClass:"completed__description"},[u._v("リクエストを送ってから1日以内にお店から連絡がない場合はお店へのお電話をお願いいたします。予約内容は、予約管理ページからも確認できます。")])])}],D=m(P,R,F,!1,null,"0aff6f52");const I=D.exports,k=d.extend({name:"ReservationFormCompleted",components:{ReservationCompleted:I},mixins:[h,f],props:{restaurantId:{type:String,default:null},reservationHash:{type:String,default:null},reservationId:{type:Number,default:null},isRequested:{type:Boolean,default:!1},paypayAmount:{type:Number,default:0},errorMessage:{type:String,default:null},reservationDate:{type:Object,default:null},reservationTime:{type:Object,default:null}},async asyncData({app:u,params:t,store:e}){var r;const a=await u.$urql.value.query(B,{restaurantId:Number(t.restaurantId)},{requestPolicy:"network-only"}).toPromise(),{data:s,error:i}=a;return i&&console.error(i),e.dispatch("session/setSessionUser",{loginSession:(r=s==null?void 0:s.entity)==null?void 0:r.loginSession}),{pageEntity:s}},data(){return{localErrorMessage:"",isWebView:E(this.$nuxt.context),pageEntity:{}}},head(){var t,e,a,s,i,r,p,y,c,_;const u={userId:((s=(a=(e=(t=this.pageEntity)==null?void 0:t.entity)==null?void 0:e.loginSession)==null?void 0:a.session)==null?void 0:s.userId)||null,ruid:A(document.cookie,"_ruid")||null};return v(((p=(r=(i=this.pageEntity)==null?void 0:i.entity)==null?void 0:r.restaurant)==null?void 0:p.name)||"",((_=(c=(y=this.pageEntity)==null?void 0:y.entity)==null?void 0:c.restaurant)==null?void 0:_.id)||0,u)},computed:{headerText(){return this.errorMessage?"エラー":this.isRequested?"リクエスト予約完了":"予約完了"},backUrl(){return{name:"reserve-form",params:{restaurantId:String(this.$route.params.restaurantId),canBack:!0}}},shouldShowContent(){return(!this.errorMessage||!this.localErrorMessage)&&!!this.reservationId},isLoggedIn(){return this.$store.getters["session/isLogin"]},unregisteredPaypay(){var u,t,e;return!((e=(t=(u=this.pageEntity)==null?void 0:u.entity)==null?void 0:t.currentUser)!=null&&e.isLinkPayPay)},unregisteredRettyEmail(){var u,t,e,a;return!((a=(e=(t=(u=this.pageEntity)==null?void 0:u.entity)==null?void 0:t.loginSession)==null?void 0:e.session)!=null&&a.rettyEmail)},restaurantUrl(){var u,t,e;return((e=(t=(u=this.pageEntity)==null?void 0:u.entity)==null?void 0:t.restaurant)==null?void 0:e.url)||""}},created(){!this.errorMessage&&!this.reservationId&&(this.localErrorMessage="セッションが終了しました。予約内容はメールからご確認ください。")}});var T=function(){var t=this,e=t._self._c;return t._self._setupProxy,e("div",[e("header",{staticClass:"page-header"},[t._v(" "+t._s(t.headerText)+" ")]),t.shouldShowContent?e("section",{staticClass:"page-section"},[e("reservation-completed",{attrs:{"reservation-hash":t.reservationHash,"reservation-id":t.reservationId,"is-requested":t.isRequested,"restaurant-id":t.restaurantId,"restaurant-url":t.restaurantUrl,"unregistered-retty-email":t.unregisteredRettyEmail,"unregistered-paypay":t.unregisteredPaypay,"is-logged-in":t.isLoggedIn,"paypay-amount":t.paypayAmount,"is-web-view":t.isWebView}})],1):e("div",{staticClass:"empty-section"},[t.localErrorMessage?e("p",{staticClass:"empty-section__description"},[t._v(t._s(t.localErrorMessage))]):t._e(),t.errorMessage?e("p",{staticClass:"empty-section__description"},[t._v(t._s(t.errorMessage))]):t._e(),e("p",[e("anchor-link",{staticClass:"empty-section__button",attrs:{to:t.backUrl}},[t._v("予約TOPへ")])],1)])])},b=[],S=m(k,T,b,!1,null,"a4323c29");const V=S.exports;export{V as default};