import{_ as h,d as s,e as o,f as a,j as i,x as y,U as f,h as c,bL as _,bc as b,t as w,bK as g,C as v,at as E,bD as q,g as I}from"#entry";const C={props:{contentId:{type:Number,required:!0},contentType:{type:String,required:!0}},data:()=>({payload:{firstName:"",lastName:"",email:"",phone:"",company:"",jobTitle:"",country:"",postalCode:"",comments:"",recaptchaToken:"",locale:{countryCode:"",region:null,compliance:!1}},errors:{},showErrors:!1,error:null,complete:!1,loading:!1,recaptcha:null}),computed:{fieldInfo(){return{rows:[{numberOfColumns:2,fields:{firstName:{type:"text_input",label:"First Name",required:!0,showErrors:this.showErrors},lastName:{type:"text_input",label:"Last Name",required:!0,showErrors:this.showErrors},email:{type:"email_input",label:"Email",required:!0,showErrors:this.showErrors},phone:{type:"text_input",label:"Phone Number"},company:{type:"text_input",label:"Company"},jobTitle:{type:"text_input",label:"Job Title",required:!0,showErrors:this.showErrors}}},{fields:{postalCode:{type:"text_input",label:"Zip/Postal Code"},locale:{type:"locale",required:!0,alphaCodeSize:2,showErrors:this.showErrors},comments:{type:"text_input",label:"Comments",rows:5}}}]}},incomplete(){return!this.complete}},mounted(){this.recaptcha=q()},methods:{submitForm(){this.showErrors=E(this.errors??{})>0},update(e,t,n){this.payload[e]=t,this.errors[e]={errorObj:n}},async onSubmit(){try{if(this.loading=!0,this.showErrors)throw new Error("Please correct the issues with this form");this.payload.recaptchaToken=await this.recaptcha("inquiry");const e=await this.$gql.query("getInquiryContact",{id:this.contentId});if(e.error)throw new Error(e.message);this.payload.content=e.data,this.payload.contentId=this.contentId,this.payload.country=this.payload.locale.countryCode,this.payload.gdprOptIn=this.payload?.locale?.compliance,delete this.payload.locale;const t=await this.$gql.mutate("setInquirySubmissions",{input:this.payload});if(t.error)throw new Error(t.message);this.loading=!1,this.complete=!0}catch(e){throw this.error="Unable to submit your request. Please refresh and try again!",this.loading=!1,new Error(e)}}}},k={class:v(["inquiry-form-wrapper"])},N={class:"inquiry-form"},T=["value"],F=["value"],S={key:0,class:"form-group-messages message"},x={key:0},B={key:1,class:"error"},W={key:1};function O(e,t,n,l,P,r){const u=_,d=b,p=g;return o(),s("div",k,[a("div",N,[i(p,{error:e.error,processing:e.loading,"include-frame":!1},{default:y(()=>[r.incomplete?(o(),s("form",{key:0,class:"form-contents",onSubmit:t[0]||(t[0]=f((...m)=>r.onSubmit&&r.onSubmit(...m),["prevent"]))},[a("input",{type:"hidden",name:"contentId",value:n.contentId},null,8,T),a("input",{type:"hidden",name:"contentType",value:n.contentType},null,8,F),i(u,{"field-info":r.fieldInfo,"field-values":e.payload,onUpdate:r.update},null,8,["field-info","field-values","onUpdate"]),i(d,{type:"submit",label:"Submit",size:"large",icon:"mdi:arrow-right","icon-position":"right",disabled:e.loading,onOnClick:r.submitForm},null,8,["disabled","onOnClick"]),e.loading||e.error?(o(),s("div",S,[e.loading?(o(),s("div",x," Hold on, we're processing your submission... ")):e.error?(o(),s("div",B," There was a problem with your submission: "+w(e.error),1)):c("",!0)])):c("",!0),t[1]||(t[1]=a("div",{class:"row"},[a("div",{class:"form-group-messages"}," By clicking above, I agree to Endeavor Business Media's Terms of Service and consent to receive promotional communications from Endeavor, its affiliates, and partners per its Privacy Notice. I also understand my personal information will be shared with the sponsor of this content, who may contact me about their offerings per their privacy policy. I can unsubscribe anytime. ")],-1))],32)):(o(),s("div",W," Thanks for your inquiry! We'll reach out shortly. "))]),_:1},8,["error","processing"])])])}const j=Object.assign(h(C,[["render",O]]),{__name:"WebInquiryForm"}),V={__name:"InquiryFormBlock",props:{data:{type:Object,required:!0,validator(e){return["id","type"].every(t=>t in e)}}},setup(e){return(t,n)=>{const l=j;return o(),I(l,{"content-id":e.data.id,"content-type":e.data.type},null,8,["content-id","content-type"])}}};export{V as default};

AltStyle によって変換されたページ (->オリジナル) /