PageSourceSearch

https://chatbothub.ai/assets/CreditCardPage-37851b08.js

js chatbothub.ai collected 2026-10-05 09:45:21 UTC 9,749 bytes, 85 lines download raw bytes

1import{d as O,r as b,a as Y,u as j,c as N,o as K,n as H,w as z,b as c,e as d,f as e,F as J,g as Q,h as k,i as P,j as m,k as w,v as R,m as A,t as f,l as F,p as G,q as W,s as X,x as C,U as Z,y as ee,z as te,A as ae,_ as oe}from"./index-6ced1034.js";import{_ as se}from"./ChaiLogo-8bb85132.js";import{c as le,a as L,F as B,b as ne}from"./vee-validate.esm-eb2daa55.js";const p=_=>(W("data-v-d36d727e"),_=_(),X(),_),ie={class:"page-frame"},re={key:0,class:"loading-container"},ce={key:1,class:"content-box"},de={class:"checkout-page"},pe=p(()=>e("header",{class:"checkout-header"},[e("div",{class:"logo"},[e("img",{src:se,alt:"chai+"})]),e("p",{class:"subtitle"},"ご希望のプランを選択して、決済手続きに進んでください。")],-1)),ue={class:"plans"},me=["onClick","onKeydown"],fe={class:"plan-title"},_e={class:"plan-price"},ye={class:"price"},he=p(()=>e("span",{class:"unit"},"/月額",-1)),ge=p(()=>e("div",{class:"plan-notes"},[e("div",null,"年間契約"),e("div",null,"初期費用:10万円")],-1)),ve={class:"form-section"},xe={class:"form-row"},be=p(()=>e("label",{class:"form-label"},[C("会社名 "),e("span",{class:"required"},"※必須")],-1)),ke={key:0,class:"error-text"},Pe={class:"form-row"},we=p(()=>e("label",{class:"form-label"},[C("担当者名 "),e("span",{class:"required"},"※必須")],-1)),Ce={key:0,class:"error-text"},qe={class:"form-row"},Se=p(()=>e("label",{class:"form-label"},[C("メールアドレス "),e("span",{class:"required"},"※必須")],-1)),Ue={key:0,class:"error-text"},Ie={class:"form-actions"},Re={class:"checkbox"},Ae=p(()=>e("span",null,[e("a",{class:"terms-link",href:"https://lp.chatbothub.ai/rules",target:"_blank",rel:"noopener noreferrer"},"利用規約"),C("に同意する ")],-1)),Fe=["disabled"],Le=O({__name:"CreditCardPage",setup(_){const i=b([]),y=b(!1),u=b("basic");function M(t){u.value=t}const n=Y({company:"",person:"",email:""}),q=b(!1),D=le({company:L().required("会社名は必須です"),person:L().required("担当者名は必須です"),email:L().email("メールアドレスの形式が正しくありません").required("メールアドレスは必須です")}),E=new Z,h=j(),S=N(()=>h.query.contract_id);function U(t){return t.toLocaleString("ja-JP")}async function T(){try{y.value=!0;const t=S.value;if(!t){console.error("No contract_id found in query params:",h.query),i.value=[{key:"basic",title:"Basic版",price:14800,displayPrice:"14,800"},{key:"professional",title:"Professional版",price:48e3,displayPrice:"48,000",featured:!0},{key:"ultra",title:"Ultra版",price:98e3,displayPrice:"98,000"}],y.value=!1;return}console.log("Fetching plan limits for contract_id:",t);const a=await E.getCreditPlanLimit({contract_id:t});console.log("Plan limits data for contract_id",t,":",a);const o=[];a.BASIC&&o.push({key:"basic",title:"Basic版",price:a.BASIC.monthly_amount||0,displayPrice:U(a.BASIC.monthly_amount||0),featured:!1}),a.PRO&&o.push({key:"professional",title:"Professional版",price:a.PRO.monthly_amount||0,displayPrice:U(a.PRO.monthly_amount||0),featured:!0}),a.ULTRA&&o.push({key:"ultra",title:"Ultra版",price:a.ULTRA.monthly_amount||0,displayPrice:U(a.ULTRA.monthly_amount||0),featured:!1}),i.value=o,console.log("Mapped plans for contract_id",t,":",i.value),i.value.length>0&&!i.value.find(s=>s.key===u.value)&&(u.value=i.value[0].key)}catch(t){console.error("Error fetching plan limits:",t),i.value=[{key:"basic",title:"Basic版",price:14800,displayPrice:"14,800"},{key:"professional",title:"Professional版",price:48e3,displayPrice:"48,000",featured:!0},{key:"ultra",title:"Ultra版",price:98e3,displayPrice:"98,000"}],I("エラー","プラン情報の取得に失敗しました。デフォルトのプランが表示されます。")}finally{y.value=!1}}const g=N(()=>{const t=h.query.email_address;if(!t)return"";console.log("Raw email from query:",t);const a=t.replace(/ /g,"+");console.log("Fixed email (spaces to +):",a);const o=decodeURIComponent(a);return console.log("Final decoded email:",o),o});K(async()=>{console.log("Component mounted, checking query params:",h.query),await T(),H(()=>{g.value?(n.email=g.value,console.log("Email auto-filled from query:",g.value),console.log("Form email after setting:",n.email)):console.log("No email_address query parameter found")})}),z(g,t=>{t&&(n.email=t,console.log("Email updated from query change:",t))}),z(S,(t,a)=>{t&&t!==a&&(console.log("Contract ID changed from",a,"to",t),T())});function I(t,a){const o=document.createElement("div");o.innerHTML=`
2    <div style="
3      position: fixed;
4      top: 0;
5      left: 0;
6      width: 100%;
7      height: 100%;
8      background: rgba(0,0,0,0.6);
9      display: flex;
10      align-items: center;
11      justify-content: center;
12      z-index: 9999;
13      animation: fadeIn 0.3s ease-out;
14    ">
15      <div style="
16        background: #E6F3FF;
17        padding: 32px;
18        border-radius: 16px;
19        max-width: 480px;
20        width: 90%;
21        box-shadow: 0 20px 40px rgba(0,0,0,0.15), 0 8px 16px rgba(0,0,0,0.1);
22        text-align: center;
23        border: 1px solid #B3D9FF;
24        animation: slideIn 0.3s ease-out;
25        position: relative;
26        overflow: hidden;
27      ">
28
29        
30        <!-- Title -->
31        <h3 style="
32          margin: 0 0 16px 0; 
33          color: #dc3545; 
34          font-size: 22px; 
35          font-weight: 600;
36          letter-spacing: -0.5px;
37        ">${t}</h3>
38        
39        <!-- Message -->
40        <p style="
41          margin: 0 0 28px 0; 
42          color: #495057; 
43          font-size: 16px; 
44          line-height: 1.6;
45          font-weight: 400;
46        ">${a}</p>
47        
48        <!-- Button -->
49        <button onclick="this.parentElement.parentElement.remove()" style="
50          background: #1A6585;
51          color: white;
52          border: none;
53          padding: 14px 32px;
54          border-radius: 12px;
55          cursor: pointer;
56          font-size: 16px;
57          font-weight: 600;
58          letter-spacing: 0.5px;
59          box-shadow: 0 4px 12px rgba(26, 101, 133, 0.3);
60          transition: all 0.2s ease;
61          min-width: 140px;
62        " onmouseover="this.style.transform='translateY(-2px)'; this.style.boxShadow='0 6px 20px rgba(26, 101, 133, 0.4)'" onmouseout="this.style.transform='translateY(0)'; this.style.boxShadow='0 4px 12px rgba(26, 101, 133, 0.3)'">
63          了解しました
64        </button>
65      </div>
66    </div>
67    
68    <style>
69      @keyframes fadeIn {
70        from { opacity: 0; }
71        to { opacity: 1; }
72      }
73      
74      @keyframes slideIn {
75        from { 
76          opacity: 0; 
77          transform: translateY(-20px) scale(0.95); 
78        }
79        to { 
80          opacity: 1; 
81          transform: translateY(0) scale(1); 
82        }
83      }
84    </style>
85  `,document.body.appendChild(o),console.log("Error modal created and added to DOM")}async function $(t){var a,o;try{const l={basic:"BASIC",professional:"PRO",ultra:"ULTRA"}[u.value]||"BASIC";console.log("Selected plan:",u.value,"-> API value:",l);const r={contract_id:S.value,company_name:t.company,person_name:t.person,email_address:t.email,plan:l};console.log("Sending API request with data:",r);const V=await E.changeCreditPlan(r);console.log("Plan change request submitted successfully",V);const v=V;
85if(v!=null&&v.stripe_url){const x=v.stripe_url;console.log("Redirecting to Stripe URL:",x);try{new URL(x),window.open(x,"_blank")}catch{console.error("Invalid Stripe URL:",x),I("エラー","無効な決済URLです。")}}else console.log("No stripe_url found in response")}catch(s){console.error("Error submitting plan change request:",s);const l=((o=(a=s==null?void 0:s.response)==null?void 0:a.data)==null?void 0:o.message)||"プラン変更の処理中にエラーが発生しました。もう一度お試しください。";I("エラー",l)}}return(t,a)=>(c(),d("div",ie,[y.value?(c(),d("div",re)):(c(),d("div",ce,[e("div",de,[pe,e("section",ue,[(c(!0),d(J,null,Q(i.value,o=>(c(),d("div",{key:o.key,class:ee(["plan-card",[{selected:u.value===o.key,featured:o.featured}]]),role:"button",tabindex:"0",onClick:s=>M(o.key),onKeydown:te(ae(s=>M(o.key),["prevent"]),["enter","space"])},[e("div",fe,f(o.title),1),e("div",_e,[e("span",ye,f(o.displayPrice),1),he]),ge],42,me))),128))]),e("section",ve,[k(m(ne),{class:"form","validation-schema":m(D),onSubmit:$},{default:P(({meta:o})=>[e("div",xe,[be,k(m(B),{name:"company","model-value":n.company},{default:P(({field:s,errors:l})=>[e("div",null,[w(e("input",A(s,{"onUpdate:modelValue":a[0]||(a[0]=r=>n.company=r),class:"form-input",type:"text",placeholder:"会社名を入力"}),null,16),[[R,n.company]]),l&&l.length?(c(),d("div",ke,f(l[0]),1)):F("",!0)])]),_:1},8,["model-value"])]),e("div",Pe,[we,k(m(B),{name:"person","model-value":n.person},{default:P(({field:s,errors:l})=>[e("div",null,[w(e("input",A(s,{"onUpdate:modelValue":a[1]||(a[1]=r=>n.person=r),class:"form-input",type:"text",placeholder:"担当者名を入力"}),null,16),[[R,n.person]]),l&&l.length?(c(),d("div",Ce,f(l[0]),1)):F("",!0)])]),_:1},8,["model-value"])]),e("div",qe,[Se,k(m(B),{name:"email","model-value":n.email},{default:P(({field:s,errors:l})=>[e("div",null,[w(e("input",A(s,{"onUpdate:modelValue":a[2]||(a[2]=r=>n.email=r),class:"form-input",type:"email",placeholder:"[email protected]"}),null,16),[[R,n.email]]),l&&l.length?(c(),d("div",Ue,f(l[0]),1)):F("",!0)])]),_:1},8,["model-value"])]),e("div",Ie,[e("label",Re,[w(e("input",{type:"checkbox","onUpdate:modelValue":a[3]||(a[3]=s=>q.value=s)},null,512),[[G,q.value]]),Ae]),e("button",{class:"submit",disabled:!q.value||!o.valid},"決済手続きに進む",8,Fe)])]),_:1},8,["validation-schema"])])])]))]))}});const Ve=oe(Le,[["__scopeId","data-v-d36d727e"]]);export{Ve 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.