PageSourceSearch

https://nicheelab.com/assets/App-Bw6mWuo8.js

js nicheelab.com collected 2026-09-24 13:59:50 UTC 184,916 bytes, 1 lines download raw bytes

1import{r as l,j as e,L as xt,i as Qn,k as fn,c as Vn,d as Mr,e as Or,f as fe}from"./vendor-react-Df_OrbJ8.js";import{l as qr,U as Nr,C as $t,r as Xn,G as Rt,a as _t,t as Zn,P as Br,b as Hr,E as Kr,h as Ur,s as Dn,g as Fn,i as Wn,f as er,j as tr,c as pt,d as mn,e as wt,k as Tn,o as nr,m as ln,n as $n,p as Gr}from"./reviewRefs-TO5psJdl.js";import{d as Yr,a as de,u as ge,j as Jr,m as Rn,o as Qr}from"./index-rKPUXJsi.js";import{aG as Vr,p as $e,l as Ie,m as ot,n as Se,T as a,A as Oe,F as rr,o as ht,q as Qe,r as Ce,c as v,B as i,s as Me,b as Fe,Z as nt,h as or,Q as pn,y as Xr,z as gn,G as Zr,a7 as qt,P as J,D as Le,w as sr,H as _n,I as eo,J as ar,i as Ne,K as Ae,N as ir,O as ce,R as lr,U as cr,C as zt,M as dr,W as to,X as Re,Y as no,_ as He,u as ro,$ as oo,a0 as bn,a1 as so,a2 as xr,aH as ao,t as ur,aI as hr,aJ as fr,ad as ye,aK as ft,a3 as Nt,a4 as Bt,e as oe,a5 as At,a6 as mr,a8 as jn,a9 as pr,aa as gr,ab as br,ac as kt,ae as yn,ag as kn,ah as Ye,ai as jr,aj as yr,ak as kr,al as Sr,am as vr,L as Ee,d as le,an as io,ao as lo,ap as yt,aq as co,ar as xo,as as uo,at as Qt,au as ho,av as fo,aw as It,ax as Pt,v as mo,ay as po,az as Vt,aA as Xt,aB as lt,aC as ee,aD as Zt,aE as go,aF as zn}from"./vendor-mui-B8ynRMiJ.js";import{M as bo}from"./MobileAppSection-DF04sQ8n.js";import{u as gt}from"./useDataLoaded-jI8nuM1B.js";import"./vendor-BpmyTNDJ.js";const jo="https://nicheelab-api.fjyjfrtfzy.workers.dev";function Cr(){return localStorage.getItem("exam_jwt_token")}function Sn(o){localStorage.setItem("exam_jwt_token",o)}function yo(){localStorage.removeItem("exam_jwt_token")}async function ve(o,t={}){const s=Cr(),n={"Content-Type":"application/json",...t.headers||{}};s&&(n.Authorization=`Bearer ${s}`);const d=await fetch(`${jo}${o}`,{...t,headers:n});if(!d.ok){const r=await d.json().catch(()=>({error:"Network error"})),E=r.error||`HTTP ${d.status}`,m=new Error(qr(E,r.code,d.status));throw m.status=d.status,m.code=r.code,m}return d.json()}async function Lt(o,t,s){return ve("/api/auth/send-otp",{method:"POST",body:JSON.stringify({email:o,type:t,turnstileToken:s})})}const Ht="kafka-exam";async function ko(o){const t=await ve("/api/auth/register",{method:"POST",body:JSON.stringify({...o,productId:Ht,...Yr()})});return Sn(t.token),t}async function So(o,t,s){return ve("/api/auth/reset-password",{method:"POST",body:JSON.stringify({email:o,otpCode:t,newPassword:s})})}async function vo(o,t,s){const n=await ve(`/api/auth/login?productId=${encodeURIComponent(Ht)}`,{method:"POST",body:JSON.stringify({email:o,password:t,turnstileToken:s})});return Sn(n.token),n}async function Ln(){const o=await ve(`/api/auth/me?productId=${encodeURIComponent(Ht)}`);return o.token&&Sn(o.token),o}function Mn(){yo()}function en(){return!!Cr()}async function wr(o){return ve("/api/answers",{method:"POST",body:JSON.stringify(o)})}async function vn(o,t,s){return ve(`/api/answers/history?exam_type=${o}&set=${t}&set_number=${s}`)}async function On(o,t){return ve(`/api/answers/history/sets?exam_type=${o}&set=${t}`)}async function tn(o,t){const s=new URLSearchParams;return o&&s.set("exam_type",o),t&&s.set("set",t),ve(`/api/answers/reset?${s.toString()}`,{method:"DELETE"})}async function Co(){return ve(`/api/subscription?productId=${encodeURIComponent(Ht)}`)}async function Ar(o){return ve("/api/consents",{method:"POST",body:JSON.stringify(o)})}async function wo(o,t){return ve(`/api/admin/questions?exam_type=${o}&set=${t}`)}async function Ao(o){return ve("/api/admin/questions",{method:"POST",body:JSON.stringify(o)})}async function Eo(o,t){return ve(`/api/admin/questions/${o}`,{method:"PUT",body:JSON.stringify(t)})}async function Io(o){return ve(`/api/admin/questions/${o}`,{method:"DELETE"})}async function Po(){return ve("/api/admin/users")}async function Do(){return ve("/api/admin/categories")}const Er=l.createContext(null),nn="exam_auth_user";function Fo({children:o}){const[t,s]=l.useState(null),[n,d]=l.useState(!0);l.useEffect(()=>{(async()=>{if(en())try{const{user:u}=await Ln();s({id:u.id,email:u.email,plan:u.plan,role:u.role})}catch(u){const c=u.status;(c===401||c===404)&&Mn()}else{const u=localStorage.getItem(nn);if(u)try{s(JSON.parse(u))}catch{localStorage.removeItem(nn)}}d(!1)})()},[]),l.useEffect(()=>{const u=c=>{if(!(c.key!=="exam_jwt_token"&&c.key!==nn&&c.key!=="exam_plan_refresh")){if(!en()){s(null);return}Ln().then(({user:h})=>{s({id:h.id,email:h.email,plan:h.plan,role:h.role})}).catch(()=>{})}};return window.addEventListener("storage",u),()=>window.removeEventListener("storage",u)},[]);const r=l.useCallback(async(u,c,h)=>{try{const{user:y}=await vo(u,c,h);return s({id:y.id,email:y.email,plan:y.plan,role:y.role}),{ok:!0}}catch(y){return{ok:!1,status:y.status,code:y.code}}},[]),E=l.useCallback(async u=>{{const{user:c}=await ko(u);s({id:c.id,email:c.email,plan:c.plan,role:c.role});return}},[]),m=l.useCallback(()=>{s(null),Mn()},[]),j=l.useCallback(async()=>
1{if(en())try{const u=await Co();s(c=>c?{...c,plan:u.plan}:null)}catch{}},[]),S={user:t,isLoggedIn:!!t,isSubscribed:(t==null?void 0:t.plan)==="premium",loading:n,login:r,register:E,logout:m,refreshSubscription:j};return e.jsx(Er.Provider,{value:S,children:o})}function Pe(){const o=l.useContext(Er);if(!o)throw new Error("useAuth must be used within AuthProvider");return o}const rn="kafka_exam_selected_type",Ir=l.createContext(null),Wo=["ccdak","ccaak","ccsd"];function To(o){return!!o&&Wo.includes(o)}function $o({children:o}){const[t,s]=l.useState(()=>{const r=localStorage.getItem(rn);return To(r)?r:null});l.useEffect(()=>{t?localStorage.setItem(rn,t):localStorage.removeItem(rn)},[t]);const n=l.useCallback(r=>{s(r)},[]),d=l.useCallback(()=>{s(null)},[]);return e.jsx(Ir.Provider,{value:{examType:t,setExamType:n,clearExamType:d},children:o})}function _e(){const o=l.useContext(Ir);if(!o)throw new Error("useExam must be used within ExamProvider");return o}const qn="exam_sound_enabled",Pr=l.createContext(null);function Ro({children:o}){const[t,s]=l.useState(!1);l.useEffect(()=>{const d=localStorage.getItem(qn);s(d==="true")},[]);const n=l.useCallback(()=>{s(d=>{const r=!d;return localStorage.setItem(qn,String(r)),r})},[]);return e.jsx(Pr.Provider,{value:{soundEnabled:t,toggleSound:n},children:o})}function Kt(){const o=l.useContext(Pr);if(!o)throw new Error("useSound must be used within SoundProvider");return o}const Nn="exam_dark_mode",Dr=l.createContext(null);function _o({children:o}){const[t,s]=l.useState(!1);l.useEffect(()=>{const d=localStorage.getItem(Nn);s(d==="true")},[]);const n=l.useCallback(()=>{s(d=>{const r=!d;return localStorage.setItem(Nn,String(r)),r})},[]);return e.jsx(Dr.Provider,{value:{darkMode:t,toggleDarkMode:n},children:o})}function Ke(){const o=l.useContext(Dr);if(!o)throw new Error("useTheme must be used within ThemeProvider");return o}const on="exam_easy_mode",Fr=l.createContext(null);function zo({children:o}){const[t,s]=l.useState(!0);l.useEffect(()=>{const d=localStorage.getItem(on);d!==null?s(d==="true"):localStorage.setItem(on,"true")},[]);const n=l.useCallback(()=>{s(d=>{const r=!d;return localStorage.setItem(on,String(r)),r})},[]);return e.jsx(Fr.Provider,{value:{easyMode:t,toggleEasyMode:n},children:o})}function Ut(){const o=l.useContext(Fr);if(!o)throw new Error("useEasyMode must be used within EasyModeProvider");return o}function bt({color:o="inherit",justifyContent:t="center"}){const{siteLocale:s}=de(),n=(r,E)=>s==="en"?E:r,d=r=>s==="en"?`/en${r}`:r;return e.jsxs(Vr,{direction:"row",spacing:2,justifyContent:t,useFlexGap:!0,flexWrap:"wrap",children:[e.jsx($e,{component:xt,to:d("/terms/"),underline:"hover",color:o,sx:{fontSize:13},children:n("利用規約","Terms of Service")}),e.jsx($e,{component:xt,to:d("/privacy/"),underline:"hover",color:o,sx:{fontSize:13},children:n("プライバシーポリシー","Privacy Policy")}),e.jsx($e,{component:xt,to:d("/legal/"),underline:"hover",color:o,sx:{fontSize:13},children:n("特定商取引法に基づく表記","Notation based on the Act on Specified Commercial Transactions")}),e.jsx($e,{component:xt,to:d("/contact"),underline:"hover",color:o,sx:{fontSize:13},children:n("お問い合わせ・解約","Contact & Cancellation")})]})}const Lo={squidInk:"#232F3E",darkBlue:"#1B2631",accent:"#1DA1F2",accentHover:"#1A8CD8",lightGray:"#F5F7FA",borderGray:"#E0E4E8",textPrimary:"#1B2631",textSecondary:"#545B64",textMuted:"#879596",success:"#1D8102",successLight:"#E6F4EA",error:"#D13212",errorLight:"#FDE8E4",cardBg:"#FFFFFF",accentBlue:"#4DB8F5",orange:"#1DA1F2",onAccent:"#1B2631",orangeHover:"#1A8CD8"},Te=Lo,We=o=>(o==null?void 0:o.trim())||"",cn=We("NicheeLab(代表:吉田祐章)"),dn=We("東京都渋谷区恵比寿西2丁目4番8号ウィンド恵比寿ビル8F"),Mo=We("NicheeLab (Representative: Hiroaki Yoshida)"),Oo=We("8F Wind Ebisu Building, 2-4-8 Ebisu-nishi, Shibuya-ku, Tokyo 150-0021, Japan"),Ft=We("[email protected]"),Bn=We("[email protected]"),qo={ja:"Kafka資格学習",en:"Kafka Certification Exam Prep"},xn=We("https://buy.stripe.com/4gM8wP4yU5Kx11Vea51sQ05"),Wr=We("https://billing.stripe.com/p/login/4gM8wPc1m2ylfWPc1X1sQ00"),Cn=xn.length>0,No=Wr.length>0,un=We("https://buy.stripe.com/8x26oH2qM8WJcKDaXT1sQ0g"),Ve=un.length>0,ut={priceLabel:{ja:"90日間 Â¥1,980 買い切り(自動更新なし)",en:"Â¥1,980 one-time for 90 days (US$12.60 · no auto-renewal)"}};function Tr(o){if(!un)return"#";const t=new URL(un);return o!=null&&o.id&&t.searchParams.set("client_reference_id",`u${o.id}`),o!=null&&o.email&&t.searchParams.set("prefilled_email",o.email),t.toString()}
1function wn(o){if(!xn)return"#";const t=new URL(xn);return o!=null&&o.id&&t.searchParams.set("client_reference_id",`u${o.id}`),o!=null&&o.email&&t.searchParams.set("prefilled_email",o.email),t.toString()}const mt=[cn?null:{ja:"事業者名",en:"Business name"},dn?null:{ja:"住所",en:"Address"},Ft?null:{ja:"問い合わせ先メールアドレス",en:"Contact email address"}].filter(o=>o!==null),Z={serviceName:qo,operatorName:{ja:cn||"要設定",en:Mo||cn||"Not set"},businessAddress:{ja:dn||"要設定",en:Oo||dn||"Not set"},contactEmail:Ft||"[email protected]",phoneNumber:{ja:We("請求があった場合、遅滞なく開示いたします。")||"請求があった場合、遅滞なく開示します。",en:We(void 0)||"Disclosed without delay upon request."},priceDisplay:{ja:We("単体プラン 月額980円(税込)または 90日間 1,980円(税込・買い切り・自動更新なし)/全試験パック 月額2,980円(税込)")||"Kafka資格: 月額980円(税込)または 90日間 1,980円(税込・買い切り・自動更新なし)",en:We("Single-exam plan: Â¥980/month or Â¥1,980 one-time for 90 days (no auto-renewal; tax included) / All-exams pack: Â¥2,980/month (tax included)")||"Kafka certification: 980 yen/month or 1,980 yen one-time for 90 days (no auto-renewal; tax included)"},paymentMethods:{ja:"クレジットカード決済(Stripe)",en:"Credit card payment (Stripe)"},serviceStartTiming:{ja:"決済完了後、直ちに有料プランをご利用いただけます。",en:"The paid plan becomes available for use immediately after payment is completed."},cancellationPolicy:{ja:"Stripe Customer Portal またはアプリ内の「サブスク管理」からいつでも解約できます。解約後は次回更新日以降の課金を停止します。買い切りプランは自動更新がなく、期間満了で自動的に終了します(解約手続きは不要です)。",en:'You can cancel at any time from the Stripe Customer Portal or from "Manage Subscription" in the app. After cancellation, we stop billing you from the next renewal date onward. One-time 90-day plans do not auto-renew and end automatically when the period expires (no cancellation needed).'},refundPolicy:{ja:"デジタルコンテンツの性質上、決済完了後の返金は原則として承っていません。法令上返金が必要な場合を除きます。",en:"Due to the nature of digital content, we do not accept refunds after payment is completed, as a general rule. This does not apply where a refund is required by law."}
1,abuseContactEmail:{ja:Bn||Ft||"要設定",en:Bn||Ft||"Not set"}},Hn={ja:"本サービスは資格ごとの月額課金制です。サブスクリプションは自動更新されます。ユーザーはマイページからいつでも解約できます。解約後、次回更新日以降の課金は行われません。既に支払われた料金の返金は行いません。",en:"This service is billed monthly on a per-certification basis. Subscriptions renew automatically. Users may cancel at any time from My Page. After cancellation, no charges will be made on or after the next renewal date. Fees already paid will not be refunded."},Kn={ja:"90日間の買い切りプランです。決済は1回のみで、自動更新や次回以降の課金はありません。期間満了で自動的に終了します(解約手続きは不要です)。既に支払われた料金の返金は行いません。",en:"This is a one-time 90-day plan. You are charged once; it does not auto-renew and no further charges are made. Access ends automatically when the period expires (no cancellation needed). Fees already paid are not refunded."},Mt={ja:"不合格保証: 有料期間中に本試験を受験して不合格だった場合、スコアレポートをお送りいただければ同じプランを90日間無償で延長します(1回限り)。",en:"Fail-safe: if you sit the real exam during your paid period and do not pass, send us your score report and we extend the same plan free of charge for 90 days (once)."},Ot={ja:"合格したら合格報告(スコアレポート)をお送りください。次の資格の初回料金が30%オフになるコードをお渡しします。",en:"Passed? Send us your score report and we will give you a code for 30% off your first payment on the next certification."},Bo=[{ja:"本サービスは Confluent Certified Developer for Apache Kafka (CCDAK) 認定試験対策のための学習プラットフォームです。",en:"This service is a learning platform for preparing for the Confluent Certified Developer for Apache Kafka (CCDAK) certification exam."},{ja:"無料プランでは一部問題のみ、有料プランでは全問題と模擬試験を利用できます。",en:"The free plan gives access to only some of the questions, while the paid plan gives access to all questions and the mock exams."},{ja:"有料プランは月額課金・自動更新のサブスクリプション、または90日間の買い切り(自動更新なし・期間満了で自動終了)です。",en:"Paid plans are either a monthly auto-renewing subscription or a one-time 90-day plan (no auto-renewal; access ends when the period expires)."},{ja:"不合格保証: 有料期間中に本試験を受験して不合格だった場合、スコアレポートの提出により同じプランを90日間無償で延長します(1回限り。返金ではありません)。",en:"Fail-safe: if you sit the real exam during your paid period and do not pass, we extend the same plan free of charge for 90 days upon submission of your score report (once; this is an extension, not a refund)."}],Ho=[{ja:"問題文・解説・画像・UI の無断転載、複製、再配布",en:"Unauthorized reproduction, copying, or redistribution of questions, explanations, images, or the UI"},{ja:"スクレイピング、クローリング、bot による大量取得",en:"Scraping, crawling, or bulk retrieval by bots"},{ja:"不正アクセス、脆弱性探索、認証回避、第三者アカウントの利用",en:"Unauthorized access, vulnerability probing, circumvention of authentication, or use of a third party's account"},{ja:"サービス運営を妨害する行為、法令または公序良俗に反する行為",en:"Acts that interfere with the operation of the Service, or acts that violate laws and regulations or public order and morals"}],Ko=[{ja:"会員登録・ログイン時のメールアドレス",en:"Email address provided at registration and login"},{ja:"認証・課金管理に必要な識別情報(Stripe customer ID / subscription ID)",en:"Identifiers required for authentication and billing management (Stripe customer ID / subscription ID)"},{ja:"アクセスログ、IP アドレス、ブラウザ情報、操作ログ",en:"Access logs, IP addresses, browser information, and operation logs"},{ja:"会員登録時の流入元情報(参照元 URL、utm_source / utm_medium / utm_campaign、最初に閲覧したページのパス)",en:"Acquisition information recorded at registration (referring URL, utm_source / utm_medium / utm_campaign, and the path of the first page viewed)"},{ja:"Cookie、ローカルストレージ、セッション情報",en:"Cookies, local storage, and session information"}],Uo=[{ja:"会員登録、本人確認、ログイン認証、パスワード再設定",en:"Account registration, identity verification, login authentication, and password reset"},{ja:"有料プランの決済、サブスクリプション管理、解約対応",en:"Payment for paid plans, subscription management, and cancellation handling"},{ja:"学習履歴、正答率、弱点分析などの機能提供",en:"Providing features such as study history, accuracy rate, and weak-area analysis"},{ja:"サービス改善、障害調査、不正利用検知、サポート対応",en:"Service improvement, incident investigation, detection of fraudulent use, and support response"},{ja:"どの記事・広告経由の登録かの把握(コンテンツ改善のための集計。個人の行動追跡には利用しません)",en:"Understanding which article or advertisement led to a registration (aggregated for content improvement; not used to track individuals)"}],Go=[{name:"Stripe",purpose:{ja:"決済処理、サブスクリプション管理、Customer Portal 提供",en:"Payment processing, subscription management, and provision of the Customer Portal"}},{name:"Cloudflare Turnstile",purpose:{ja:"bot 対策、不正リクエスト抑止",en:"Bot countermeasures and deterrence of unauthorized requests"}},{name:"Cloudflare Analytics",purpose:{ja:"アクセス分析と品質改善",en:"Access analysis and quality improvement"}},{name:"Resend",purpose:{ja:"認証コード・案内メールの送信",en:"Sending verification codes and notification emails"}}],$r=[{ja:"本サービスの問題・解説は公式試験問題の転載ではなく、公開された試験ガイドや公式ドキュメントの出題範囲を参考に独自作成しています。",en:"The questions and explanations on this service are not reproductions of official exam questions; they are created independently with reference to the exam scope set out in publicly available exam guides and official documentation."},{ja:"Apache Kafka は Apache Software Foundation の商標です。Confluent は Confluent, Inc. の商標です。",en:"Apache Kafka is a trademark of the Apache Software Foundation. Confluent is a trademark of Confluent, Inc."}],et=Te,Un={termsAccepted:!1,privacyAccepted:!1,autoRenewalAccepted:!1};function hn({open:o,onClose:t,onConfirm:s,loading:n=!1,error:d="",plan:r="monthly"}){const{siteLocale:E,buildPath:m}=de(),j=(y,g)=>E==="en"?g:y,[S,u]=l.useState(Un);l.useEffect(()=>{o&&u(Un)},[o]);const c=S.termsAccepted&&S.privacyAccepted&&S.autoRenewalAccepted,h=y=>{u(g=>({...g,[y]:!g[y]}))};return e.jsxs(Ie,{open:o,onClose:n?void 0:t,maxWidth:"sm",fullWidth:!0,children:[e.jsx(ot,{sx:{fontWeight:700,color:et.squidInk},children:j("有料プラン申込み前のご確認","Before you subscribe")}),e.jsxs(Se,{children:[e.jsx(a,{variant:"body2",sx:{color:et.textSecondary,mb:2},children:j("お申込み前に、以下の同意事項をご確認ください。","Please review and agree to the following before continuing.")}),e.jsx(Oe,{severity:"info",sx:{mb:2},children:r==="buyout"?j(Kn.ja,Kn.en):j(Hn.ja,Hn.en)}
1),E==="en"&&e.jsx(a,{variant:"caption",sx:{display:"block",color:"#5C6B73",mb:2},children:Nr}),e.jsxs(rr,{children:[e.jsx(ht,{control:e.jsx(Qe,{checked:S.termsAccepted,onChange:()=>h("termsAccepted")}),label:e.jsxs(a,{variant:"body2",children:[e.jsx($e,{component:xt,to:m("/kafka-exam/terms"),underline:"hover",target:"_blank",rel:"noreferrer",children:j("利用規約","Terms of Service")}),j("に同意する","I agree to")]})}),e.jsx(ht,{control:e.jsx(Qe,{checked:S.privacyAccepted,onChange:()=>h("privacyAccepted")}),label:e.jsxs(a,{variant:"body2",children:[e.jsx($e,{component:xt,to:m("/kafka-exam/privacy"),underline:"hover",target:"_blank",rel:"noreferrer",children:j("プライバシーポリシー","Privacy Policy")}),j("に同意する","I agree to")]})}),e.jsx(ht,{control:e.jsx(Qe,{checked:S.autoRenewalAccepted,onChange:()=>h("autoRenewalAccepted")}),label:e.jsx(a,{variant:"body2",children:r==="buyout"?j("90日間の買い切り(自動更新なし・期間満了で終了)であることを確認した","I understand this is a one-time 90-day plan (no auto-renewal; access ends when the period expires)"):j("月額課金の自動更新に同意する","I agree to monthly auto-renewal")})})]}),e.jsx(a,{variant:"caption",sx:{display:"block",mt:1.5,color:et.textMuted},children:j(`同意記録バージョン: ${$t}`,`Consent record version: ${$t}`)}),e.jsx(Oe,{severity:"warning",sx:{mt:2,"& .MuiAlert-message":{fontSize:12}},children:j("決済にはVisa / Mastercard / JCB等の通常クレジットカードをご利用ください。一部のデビットカード・プリペイドカードでは決済が失敗する場合があります。","Pay with a standard credit card such as Visa, Mastercard, or JCB. Some debit and prepaid cards may be declined.")}),d&&e.jsx(Oe,{severity:"error",sx:{mt:2},children:d})]}),e.jsxs(Ce,{sx:{px:3,pb:2},children:[e.jsx(v,{onClick:t,disabled:n,sx:{color:et.textSecondary},children:j("キャンセル","Cancel")}),e.jsx(v,{variant:"contained",onClick:()=>s(S),disabled:n||!c,sx:{bgcolor:et.orange,color:et.squidInk,fontWeight:700,"&:hover":{bgcolor:et.orangeHover}},children:j("同意して Stripe に進む","Agree and continue to Stripe")})]})]})}const me=Te;function Xe({open:o,onClose:t}){const s=ge(),{siteLocale:n}=de(),d=n==="en",r=(k,M)=>d?M:k,{isLoggedIn:E,user:m}=Pe(),[j,S]=l.useState(!1),[u,c]=l.useState("monthly"),[h,y]=l.useState(!1),[g,C]=l.useState(""),f=async k=>{C("");const M=u==="buyout";if(M?!Ve:!Cn){C(r("Stripe の課金リンクが未設定です。環境変数を確認してください。","The Stripe billing link is not configured. Check the environment variables."));return}const I=Xn();try{y(!0),E&&await Ar({consentVersion:$t,context:"checkout",termsAccepted:k.termsAccepted,privacyAccepted:k.privacyAccepted,autoRenewalAccepted:M?!1:k.autoRenewalAccepted});try{localStorage.setItem("checkout_return_to",window.location.pathname+window.location.search)}catch{}I.open((M?Tr:wn)(m)),S(!1),t()}catch(P){I.cancel(),C(P.message||r("同意内容の保存に失敗しました","Failed to save your consent"))}finally{y(!1)}};return E?e.jsxs(Ie,{scroll:"body",open:o,onClose:t,maxWidth:"sm",fullWidth:!0,children:[e.jsx(ot,{sx:{fontWeight:700,color:me.squidInk},children:r("有料プランで全問題を解放","Unlock all problems with the paid plan")}),e.jsxs(Se,{children:[e.jsx(a,{variant:"body2",sx:{color:me.textSecondary,mb:2},children:r(`現在のプランでは練習セット 1〜${Rt} と模擬試験 ${_t} 回分をご利用いただけます。有料プラン(月額980円)にご加入いただくと:`,`Your current plan includes practice sets 1-${Rt} and ${_t} mock exam. Join the paid plan (¥980/mo, US$6.20) to unlock:`)}),e.jsx(i,{sx:{display:"flex",flexDirection:"column",gap:1},children:[r("全問題にフルアクセス","Full access to all problems"),r("本番形式の模擬試験が解き放題","Unlimited real-format mock exams"),r("全問Confluent/Apache Kafka公式ドキュメント準拠の詳細解説付き","Every question has a detailed explanation based on the official Confluent / Apache Kafka documentation"),r("すべてのカテゴリー・試験ドメインを網羅","Covers all categories and exam domains")].map((k,M)=>
1e.jsxs(i,{sx:{display:"flex",alignItems:"flex-start",gap:1},children:[e.jsx(Me,{sx:{color:me.orange,fontSize:18,mt:.2}}),e.jsx(a,{variant:"body2",sx:{color:me.textPrimary},children:k})]},M))})]}),e.jsxs(Ce,{sx:{px:3,pb:2},children:[e.jsx(v,{onClick:t,sx:{color:me.textSecondary},children:r("閉じる","Close")}),e.jsx(v,{variant:"contained",onClick:()=>{C(""),c("monthly"),S(!0)},sx:{bgcolor:me.orange,color:me.squidInk,fontWeight:700,"&:hover":{bgcolor:me.orangeHover}},children:r("有料プランに申し込む","Get the paid plan")}),Ve&&e.jsx(v,{variant:"outlined",onClick:()=>{C(""),c("buyout"),S(!0)},sx:{color:me.squidInk,borderColor:me.orange,fontWeight:700,"&:hover":{borderColor:me.orangeHover,bgcolor:"rgba(0,0,0,0.03)"}},children:r(ut.priceLabel.ja,ut.priceLabel.en)})]}),e.jsx(hn,{open:j,onClose:()=>{h||(S(!1),C(""))},plan:u,onConfirm:f,loading:h,error:g})]}):e.jsxs(Ie,{scroll:"body",open:o,onClose:t,maxWidth:"sm",fullWidth:!0,children:[e.jsx(ot,{sx:{fontWeight:700,color:me.squidInk},children:r("Kafka 有料プランで全問題を解放","Unlock every question with Kafka Pro")}),e.jsxs(Se,{children:[e.jsx(a,{variant:"body2",sx:{color:me.textSecondary,mb:2},children:r("月額980円(税込)で Kafka Developer + Administrator + Streams の問題+模擬試験にフルアクセスできます。","¥980/month (US$6.20) (tax incl.) for full access to Kafka Developer, Administrator, and Streams questions and mock exams.")}),e.jsx(i,{sx:{display:"flex",flexDirection:"column",gap:1},children:[r("全問題にフルアクセス(練習+本番形式の模擬試験)","Full access to all problems (practice + real-format mocks)"),r("全問公式ドキュメント準拠の詳細解説付き","Every question has a detailed explanation aligned with official docs"),r("カテゴリ別の弱点分析・進捗管理","Weakness analysis & progress tracking by category"),r("決済後、メールで届くリンクからパスワードを設定 → そのままログイン","After payment, set a password from the email link → log in immediately")].map((k,M)=>e.jsxs(i,{sx:{display:"flex",alignItems:"flex-start",gap:1},children:[e.jsx(Me,{sx:{color:me.orange,fontSize:18,mt:.2}}),e.jsx(a,{variant:"body2",sx:{color:me.textPrimary},children:k})]},M))}),g&&e.jsx(a,{variant:"caption",sx:{color:"error.main",display:"block",mt:1.5},children:g})]}),e.jsxs(Ce,{sx:{px:3,pb:1,flexDirection:"column",alignItems:"stretch",gap:1},children:[e.jsx(v,{variant:"contained",onClick:()=>{C(""),c("monthly"),S(!0)},sx:{bgcolor:me.orange,color:me.squidInk,fontWeight:700,"&:hover":{bgcolor:me.orangeHover}},children:r("有料プランに申し込む(月額¥980)","Get the paid plan (¥980/mo, US$6.20)")}),Ve&&e.jsx(v,{variant:"outlined",onClick:()=>{C(""),c("buyout"),S(!0)},sx:{color:me.squidInk,borderColor:me.orange,fontWeight:700,"&:hover":{borderColor:me.orangeHover,bgcolor:"rgba(0,0,0,0.03)"}},children:r(ut.priceLabel.ja,ut.priceLabel.en)}),e.jsx(v,{onClick:t,sx:{color:me.textSecondary},children:r("あとで","Later")})]}),e.jsx(i,{sx:{px:3,pb:2,textAlign:"center"},children:e.jsxs(a,{variant:"caption",sx:{color:me.textSecondary},children:[r("既にアカウントをお持ちの方は","Already have an account? ")," ",e.jsx(i,{component:"span",role:"button",onClick:()=>{t(),s("/kafka-exam/login")},sx:{color:me.orange,cursor:"pointer",fontWeight:600,textDecoration:"underline"},children:r("ログイン","Log in")})]})}),e.jsx(hn,{open:j,onClose:()=>{h||(S(!1),C(""))},plan:u,onConfirm:f,loading:h,error:g})]})}const z=Te;function Yo(){const o=ge(),{siteLocale:t}=de(),s=t==="en",n=(c,h)=>s?h:c,[d,r]=l.useState(!1),[E,m]=l.useState(0),j=[{image:"/images/kafka/confluent-developer-badge.png",title:n("CCDAK 対策","CCDAK Prep"),subtitle:"Confluent Certified Developer",desc:n("Kafka Producer/Consumer・Streams・Connect・Schema Registry・ksqlDB","Kafka Producer/Consumer, Streams, Connect, Schema Registry, ksqlDB"),bg:`linear-gradient(135deg, #1DA1F2 0%, ${z.squidInk} 100%)`}],S=l.useCallback(()=>m(c=>(c+1)%j.length),[j.length]);l.useEffect(()=>{const c=setInterval(S,4500);return()=>clearInterval(c)},[S]);const u=j[E];return e.jsxs(i,{sx:{display:"flex",flexDirection:"column",minHeight:"100vh",width:"100%"},children:[e.jsx(i,{sx:{position:"relative",background:u.bg,color:"#fff",py:{xs:5,md:8},px:{xs:2,md:4},overflow:"hidden",transition:"background 0.8s ease",minHeight:{xs:"auto",md:420}},children:e.jsxs(Fe,{maxWidth:"lg",sx:{position:"relative",zIndex:1},children:[e.jsxs(i,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},alignItems:"center",gap:{xs:3,md:6}},children:[e.jsx(i,{sx:{flexShrink:0},children:e.jsx(i,{component:"img",src:u.image,alt:u.title,sx:{width:{xs:150,md:240},height:{xs:150,md:240},objectFit:"contain",filter:"drop-shadow(0 4px 20px rgba(0,0,0,0.3))"}})}),e.jsxs(i,{sx:{textAlign:{xs:"center",md:"left"},flex:1},children:[e.jsx(a,{variant:"overline",sx:{color:z.orange,fontWeight:700,letterSpacing:2,fontSize:{xs:12,md:14}},children:u.subtitle}),e.jsx(a,{variant:"h3",sx:{fontWeight:800,mb:1,fontSize:{xs:"1.8rem",md:"2.8rem"},lineHeight:1.2},children:u.title}),e.jsx(a,{variant:"h6",sx:{opacity:.9,mb:3,fontWeight:400,fontSize:{xs:"0.95rem",md:"1.15rem"}},children:u.desc}),e.jsxs(i,{sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},gap:1.5,justifyContent:{xs:"center",md:"flex-start"}},children:[e.jsx(v,{variant:"contained",size:"large",onClick:()=>o("/kafka-exam/select"),sx:{bgcolor:z.orange,color:z.onAccent,fontWeight:700,py:1.5,px:4,fontSize:"1rem","&:hover":{bgcolor:z.orangeHover}},children:n("今すぐ無料で試す","Start free now")}),e.jsx(v,{variant:"outlined",size:"large",onClick:()=>o("/kafka-exam/login"),sx:{borderColor:"rgba(255,255,255,0.6)",color:"#fff",py:1.5,px:4,"&:hover":{borderColor:"#fff",bgcolor:"rgba(255,255,255,0.08)"}},children:n("ログイン","Log in")}),e.jsx(v,{size:"large",onClick:()=>o("/kafka-exam/select"),sx:{color:z.orange,fontWeight:600},endIcon:e.jsx(nt,{}),children:n("試験を選択する","Choose an exam")})]})]})]}),e.jsx(i,{sx:{display:"flex",justifyContent:"center",gap:1,mt:3},children:j.map((c,h)=>e.jsx(i,{onClick:()=>m(h),sx:{width:h===E?28:10,height:10,borderRadius:5,bgcolor:h===E?z.orange:"rgba(255,255,255,0.4)",cursor:"pointer",transition:"all 0.3s"}},h))})]})}),e.jsx(i,{sx:{bgcolor:z.squidInk,py:{xs:3,md:4}},children:e.jsx(Fe,{maxWidth:"lg",children:e.jsx(i,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr 1fr",md:"1fr 1fr 1fr 1fr"},gap:{xs:2,md:4}},children:[{value:n("900問","900 Qs"),label:n("公開問題数","Total questions"),sub:n("練習 + 模擬試験","Practice + mock exams")},{value:n("3資格","3 certs"),label:n("対応試験","Supported exams"),sub:"CCDAK + CCSD + CCAAK"},{value:n("日英対応","JA & EN"),label:n("出題・解説言語","Question & answer language"),sub:n("English / 日本語","English / 日本語")},{value:"100%",label:n("解説カバー率","Explanation coverage"),sub:n("全問詳細解説付き","Every question has a detailed explanation")}].map((c,h)=>e.jsxs(i,{sx:{textAlign:"center"},children:[e.jsx(a,{variant:"h4",sx:{fontWeight:800,color:z.orange,fontSize:{xs:"1.5rem",md:"2rem"}},children:c.value}),e.jsx(a,{sx:{color:"#fff",fontWeight:600,fontSize:{xs:14,md:16}},children:c.label}),e.jsx(a,{sx:{color:"rgba(255,255,255,0.6)",fontSize:{xs:13,md:13}},children:c.sub})]},h))})})}),e.jsx(i,{sx:{py:{xs:5,md:7},px:2,bgcolor:z.lightGray},children:e.jsxs(Fe,{maxWidth:"lg",children:[e.jsx(a,{variant:"h4",sx:{textAlign:"center",fontWeight:800,color:z.squidInk,mb:1,fontSize:{xs:"1.4rem",md:"2rem"}},children:n("選ばれる理由","Why Nicheelab")}),e.jsx(a,{sx:{textAlign:"center",color:z.textSecondary,mb:4},children:n("Confluent公式試験ガイドに準拠した問題で合格を目指せます","Pass with questions aligned to Confluent's official Exam Guide")}),e.jsx(i,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"1fr 1fr",md:"1fr 1fr 1fr"},gap:3},children:[{icon:e.jsx(or,{sx:{fontSize:44,color:z.orange}}
1),title:n("CCDAK 対応","CCDAK covered"),desc:n("Confluent Certified Developer 試験範囲を完全カバー","Full coverage of the Confluent Certified Developer exam scope")},{icon:e.jsx(pn,{sx:{fontSize:44,color:z.orange}}),title:n("日本語・英語の問題と詳細解説","Bilingual questions & detailed explanations"),desc:n("日本語・英語で出題。Confluent/Apache Kafka公式ドキュメントに基づく900問","900 questions in Japanese and English, grounded in the official Confluent/Apache Kafka documentation")},{icon:e.jsx(Xr,{sx:{fontSize:44,color:z.orange}}),title:n("スキマ時間で効率学習","Study in your spare time"),desc:n("1問ずつ即座に解説を確認。通勤中や休憩時間に5分から学習","See the explanation right after each question — study from 5 minutes during commutes or breaks")},{icon:e.jsx(gn,{sx:{fontSize:44,color:z.orange}}),title:n("正解率トラッキング","Accuracy tracking"),desc:n("カテゴリーごとの正解率を自動記録。弱点をグラフで可視化","Automatically tracks accuracy per category and visualizes weak areas in charts")},{icon:e.jsx(Zr,{sx:{fontSize:44,color:z.orange}}),title:n("マルチデバイス対応","Multi-device ready"),desc:n("PC・タブレット・スマホどの端末でも最適な画面で学習","Optimized layout for desktop, tablet, and mobile")},{icon:e.jsx(qt,{sx:{fontSize:44,color:z.orange}}),title:n("公式ドキュメント準拠","Aligned with official docs"),desc:n("解説はConfluent/Apache Kafka公式ドキュメントに基づき作成","Explanations built from the official Confluent/Apache Kafka documentation")}].map((c,h)=>e.jsxs(J,{elevation:0,sx:{p:3,borderRadius:2,border:`1px solid ${z.borderGray}`,bgcolor:z.cardBg,transition:"all 0.2s","&:hover":{boxShadow:"0 4px 20px rgba(0,0,0,0.08)",transform:"translateY(-2px)"}},children:[e.jsx(i,{sx:{mb:1.5},children:c.icon}),e.jsx(a,{variant:"h6",sx:{fontWeight:700,color:z.squidInk,mb:.5,fontSize:{xs:16,md:18}},children:c.title}),e.jsx(a,{variant:"body2",sx:{color:z.textSecondary,lineHeight:1.7},children:c.desc})]},h))})]})}),e.jsx(Le,{}),e.jsx(i,{sx:{py:{xs:5,md:7},px:2,bgcolor:"#fff"},children:e.jsxs(Fe,{maxWidth:"lg",children:[e.jsx(a,{variant:"h4",sx:{textAlign:"center",fontWeight:800,color:z.squidInk,mb:4,fontSize:{xs:"1.4rem",md:"2rem"}},children:n("対応試験","Supported exams")}),e.jsxs(i,{sx:{display:"flex",justifyContent:"center",gap:3,flexWrap:"wrap"},children:[e.jsxs(J,{elevation:0,onClick:()=>o("/kafka-exam/select"),sx:{p:2.5,borderRadius:3,border:"2px solid #1DA1F220",display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",gap:.5,cursor:"pointer",transition:"all 0.2s","&:hover":{borderColor:"#1DA1F2",boxShadow:"0 4px 16px #1DA1F220"}},children:[e.jsx(i,{component:"img",loading:"lazy",decoding:"async",src:"/images/kafka/confluent-developer-badge.png",alt:"CCDAK",sx:{width:120,height:120,objectFit:"contain",mb:1}}),e.jsx(a,{variant:"body2",sx:{fontWeight:700,color:z.squidInk,lineHeight:1.3},children:"Confluent Certified Developer"}),e.jsx(a,{variant:"caption",sx:{color:z.textSecondary,fontSize:12},children:n("CCDAK | 900問","CCDAK | 900 Qs")})]}),e.jsxs(J,{elevation:0,onClick:()=>o("/kafka-exam/select"),sx:{p:2.5,borderRadius:3,border:"2px solid #1DA1F220",display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",gap:.5,cursor:"pointer",transition:"all 0.2s","&:hover":{borderColor:"#1DA1F2",boxShadow:"0 4px 16px #1DA1F220"}},children:[e.jsx(i,{component:"img",loading:"lazy",decoding:"async",src:"/images/kafka-streams/kafka-streams-badge.png",alt:"CCSD",sx:{width:120,height:120,objectFit:"contain",mb:1}}),e.jsx(a,{variant:"body2",sx:{fontWeight:700,color:z.squidInk,lineHeight:1.3},children:"Confluent Kafka Streams Developer"}),e.jsx(a,{variant:"caption",sx:{color:z.textSecondary,fontSize:12},children:n("CCSD | 900問","CCSD | 900 Qs")})]}),e.jsxs(J,{elevation:0,onClick:()=>o("/kafka-exam/select"),sx:{p:2.5,borderRadius:3,border:"2px solid #1DA1F220",display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",gap:.5,cursor:"pointer",transition:"all 0.2s","&:hover":{borderColor:"#1DA1F2",boxShadow:"0 4px 16px #1DA1F220"}},children:[e.jsx(i,{component:"img",loading:"lazy",decoding:"async",src:"/images/kafka-admin/kafka-admin-badge.png",alt:"CCAAK",sx:{width:120,height:120,objectFit:"contain",mb:1}}),e.jsx(a,{variant:"body2",sx:{fontWeight:700,color:z.squidInk,lineHeight:1.3},children:"Confluent Kafka Administrator"}),e.jsx(a,{variant:"caption",sx:{color:z.textSecondary,fontSize:12},children:n("CCAAK | 900問","CCAAK | 900 Qs")})]})]})]})}),e.jsx(Le,{}),e.jsx(i,{sx:{py:{xs:5,md:7},px:2,bgcolor:"#fff"},children:e.jsxs(Fe,{maxWidth:"md",children:[e.jsx(a,{variant:"h4",sx:{textAlign:"center",fontWeight:800,color:z.squidInk,mb:4,fontSize:{xs:"1.4rem",md:"2rem"}},children:n("料金プラン","Pricing")}),e.jsxs(i,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"1fr 1fr"},gap:3,maxWidth:600,mx:"auto"},children:[e.jsxs(J,{elevation:0,sx:{p:3,textAlign:"center",borderRadius:2,border:`1px solid ${z.borderGray}`},children:[e.jsx(a,{variant:"h6",sx:{color:z.squidInk,fontWeight:700},children:n("無料で試す","Try for free")}),e.jsx(a,{variant:"h3",sx:{fontWeight:800,my:1.5,color:z.squidInk},children:"¥0"}),e.jsx(a,{variant:"body2",sx:{color:z.textSecondary,mb:2},children:n("公開問題で学習を体験","Sample the public problems")}),e.jsx(v,{variant:"outlined",fullWidth:!0,size:"large",onClick:()=>o("/kafka-exam/select"),sx:{borderColor:z.squidInk,color:z.squidInk,fontWeight:600,"&:hover":{bgcolor:z.lightGray}},children:n("ゲストで試す","Try as guest")})]}),e.jsxs(J,{elevation:2,sx:{p:3,textAlign:"center",borderRadius:2,border:`2px solid ${z.orange}`,position:"relative",overflow:"visible"},children:[e.jsxs(i,{sx:{position:"absolute",top:-14,left:"50%",transform:"translateX(-50%)",bgcolor:z.orange,color:z.onAccent,px:2,py:.4,borderRadius:1,fontSize:13,fontWeight:700,display:"flex",alignItems:"center",gap:.5,whiteSpace:"nowrap"},children:[e.jsx(sr,{sx:{fontSize:16}})," ",n("おすすめ","Recommended")]}),e.jsx(a,{variant:"h6",sx:{color:z.squidInk,fontWeight:700,mt:1},children:n("有料プラン","Paid Plan")}),e.jsxs(a,{variant:"h3",sx:{fontWeight:800,my:1,color:z.orange},children:["¥980",e.jsx(a,{component:"span",variant:"body2",sx:{color:z.textMuted},children:n("/月","/mo · US$6.20")})]}),e.jsx(a,{variant:"body2",sx:{color:z.textSecondary,mb:2},children:n("Kafka全問題+模擬試験にフルアクセス","Full access to all Kafka practice + mock exams")}),e.jsx(Xe,{open:d,onClose:()=>r(!1)}),e.jsx(v,{variant:"contained",fullWidth:!0,size:"large",onClick:()=>r(!0),disabled:!Cn,sx:{bgcolor:z.orange,color:z.onAccent,fontWeight:700,"&:hover":{bgcolor:z.orangeHover}},children:n("有料プランで始める(月額¥980)","Get the paid plan (¥980/mo, US$6.20)")}),Ve&&e.jsx(v,{variant:"outlined",fullWidth:!0,size:"large",onClick:()=>r(!0),sx:{mt:1,color:z.orange,borderColor:z.orange,fontWeight:700,"&:hover":{borderColor:z.orangeHover,bgcolor:"rgba(0,0,0,0.03)"}},children:n("90日間 ¥1,980 買い切りで始める(自動更新なし)","Start with a one-time 90-day plan (¥1,980 · US$12.60 · no auto-renewal)")}
1),Ve&&e.jsxs(a,{variant:"caption",sx:{display:"block",mt:1.5,color:z.textSecondary,lineHeight:1.6},children:[n(Mt.ja,Mt.en)," ",n(Ot.ja,Ot.en)]})]})]})]})}),e.jsx(Le,{}),e.jsx(i,{sx:{py:{xs:5,md:7},px:2,bgcolor:"#fff"},children:e.jsxs(Fe,{maxWidth:"lg",children:[e.jsx(a,{variant:"h4",sx:{textAlign:"center",fontWeight:800,color:z.squidInk,mb:1,fontSize:{xs:"1.4rem",md:"2rem"}},children:n("Kafka資格の学習ガイド","Kafka Certification Study Guide")}),e.jsx(a,{sx:{textAlign:"center",color:z.textSecondary,mb:4,fontSize:{xs:14,md:16}},children:n("試験対策に役立つ記事を公開中","Articles to support your exam prep")}),e.jsx(i,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"1fr 1fr",md:"1fr 1fr 1fr"},gap:2},children:[{title:n("資格全体像","Certification Overview"),desc:n("CCDAK・CCAAKの位置付けと選び方","Where CCDAK & CCAAK fit and how to choose"),to:"/articles/kafka/certifications/"},{title:n("CCDAK試験ガイド","CCDAK Exam Guide"),desc:n("出題範囲・配点・申込み・対策","Scope, weighting, registration, prep"),to:"/articles/kafka/ccdak-exam/"},{title:n("CCAAK試験ガイド","CCAAK Exam Guide"),desc:n("運用観点の出題と対策","Operations-focused questions and prep"),to:"/articles/kafka/ccaak-exam/"},{title:n("難易度比較","Difficulty Comparison"),desc:n("CCDAK/CCAAKの学習時間と難しさ","Study time and difficulty: CCDAK vs CCAAK"),to:"/articles/kafka/difficulty/"},{title:n("勉強方法ガイド","Study Strategy Guide"),desc:n("公式ドキュメント・演習の進め方","How to use official docs and exercises"),to:"/articles/kafka/study-guide/"},{title:n("問題例","Sample Questions"),desc:n("主要ドメイン別のサンプル問題","Sample questions by major domain"),to:"/articles/kafka/sample-questions/"},{title:n("受験料ガイド","Exam Cost Guide"),desc:n("費用・バウチャー・再受験規則","Fees, vouchers, retake rules"),to:"/articles/kafka/exam-cost/"},{title:n("合格体験記","Pass Stories"),desc:n("当日の流れ・ツール・注意点","Test-day flow, tools, gotchas"),to:"/articles/kafka/exam-experience/"},{title:n("Confluent Cloud 無料枠","Confluent Cloud Free Tier"),desc:n("学習用クラスタ構築と実機演習","Spinning up a learning cluster and hands-on"),to:"/articles/kafka/free-trial/"},{title:n("キャリア価値","Career Value"),desc:n("ストリーミング領域の市場価値","Market value in the streaming space"),to:"/articles/kafka/career/"},{title:n("Topic と Partition","Topics & Partitions"),desc:n("分散とスケーラビリティの要","Core of distribution and scalability"),to:"/articles/kafka/topics-partitions/"},{title:n("Replica と ISR","Replicas & ISR"),desc:n("耐障害性・一貫性の設計","Fault tolerance and consistency design"),to:"/articles/kafka/replicas-isr/"},{title:"Consumer Groups",desc:n("並列処理・グループ調整","Parallelism and group coordination"),to:"/articles/kafka/consumer-groups/"},{title:n("acks 設定","acks setting"),desc:n("耐久性 vs レイテンシのトレードオフ","Durability vs latency trade-off"),to:"/articles/kafka/acks-config/"}
1,{title:"Idempotent Producer",desc:n("重複排除の仕組み","Deduplication mechanics"),to:"/articles/kafka/idempotent-producer/"},{title:"Exactly-Once",desc:n("EOS の保証範囲と条件","EOS guarantees: scope and conditions"),to:"/articles/kafka/exactly-once/"},{title:"Schema Registry",desc:n("スキーマ進化と互換性","Schema evolution and compatibility"),to:"/articles/kafka/schema-registry/"},{title:n("Avro スキーマ","Avro Schemas"),desc:n("フィールド進化・デフォルト値","Field evolution and defaults"),to:"/articles/kafka/avro-schemas/"},{title:"Kafka Connect",desc:n("Source/Sink・分散モード","Source/Sink, distributed mode"),to:"/articles/kafka/kafka-connect/"},{title:"Kafka Streams",desc:n("KStream/KTableの使い分け","When to use KStream vs KTable"),to:"/articles/kafka/kafka-streams/"},{title:"ksqlDB",desc:n("SQLライクなストリーム処理","SQL-like stream processing"),to:"/articles/kafka/ksqldb/"},{title:n("圧縮タイプ比較","Compression Comparison"),desc:"gzip/snappy/lz4/zstd",to:"/articles/kafka/compression/"},{title:n("監視・メトリクス","Monitoring & Metrics"),desc:n("JMX・ブローカー観測ポイント","JMX and broker observation points"),to:"/articles/kafka/monitoring/"},{title:"Partition Assignor",desc:"Range/RoundRobin/Sticky",to:"/articles/kafka/partition-assignment/"}].map((c,h)=>e.jsxs(J,{onClick:()=>o(c.to),elevation:0,sx:{p:2.5,cursor:"pointer",borderRadius:2,border:`1px solid ${z.borderGray}`,transition:"box-shadow 0.2s, transform 0.2s","&:hover":{boxShadow:"0 4px 16px rgba(0,0,0,0.08)",transform:"translateY(-2px)"}},children:[e.jsx(a,{sx:{fontWeight:700,color:z.squidInk,fontSize:15,mb:.5},children:c.title}),e.jsx(a,{variant:"body2",sx:{color:z.textSecondary,fontSize:13},children:c.desc})]},h))})]})}),e.jsx(bo,{app:Jr("kafka-exam")}),e.jsx(Le,{}),e.jsx(i,{sx:{py:{xs:5,md:6},px:2,bgcolor:z.squidInk,textAlign:"center"},children:e.jsxs(Fe,{maxWidth:"sm",children:[e.jsx(a,{variant:"h5",sx:{fontWeight:800,color:"#fff",mb:1,fontSize:{xs:"1.2rem",md:"1.5rem"}},children:n("今すぐ学習を始めましょう","Start studying now")}),e.jsx(a,{sx:{color:"rgba(255,255,255,0.7)",mb:3},children:n("日本語で学べるKafka資格学習サイトで、合格を目指しましょう","Pass your Kafka certifications with bilingual study resources")}),e.jsx(v,{variant:"contained",size:"large",onClick:()=>o("/kafka-exam/select"),endIcon:e.jsx(nt,{}),sx:{bgcolor:z.orange,color:z.onAccent,fontWeight:700,py:1.5,px:4,"&:hover":{bgcolor:z.orangeHover}},children:n("試験を選択して学習する","Choose an exam and study")})]})}),e.jsxs(i,{sx:{bgcolor:z.darkBlue,py:2,px:2,textAlign:"center"},children:[e.jsx(i,{sx:{mb:1.5},children:e.jsx(bt,{color:"rgba(255,255,255,0.72)"})}),e.jsxs(a,{variant:"body2",sx:{color:"rgba(255,255,255,0.5)",fontSize:12},children:["© 2026 NicheeLab All rights reserved. | ",n("Apache Kafka は Apache Software Foundation の商標です。Confluent は Confluent, Inc. の商標です。","Apache Kafka is a trademark of the Apache Software Foundation. Confluent is a trademark of Confluent, Inc.")]})]})]})}const ue=Te,Jo=[{type:"ccdak",img:"/images/kafka/confluent-developer-badge.png",name:"Certified Developer",sub:"CCDAK",borderColor:"#1DA1F2",category:"Developer"},{type:"ccsd",img:"/images/kafka-streams/kafka-streams-badge.png",name:"Kafka Streams Developer",sub:"CCSD",borderColor:"#1DA1F2",category:"Streams",noCert:{ja:"Confluent は Kafka Streams 単独の認定資格を提供していません。学習用の教材です。",en:"Confluent does not offer a standalone Kafka Streams certification. This is study material."}},{type:"ccaak",img:"/images/kafka-admin/kafka-admin-badge.png",name:"Kafka Administrator",sub:"CCAAK",borderColor:"#1DA1F2",category:"Administrator"}];function Qo(){const o=ge(),{siteLocale:t}=de(),s=t==="en",n=(I,P)=>s?P:I,[d,r]=Qn(),{user:E,isLoggedIn:m,loading:j,logout:S,refreshSubscription:u}=Pe(),{setExamType:c}=_e(),[h,y]=l.useState(!1),[g,C]=l.useState(!1);l.useEffect(()=>{j||d.get("registered")==="true"&&m&&(C(!0),r({},{replace:!0}))},[j,m,d,r]),l.useEffect(()=>{if(j||d.get("payment")!=="success")return;if(!m){o("/kafka-exam/login?from=payment");return}y(!0),r({},{replace:!0});let I=!1;return(async()=>{for(let P=0;P<15;P++){if(I)return;await u(),await new Promise(b=>setTimeout(b,3e3))}})(),()=>{I=!0}},[j,m]);const f=I=>{c(I.type),o("/kafka-exam/menu")},k=()=>{S(),o("/kafka-exam/")},M=["Developer","Streams","Administrator"];return e.jsxs(i,{sx:{display:"flex",flexDirection:"column",minHeight:"100vh",bgcolor:ue.lightGray},children:[e.jsxs(Ie,{open:h,onClose:()=>y(!1),maxWidth:"sm",fullWidth:!0,children:[e.jsxs(Se,{sx:{textAlign:"center",pt:4,pb:2},children:[e.jsxs(i,{sx:{display:"flex",justifyContent:"center",gap:1,mb:2},children:[e.jsx(_n,{sx:{fontSize:48,color:ue.orange}}),e.jsx(eo,{sx:{fontSize:48,color:"#1D8102"}})]}),e.jsx(a,{variant:"h5",sx:{fontWeight:800,color:ue.squidInk,mb:1},children:n("有料プランが有効になりました!","Paid plan activated!")}),e.jsx(a,{variant:"body1",sx:{color:ue.textSecondary,mb:2},children:n("すべての機能がロック解除されました","All features unlocked")}),e.jsx(i,{sx:{display:"flex",flexDirection:"column",gap:1,textAlign:"left",bgcolor:ue.lightGray,borderRadius:2,p:2,mx:"auto",maxWidth:360},children:[n("全問題にフルアクセス","Full access to every question"),n("Confluent Certified Developer 全1資格対応","Covers 1 certification: Confluent Certified Developer"),n("全問題に解説付き","An explanation for every question"),n("カテゴリー別弱点分析","Weak-area analysis by category")].map((I,P)=>e.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(Me,{sx:{color:"#1D8102",fontSize:20}}),e.jsx(a,{variant:"body2",sx:{color:ue.squidInk,fontWeight:500},children:I})]},P))})]}),e.jsx(Ce,{sx:{justifyContent:"center",pb:3},children:e.jsx(v,{variant:"contained",size:"large",onClick:()=>y(!1),sx:{bgcolor:ue.orange,color:ue.onAccent,fontWeight:700,px:5,"&:hover":{bgcolor:ue.orangeHover}}
1,children:n("さっそく学習を始める","Start studying now")})})]}),e.jsx(Ie,{open:g,onClose:()=>C(!1),maxWidth:"sm",fullWidth:!0,children:e.jsxs(Se,{sx:{textAlign:"center",pt:4,pb:2},children:[e.jsx(_n,{sx:{fontSize:56,color:ue.orange,mb:1}}),e.jsx(a,{variant:"h5",sx:{fontWeight:800,color:ue.squidInk,mb:1},children:n("会員登録が完了しました!","Welcome! Your account is ready.")}),e.jsx(a,{variant:"body1",sx:{color:ue.textSecondary,mb:3},children:n("NicheeLab へようこそ。まずは無料で問題を解いてみましょう。","Welcome to NicheeLab. Try free problems to get started.")}),e.jsxs(i,{sx:{display:"flex",flexDirection:"column",gap:1.5,maxWidth:400,mx:"auto"},children:[e.jsx(v,{variant:"contained",size:"large",fullWidth:!0,startIcon:e.jsx(sr,{}),onClick:()=>{C(!1),window.open(wn(E),"_blank")},sx:{bgcolor:ue.orange,color:ue.onAccent,fontWeight:700,py:1.5,"&:hover":{bgcolor:ue.orangeHover}},children:n("有料プランに申し込む(¥980/月)","Get the paid plan (¥980/mo, US$6.20)")}),e.jsx(a,{variant:"caption",sx:{color:ue.textMuted},children:e.jsx(e.Fragment,{children:n("¥980/月、または 90日間 ¥1,980 買い切り(自動更新なし)","¥980/mo (US$6.20), or ¥1,980 one-time for 90 days (no auto-renewal)")})}),e.jsx(v,{variant:"outlined",size:"large",fullWidth:!0,startIcon:e.jsx(or,{}),onClick:()=>C(!1),sx:{borderColor:ue.squidInk,color:ue.squidInk,fontWeight:600,py:1.5},children:n("まずは無料で試してみる","Try free first")})]})]})}),e.jsxs(i,{sx:{bgcolor:ue.squidInk,px:2,pt:{xs:1.5,md:2},pb:{xs:2,md:3}},children:[e.jsx(i,{sx:{display:"flex",justifyContent:"flex-end",mb:{xs:.5,md:1},gap:1},children:m?e.jsx(v,{size:"small",startIcon:e.jsx(ar,{fontSize:"small"}),onClick:k,sx:{color:"rgba(255,255,255,0.85)",textTransform:"none",fontWeight:600},children:n("ログアウト","Log out")}):e.jsxs(e.Fragment,{children:[e.jsx(v,{size:"small",variant:"outlined",onClick:()=>o("/kafka-exam/login"),sx:{color:"#fff",borderColor:"rgba(255,255,255,0.5)",textTransform:"none"},children:n("ログイン","Log in")}),e.jsx(v,{size:"small",variant:"contained",onClick:()=>o("/kafka-exam/register"),sx:{bgcolor:ue.orange,textTransform:"none","&:hover":{bgcolor:ue.orangeHover}},children:n("新規登録","Sign up")})]})}),e.jsxs(i,{sx:{textAlign:"center"},children:[e.jsx(a,{sx:{color:"#fff",fontWeight:700,fontSize:{xs:"1.15rem",sm:"1.35rem",md:"1.5rem"}},children:n("Kafka 試験を選択","Choose a Kafka exam")}),m&&E?e.jsxs(a,{variant:"body2",sx:{color:"rgba(255,255,255,0.7)",mt:.5},children:[E.email," | ",E.plan==="premium"?n("有料プラン","Paid plan"):n("無料プラン","Free plan")]}):e.jsx(a,{variant:"body2",sx:{color:ue.orange,mt:.5},children:n("ゲストモード","Guest mode")})]})]}),e.jsx(Fe,{maxWidth:"lg",sx:{flex:1,py:4},children:M.map(I=>{const P=Jo.filter(b=>b.category===I);return P.length?e.jsxs(i,{sx:{mb:4},children:[e.jsx(Ne,{label:I,sx:{mb:2,bgcolor:I==="Advanced"?"#1B4B8F":I==="Specialty"?"#56CCF2":"#29B5E8",color:"#fff",fontWeight:700}}),e.jsx(i,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"1fr 1fr",md:"1fr 1fr 1fr"},gap:2},children:P.map(b=>e.jsxs(J,{role:"button",tabIndex:0,onClick:()=>f(b),onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&f(b)},sx:{p:2.5,cursor:"pointer",display:"flex",alignItems:"center",gap:2,bgcolor:"#fff",border:`2px solid ${b.borderColor}`,borderRadius:2,minHeight:80,transition:"transform 0.2s, box-shadow 0.2s","&:hover":{transform:"translateY(-2px)",boxShadow:"0 4px 20px rgba(0,0,0,0.1)"},"&:focus-visible":{outline:"2px solid #29B5E8",outlineOffset:2}},elevation:0,children:[e.jsx(i,{component:"img",src:b.img,alt:b.name,sx:{width:{xs:64,md:80},height:{xs:64,md:80},objectFit:"contain"}}),e.jsxs(i,{children:[e.jsx(a,{variant:"subtitle1",sx:{color:ue.squidInk,fontWeight:700,lineHeight:1.3,fontSize:{xs:14,md:15}},children:b.name}),e.jsx(a,{variant:"caption",sx:{color:ue.textSecondary},children:b.sub}),b.noCert&&e.jsx(a,{variant:"caption",sx:{color:ue.textSecondary,display:"block",mt:.5,fontSize:11,lineHeight:1.4},children:n(b.noCert.ja,b.noCert.en)})]})]},b.name))})]},I):null})})]})}const Vo="0x4AAAAAACtuEvtwfKvYO0-O";function An({siteKey:o,onVerify:t,resetKey:s}){const n=l.useRef(null),d=l.useRef(null);return l.useEffect(()=>{const r=o||Vo,E=()=>{!n.current||!window.turnstile||(d.current&&window.turnstile.remove(d.current),d.current=window.turnstile.render(n.current,{sitekey:r,callback:t,"expired-callback":()=>t(""),"error-callback":()=>t(""),theme:"light",language:window.location.pathname.startsWith("/en/")||window.location.pathname==="/en"?"en":"ja"}))};if(window.turnstile)E();
1else{const m=document.createElement("script");m.src="https://challenges.cloudflare.com/turnstile/v0/api.js?onload=onTurnstileLoad",m.async=!0,window.onTurnstileLoad=E,document.head.appendChild(m)}return()=>{d.current&&window.turnstile&&(window.turnstile.remove(d.current),d.current=null)}},[o,t]),l.useEffect(()=>{s===void 0||s===0||d.current&&window.turnstile&&(t(""),window.turnstile.reset(d.current))},[s]),e.jsx(i,{ref:n,sx:{my:2,display:"flex",justifyContent:"center"}})}const sn=Te;function Xo(){const{siteLocale:o}=de(),t=(P,b)=>o==="en"?b:P,s=ge(),[n]=Qn(),d=n.get("from")==="payment",{login:r}=Pe(),[E,m]=l.useState(""),[j,S]=l.useState(""),[u,c]=l.useState(""),[h,y]=l.useState(""),[g,C]=l.useState(0),[f,k]=l.useState(!1),M=l.useCallback(P=>{y(P)},[]),I=async P=>{P.preventDefault(),c("");const b=await r(E,j,h||void 0);b.ok||(y(""),C(w=>w+1)),b.ok?s(d?"/kafka-exam/select?payment=success":"/kafka-exam/select"):b.status===401?c(t("メールアドレスまたはパスワードが正しくありません","The email address or password is incorrect")):b.status===429?c(t("試行回数が多すぎます。1 分ほど待ってからもう一度お試しください","Too many attempts. Please wait a minute and try again.")):b.code==="TURNSTILE_FAILED"?c(t("「私はロボットではありません」にチェックを入れてから、もう一度お試しください",`Please tick the "I'm not a robot" checkbox and try again.`)):b.status===400||b.status===403?c(t("認証の確認に失敗しました。ページを再読み込みしてもう一度お試しください","Verification failed. Please reload the page and try again.")):c(t("通信エラーが発生しました。時間をおいてもう一度お試しください","A network error occurred. Please try again in a moment."))};return e.jsxs(i,{sx:{p:3,maxWidth:400,mx:"auto",mt:4},children:[d&&e.jsxs(i,{sx:{bgcolor:"#E8F5E9",borderRadius:2,p:2,mb:3,textAlign:"center"},children:[e.jsx(Me,{sx:{color:"#1D8102",fontSize:32,mb:.5}}),e.jsx(a,{variant:"body1",sx:{fontWeight:700,color:"#1D8102"},children:t("お支払いが完了しました!","Payment complete!")}),e.jsx(a,{variant:"body2",sx:{color:sn.textSecondary},children:t("ログインして有料プランを有効にしてください","Log in to activate your paid plan")})]}),e.jsx(a,{variant:"h5",sx:{mb:3,textAlign:"center"},children:t("ログイン","Log in")}),e.jsxs("form",{onSubmit:I,children:[e.jsx(Ae,{fullWidth:!0,label:t("メールアドレス","Email address"),type:"email",value:E,onChange:P=>m(P.target.value),required:!0,sx:{mb:2}}),e.jsx(Ae,{fullWidth:!0,label:t("パスワード","Password"),type:f?"text":"password",value:j,onChange:P=>S(P.target.value),required:!0,sx:{mb:2},InputProps:{endAdornment:e.jsx(ir,{position:"end",children:e.jsx(ce,{onClick:()=>k(!f),edge:"end",size:"small",children:f?e.jsx(lr,{}):e.jsx(cr,{})})})}}),e.jsx(An,{onVerify:M,resetKey:g}),u&&e.jsx(a,{color:"error",variant:"body2",sx:{mb:1},children:u}),e.jsx(v,{type:"submit",variant:"contained",fullWidth:!0,sx:{mb:2,bgcolor:"#FF9900",color:"#232F3E","&:hover":{bgcolor:"#EC7211"}},children:t("ログイン","Log in")})]}),e.jsx(a,{variant:"body2",sx:{textAlign:"center",mb:1},children:e.jsx($e,{component:"button",onClick:()=>s("/kafka-exam/forgot-password"),sx:{cursor:"pointer",color:sn.textSecondary,fontSize:"0.85rem"},children:t("パスワードを忘れた方はこちら","Forgot your password?")})}),e.jsxs(a,{variant:"body2",sx:{textAlign:"center"},children:[t("アカウントをお持ちでない方は ","Don't have an account? "),e.jsx($e,{component:"button",onClick:()=>s("/kafka-exam/register"),sx:{cursor:"pointer"},children:t("会員登録","Sign up")})]}),e.jsx(i,{sx:{mt:2},children:e.jsx(bt,{color:sn.textSecondary})})]})}const pe=Te,Zo=[{ja:"Confluent CCDAK 対応の日本語問題集",en:"Question bank for Confluent CCDAK"},{ja:"本番形式の模擬試験を収録",en:"Includes full-length mock exams"},{ja:"全問に詳しい解説付き(Confluent/Apache Kafka公式ドキュメント準拠)",en:"Detailed explanations for every question (based on official Confluent/Apache Kafka docs)"},{ja:"問題ごと・カテゴリーごとの正解率トラッキング",en:"Track your score by question and by category"},{ja:"PC・スマホ・タブレットどこでも学習可能",en:"Study on desktop, phone, or tablet"}];function es(){const{siteLocale:o,buildPath:t}=de(),s=(L,H)=>o==="en"?H:L,n=ge(),{register:d}=Pe(),[r,E]=l.useState("form"),[m,j]=l.useState(""),[S,u]=l.useState(""),[c,h]=l.useState(""),[y,g]=l.useState(""),[C,f]=l.useState(!1),[k,M]=l.useState(""),[I,P]=l.useState(0),[b,w]=l.useState(0),[R,X]=l.useState(!1),[O,K]=l.useState(!1),[T,D]=l.useState(!1),N=l.useRef();l.useEffect(()=>()=>{N.current&&clearInterval(N.current)},[]);const ne=()=>{w(60),N.current=setInterval(()=>{w(L=>L<=1?(clearInterval(N.current),0):L-1)},1e3)},U=l.useCallback(L=>{M(L)},[]),G=async L=>{if(L.preventDefault(),g(""),!m){g(s("メールアドレスを入力してください","Enter your email address"));return}if(!S||S.length<8){g(s("パスワードは8文字以上にしてください","Your password must be at least 8 characters"));return}if(!/[a-zA-Z]/.test(S)){g(s("パスワードに英字を含めてください","Include at least one letter in your password"));return}if(!/[0-9]/.test(S)){g(s("パスワードに数字を含めてください","Include at least one number in your password"));return}if(!R||!O){g(s("利用規約とプライバシーポリシーへの同意が必要です","You must agree to the Terms of Service and the Privacy Policy"));return}if(!k){g(s("確認 (bot 検証) が終わるまで数秒お待ちください","Please wait a few seconds for the verification to finish"));return}f(!0);try{await Lt(m,"register",k||void 0),E("otp"),ne()}catch(H){M(""),P(F=>F+1),g(H.message||s("認証コードの送信に失敗しました","Failed to send the verification code"))}finally{f(!1)}},_=async()=>{g(""),f(!0);try{await Lt(m,"register"),ne()}catch(L){g(L.message||s("認証コードの再送信に失敗しました","Failed to resend the verification code"))}finally{f(!1)}},$=async L=>{if(L.preventDefault(),g(""),!c||c.length!==6){g(s("6桁の認証コードを入力してください","Enter the 6-digit verification code"));return}if(!R||!O){g(s("利用規約とプライバシーポリシーへの同意が必要です","You must agree to the Terms of Service and the Privacy Policy"));return}f(!0);try{await d({email:m,password:S,otpCode:c,turnstileToken:k||void 0,termsAccepted:R,privacyAccepted:O}),Zn("sign_up"),n("/kafka-exam/select?registered=true")}catch(H){g(H.message||s("登録に失敗しました","Registration failed"))}finally{f(!1)}};return e.jsxs(i,{sx:{minHeight:"100vh",bgcolor:pe.lightGray,display:"flex",flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(i,{sx:{flex:{xs:"none",md:1},bgcolor:pe.squidInk,color:"#fff",p:{xs:3,md:6},display:"flex",flexDirection:"column",justifyContent:"center"},children:[e.jsx(a,{variant:"h4",sx:{fontWeight:800,mb:1,fontSize:{xs:"1.3rem",md:"2rem"}},children:s("Kafka Developer 資格学習で","Study for Kafka Developer certification")}),e.jsx(a,{variant:"h4",sx:{fontWeight:800,color:pe.orange,mb:3,fontSize:{xs:"1.3rem",md:"2rem"}},children:s("合格を確実に。","and pass with confidence.")}),e.jsx(i,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:Zo.map((L,H)=>
1e.jsxs(i,{sx:{display:"flex",alignItems:"flex-start",gap:1},children:[e.jsx(Me,{sx:{color:pe.orange,fontSize:20,mt:.3,flexShrink:0}}),e.jsx(a,{variant:"body2",sx:{color:"rgba(255,255,255,0.9)",lineHeight:1.5},children:s(L.ja,L.en)})]},H))}),e.jsx(Le,{sx:{borderColor:"rgba(255,255,255,0.1)",my:3}}),e.jsxs(i,{sx:{display:"flex",gap:3},children:[e.jsxs(i,{children:[e.jsx(a,{variant:"h5",sx:{fontWeight:800,color:pe.orange},children:"¥0"}),e.jsx(a,{variant:"caption",sx:{color:"rgba(255,255,255,0.6)"},children:s("アカウント作成","Create account")})]}),e.jsxs(i,{children:[e.jsx(a,{variant:"caption",sx:{color:"rgba(255,255,255,0.4)",textDecoration:"none"},children:s("月額プラン","Monthly plan")}),e.jsxs(a,{variant:"h5",sx:{fontWeight:800,color:pe.orange},children:["¥980",e.jsx(a,{component:"span",variant:"caption",sx:{color:"rgba(255,255,255,0.5)"},children:s("/月","/month · US$6.20")})]}),e.jsx(a,{variant:"caption",sx:{color:"#ff6b6b",fontWeight:700},children:s("または 90日間 ¥1,980 買い切り(自動更新なし)","or ¥1,980 one-time for 90 days (no auto-renewal)")})]})]})]}),e.jsx(i,{sx:{flex:{xs:"none",md:1},display:"flex",alignItems:"center",justifyContent:"center",p:{xs:3,md:6}},children:e.jsxs(J,{sx:{p:4,maxWidth:420,width:"100%",borderRadius:2},elevation:2,children:[r==="form"?e.jsxs(e.Fragment,{children:[e.jsx(a,{variant:"h5",sx:{mb:.5,fontWeight:700,color:pe.squidInk},children:s("アカウント作成","Create account")}),e.jsx(a,{variant:"body2",sx:{mb:3,color:pe.textSecondary},children:s("登録すると進捗の保存とクロスデバイス同期が利用できます。有料プランは登録後に申込み可能です。","Sign up to save your progress and sync it across devices. You can subscribe to a paid plan after signing up.")}),e.jsxs("form",{onSubmit:G,children:[e.jsx(Ae,{fullWidth:!0,label:s("メールアドレス","Email address"),type:"email",value:m,onChange:L=>j(L.target.value),required:!0,sx:{mb:2}}),e.jsx(Ae,{fullWidth:!0,label:s("パスワード(英字+数字を含む8文字以上)","Password (8+ characters, with letters and numbers)"),type:T?"text":"password",value:S,onChange:L=>u(L.target.value),required:!0,inputProps:{minLength:8},sx:{mb:2},InputProps:{endAdornment:e.jsx(ir,{position:"end",children:e.jsx(ce,{onClick:()=>D(!T),edge:"end",size:"small",children:T?e.jsx(lr,{}):e.jsx(cr,{})})})}}),e.jsxs(rr,{sx:{mb:1},children:[e.jsx(ht,{control:e.jsx(Qe,{checked:R,onChange:L=>X(L.target.checked)}),label:e.jsxs(a,{variant:"body2",children:[e.jsx($e,{href:t("/terms/"),underline:"hover",target:"_blank",rel:"noreferrer",children:s("利用規約","Terms of Service")}),s("に同意する","I agree to the")]})}),e.jsx(ht,{control:e.jsx(Qe,{checked:O,onChange:L=>K(L.target.checked)}),label:e.jsxs(a,{variant:"body2",children:[e.jsx($e,{href:t("/privacy/"),underline:"hover",target:"_blank",rel:"noreferrer",children:s("プライバシーポリシー","Privacy Policy")}),s("に同意する","I agree to the")]})})]}),e.jsx(Oe,{severity:"info",sx:{mb:2},children:s("有料プランはログイン後に別画面でお申込みいただきます。月額課金・自動更新への同意はお申込み時に取得します。","Paid plans are purchased on a separate screen after you sign in. Consent to monthly billing and auto-renewal is collected at checkout.")}),e.jsx(An,{onVerify:U,resetKey:I}),y&&e.jsx(a,{color:"error",variant:"body2",sx:{mb:1},children:y}),e.jsx(v,{type:"submit",variant:"contained",fullWidth:!0,size:"large",disabled:C,sx:{mb:2,bgcolor:pe.orange,color:pe.squidInk,fontWeight:700,"&:hover":{bgcolor:pe.orangeHover}},children:C?e.jsx(zt,{size:24,sx:{color:pe.squidInk}}):s("認証コードを送信","Send verification code")})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs(i,{sx:{textAlign:"center",mb:2},children:[e.jsx(dr,{sx:{fontSize:48,color:pe.orange,mb:1}}),e.jsx(a,{variant:"h5",sx:{fontWeight:700,color:pe.squidInk},children:s("メール認証","Verify email")})]}),e.jsxs(a,{variant:"body2",sx:{mb:1,color:pe.textSecondary,textAlign:"center"},children:[e.jsx("strong",{children:m})," ",s("に6桁の認証コードを送信しました。"," — we sent a 6-digit verification code."),e.jsx("br",{}),s("メールを確認して入力してください。","Check your email address and enter it again.")]}
1),e.jsx(a,{variant:"caption",sx:{display:"block",mb:2,color:"#d32f2f",textAlign:"center",bgcolor:"#FFF3E0",borderRadius:1,py:.5,px:1},children:s("メールが届かない場合は迷惑メール(スパム)フォルダもご確認ください","If the email doesn't arrive, check your spam folder")}),e.jsx(Oe,{severity:"success",sx:{mb:2},children:s("認証が完了するとログイン状態になり進捗を同期できます。有料プランへの申込みはログイン後に行えます。","Once verified, you'll be signed in and your progress will sync. You can subscribe to a paid plan after signing in.")}),e.jsxs("form",{onSubmit:$,children:[e.jsx(Ae,{fullWidth:!0,label:s("認証コード(6桁)","Verification code (6 digits)"),value:c,onChange:L=>{const H=L.target.value.replace(/\D/g,"").slice(0,6);h(H)},required:!0,inputProps:{maxLength:6,inputMode:"numeric",style:{textAlign:"center",fontSize:24,letterSpacing:8}},sx:{mb:2}}),y&&e.jsx(a,{color:"error",variant:"body2",sx:{mb:1},children:y}),e.jsx(v,{type:"submit",variant:"contained",fullWidth:!0,size:"large",disabled:C||c.length!==6,sx:{mb:2,bgcolor:pe.orange,color:pe.squidInk,fontWeight:700,"&:hover":{bgcolor:pe.orangeHover}},children:C?e.jsx(zt,{size:24,sx:{color:pe.squidInk}}):s("登録を完了する","Complete registration")})]}),e.jsxs(i,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsx(v,{size:"small",onClick:()=>{E("form"),h(""),g("")},sx:{color:pe.textSecondary},children:s("戻る","Back")}),e.jsx(v,{size:"small",onClick:_,disabled:b>0||C,sx:{color:pe.accentBlue},children:b>0?s(`再送信(${b}秒)`,`Resend (${b}s)`):s("コードを再送信","Resend code")})]})]}),e.jsxs(a,{variant:"body2",sx:{textAlign:"center",color:pe.textSecondary,mt:r==="otp"?2:0},children:[s("すでにアカウントをお持ちの方は ","Already have an account? "),e.jsx($e,{component:"button",onClick:()=>n("/kafka-exam/login"),sx:{cursor:"pointer",color:pe.accentBlue},children:s("ログイン","Log in")})]}),e.jsx(i,{sx:{mt:2},children:e.jsx(bt,{color:pe.textSecondary})})]})})]})}const he=Te;function ts(){const{siteLocale:o}=de(),t=(D,N)=>o==="en"?N:D,s=ge(),[n,d]=l.useState("email"),[r,E]=l.useState(""),[m,j]=l.useState(""),[S,u]=l.useState(""),[c,h]=l.useState(""),[y,g]=l.useState(""),[C,f]=l.useState(!1),[k,M]=l.useState(0),[I,P]=l.useState(""),[b,w]=l.useState(0),R=l.useRef();l.useEffect(()=>()=>{R.current&&clearInterval(R.current)},[]);const X=()=>{M(60),R.current=setInterval(()=>{M(D=>D<=1?(clearInterval(R.current),0):D-1)},1e3)},O=async D=>{if(D.preventDefault(),g(""),!r){g(t("メールアドレスを入力してください","Enter your email address"));return}if(!I){g(t("確認 (bot 検証) が終わるまで数秒お待ちください","Please wait a few seconds for the verification to finish"));return}f(!0);try{await Lt(r,"reset",I||void 0),d("otp"),X()}catch(N){P(""),w(ne=>ne+1),g(N.message||t("認証コードの送信に失敗しました","Failed to send the verification code"))}finally{f(!1)}},K=async()=>{g(""),f(!0);try{await Lt(r,"reset"),X()}catch(D){g(D.message||t("認証コードの再送信に失敗しました","Failed to resend the verification code"))}finally{f(!1)}},T=async D=>{if(D.preventDefault(),g(""),m.length!==6){g(t("6桁の認証コードを入力してください","Enter the 6-digit verification code"));return}if(S.length<8){g(t("パスワードは8文字以上にしてください","Your password must be at least 8 characters"));return}if(S!==c){g(t("パスワードが一致しません","The passwords do not match"));return}f(!0);try{await So(r,m,S),d("done")}catch(N){g(N.message||t("パスワードの再設定に失敗しました","Failed to reset your password"))}finally{f(!1)}};return e.jsx(i,{sx:{minHeight:"100vh",bgcolor:he.lightGray,display:"flex",alignItems:"center",justifyContent:"center",p:3},children:e.jsxs(J,{sx:{p:4,maxWidth:420,width:"100%",borderRadius:2},elevation:2,children:[n==="email"&&e.jsxs(e.Fragment,{children:[e.jsxs(i,{sx:{textAlign:"center",mb:2},children:[e.jsx(to,{sx:{fontSize:48,color:he.orange,mb:1}}),e.jsx(a,{variant:"h5",sx:{fontWeight:700,color:he.squidInk},children:t("パスワード再設定","Reset password")})]}),e.jsxs(a,{variant:"body2",sx:{mb:3,color:he.textSecondary,textAlign:"center"},children:[t("登録済みのメールアドレスを入力してください。","Enter the email address you registered with."),e.jsx("br",{}),t("認証コードをお送りします。","We'll send you a verification code.")]}),e.jsxs("form",{onSubmit:O,children:[e.jsx(Ae,{fullWidth:!0,label:t("メールアドレス","Email address"),type:"email",value:r,onChange:D=>E(D.target.value),required:!0,sx:{mb:2}}),e.jsx(An,{onVerify:P,resetKey:b}),y&&e.jsx(a,{color:"error",variant:"body2",sx:{mb:1},children:y}),e.jsx(v,{type:"submit",variant:"contained",fullWidth:!0,size:"large",disabled:C,sx:{mb:2,bgcolor:he.orange,color:he.squidInk,fontWeight:700,"&:hover":{bgcolor:he.orangeHover}},children:C?e.jsx(zt,{size:24,sx:{color:he.squidInk}}):t("認証コードを送信","Send verification code")})]})]}),n==="otp"&&e.jsxs(e.Fragment,{children:[e.jsxs(i,{sx:{textAlign:"center",mb:2},children:[e.jsx(dr,{sx:{fontSize:48,color:he.orange,mb:1}}),e.jsx(a,{variant:"h5",sx:{fontWeight:700,color:he.squidInk},children:t("新しいパスワードを設定","Set a new password")})]}),e.jsxs(a,{variant:"body2",sx:{mb:1,color:he.textSecondary,textAlign:"center"},children:[e.jsx("strong",{children:r})," ",t("に送信された認証コードと"," and the verification code sent to "),e.jsx("br",{}),t("新しいパスワードを入力してください。","Enter a new password.")]}
1),e.jsx(a,{variant:"caption",sx:{display:"block",mb:2,color:"#d32f2f",textAlign:"center",bgcolor:"#FFF3E0",borderRadius:1,py:.5,px:1},children:t("メールが届かない場合は迷惑メール(スパム)フォルダもご確認ください","If the email doesn't arrive, check your spam folder")}),e.jsxs("form",{onSubmit:T,children:[e.jsx(Ae,{fullWidth:!0,label:t("認証コード(6桁)","Verification code (6 digits)"),value:m,onChange:D=>{const N=D.target.value.replace(/\D/g,"").slice(0,6);j(N)},required:!0,inputProps:{maxLength:6,inputMode:"numeric",style:{textAlign:"center",fontSize:24,letterSpacing:8}},sx:{mb:2}}),e.jsx(Ae,{fullWidth:!0,label:t("新しいパスワード(8文字以上)","New password (at least 8 characters)"),type:"password",value:S,onChange:D=>u(D.target.value),required:!0,inputProps:{minLength:8},sx:{mb:2}}),e.jsx(Ae,{fullWidth:!0,label:t("パスワード確認","Confirm password"),type:"password",value:c,onChange:D=>h(D.target.value),required:!0,sx:{mb:2}}),y&&e.jsx(a,{color:"error",variant:"body2",sx:{mb:1},children:y}),e.jsx(v,{type:"submit",variant:"contained",fullWidth:!0,size:"large",disabled:C,sx:{mb:2,bgcolor:he.orange,color:he.squidInk,fontWeight:700,"&:hover":{bgcolor:he.orangeHover}},children:C?e.jsx(zt,{size:24,sx:{color:he.squidInk}}):t("パスワードを再設定","Reset password")})]}),e.jsxs(i,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsx(v,{size:"small",onClick:()=>{d("email"),j(""),u(""),h(""),g("")},sx:{color:he.textSecondary},children:t("戻る","Back")}),e.jsx(v,{size:"small",onClick:K,disabled:k>0||C,sx:{color:he.accentBlue},children:k>0?t(`再送信(${k}秒)`,`Resend (${k}s)`):t("コードを再送信","Resend code")})]})]}),n==="done"&&e.jsxs(e.Fragment,{children:[e.jsxs(i,{sx:{textAlign:"center",mb:2},children:[e.jsx(Me,{sx:{fontSize:48,color:"#1D8102",mb:1}}),e.jsx(a,{variant:"h5",sx:{fontWeight:700,color:he.squidInk},children:t("再設定完了","Password reset")})]}),e.jsxs(a,{variant:"body2",sx:{mb:3,color:he.textSecondary,textAlign:"center"},children:[t("パスワードが正常に再設定されました。","Your password has been reset."),e.jsx("br",{}),t("新しいパスワードでログインしてください。","Sign in with your new password.")]}),e.jsx(v,{variant:"contained",fullWidth:!0,size:"large",onClick:()=>s("/kafka-exam/login"),sx:{mb:2,bgcolor:he.orange,color:he.squidInk,fontWeight:700,"&:hover":{bgcolor:he.orangeHover}},children:t("ログインページへ","Go to login")})]}),e.jsx(a,{variant:"body2",sx:{textAlign:"center",color:he.textSecondary,mt:1},children:e.jsx($e,{component:"button",onClick:()=>s("/kafka-exam/login"),sx:{cursor:"pointer",color:he.accentBlue},children:t("ログインに戻る","Back to login")})}),e.jsx(i,{sx:{mt:2},children:e.jsx(bt,{color:he.textSecondary})})]})})}const Gn=10,St={problems:[]},Wt={},Tt={};async function Rr(o){try{const t=await fetch(o);if(!t.ok)return St;const s=await t.json();return Array.isArray(s)?{problems:s}:s&&Array.isArray(s.problems)?s:St}catch{return St}}const _r={ccdak:"/data/kafka",ccaak:"/data/kafka-admin",ccsd:"/data/kafka-streams"};async function st(o){if(Wt[o])return Wt[o];const t=await Rr(`${_r[o]}/${o}Problems.json`);return Wt[o]=t,t}async function at(o){if(Tt[o])return Tt[o];const t=await Rr(`${_r[o]}/${o}MockExamProblems.json`);return Tt[o]=t,t}function zr(o){return it(o).problems.length}function En(o){const t=it(o);return new Set(t.problems.map(n=>n.set_number||1)).size}function In(o){const t=Gt(o);return new Set(t.problems.map(n=>n.set_number||1)).size}function it(o){return Wt[o]||St}function Je(o,t){const s=it(o),n=s.problems.filter(d=>d.set_number===t);return n.length>0?{problems:n}:{problems:s.problems}}function Gt(o){return Tt[o]||St}function qe(o,t){const s=Gt(o),n=s.problems.filter(d=>d.set_number===t);return n.length>0?{problems:n}:{problems:s.problems}}const te=Te,ns={ccdak:"Certified Developer",ccaak:"Certified Administrator",ccsd:"Kafka Streams Developer"},rs={ccdak:"CCDAK",ccaak:"CCAAK",ccsd:"CCSD"},os=()=>{const o=ge(),{user:t,logout:s}=Pe(),{examType:n}=_e(),{siteLocale:d}
1=de(),r=(U,G)=>d==="en"?G:U,[E,m]=l.useState(!1),[j,S]=l.useState("monthly"),[u,c]=l.useState(!1),[h,y]=l.useState(!1),[g,C]=l.useState(!1),[f,k]=l.useState(""),[M,I]=l.useState(!1);if(l.useEffect(()=>{if(!n){o("/kafka-exam/select");return}let U=!1;return Promise.all([st(n),at(n)]).then(()=>{U||I(!0)}),()=>{U=!0}},[n,o]),!n)return null;if(!M)return e.jsx(i,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"100vh",bgcolor:te.lightGray},children:e.jsx(a,{sx:{color:te.textSecondary},children:r("問題データを読み込み中...","Loading questions...")})});const P=rs[n]||ns[n]||n.toUpperCase(),b=zr(n),w=En(n),R=In(n),X=`${n}_`,O=Number(localStorage.getItem(`${X}currentSet`)||"1"),K=Number(localStorage.getItem(`${X}answeredCount`)||"0"),T=Number(localStorage.getItem(`${X}correctCount`)||"0"),D=K>0?Math.round(T/K*100):0,N=async U=>{k("");const G=j==="buyout";if(j==="all-access"?!Rn:G?!Ve:!Cn){k(r("Stripe の課金リンクが未設定です。環境変数を確認してください。","The Stripe billing link is not configured. Check the environment variables."));return}const _=Xn();try{C(!0),await Ar({consentVersion:$t,context:"checkout",termsAccepted:U.termsAccepted,privacyAccepted:U.privacyAccepted,autoRenewalAccepted:G?!1:U.autoRenewalAccepted}),_.open(j==="all-access"?Qr(t):(G?Tr:wn)(t)),m(!1)}catch($){_.cancel(),k($.message||r("同意内容の保存に失敗しました","Failed to save your consent"))}finally{C(!1)}},ne=()=>{s(),y(!0),setTimeout(()=>o("/kafka-exam/login"),1200)};return e.jsxs(i,{sx:{display:"flex",flexDirection:"column",minHeight:"100vh",width:"100%",bgcolor:te.lightGray},children:[e.jsx(i,{sx:{bgcolor:te.squidInk,px:2,py:2.5,position:"relative"},children:e.jsxs(i,{sx:{display:"flex",alignItems:"center",maxWidth:800,mx:"auto"},children:[e.jsx(ce,{onClick:()=>o("/kafka-exam/select"),"aria-label":r("試験選択へ戻る","Back to exam selection"),sx:{color:"#fff",mr:1,minWidth:44,minHeight:44},children:e.jsx(Re,{})}),e.jsx(ce,{onClick:()=>c(!0),"aria-label":r("他の試験へ切り替え","Switch to another exam"),sx:{color:"#fff",mr:1,minWidth:44,minHeight:44},children:e.jsx(no,{})}),e.jsxs(i,{sx:{flex:1},children:[e.jsx(a,{sx:{color:"#fff",fontWeight:800,fontSize:{xs:"1.2rem",md:"1.5rem"},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:P}),K>0&&e.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:1,mt:.5},children:[e.jsx(gn,{sx:{color:te.accent,fontSize:16}}),e.jsx(a,{variant:"caption",sx:{color:"rgba(255,255,255,0.7)"},children:r(`正解率 ${D}%(${T}/${K}問)`,`Accuracy ${D}% (${T}/${K} questions)`)})]})]}),t?e.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(Ne,{label:t.plan==="premium"?r("有料","Paid"):r("無料","Free"),size:"small",sx:{bgcolor:t.plan==="premium"?te.accent:"rgba(255,255,255,0.15)",color:"#fff",fontWeight:700,fontSize:11,height:24}}),e.jsx(ce,{onClick:ne,"aria-label":r("ログアウト","Log out"),sx:{color:"rgba(255,255,255,0.6)",minWidth:40,minHeight:40},children:e.jsx(ar,{sx:{fontSize:20}})})]}):e.jsxs(i,{sx:{display:"flex",gap:1},children:[e.jsx(v,{size:"small",variant:"outlined",onClick:()=>o("/kafka-exam/login"),sx:{color:"#fff",borderColor:"rgba(255,255,255,0.4)",textTransform:"none",fontSize:13,height:36,whiteSpace:"nowrap",flexShrink:0},children:r("ログイン","Log in")}),e.jsx(v,{size:"small",variant:"contained",onClick:()=>o("/kafka-exam/register"),sx:{bgcolor:te.accent,textTransform:"none",fontSize:13,fontWeight:700,height:36,"&:hover":{bgcolor:te.accentHover},whiteSpace:"nowrap",flexShrink:0},children:r("登録","Sign up")})]})]})}),e.jsxs(Fe,{maxWidth:"sm",sx:{flex:1,py:3},children:[e.jsx(Br,{examType:n,totalProblems:b,locale:d==="en"?"en":"ja",translateCategory:U=>Hr(U,d==="en"?"en":"ja")}),K>0&&e.jsxs(J,{role:"button",tabIndex:0,onClick:()=>o("/kafka-exam/practice"),onKeyDown:U=>{U.key==="Enter"&&o("/kafka-exam/practice")},sx:{p:2.5,mb:2.5,borderRadius:2.5,border:`2px solid ${te.accent}`,cursor:"pointer",transition:"all 0.2s","&:hover":{boxShadow:`0 4px 16px ${te.accent}25`},"&:focus-visible":{outline:`2px solid ${te.accent}`,outlineOffset:2}}
1,elevation:0,children:[e.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs(i,{children:[e.jsx(a,{sx:{fontWeight:700,color:te.textPrimary,fontSize:15},children:r("続きから学習する","Continue studying")}),e.jsx(a,{variant:"caption",sx:{color:te.textSecondary},children:r(`練習${O} を解いています`,`Working on Practice ${O}`)})]}),e.jsx(nt,{sx:{color:te.accent}})]}),e.jsx(He,{variant:"determinate",value:Math.min(K/10*100,100),sx:{mt:1.5,height:6,borderRadius:3,bgcolor:"#E0E4E8","& .MuiLinearProgress-bar":{bgcolor:te.accent,borderRadius:3}}})]}),e.jsxs(i,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[e.jsxs(J,{role:"button",tabIndex:0,onClick:()=>o("/kafka-exam/practice"),onKeyDown:U=>{U.key==="Enter"&&o("/kafka-exam/practice")},sx:{p:2.5,borderRadius:2.5,cursor:"pointer",display:"flex",alignItems:"center",gap:2,transition:"all 0.2s","&:hover":{transform:"translateY(-2px)",boxShadow:"0 4px 16px rgba(0,0,0,0.08)"},"&:focus-visible":{outline:`2px solid ${te.accent}`,outlineOffset:2}},elevation:0,children:[e.jsx(i,{sx:{width:52,height:52,borderRadius:2,bgcolor:"#E5F5FC",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(ro,{sx:{fontSize:28,color:te.accent}})}),e.jsxs(i,{sx:{flex:1,minWidth:0},children:[e.jsx(a,{sx:{fontWeight:700,fontSize:16,color:te.textPrimary},children:r("練習問題","Practice questions")}),e.jsx(a,{variant:"caption",sx:{color:te.textSecondary},children:r(`${b}問・${w}セット`,`${b} questions in ${w} sets`)})]}),e.jsx(nt,{sx:{color:te.textMuted,fontSize:20}})]}),e.jsxs(J,{role:"button",tabIndex:0,onClick:()=>o("/kafka-exam/mock"),onKeyDown:U=>{U.key==="Enter"&&o("/kafka-exam/mock")},sx:{p:2.5,borderRadius:2.5,cursor:"pointer",display:"flex",alignItems:"center",gap:2,transition:"all 0.2s","&:hover":{transform:"translateY(-2px)",boxShadow:"0 4px 16px rgba(0,0,0,0.08)"},"&:focus-visible":{outline:`2px solid ${te.accent}`,outlineOffset:2}},elevation:0,children:[e.jsx(i,{sx:{width:52,height:52,borderRadius:2,bgcolor:"#FFF3E0",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(pn,{sx:{fontSize:28,color:"#FF9900"}})}),e.jsxs(i,{sx:{flex:1,minWidth:0},children:[e.jsx(a,{sx:{fontWeight:700,fontSize:16,color:te.textPrimary},children:r("模擬試験","Mock exams")}),e.jsx(a,{variant:"caption",sx:{color:te.textSecondary},children:r(`本番形式・${R}回分`,`Exam format, ${R} full mocks`)})]}),e.jsx(nt,{sx:{color:te.textMuted,fontSize:20}})]}),e.jsxs(J,{role:"button",tabIndex:0,onClick:()=>o("/kafka-exam/review"),onKeyDown:U=>{U.key==="Enter"&&o("/kafka-exam/review")},sx:{p:2.5,borderRadius:2.5,cursor:"pointer",display:"flex",alignItems:"center",gap:2,transition:"all 0.2s","&:hover":{transform:"translateY(-2px)",boxShadow:"0 4px 16px rgba(0,0,0,0.08)"},"&:focus-visible":{outline:`2px solid ${te.accent}`,outlineOffset:2}},elevation:0,children:[e.jsx(i,{sx:{width:52,height:52,borderRadius:2,bgcolor:"#E8F5E9",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(oo,{sx:{fontSize:28,color:"#1D8102"}})}),e.jsxs(i,{sx:{flex:1,minWidth:0},children:[e.jsx(a,{sx:{fontWeight:700,fontSize:16,color:te.textPrimary},children:r("復習","Review")}),e.jsx(a,{variant:"caption",sx:{color:te.textSecondary},children:r("間違えた問題を繰り返し解く","Practice the questions you got wrong")})]}),e.jsx(nt,{sx:{color:te.textMuted,fontSize:20}})]}),e.jsxs(J,{role:"button",tabIndex:0,onClick:()=>o("/kafka-exam/settings"),onKeyDown:U=>{U.key==="Enter"&&o("/kafka-exam/settings")},sx:{p:2.5,borderRadius:2.5,cursor:"pointer",display:"flex",alignItems:"center",gap:2,transition:"all 0.2s","&:hover":{transform:"translateY(-2px)",boxShadow:"0 4px 16px rgba(0,0,0,0.08)"},"&:focus-visible":{outline:`2px solid ${te.accent}`,outlineOffset:2}},elevation:0,children:[e.jsx(i,{sx:{width:52,height:52,borderRadius:2,bgcolor:"#F5F5F5",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(bn,{sx:{fontSize:28,color:te.textSecondary}})}),e.jsxs(i,{sx:{flex:1,minWidth:0},children:[e.jsx(a,{sx:{fontWeight:700,fontSize:16,color:te.textPrimary},children:r("設定","Settings")}),e.jsx(a,{variant:"caption",sx:{color:te.textSecondary},children:r("表示・音声・データ管理","Display, sound, and data")})]}),e.jsx(nt,{sx:{color:te.textMuted,fontSize:20}})]})]}),t&&t.plan!=="premium"&&e.jsxs(J,{sx:{mt:3,p:2.5,borderRadius:2.5,bgcolor:te.squidInk,textAlign:"center"}
1,elevation:0,children:[e.jsx(a,{sx:{color:"#fff",fontWeight:700,fontSize:15,mb:.5},children:r("全問題にアクセスする","Get all questions")}),e.jsx(a,{variant:"caption",sx:{color:"rgba(255,255,255,0.6)",display:"block",mb:2},children:r(`練習セット${Rt+1}以降・模擬試験${_t+1}回目以降のフルアクセス`,`Full access to Practice Set ${Rt+1}+ and Mock Exam ${_t+1}+`)}),e.jsx(v,{variant:"contained",onClick:()=>{k(""),S("monthly"),m(!0)},sx:{bgcolor:te.accent,color:te.onAccent,fontWeight:700,borderRadius:2,textTransform:"none",px:4,"&:hover":{bgcolor:te.accentHover}},children:r("有料プランを見る","See paid plans")}),Ve&&e.jsx(i,{sx:{mt:1.5},children:e.jsx(v,{variant:"outlined",onClick:()=>{k(""),S("buyout"),m(!0)},sx:{color:"#fff",borderColor:"rgba(255,255,255,0.6)",fontWeight:700,borderRadius:2,textTransform:"none",px:3,"&:hover":{borderColor:"#fff",bgcolor:"rgba(255,255,255,0.08)"}},children:r(ut.priceLabel.ja,ut.priceLabel.en)})}),Ve&&e.jsxs(a,{variant:"caption",sx:{display:"block",mt:1.5,color:"rgba(255,255,255,0.65)",lineHeight:1.6,textAlign:"left"},children:[r(Mt.ja,Mt.en)," ",r(Ot.ja,Ot.en)]}),Rn&&e.jsxs(i,{sx:{mt:2,pt:2,borderTop:"1px solid rgba(255,255,255,0.1)"},children:[e.jsx(a,{variant:"caption",sx:{color:"rgba(255,255,255,0.7)",display:"block",mb:1},children:r("全試験まとめてお得に","Every exam track for less")}),e.jsx(v,{variant:"outlined",size:"small",onClick:()=>{k(""),S("all-access"),m(!0)},sx:{color:"#fff",borderColor:"rgba(255,255,255,0.5)",textTransform:"none",fontSize:13,"&:hover":{borderColor:"#fff",bgcolor:"rgba(255,255,255,0.08)"}},children:r("全試験パック ¥2,980/月にアップグレード","Upgrade to the All Exams pack, ¥2,980/month (US$18.80)")})]})]}),t&&t.plan==="premium"&&No&&e.jsx(i,{sx:{mt:2,textAlign:"center"},children:e.jsx(v,{size:"small",startIcon:e.jsx(so,{}),onClick:()=>window.open(Wr,"_blank","noopener,noreferrer"),sx:{color:te.textMuted,fontSize:13,textTransform:"none"},children:r("サブスクリプション管理","Manage subscription")})})]}),e.jsx(Kr,{open:u,onClose:()=>c(!1),currentPath:typeof window<"u"?window.location.pathname:void 0}),e.jsx(hn,{open:E,onClose:()=>{g||(m(!1),k(""))},plan:j==="buyout"?"buyout":"monthly",onConfirm:N,loading:g,error:f}),e.jsx(xr,{open:h,autoHideDuration:1500,onClose:()=>y(!1),anchorOrigin:{vertical:"top",horizontal:"center"},children:e.jsx(Oe,{severity:"success",variant:"filled",onClose:()=>y(!1),sx:{fontWeight:600},children:r("ログアウトしました","Signed out")})})]})},je=Te;function Lr({mode:o,title:t,subtitle:s,setCount:n,getLocalResult:d,onSetClick:r,guestUnlockedSetCount:E=1,getInProgress:m,onRestart:j,getSetProblems:S}){const{siteLocale:u}=de(),c=(_,$)=>u==="en"?$:_,h=ge(),{isSubscribed:y,isLoggedIn:g}=Pe(),{examType:C}=_e(),{darkMode:f}=Ke(),[k,M]=l.useState(!1),[I,P]=l.useState(new Map),[b,w]=l.useState(0),R=f?"#121212":je.lightGray,X=f?"#1a1a2e":je.squidInk,O=f?"#1e1e1e":"#fff",K=f?"#252540":je.squidInk,T=f?"#2a2a2a":"#F0F0F0",D=f?"#e0e0e0":je.textPrimary;if(l.useEffect(()=>{g&&C&&On(C,o).then(({sets:_})=>{const $=new Map;for(const L of _)$.set(L.setNumber,L);P($)}).catch(()=>{})},[g,C,o]),l.useEffect(()=>{if(!g||!C||!S||n===0)return;let _=!0;return Ur({examType:C,kind:o==="mock"?"mock":"practice",getSets:()=>On(C,o),getHistory:$=>vn(C,o,$),getSetProblems:S}).then($=>{_&&$!==null&&w(L=>L+1)}).catch(()=>{}),()=>{_=!1}},[g,C,o,n]),l.useEffect(()=>{C||h("/kafka-exam/select")},[C,h]),!C)return null;const N=Array.from({length:n},(_,$)=>$+1),ne=_=>S?S(_).length:0,U=_=>{if(!y&&_>E){M(!0);return}r(_)},G=N.filter(_=>{const $=I.get(_),L=g?null:d(_,C),H=ne(_);return H>0&&(($==null?void 0:$.answered)??0)>=H||((L==null?void 0:L.done)??!1)}).length;return e.jsxs(i,{sx:{display:"flex",flexDirection:"column",width:"100%",minHeight:"100vh",bgcolor:R},children:[e.jsxs(i,{sx:{bgcolor:X,display:"flex",alignItems:"center",px:1,py:2,flexShrink:0},children:[e.jsx(ce,{onClick:()=>h("/kafka-exam/menu"),"aria-label":c("メニューへ戻る","Back to menu"),sx:{color:"#fff",minWidth:44,minHeight:44},children:e.jsx(Re,{})}),e.jsxs(i,{sx:{flex:1,textAlign:"center"},children:[e.jsx(a,{sx:{color:"#fff",fontWeight:700,fontSize:{xs:"1.1rem",md:"1.3rem"}},children:t}),e.jsxs(a,{variant:"caption",sx:{color:"rgba(255,255,255,0.6)"},children:[s," ",G>0&&c(`・${G}/${n} 完了`,`· ${G}/${n} completed`)]})]}),e.jsx(i,{sx:{width:44}})]}),e.jsx(Fe,{maxWidth:"md",sx:{flex:1,overflowY:"auto",py:3},children:e.jsx(i,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr 1fr",sm:"1fr 1fr 1fr",md:"1fr 1fr 1fr 1fr"},gap:2},children:N.map(_=>{const $=I.get(_),L=g?null:d(_,C),H=($==null?void 0:$.answered)??0,F=ne(_),x=F>0&&H>=F,W=x?Math.round((($==null?void 0:$.correct)??0)/F*100):(L==null?void 0:L.rate)??0,Q=x||((L==null?void 0:L.done)??!1),p=!y&&_>E,B=(!p&&m?m(_):null)??(!Q&&H>0?H:null);return e.jsxs(J,{role:"button",tabIndex:0,onClick:()=>U(_),onKeyDown:re=>{(re.key==="Enter"||re.key===" ")&&U(_)},sx:{p:2,minHeight:100,bgcolor:p?T:Q?O:K,borderRadius:2.5,cursor:"pointer",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:.5,transition:"transform 0.2s, box-shadow 0.2s","&:hover":{transform:"translateY(-2px)",boxShadow:"0 4px 16px rgba(0,0,0,0.1)"},"&:focus-visible":{outline:`2px solid ${je.accent}`,outlineOffset:2},border:Q?`2px solid ${W>=70?je.success:je.error}`:p?`1px solid ${je.borderGray}`:"none",position:"relative"},elevation:p?0:1,children:[p&&e.jsx(ao,{sx:{fontSize:20,color:je.textMuted,mb:.5}}),Q&&!p&&e.jsx(Me,{sx:{fontSize:20,color:W>=70?je.success:je.error,mb:.5}}),e.jsx(a,{sx:{fontWeight:700,fontSize:18,color:p?je.textMuted:Q?D:"#fff"},children:_}),Q&&!p&&B===null?e.jsx(Ne,{label:`${W}%`,size:"small",sx:{height:22,fontSize:12,fontWeight:700,bgcolor:W>=70?je.successLight:je.errorLight,color:W>=70?je.success:je.error}}):e.jsx(a,{variant:"caption",sx:{color:p?je.textMuted:B!==null?Q?D:"#fff":"rgba(255,255,255,0.4)",fontSize:11,fontWeight:B!==null?700:400},children:p?c("ロック","Locked"):B!==null?c(`途中 ${B}問`,`In progress: ${B}`):c("未受験","Not attempted")}),B!==null&&j&&e.jsxs(i,{sx:{display:"flex",gap:.5,mt:.25},children:[e.jsx(v,{size:"small",onClick:re=>{re.stopPropagation(),U(_)},onKeyDown:re=>re.stopPropagation(),sx:{minHeight:32,px:1,fontSize:12,fontWeight:700,textTransform:"none",textDecoration:"underline",color:Q?D:"#fff"},children:c("続きから","Resume")}),e.jsx(v,{size:"small",onClick:re=>{re.stopPropagation(),j(_)},onKeyDown:re=>re.stopPropagation(),sx:{minHeight:32,px:1,fontSize:12,fontWeight:700,textTransform:"none",textDecoration:"underline",color:Q?D:"#fff"},children:c("最初から","Restart")})]}),Q&&!p&&e.jsx(He,{variant:"determinate",value:W,sx:{width:"100%",height:4,borderRadius:2,mt:.5,bgcolor:"#E0E4E8","& .MuiLinearProgress-bar":{bgcolor:W>=70?je.success:je.error,borderRadius:2}}})]},_)})})}),e.jsx(Xe,{open:k,onClose:()=>M(!1)})]})}function ss(o,t){const s=localStorage.getItem(`practice_result_${t}_set${o}`);if(!s)return{rate:0,done:!1};try{const n=JSON.parse(s);return{rate:Number(n.rate)||0,done:!0}}catch{return{rate:0,done:!1}}}const an=()=>{const{siteLocale:o}=de(),t=(m,j)=>o==="en"?j:m,s=ge(),{examType:n}=_e();gt(n?()=>st(n):null,n);const d=n?En(n):0,r=n?zr(n):0,E=m=>{if(n){const j=Je(n,m).problems,S=Fn(n);if(Wn(S,m,j.length)){const c=er(j,S.answeredIds);if(c!==null){s(`/kafka-exam/training-problem/${c}`);return}}Dn(n,m);const u=j.length>0?j[0].id:1;s(`/kafka-exam/training-problem/${u}`)}};return e.jsx(Lr,{mode:"practice",guestUnlockedSetCount:3,title:t("練習問題","Practice"),subtitle:t(`各${Gn}問 / 全${r}問`,`${Gn} each / ${r} total`),setCount:d,getLocalResult:ss,onSetClick:E,getSetProblems:m=>n?Je(n,m).problems:[],getInProgress:m=>{if(!n)return null;const j=Je(n,m).problems.length,S=Fn(n);return Wn(S,m,j)?(S==null?void 0:S.answeredIds.length)??0:null},onRestart:m=>{var S;if(!n)return;Dn(n,m);const j=Je(n,m).problems;s(`/kafka-exam/training-problem/${((S=j[0])==null?void 0:S.id)??1}`)}})};function Be({children:o,component:t="div",sx:s={}}){return e.jsx(i,{component:t,sx:{userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",WebkitTouchCallout:"none",...s},onCopy:n=>n.preventDefault(),onCut:n=>n.preventDefault(),onContextMenu:n=>n.preventDefault(),onDragStart:n=>n.preventDefault(),children:o})}function Yt(){l.useEffect(()=>{const o=r=>{if(r.key==="F12"){r.preventDefault();return}
1if(r.ctrlKey&&r.shiftKey&&(r.key==="I"||r.key==="i"||r.key==="J"||r.key==="j"||r.key==="C"||r.key==="c")){r.preventDefault();return}if(r.ctrlKey&&(r.key==="U"||r.key==="u")){r.preventDefault();return}if(r.ctrlKey&&(r.key==="S"||r.key==="s")){r.preventDefault();return}if(r.ctrlKey&&(r.key==="P"||r.key==="p")){r.preventDefault();return}if(r.ctrlKey&&(r.key==="A"||r.key==="a")){r.preventDefault();return}if(r.ctrlKey&&(r.key==="C"||r.key==="c")&&!r.shiftKey){r.preventDefault();return}},t=r=>{r.preventDefault()},s=r=>{r.preventDefault(),r.clipboardData&&r.clipboardData.setData("text/plain","")},n=r=>{r.preventDefault()},d=r=>{r.preventDefault()};return document.addEventListener("keydown",o),document.addEventListener("contextmenu",t),document.addEventListener("copy",s),document.addEventListener("dragstart",n),document.addEventListener("selectstart",d),()=>{document.removeEventListener("keydown",o),document.removeEventListener("contextmenu",t),document.removeEventListener("copy",s),document.removeEventListener("dragstart",n),document.removeEventListener("selectstart",d)}},[])}const as="/sounds/correct.mp3",is="/sounds/incorrect.mp3",Yn=()=>{l.useEffect(()=>{Zn("begin_practice")},[]),Yt();const{id:o}=fn(),t=ge(),s=Number(o),{examType:n}=_e(),{soundEnabled:d}=Kt(),{darkMode:r,toggleDarkMode:E}=Ke(),{easyMode:m,toggleEasyMode:j}=Ut(),{isLoggedIn:S,isSubscribed:u,loading:c}=Pe(),{siteLocale:h,effectiveStudyMode:y,isEnglishQuestionMode:g,toggleEnglishQuestionMode:C}=de(),f=(A,V)=>h==="en"?V:A,[k,M]=l.useState(!1),[I,P]=l.useState([]),[b,w]=l.useState(null),[R,X]=l.useState(null),O=l.useRef(null),K=l.useRef(null),T=A=>{K.current||(O.current&&(clearTimeout(O.current),O.current=null),K.current=A,Vn.flushSync(()=>{w(A)}))};l.useEffect(()=>()=>{O.current&&clearTimeout(O.current)},[]);const D=Number(localStorage.getItem(`${n?n+"_":""}currentSet`)||"1");l.useEffect(()=>{if(!n)return;let A=!1;return st(n).then(()=>{A||M(!0)}),()=>{A=!0}},[n]);const N=n&&k?tr(it(n).problems,s):null,ne=(N==null?void 0:N.set)??D,U=n?Je(n,ne):{problems:[]},G=N==null?void 0:N.problem,_=N==null?void 0:N.set;l.useEffect(()=>{n&&_&&_!==D&&localStorage.setItem(`${n}_currentSet`,String(_))},[n,_,D]);const $=G?pt(G,h,y):null;if(l.useEffect(()=>{$&&P(Array($.options.length).fill(!1)),O.current&&(clearTimeout(O.current),O.current=null),K.current=null,w(null)},[s,k]),l.useEffect(()=>{d&&b==="correct"?new Audio(as).play().catch(()=>{}):d&&b==="incorrect"&&new Audio(is).play().catch(()=>{})},[b,d]),l.useEffect(()=>{n||t("/kafka-exam/select")},[n,t]),G&&mn("practice",ne,{isSubscribed:u,loading:c}))return e.jsx(i,{sx:{minHeight:"100vh",bgcolor:"#F2F3F3"},children:e.jsx(Xe,{open:!0,onClose:()=>t("/kafka-exam/practice")})});if(!k||!G||!$)return e.jsx(i,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"100vh",bgcolor:"#f5f5f5"},children:e.jsx(a,{sx:{color:"#666"},children:k?h==="en"?`Question not found (ID: ${o})`:`問題が存在しません (ID: ${o})`:f("問題データを読み込み中...","Loading questions...")})});const L=U.problems,H=L.length,F=L.findIndex(A=>A.id===s),x=n?`${n}_`:"",W=localStorage.getItem(`${x}answersDetail`)||"[]",Q=new Set(JSON.parse(W).map(A=>
1A.questionId)).size,p=Math.min(Q/H*100,100),q=A=>{K.current||(O.current&&(clearTimeout(O.current),O.current=null),P(V=>{const ie=G.correctAnswers.length;if(m&&ie===1){const ae=V.map((xe,se)=>se===A);return setTimeout(()=>{if(K.current)return;const xe=G.correctAnswers[0]===A;T(xe?"correct":"incorrect"),B(xe,[A])},0),ae}const Y=[...V];Y[A]=!Y[A];const Ze=Y.filter(Boolean).length;return m&&Ze>=G.correctAnswers.length&&(O.current&&clearTimeout(O.current),O.current=setTimeout(()=>{if(O.current=null,K.current)return;const ae=Y.map((se,ze)=>se?ze:-1).filter(se=>se!==-1),xe=ae.length===G.correctAnswers.length&&ae.every((se,ze)=>se===G.correctAnswers[ze]);T(xe?"correct":"incorrect"),B(xe,ae)},1e3)),Y}))},B=(A,V)=>{const ie=localStorage.getItem(`${x}answersDetail`)||"[]";let Y=JSON.parse(ie);Y=Y.filter(ae=>ae.questionId!==s),Y.push({questionId:s,isCorrect:A,category:G.category,ts:Date.now()}),localStorage.setItem(`${x}answersDetail`,JSON.stringify(Y));const Ze=Y.filter(ae=>ae.isCorrect).length;if(localStorage.setItem(`${x}answeredCount`,String(Y.length)),localStorage.setItem(`${x}correctCount`,String(Ze)),localStorage.setItem(`ratio_${n}_${s}`,A?"100":"0"),S&&n){const ae=V??I.map((xe,se)=>xe?se:-1).filter(xe=>xe!==-1);wr({question_id:s,selected_choice_ids:ae,is_correct:A,exam_type:n,question_set:"practice",set_number:ne}).catch(()=>{})}if(n){const ae=`${n}_wrong_answers`,xe=localStorage.getItem(ae)||"[]";let se=JSON.parse(xe);A?se=se.filter(ze=>ze!==s):se.includes(s)||se.push(s),localStorage.setItem(ae,JSON.stringify(se))}},re=()=>{if(K.current)return;const A=I.map((ie,Y)=>ie?Y:-1).filter(ie=>ie!==-1),V=A.length===G.correctAnswers.length&&A.every((ie,Y)=>ie===G.correctAnswers[Y]);T(V?"correct":"incorrect"),B(V,A)},be=()=>{K.current=null,w(null)},De=()=>{if(be(),F>=0&&F<L.length-1){const A=L[F+1].id;t(`/kafka-exam/training-problem/${A}`)}else t("/kafka-exam/practice/result")},Ue=()=>{be(),t(`/kafka-exam/training-problem/${s}/explanation`)},we=r?"#121212":"#F2F3F3",ke=r?"#e0e0e0":"#333",Et=r?"#b0b0b0":"#444",Jt=r?"#333":"#e0e0e0";return e.jsxs(i,{sx:{display:"flex",flexDirection:"column",minHeight:"100vh",width:"100%",bgcolor:we},children:[e.jsxs(i,{sx:{height:64,bgcolor:"#232F3E",display:"flex",alignItems:"center",px:1,flexShrink:0},children:[e.jsx(ce,{onClick:()=>t("/kafka-exam/practice"),"aria-label":f("戻る","Back"),sx:{color:"#fff",minWidth:44,minHeight:44},children:e.jsx(Re,{})}),e.jsxs(i,{sx:{flex:1,textAlign:"center",minWidth:0,px:1},children:[e.jsx(a,{variant:"body2",sx:{color:"#29B5E8",fontSize:"0.75rem",lineHeight:1,fontWeight:600},children:h==="en"?`Practice ${ne}`:`練習${ne}`}),e.jsx(a,{sx:{color:"#fff",lineHeight:1.3,fontSize:{xs:"1rem",sm:"1.1rem",md:"1.25rem"},fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:$.title})]}),h==="ja"&&e.jsx(ce,{onClick:C,"aria-label":g?f("日本語に戻す","Back to Japanese"):f("英語で表示","Show in English"),sx:{color:g?"#29B5E8":"rgba(255,255,255,0.6)",minWidth:44,minHeight:44},children:e.jsx(ur,{})}),e.jsx(ce,{onClick:A=>X(A.currentTarget),"aria-label":f("メニュー","Menu"),sx:{color:"#fff",minWidth:44,minHeight:44},children:e.jsx(hr,{})}),e.jsxs(fr,{anchorEl:R,open:!!R,onClose:()=>X(null),PaperProps:{sx:{minWidth:200}},children:[e.jsxs(ye,{onClick:()=>{E(),X(null)},children:[e.jsx(ft,{children:r?e.jsx(Nt,{fontSize:"small"}):e.jsx(Bt,{fontSize:"small"})}),e.jsx(oe,{children:r?f("ライトモード","Light mode"):f("ダークモード","Dark mode")})]}),e.jsxs(ye,{onClick:()=>{j(),X(null)},children:[e.jsx(ft,{children:e.jsx(At,{fontSize:"small",sx:{color:m?"#FF9900":void 0}})}),e.jsx(oe,{children:m?f("らくらくモード OFF","Easy mode OFF"):f("らくらくモード ON","Easy mode ON")})]}),e.jsxs(ye,{onClick:()=>{X(null),t("/kafka-exam/settings")},children:[e.jsx(ft,{children:e.jsx(bn,{fontSize:"small"})}),e.jsx(oe,{children:f("設定","Settings")})]})]})]}),e.jsxs(i,{sx:{px:{xs:2,md:4,lg:6},pt:{xs:1.5,md:2},pb:.5,maxWidth:{md:1100},mx:{md:"auto"},width:"100%"},children:[e.jsx(He,{variant:"determinate",value:p,sx:{height:{xs:8,md:10},borderRadius:4,bgcolor:r?"#333":"#F2F3F3","& .MuiLinearProgress-bar":{backgroundColor:"#1D8102"}}}),e.jsxs(a,{sx:{display:"block",textAlign:"center",mt:.5,color:Et,fontSize:{xs:"0.75rem",md:"0.9rem"}},children:[h==="en"?"Progress":"進捗",": ",Q,"/",H]})]}),e.jsxs(i,{sx:{px:{xs:2,md:4,lg:6},py:{xs:2,md:3},flex:1,overflowY:"auto",maxWidth:{md:1100},mx:{md:"auto"},width:"100%"},children:[e.jsx(Be,{children:e.jsx(wt,{text:$.question,sx:{color:ke,whiteSpace:"pre-line",mb:{xs:3,md:4},fontSize:{xs:"1rem",md:"1.2rem",lg:"1.3rem"},lineHeight:{xs:1.7,md:1.8},fontWeight:500}})}),e.jsx(i,{sx:{display:"flex",flexDirection:"column",gap:{xs:1.5,md:2}},children:$.options.map((A,V)=>{const ie=G.correctAnswers.length===1,Y=I[V];return e.jsxs(J,{onClick:()=>q(V),sx:{display:"flex",alignItems:"center",bgcolor:Y?r?"#1a2a1a":"#EBF5EB":r?"#1e1e1e":"#fff",border:Y?"2px solid #1D8102":`2px solid ${Jt}`,borderRadius:2,p:{xs:1.5,md:2.25},minHeight:52,cursor:"pointer",transition:"all 0.15s"}
1,elevation:0,children:[ie?e.jsx(mr,{checked:Y,sx:{mr:{xs:1,md:1.5},p:.5,color:r?"#aaa":void 0,"&.Mui-checked":{color:"#1D8102"}}}):e.jsx(Qe,{checked:Y,sx:{mr:{xs:1,md:1.5},p:.5,color:r?"#aaa":void 0,"&.Mui-checked":{color:"#1D8102"}}}),e.jsx(Be,{children:e.jsxs(a,{sx:{color:Y?r?"#fff":"#1B3139":Et,fontWeight:Y?600:400,fontSize:{xs:"0.95rem",md:"1.1rem",lg:"1.15rem"},lineHeight:1.6},children:[e.jsxs(i,{component:"span",sx:{fontWeight:700,mr:.5},children:[String.fromCharCode(65+V),"."]}),A]})})]},V)})})]}),!m&&e.jsx(i,{sx:{p:2,flexShrink:0},children:e.jsx(v,{variant:"contained",fullWidth:!0,onClick:re,disabled:!I.some(Boolean),sx:{height:48,bgcolor:"#FF9900",color:"#232F3E",fontSize:"1.1rem",borderRadius:2,"&:hover":{bgcolor:"#EC7211"}},children:h==="en"?"Submit":"回答"})}),e.jsxs(Ie,{open:b==="correct",onClose:be,PaperProps:{sx:{bgcolor:r?"#1e1e1e":void 0,minWidth:{xs:"85vw",sm:380}}},children:[e.jsxs(Se,{sx:{textAlign:"center",pt:3,pb:1,px:3},children:[e.jsx(qt,{sx:{fontSize:72,color:"#1D8102",mb:1}}),e.jsx(a,{variant:"h5",sx:{color:ke,fontWeight:700},children:h==="en"?"Correct":"正解"})]}),e.jsxs(Ce,{sx:{justifyContent:"center",pb:3,px:3,gap:1.5,flexWrap:"wrap"},children:[e.jsx(v,{variant:"contained",size:"large",sx:{bgcolor:"#FF9900",color:"#232F3E",fontWeight:700,minWidth:132,py:1.25,"&:hover":{bgcolor:"#EC7211"}},onClick:De,children:h==="en"?"Next":"次へ"}),e.jsx(v,{variant:"outlined",size:"large",sx:{fontWeight:700,minWidth:132,py:1.25,color:ke,borderColor:r?"rgba(255,255,255,0.5)":"rgba(0,0,0,0.5)"},onClick:Ue,children:h==="en"?"Explanation":"解説"})]})]}),e.jsxs(Ie,{open:b==="incorrect",onClose:be,PaperProps:{sx:{bgcolor:r?"#1e1e1e":void 0,minWidth:{xs:"85vw",sm:420},maxWidth:560}},children:[e.jsxs(Se,{sx:{pt:3,pb:1,px:3},children:[e.jsxs(i,{sx:{textAlign:"center"},children:[e.jsx(jn,{sx:{fontSize:72,color:"#D13212",mb:1}}),e.jsx(a,{variant:"h5",sx:{color:ke,fontWeight:700},children:h==="en"?"Incorrect":"不正解"})]}),e.jsxs(i,{sx:{mt:2},children:[e.jsx(a,{variant:"subtitle2",sx:{mb:.75,color:r?"#bbb":"#555",fontWeight:700},children:h==="en"?"Correct answer(s)":"正解"}),G.correctAnswers.map(A=>{const V=$.options[A]??"",ie=/^[A-Z][\.\)]/.test(V.trim()),Y=String.fromCharCode(65+A);return e.jsx(i,{sx:{py:.75,px:1.25,mb:.5,borderRadius:1,bgcolor:r?"rgba(29, 129, 2, 0.18)":"#e8f5e9",border:"1px solid #1D8102"},children:e.jsxs(a,{variant:"body2",sx:{color:r?"#a5d6a7":"#1D8102",whiteSpace:"pre-wrap",wordBreak:"break-word",lineHeight:1.5},children:[ie?V:`${Y}. ${V}`," ✓"]})},A)})]})]}),e.jsxs(Ce,{sx:{justifyContent:"center",pb:3,px:3,gap:1.5,flexWrap:"wrap"},children:[e.jsx(v,{variant:"contained",size:"large",sx:{bgcolor:"#FF9900",color:"#232F3E",fontWeight:700,minWidth:132,py:1.25,"&:hover":{bgcolor:"#EC7211"}},onClick:De,children:h==="en"?"Next":"次へ"}),e.jsx(v,{variant:"outlined",size:"large",sx:{fontWeight:700,minWidth:132,py:1.25,color:ke,borderColor:r?"rgba(255,255,255,0.5)":"rgba(0,0,0,0.5)"},onClick:Ue,children:h==="en"?"Explanation":"解説"})]})]})]})},ls="https://nicheelab-api.fjyjfrtfzy.workers.dev";function cs({questionId:o,examType:t,setNumber:s,questionTitle:n}){const{siteLocale:d}=de(),r=(P,b)=>d==="en"?b:P,[E,m]=l.useState(!1),[j,S]=l.useState("error"),[u,c]=l.useState(""),[h,y]=l.useState(!1),[g,C]=l.useState(!1),[f,k]=l.useState(""),M=async()=>{if(u.trim().length<5){k(r("5文字以上で入力してください","Enter at least 5 characters"));return}y(!0),k("");try{const P=localStorage.getItem("exam_jwt_token"),b=await fetch(`${ls}/api/reports`,{method:"POST",headers:{"Content-Type":"application/json",...P?{Authorization:`Bearer ${P}`}:{}},body:JSON.stringify({questionId:o,examType:t,setNumber:s,reportType:j,message:u.trim()})});if(!b.ok){const w=await b.json().catch(()=>({}));throw new Error(w.error||r("送信に失敗しました","Failed to send"))}C(!0)}catch(P){k(P instanceof Error?P.message:r("送信に失敗しました","Failed to send"))}finally{y(!1)}},I=()=>{m(!1),c(""),S("error"),k(""),C(!1)};return e.jsxs(e.Fragment,{children:[e.jsx(v,{size:"small",startIcon:e.jsx(pr,{sx:{fontSize:16}}),onClick:()=>
1m(!0),sx:{color:"#879596",fontSize:12,textTransform:"none","&:hover":{color:"#FF3621"}},children:r("問題の誤りを報告","Report an error")}),e.jsx(Ie,{open:E,onClose:I,maxWidth:"sm",fullWidth:!0,children:g?e.jsxs(e.Fragment,{children:[e.jsxs(Se,{sx:{textAlign:"center",py:5},children:[e.jsx(Me,{sx:{fontSize:56,color:"#1D8102",mb:2}}),e.jsx(a,{variant:"h6",sx:{fontWeight:700,mb:1},children:r("報告を受け付けました","Report received")}),e.jsx(a,{variant:"body2",sx:{color:"#545B64"},children:r("確認のうえ、修正を行います。ご協力ありがとうございます。","We'll review it and make any needed fixes. Thanks for the help.")})]}),e.jsx(Ce,{children:e.jsx(v,{onClick:I,children:r("閉じる","Close")})})]}):e.jsxs(e.Fragment,{children:[e.jsx(ot,{sx:{fontWeight:700},children:r("問題の誤りを報告","Report an error")}),e.jsxs(Se,{children:[n&&e.jsx(a,{variant:"body2",sx:{color:"#545B64",mb:2,bgcolor:"#F2F3F3",p:1.5,borderRadius:1},children:r(`対象: ${n}`,`Target: ${n}`)}),e.jsxs(gr,{fullWidth:!0,sx:{mb:2},children:[e.jsx(br,{children:r("報告種別","Report type")}),e.jsxs(kt,{value:j,label:r("報告種別","Report type"),onChange:P=>S(P.target.value),children:[e.jsx(ye,{value:"error",children:r("正解・解説の誤り","Wrong answer or explanation")}),e.jsx(ye,{value:"typo",children:r("誤字・脱字","Typo")}),e.jsx(ye,{value:"outdated",children:r("情報が古い","Out of date")}),e.jsx(ye,{value:"unclear",children:r("問題文がわかりにくい","Question is unclear")}),e.jsx(ye,{value:"other",children:r("その他","Other")})]})]}),e.jsx(Ae,{fullWidth:!0,multiline:!0,rows:4,label:r("詳細(どこがどう間違っているか)","Details (what is wrong and how)"),value:u,onChange:P=>c(P.target.value),placeholder:r("例: 正解がAとなっていますが、Bが正しいと思います。理由は...","Example: The answer is marked A, but I believe B is correct because..."),inputProps:{maxLength:1e3}}),f&&e.jsx(a,{color:"error",variant:"body2",sx:{mt:1},children:f}),e.jsx(i,{sx:{mt:1,textAlign:"right"},children:e.jsxs(a,{variant:"caption",sx:{color:"#879596"},children:[u.length,"/1000"]})})]}),e.jsxs(Ce,{children:[e.jsx(v,{onClick:I,sx:{color:"#545B64"},children:r("キャンセル","Cancel")}),e.jsx(v,{onClick:M,variant:"contained",disabled:h,sx:{bgcolor:"#FF3621","&:hover":{bgcolor:"#E02E1B"}},children:h?r("送信中...","Sending..."):r("送信","Send")})]})]})})]})}const Jn=()=>{Yt();const o=ge(),{id:t}=fn(),{pathname:s}=Mr(),n=Number(t),{examType:d}=_e(),{darkMode:r}=Ke(),{isSubscribed:E,loading:m}=Pe(),{siteLocale:j,effectiveStudyMode:S}=de(),u=j==="en",c=(T,D)=>u?D:T,[h,y]=l.useState(!1),g=s.includes("mock-problem"),C=d?`${d}_`:"",f=d?`${d}_mock_`:"",k=Number(localStorage.getItem(g?`${f}currentSet`:`${C}currentSet`)||"1"),M=!g&&d?tr(it(d).problems,n):null,I=(M==null?void 0:M.set)??k;l.useEffect(()=>{if(!d)return;let T=!1;return(g?at(d):st(d)).then(()=>{T||y(!0)}),()=>{T=!0}},[d,g]),l.useEffect(()=>{d||o("/kafka-exam/select")},[d,o]);const b=(d?g?qe(d,I):Je(d,I):{problems:[]}).problems,w=b.find(T=>T.id===n),R=w?pt(w,j,S):null,X=b.findIndex(T=>T.id===n),O=()=>{if(X>=0&&X<b.length-1){const T=b[X+1].id;o(g?`/kafka-exam/mock-problem/${T}`:`/kafka-exam/training-problem/${T}`)}else o(g?"/kafka-exam/mock-exam/result":"/kafka-exam/practice/result")},K=()=>o("/kafka-exam/menu");return w&&mn(g?"mock":"practice",I,{isSubscribed:E,loading:m})?e.jsx(i,{sx:{minHeight:"100vh",bgcolor:"#F2F3F3"},children:e.jsx(Xe,{open:!0,onClose:()=>o(g?"/kafka-exam/mock":"/kafka-exam/practice")})}):!h||!w||!R?e.jsx(i,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"100vh",bgcolor:"#F5F7FA"},children:e.jsx(a,{sx:{color:"#666"},children:h?c("問題が見つかりません","Question not found"):c("読み込み中...","Loading...")})}):e.jsxs(i,{className:r?"nl-dark-surface":void 0,sx:{display:"flex",flexDirection:"column",minHeight:"100vh",width:"100%",bgcolor:"#F5F7FA"},children:[e.jsxs(i,{sx:{height:64,bgcolor:"#232F3E",display:"flex",alignItems:"center",px:1,flexShrink:0},children:[e.jsx(ce,{onClick:()=>o("/kafka-exam/menu"),"aria-label":c("戻る","Back"),sx:{minWidth:48,minHeight:48},children:e.jsx(Re,{sx:{color:"#fff"}})}),e.jsxs(a,{variant:"h6",sx:{color:"#fff",flex:1,textAlign:"center",fontSize:{xs:"0.95rem",md:"1.25rem"}},children:[R.title," ",j==="en"?"Explanation":c("解説","Explanation")]}),e.jsx(i,{sx:{width:48}})]}),e.jsxs(i,{sx:{flex:1,overflowY:"auto",p:{xs:2,md:3},maxWidth:800,mx:"auto",width:"100%"},children:[e.jsx(Be,{children:e.jsx(wt,{text:R.question,sx:{color:"#1B2631",whiteSpace:"pre-line",mb:3,lineHeight:1.9,fontSize:{xs:15,md:16}}})}),e.jsx(i,{sx:{display:"flex",flexDirection:"column",gap:1.5,mb:3},children:R.options.map((T,D)=>{const N=w.correctAnswers.includes(D);return e.jsxs(J,{sx:{display:"flex",alignItems:"center",border:N?"2px solid #1D8102":"2px s
1olid transparent",bgcolor:N?"#f0fff0":"white",borderRadius:2,p:1.5,minHeight:52,boxShadow:N?"0 2px 8px rgba(29,129,2,0.12)":"0 1px 3px rgba(0,0,0,0.06)"},elevation:0,children:[e.jsx(mr,{checked:N,sx:{color:N?"#1D8102":"#ccc",p:.5,mr:1}}),e.jsx(Be,{children:e.jsxs(a,{variant:"body1",sx:{color:"#333",lineHeight:1.7},children:[e.jsxs(i,{component:"span",sx:{fontWeight:700,mr:.5},children:[String.fromCharCode(65+D),"."]}),T]})})]},D)})}),e.jsxs(J,{sx:{p:{xs:2,md:3},bgcolor:"#fff",borderLeft:"4px solid #29B5E8",borderRadius:2,boxShadow:"0 1px 4px rgba(0,0,0,0.06)"},elevation:0,children:[e.jsx(a,{variant:"subtitle2",sx:{color:"#232F3E",mb:1.5,fontWeight:700},children:j==="en"?"Explanation":c("解説","Explanation")}),e.jsx(Be,{children:e.jsx(wt,{text:R.explanation,sx:{color:"#333",whiteSpace:"pre-line",lineHeight:1.9,fontSize:{xs:14,md:15}}})})]}),Array.isArray(w.sources)&&w.sources.length>0&&e.jsxs(J,{sx:{mt:2,p:2,bgcolor:"#f9f9f9",borderLeft:"4px solid #1976d2"},elevation:0,children:[e.jsxs(a,{variant:"subtitle2",sx:{color:"#1976d2",mb:1},children:["📚 ",c("公式リファレンス","Official references")]}),e.jsx(i,{component:"ul",sx:{pl:2.5,m:0},children:w.sources.map((T,D)=>e.jsx(a,{component:"li",variant:"body2",sx:{mb:.5,color:"#333"},children:e.jsx(i,{component:"a",href:T,target:"_blank",rel:"noopener noreferrer",sx:{color:"#1976d2",wordBreak:"break-all",textDecoration:"underline"},children:T})},D))})]}),e.jsx(i,{sx:{mt:2,textAlign:"right"},children:e.jsx(cs,{questionId:w.id,examType:d,setNumber:I,questionTitle:w.title})})]}),e.jsxs(i,{sx:{p:{xs:2,md:3},display:"flex",gap:1.5,flexShrink:0,maxWidth:{xs:800,md:1100},mx:"auto",width:"100%"},children:[e.jsx(v,{variant:"outlined",onClick:K,startIcon:e.jsx(yn,{}),sx:{height:{xs:48,md:56},borderColor:"#232F3E",color:"#232F3E",borderRadius:2,minWidth:48,"&:hover":{bgcolor:"#f0f0f0"}},children:j==="en"?"Menu":c("メニュー","Menu")}),e.jsx(v,{variant:"contained",fullWidth:!0,onClick:O,sx:{height:{xs:48,md:56},bgcolor:"#FF9900",color:"#232F3E",fontSize:{xs:"1.1rem",md:"1.25rem"},fontWeight:600,borderRadius:2,"&:hover":{bgcolor:"#EC7211"}},children:j==="en"?"Next":c("次へ","Next")})]})]})};function ds(){const o=ge(),[t,s]=l.useState(0),[n,d]=l.useState(!1),{examType:r}=_e(),{darkMode:E}=Ke(),m=gt(r?()=>st(r):null,r),{isLoggedIn:j}=Pe(),{isSubscribed:S}=Pe(),{siteLocale:u,studyMode:c}=de(),h=(p,q)=>u==="en"?q:p,[y,g]=l.useState(u==="en"||c==="en-question"?"en":"ja"),C=r?`${r}_`:"",f=localStorage.getItem(`${C}currentSet`)||"1",M=(r?Je(r,Number(f)):{problems:[]}).problems,I=M.length,P=Number(localStorage.getItem(`${C}correctCount`)||0),b=I>0?Math.round(P/I*100):0,w=localStorage.getItem(`${C}answersDetail`)||"[]",R=JSON.parse(w),X=new Map(R.map(p=>[p.questionId,p])),O={};for(const p of R){const q=M.find(re=>re.id===p.questionId);if(!q)continue;const B=q.category;O[B]||(O[B]={correct:0,total:0}),O[B].total+=1,p.isCorrect&&(O[B].correct+=1)}const K=Object.entries(O).map(([p,q])=>({category:p,correct:q.correct,total:q.total})),[T,D]=l.useState(null),[N,ne]=l.useState(null),[U,G]=l.useState(null);l.useEffect(()=>{j&&r&&vn(r,"practice",Number(f)).then(p=>{D(p.correct),ne(p.rate),G(p.categories.map(q=>({category:q.name,correct:q.correct,total:q.total})))}).catch(()=>{})},[j,r,f]);const _=R.length>0?P:T??P,$=R.length>0?b:N??b,L=K.length>0?K:U??[];l.useEffect(()=>{if(!r){o("/kafka-exam/select");return}m&&I>0&&R.length>0&&localStorage.setItem(`practice_result_${r}_set${f}`,JSON.stringify({rate:$,correct:_,total:I}))},[r,o,f,$,_,I,R.length,m]);const H=Number(f)+1,F=r?En(r):0,x=H<=F,W=!S&&H>3,Q=()=>{if(W){d(!0);return}if(D(null),ne(null),G(null),r){const p=`${r}_`;localStorage.setItem(`${p}answeredCount`,"0"),localStorage.setItem(`${p}correctCount`,"0"),localStorage.setItem(`${p}answersDetail`,"[]"),localStorage.setItem(`${p}currentSet`,String(H));const q=Je(r,H).problems,B=q.length>0?q[0].id:1;o(`/kafka-exam/training-problem/${B}`,{replace:!0})}else o("/kafka-exam/training-problem/1")};return r?m?e.jsxs(i,{className:E?"nl-dark-surface":void 0,sx:{display:"flex",flexDirection:"column",minHeight:"100vh",width:"100%"},children:[e.jsxs(i,{sx:{height:64,bgcolor:"#232F3E",display:"flex",alignItems:"center",px:1,flexShrink:0},children:[e.jsx(ce,{onClick:()=>o("/kafka-exam/practice"),"aria-label":h("一覧へ戻る","Back to list"),sx:{color:"#fff",minWidth:48,minHeight:48},children:e.jsx(Re,{})}),e.jsx(a,{variant:"h6",sx:{color:"#fff",flex:1,textAlign:"center"},children:u==="en"?`Practice ${f} Results`:`練習${f} 結果`}),e.jsx(i,{sx:{width:48}})]}),e.jsx(i,{sx:{display:"flex",justifyContent:"flex-end",px:2,pt:1.5},children:e.jsxs(i,{sx:{display:"flex",bgcolor:"#f0f0f0",borderRadius:1.5,overflow:"hidden"},children:[e.jsx(v,{onClick:()=>g("ja"),sx:{minWidth:56,height:36,fontWeight:700,fontSize:14,bgcolor:y==="ja"?"#232F3E":"transparent",color:y==="ja"?"#fff":"#666",borderRadius:0,"&:hover":{bgcolor:y==="ja"?"#232F3E":"#e0e0e0"}},children:"JA"}),e.jsx(v,{onClick:()=>g("en"),sx:{minWidth:56,height:36,fontWeight:700,fontSize:14,bgcolor:y==="en"?"#232F3E":"transparent",color:y==="en"?"#fff":"#666",borderRadius:0,"&:hover":{bgcolor:y==="en"?"#232F3E":"#e0e0e0"}},children:"EN"})]})}),e.jsxs(i,{sx:{flex:1,display:"flex",flexDirection:"column"},children:[e.jsxs(i,{sx:{display:"flex",alignItems:"center",borderBottom:"1px solid #e0e0e0"},children:[e.jsxs(kn,{value:t,onChange:(p,q)=>s(q),textColor:"primary",indicatorColor:"primary",sx:{flex:1},children:[e.jsx(Ye,{label:u==="en"?"Results":"試験結果"}),e.jsx(Ye,{label:u==="en"?"By Category":"カテゴリー別"})]}),e.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:.5,mr:1,flexShrink:0},children:[e.jsx(v,{onClick:()=>o("/kafka-exam/practice"),size:"small",sx:{color:"#232F3E",fontWeight:700,fontSize:"0.85rem",whiteSpace:"nowrap",minHeight:44,minWidth:56},children:u==="en"?"List":"一覧"}),x&&e.jsx(v,{onClick:Q,size:"small",sx:{color:W?"#555":"#232F3E",bgcolor:W?"#E8E8E8":"#FF9900",minHeight:44,px:1.5,"&:hover":{bgcolor:W?"#DDD":"#EC7211"},fontWeight:700,fontSize:"0.85rem",whiteSpace:"nowrap"},children:W?u==="en"?"Locked":"🔒 次へ ▶":u==="en"?"Next ▶":"次へ ▶"})]})]}),e.jsxs(i,{sx:{flex:1,overflowY:"auto",p:2},children:[t===0&&e.jsxs(e.Fragment,{children:[e.jsxs(J,{sx:{p:3,mb:2,textAlign:"center"},children:[e.jsxs(a,{variant:"h4",sx:{color:"#FF9900",fontWeight:"bold",mb:1},children:[$,"%"]}),e.jsx(He,{variant:"determinate",value:$,sx:{height:10,borderRadius:5,bgcolor:"#F2F3F3",mb:1,"& .MuiLinearProgress-bar":{backgroundColor:$>=70?"#1D8102":"#D13212"}}}),e.jsx(a,{variant:"body1",children:u==="en"?`${_} correct out of ${I}`:`${I}問中 ${_}問正解`})]}),$>=90&&e.jsxs(J,{sx:{p:2,mb:2,bgcolor:"#E8F5E9",border:"1px solid #4CAF50",borderRadius:2,textAlign:"center"}
1,elevation:0,children:[e.jsx(a,{sx:{fontSize:32,mb:.5},children:"🎉"}),e.jsx(a,{sx:{fontWeight:700,color:"#2E7D32",fontSize:16},children:u==="en"?"Excellent! Outstanding performance!":"素晴らしい成績です!"})]}),$>=70&&$<90&&e.jsx(J,{sx:{p:2,mb:2,bgcolor:"#FFF3E0",border:"1px solid #FF9800",borderRadius:2,textAlign:"center"},elevation:0,children:e.jsx(a,{sx:{fontWeight:700,color:"#E65100",fontSize:15},children:u==="en"?"Passed! Keep building on this momentum.":"合格圏内です。この調子で続けましょう。"})}),e.jsx(a,{variant:"body2",sx:{color:"#666",mb:3},children:u==="en"?$>=70?"You have reached the passing range. Keep studying.":"You need a bit more practice. Review the questions you missed.":$>=70?h("合格ラインに達しています。引き続き学習を続けましょう。","You are above the passing line. Keep going."):h("もう少し学習が必要です。間違えた問題を復習しましょう。","You need a little more study. Review the questions you missed.")}),e.jsx(a,{variant:"subtitle1",sx:{fontWeight:700,mb:1.5,color:"#232F3E"},children:u==="en"?"Question Review":"問題別 解答・解説"}),M.map((p,q)=>{const B=pt(p,y==="en"?"en":"ja",y==="en"?"en-question":"ja"),re=X.get(p.id),be=(re==null?void 0:re.isCorrect)??!1,De=!!re;return e.jsxs(jr,{sx:{mb:1},children:[e.jsx(yr,{expandIcon:e.jsx(Sr,{}),children:e.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:1,width:"100%"},children:[De?be?e.jsx(Me,{sx:{color:"#1D8102",fontSize:22}}):e.jsx(kr,{sx:{color:"#D13212",fontSize:22}}):e.jsx(Ne,{label:u==="en"?"Not answered":"未回答",size:"small",sx:{bgcolor:"#eee"}}),e.jsxs(a,{variant:"body2",sx:{fontWeight:600,flex:1},children:[u==="en"?"Q":"問",q+1,". ",B.question.slice(0,60),"…"]})]})}),e.jsxs(vr,{children:[e.jsx(a,{variant:"body2",sx:{whiteSpace:"pre-line",mb:2,color:"#333"},children:B.question}),e.jsx(i,{sx:{mb:2},children:B.options.map((Ue,we)=>{const ke=p.correctAnswers.includes(we);return e.jsx(i,{sx:{p:1,mb:.5,borderRadius:1,bgcolor:ke?"#e8f5e9":"transparent",border:ke?"1px solid #1D8102":"1px solid #eee"},children:e.jsxs(a,{variant:"body2",sx:{color:ke?"#1D8102":"#555"},children:[String.fromCharCode(65+we),". ",Ue," ",ke&&"✓"]})},we)})}),e.jsxs(J,{sx:{p:1.5,bgcolor:"#f9f9f9",borderLeft:"3px solid #232F3E"},elevation:0,children:[e.jsx(a,{variant:"caption",sx:{color:"#232F3E",fontWeight:600},children:u==="en"?"Explanation":"解説"}),e.jsx(a,{variant:"body2",sx:{color:"#333",whiteSpace:"pre-line",mt:.5},children:B.explanation})]})]})]},p.id)})]}),t===1&&e.jsxs(J,{sx:{p:2},children:[e.jsx(a,{variant:"h6",sx:{mb:1},children:u==="en"?"Accuracy by Category":"カテゴリー別正解率"}),e.jsx(Ee,{children:L.map((p,q)=>{const B=p.total?Math.round(p.correct/p.total*100):0;return e.jsxs(le,{sx:{flexDirection:"column",alignItems:"stretch"},children:[e.jsx(oe,{primary:p.category,secondary:`${p.correct}/${p.total} (${B}%)`}),e.jsx(He,{variant:"determinate",value:B,sx:{height:6,borderRadius:3,bgcolor:"#F2F3F3","& .MuiLinearProgress-bar":{backgroundColor:B>=70?"#1D8102":"#D13212"}}})]},q)})})]})]})]}),e.jsx(i,{sx:{p:2,display:"flex",justifyContent:"center",flexShrink:0},children:e.jsx(ce,{onClick:()=>o("/kafka-exam/practice"),sx:{bgcolor:"#232F3E",color:"white",width:48,height:48,"&:hover":{bgcolor:"#1B2631"}},title:u==="en"?"Go to practice list":"練習問題一覧へ",children:e.jsx(yn,{})})}),e.jsx(Xe,{open:n,onClose:()=>d(!1)})]}):e.jsx(i,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"100vh"},children:e.jsx(a,{sx:{color:"#666"},children:h("読み込み中...","Loading...")})}):null}const xs=()=>{const{siteLocale:o}=de(),t=(k,M)=>o==="en"?M:k,s=ge(),{examType:n}=_e(),{darkMode:d}=Ke();gt(n?()=>Promise.all([st(n),at(n)]):null,n);const[r,E]=l.useState(!1);if(!n)return s("/kafka-exam/select"),null;const m=it(n).problems,j=Gt(n).problems,S=Tn(`${n}_wrong_answers`),u=Tn(`${n}_mock_wrong_answers`),c=[...m.filter(k=>S.includes(k.id)).map(k=>({ref:k.id,problem:k})),...j.filter(k=>u.includes(k.id)).map(k=>({ref:-k.id,problem:k}))],h=c.map(k=>k.problem),y=c.map(k=>k.ref),g={};for(const k of h)g[k.category]||(g[k.category]=[]),g[k.category].push(k);const C=()=>
1{if(h.length===0)return;const k=[...y].sort(()=>Math.random()-.5);localStorage.setItem(`${n}_review_queue`,JSON.stringify(k)),localStorage.setItem(`${n}_review_index`,"0"),s("/kafka-exam/review-problem")},f=k=>{const I=c.filter(P=>P.problem.category===k).map(P=>P.ref).sort(()=>Math.random()-.5);localStorage.setItem(`${n}_review_queue`,JSON.stringify(I)),localStorage.setItem(`${n}_review_index`,"0"),s("/kafka-exam/review-problem")};return e.jsxs(i,{className:d?"nl-dark-surface":void 0,sx:{display:"flex",flexDirection:"column",minHeight:"100vh",width:"100%"},children:[e.jsxs(i,{sx:{height:64,bgcolor:"#232F3E",display:"flex",alignItems:"center",px:1,flexShrink:0},children:[e.jsx(ce,{onClick:()=>s("/kafka-exam/menu"),children:e.jsx(Re,{sx:{color:"#fff"}})}),e.jsx(a,{variant:"h6",sx:{color:"#fff",flex:1,textAlign:"center"},children:t("復習","Review")}),e.jsx(i,{sx:{width:48}})]}),e.jsxs(i,{sx:{flex:1,p:2},children:[e.jsxs(J,{sx:{p:2,mb:2,textAlign:"center",bgcolor:"#f9f9f9"},elevation:0,children:[e.jsx(a,{variant:"h5",sx:{color:"#FF9900",fontWeight:700},children:t(`${h.length}問`,`${h.length} questions`)}),e.jsx(a,{variant:"body2",sx:{color:"#666"},children:t("間違えた問題","Missed questions")})]}),h.length===0?e.jsxs(J,{sx:{p:4,textAlign:"center",borderRadius:2},elevation:0,children:[e.jsx(a,{sx:{fontSize:48,mb:1},children:"✨"}),e.jsx(a,{variant:"h6",sx:{color:"#1D8102",fontWeight:700,mb:1},children:t("間違えた問題はまだありません","No missed questions yet")}),e.jsx(a,{variant:"body2",sx:{color:"#888",mb:2},children:t("練習問題や模擬試験を解いてみましょう。","Try the practice questions and mock exams.")})]}):e.jsxs(i,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsxs(J,{onClick:C,sx:{p:2,cursor:"pointer",display:"flex",alignItems:"center",gap:2,border:"2px solid #FF9900",borderRadius:2,"&:hover":{bgcolor:"rgba(255,153,0,0.05)"}},elevation:0,children:[e.jsx(io,{sx:{color:"#FF9900",fontSize:32}}),e.jsxs(i,{children:[e.jsx(a,{variant:"body1",sx:{fontWeight:700,color:"#232F3E"},children:t("間違えた問題をランダムに出題","Review missed questions in random order")}),e.jsx(a,{variant:"body2",sx:{color:"#888"},children:t(`${h.length}問からランダムに出題します`,`Questions are drawn at random from ${h.length} questions`)})]})]}),e.jsxs(J,{onClick:()=>E(!r),sx:{p:2,cursor:"pointer",display:"flex",alignItems:"center",gap:2,border:"2px solid #0073BB",borderRadius:2,"&:hover":{bgcolor:"rgba(0,115,187,0.05)"}},elevation:0,children:[e.jsx(lo,{sx:{color:"#0073BB",fontSize:32}}),e.jsxs(i,{children:[e.jsx(a,{variant:"body1",sx:{fontWeight:700,color:"#232F3E"},children:t("カテゴリー別に間違えた問題を出題","Review missed questions by category")}),e.jsx(a,{variant:"body2",sx:{color:"#888"},children:t(`${Object.keys(g).length}カテゴリー`,`${Object.keys(g).length} categories`)})]})]}),r&&e.jsx(Ee,{sx:{bgcolor:"#f9f9f9",borderRadius:2},children:Object.entries(g).map(([k,M])=>e.jsxs(le,{onClick:()=>f(k),sx:{cursor:"pointer","&:hover":{bgcolor:"#eee"}},children:[e.jsx(oe,{primary:k,primaryTypographyProps:{fontWeight:600}}),e.jsx(Ne,{label:t(`${M.length}問`,`${M.length} questions`),size:"small",sx:{bgcolor:"#0073BB",color:"#fff"}})]},k))})]})]}),e.jsx(i,{sx:{p:2,display:"flex",justifyContent:"center",flexShrink:0},children:e.jsx(v,{variant:"outlined",onClick:()=>s("/kafka-exam/menu"),sx:{color:"#232F3E",borderColor:"#232F3E"},children:t("ホームへ戻る","Back to home")})})]})},us="/sounds/correct.mp3",hs="/sounds/incorrect.mp3",fs=()=>{const{siteLocale:o,effectiveStudyMode:t}=de(),s=(x,W)=>o==="en"?W:x;Yt();const n=ge(),{examType:d}=_e();gt(d?()=>Promise.all([st(d),at(d)]):null,d);const{soundEnabled:r}=Kt(),{darkMode:E,toggleDarkMode:m}=Ke(),{easyMode:j,toggleEasyMode:S}=Ut(),u=l.useRef(null),c=l.useRef(null),h=x=>{c.current||(u.current&&(clearTimeout(u.current),u.current=null),c.current=x,K(x))};l.useEffect(()=>()=>{u.current&&clearTimeout(u.current)},[]);const y=JSON.parse(localStorage.getItem(`${d}_review_queue`)||"[]"),g=Number(localStorage.getItem(`${d}
1_review_index`)||"0"),[C,f]=l.useState(g),k=y[C],M=d?it(d).problems:[],I=d?Gt(d).problems:[],P=typeof k=="number"&&k<0,b=(P?I:M).find(x=>x.id===Math.abs(k)),w=b?pt(b,o,t):null,[R,X]=l.useState([]),[O,K]=l.useState(null);l.useEffect(()=>{b&&X(Array(b.options.length).fill(!1)),u.current&&(clearTimeout(u.current),u.current=null)},[C,b==null?void 0:b.options.length]),l.useEffect(()=>{r&&O==="correct"?new Audio(us).play().catch(()=>{}):r&&O==="incorrect"&&new Audio(hs).play().catch(()=>{})},[O,r]),l.useEffect(()=>{d||n("/kafka-exam/select")},[d,n]);const T=l.useCallback(x=>{if(d&&x){const W=P?`${d}_mock_wrong_answers`:`${d}_wrong_answers`,Q=localStorage.getItem(W)||"[]";let p=JSON.parse(Q);p=p.filter(q=>q!==Math.abs(k)),localStorage.setItem(W,JSON.stringify(p))}},[d,k,P]);if(!d||!b)return e.jsxs(i,{sx:{p:4,textAlign:"center"},children:[e.jsx(a,{variant:"h6",sx:{color:"#888",mb:2},children:s("復習する問題がありません","No questions to review")}),e.jsx(v,{variant:"outlined",onClick:()=>n("/kafka-exam/review"),children:s("復習メニューへ戻る","Back to Review Menu")})]});const D=x=>{c.current||(u.current&&(clearTimeout(u.current),u.current=null),X(W=>{const Q=b.correctAnswers.length;if(j&&Q===1){const B=W.map((re,be)=>be===x);return setTimeout(()=>{if(c.current)return;const re=b.correctAnswers[0]===x;h(re?"correct":"incorrect"),T(re)},0),B}const p=[...W];p[x]=!p[x];const q=p.filter(Boolean).length;return j&&q>=b.correctAnswers.length&&(u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{if(u.current=null,c.current)return;const B=p.map((be,De)=>be?De:-1).filter(be=>be!==-1),re=B.length===b.correctAnswers.length&&B.every((be,De)=>be===b.correctAnswers[De]);h(re?"correct":"incorrect"),T(re)},1e3)),p}))},N=()=>{if(c.current)return;const x=R.map((Q,p)=>Q?p:-1).filter(Q=>Q!==-1),W=x.length===b.correctAnswers.length&&x.every((Q,p)=>Q===b.correctAnswers[p]);h(W?"correct":"incorrect"),T(W)},ne=()=>{c.current=null,K(null)},U=()=>{ne();const x=C+1;x<y.length?(localStorage.setItem(`${d}_review_index`,String(x)),f(x)):n("/kafka-exam/review")},G=E?"#121212":"#F2F3F3",_=E?"#e0e0e0":"#333",$=E?"#b0b0b0":"#444",L=E?"#333":"#e0e0e0",H=E?"#FF9900":"#232F3E",F=y.length>0?(C+1)/y.length*100:0;return e.jsxs(i,{sx:{display:"flex",flexDirection:"column",minHeight:"100vh",width:"100%",bgcolor:G},children:[e.jsxs(i,{sx:{height:64,bgcolor:"#232F3E",display:"flex",alignItems:"center",px:1,flexShrink:0},children:[e.jsx(ce,{onClick:()=>n("/kafka-exam/review"),children:e.jsx(Re,{sx:{color:"#fff"}})}),e.jsx(a,{sx:{color:"#fff",flex:1,textAlign:"center",fontSize:{xs:"0.85rem",sm:"1.1rem",md:"1.25rem"},fontWeight:600},children:s(`復習 (${C+1}/${y.length})`,`Review (${C+1}/${y.length})`)}),e.jsx(ce,{onClick:m,children:E?e.jsx(Nt,{sx:{color:"#fff"}}):e.jsx(Bt,{sx:{color:"#fff"}})}
1),e.jsx(ce,{onClick:S,sx:{color:j?"#FF9900":"rgba(255,255,255,0.6)"},children:e.jsx(At,{})})]}),e.jsxs(i,{sx:{px:2,pt:1.5,pb:.5},children:[e.jsx(He,{variant:"determinate",value:F,sx:{height:8,borderRadius:4,bgcolor:E?"#333":"#F2F3F3","& .MuiLinearProgress-bar":{backgroundColor:"#FF9900"}}}),e.jsxs(a,{variant:"caption",sx:{display:"block",textAlign:"center",mt:.5,color:$},children:[C+1,"/",y.length]})]}),e.jsxs(i,{sx:{px:2,py:2,flex:1,overflowY:"auto"},children:[e.jsx(Be,{children:e.jsx(wt,{text:(w==null?void 0:w.question)??"",sx:{color:_,whiteSpace:"pre-line",mb:3}})}),e.jsx(i,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:((w==null?void 0:w.options)??[]).map((x,W)=>e.jsxs(J,{onClick:()=>D(W),sx:{display:"flex",alignItems:"center",bgcolor:j&&R[W]?E?"#2a2a2a":"#e0e0e0":E?"#1e1e1e":"#fff",border:R[W]?`2px solid ${H}`:`1px solid ${L}`,borderRadius:1,p:1.5,cursor:"pointer",transition:"all 0.2s"},elevation:0,children:[e.jsx(Qe,{checked:R[W],onChange:()=>D(W),onClick:Q=>Q.stopPropagation(),sx:{mr:1,p:.5,color:E?"#fff":void 0}}),e.jsx(Be,{children:e.jsx(a,{variant:"body1",sx:{color:$},children:x})})]},W))})]}),!j&&e.jsx(i,{sx:{p:2,flexShrink:0},children:e.jsx(v,{variant:"contained",fullWidth:!0,onClick:N,disabled:!R.some(Boolean),sx:{height:48,bgcolor:"#FF9900",color:"#232F3E",fontSize:"1.1rem",borderRadius:2,"&:hover":{bgcolor:"#EC7211"}},children:s("回答","Answer")})}),e.jsxs(Ie,{open:O==="correct",onClose:ne,PaperProps:{sx:{bgcolor:E?"#1e1e1e":void 0,minWidth:{xs:"85vw",sm:380}}},children:[e.jsxs(Se,{sx:{textAlign:"center",pt:3,pb:1,px:3},children:[e.jsx(qt,{sx:{fontSize:72,color:"#1D8102",mb:1}}),e.jsx(a,{variant:"h5",sx:{color:_,fontWeight:700},children:s("正解","Correct")})]}),e.jsx(Ce,{sx:{justifyContent:"center",pb:3,px:3},children:e.jsx(v,{variant:"contained",size:"large",sx:{bgcolor:"#FF9900",color:"#232F3E",fontWeight:700,minWidth:160,py:1.25,"&:hover":{bgcolor:"#EC7211"}},onClick:U,children:s("次へ","Next")})})]}),e.jsxs(Ie,{open:O==="incorrect",onClose:ne,PaperProps:{sx:{bgcolor:E?"#1e1e1e":void 0,minWidth:{xs:"85vw",sm:420},maxWidth:560}},children:[e.jsxs(Se,{sx:{pt:3,pb:1,px:3},children:[e.jsxs(i,{sx:{textAlign:"center"},children:[e.jsx(jn,{sx:{fontSize:72,color:"#D13212",mb:1}}),e.jsx(a,{variant:"h5",sx:{color:_,fontWeight:700},children:s("不正解","Incorrect")})]}),e.jsxs(i,{sx:{mt:2},children:[e.jsx(a,{variant:"subtitle2",sx:{mb:.75,color:E?"#bbb":"#555",fontWeight:700},children:s("正解","Correct")}),b.correctAnswers.map(x=>{const W=(w==null?void 0:w.options[x])??"",Q=/^[A-Z][\.\)]/.test(W.trim()),p=String.fromCharCode(65+x);return e.jsx(i,{sx:{py:.75,px:1.25,mb:.5,borderRadius:1,bgcolor:E?"rgba(29, 129, 2, 0.18)":"#e8f5e9",border:"1px solid #1D8102"},children:e.jsxs(a,{variant:"body2",sx:{color:E?"#a5d6a7":"#1D8102",whiteSpace:"pre-wrap",wordBreak:"break-word",lineHeight:1.5},children:[Q?W:`${p}. ${W}`," ✓"]})},x)})]})]}),e.jsx(Ce,{sx:{justifyContent:"center",pb:3,px:3},children:e.jsx(v,{variant:"contained",size:"large",sx:{bgcolor:"#FF9900",color:"#232F3E",fontWeight:700,minWidth:160,py:1.25,"&:hover":{bgcolor:"#EC7211"}},onClick:U,children:s("次へ","Next")})})]})]})};function ms(o,t){const s=localStorage.getItem(`mock_result_${t}_set${o}`);if(!s)return{rate:0,done:!1};try{const n=JSON.parse(s);return{rate:Number(n.rate)||0,done:!0}}catch{return{rate:0,done:!1}}}const ps=()=>{const{siteLocale:o}=de(),t=(u,c)=>o==="en"?c:u,s=ge(),{examType:n}=_e();gt(n?()=>at(n):null,n);const d=n?In(n):0,E=(n?qe(n,1):{problems:[]}).problems.length,m=u=>{if(!n)return;nr(n,u);const c=qe(n,u).problems;s(`/kafka-exam/mock-problem/${c.length>0?c[0].id:1}`)},j=u=>{if(!n)return;const c=qe(n,u).problems,h=ln(n);if($n(h,u,c.length)){const y=er(c,h.answeredIds);s(y===null?"/kafka-exam/mock-exam/result":`/kafka-exam/mock-problem/${y}`);return}m(u)},S=u=>{if(!n)return null;const c=ln(n),h=qe(n,u).problems.length;return $n(c,u,h)?c.answeredIds.length:null};return e.jsx(Lr,{mode:"mock",title:t("模擬試験","Mock exam"),subtitle:t(`各${E}問・本番形式`,`${E} questions each, exam format`),setCount:d,getLocalResult:ms,onSetClick:j,getSetProblems:u=>n?qe(n,u).problems:[],getInProgress:S,onRestart:m})},gs="/sounds/correct.mp3",bs="/sounds/incorrect.mp3",js=()=>{Yt();const{id:o}=fn(),t=ge(),s=Number(o),{examType:n}=_e(),{soundEnabled:d}=Kt(),{darkMode:r,toggleDarkMode:E}=Ke(),{easyMode:m,toggleEasyMode:j}=Ut(),{isLoggedIn:S,isSubscribed:u,loading:c}=Pe(),{siteLocale:h,effectiveStudyMode:y,isEnglishQuestionMode:g,toggleEnglishQuestionMode:C}=de(),f=(A,V)=>h==="en"?V:A,[k,M]=l.useState(!1),[I,P]=l.useState(!1),[b,w]=l.useState([]),[R,X]=l.useState(null),[O,K]=l.useState(null),T=l.useRef(null),D=l.useRef(null),N=A=>{D.current||(T.current&&(clearTimeout(T.current),T.current=null),D.current=A,Vn.flushSync(()=>{X(A)}))};l.useEffect(()=>()=>{T.current&&clearTimeout(T.current)},[]);const ne=n?`${n}_mock_`:"",U=Number(localStorage.getItem(`${ne}currentSet`)||"1");l.useEffect(()=>{if(!n)return;let A=!1;return at(n).then(()=>{A||P(!0)}),()=>{A=!0}},[n]);const G=n?qe(n,U):{problems:[]},_=G.problems.length,$=localStorage.getItem(`${ne}answersDetail`)||"[]",L=new Set(JSON.parse($).map(A=>A.questionId)).size,H=Math.min(_>0?L/_*100:0,100),F=G.problems.find(A=>A.id===s),x=F?pt(F,h,y):null;if(l.useEffect(()=>{x&&w(Array(x.options.length).fill(!1)),D.current=null,X(null)},[s,I]),l.useEffect(()=>{d&&R==="correct"?new Audio(gs).play().catch(()=>{}):d&&R==="incorrect"&&new Audio(bs).play().catch(()=>{})},[R,d]),l.useEffect(()=>{T.current&&(clearTimeout(T.current),T.current=null),x&&w(Array(x.options.length).fill(!1))},[s,x==null?void 0:x.options.length]),l.useEffect(()=>{n||t("/kafka-exam/select")},[n,t]),l.useEffect(()=>{var A;n&&((A=ln(n))!=null&&A.completed)&&t("/kafka-exam/mock",{replace:!0})},[n,s,t]),F&&mn("mock",U,{isSubscribed:u,loading:c}))return e.jsx(i,{sx:{minHeight:"100vh",bgcolor:"#F2F3F3"}
1,children:e.jsx(Xe,{open:!0,onClose:()=>t("/kafka-exam/mock")})});if(!I||!F||!x)return e.jsx(i,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"100vh",bgcolor:"#f5f5f5"},children:e.jsx(a,{sx:{color:"#666"},children:I?f("問題が見つかりません","Question not found"):f("問題データを読み込み中...","Loading questions...")})});const W=A=>{D.current||(T.current&&(clearTimeout(T.current),T.current=null),w(V=>{const ie=F.correctAnswers.length;if(m&&ie===1){const ae=V.map((xe,se)=>se===A);return setTimeout(()=>{if(D.current)return;const xe=F.correctAnswers[0]===A;N(xe?"correct":"incorrect"),Q(xe,[A])},0),ae}const Y=[...V];Y[A]=!Y[A];const Ze=Y.filter(Boolean).length;return m&&Ze>=F.correctAnswers.length&&(T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{if(T.current=null,D.current)return;const ae=Y.map((se,ze)=>se?ze:-1).filter(se=>se!==-1),xe=ae.length===F.correctAnswers.length&&ae.every((se,ze)=>se===F.correctAnswers[ze]);N(xe?"correct":"incorrect"),Q(xe,ae)},1e3)),Y}))},Q=(A,V)=>{const ie=localStorage.getItem(`${ne}answersDetail`)||"[]";let Y=JSON.parse(ie);Y=Y.filter(ae=>ae.questionId!==s),Y.push({questionId:s,isCorrect:A,category:F.category,ts:Date.now()}),localStorage.setItem(`${ne}answersDetail`,JSON.stringify(Y));const Ze=Y.filter(ae=>ae.isCorrect).length;if(localStorage.setItem(`${ne}answeredCount`,String(Y.length)),localStorage.setItem(`${ne}correctCount`,String(Ze)),S&&n){const ae=V??b.map((xe,se)=>xe?se:-1).filter(xe=>xe!==-1);wr({question_id:s,selected_choice_ids:ae,is_correct:A,exam_type:n,question_set:"mock",set_number:U}).catch(()=>{})}if(n){const ae=`${n}_mock_wrong_answers`,xe=localStorage.getItem(ae)||"[]";let se=JSON.parse(xe);A?se=se.filter(ze=>ze!==s):se.includes(s)||se.push(s),localStorage.setItem(ae,JSON.stringify(se))}},p=()=>{if(D.current)return;const A=b.map((ie,Y)=>ie?Y:-1).filter(ie=>ie!==-1),V=A.length===F.correctAnswers.length&&A.every((ie,Y)=>ie===F.correctAnswers[Y]);N(V?"correct":"incorrect"),Q(V,A)},q=()=>{D.current=null,X(null)},B=G.problems,re=B.findIndex(A=>A.id===s),be=()=>{if(q(),re>=0&&re<B.length-1){const A=B[re+1].id;t(`/kafka-exam/mock-problem/${A}`)}else t("/kafka-exam/mock-exam/result")},De=()=>{q(),t(`/kafka-exam/mock-problem/${s}/explanation`)},Ue=r?"#121212":"#F2F3F3",we=r?"#e0e0e0":"#333",ke=r?"#b0b0b0":"#444",Et=r?"#333":"#e0e0e0",Jt=r?"#FF9900":"#232F3E";return e.jsxs(i,{sx:{display:"flex",flexDirection:"column",minHeight:"100vh",width:"100%",bgcolor:Ue},children:[e.jsxs(i,{sx:{height:64,bgcolor:"#232F3E",display:"flex",alignItems:"center",px:1,flexShrink:0},children:[e.jsx(ce,{onClick:()=>t("/kafka-exam/mock"),"aria-label":f("戻る","Back"),sx:{color:"#fff",minWidth:44,minHeight:44},children:e.jsx(Re,{})}),e.jsxs(i,{sx:{flex:1,textAlign:"center",minWidth:0,px:1},children:[e.jsx(a,{variant:"body2",sx:{color:"#FF9900",fontSize:"0.75rem",lineHeight:1,fontWeight:600},children:h==="en"?`Mock Exam ${U}`:`模擬試験${U}`}),e.jsx(a,{sx:{color:"#fff",lineHeight:1.3,fontSize:{xs:"1rem",sm:"1.1rem",md:"1.25rem"},fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:x.title})]}),h==="ja"&&e.jsx(ce,{onClick:C,"aria-label":g?f("日本語に戻す","Back to Japanese"):f("英語で表示","Show in English"),sx:{color:g?"#29B5E8":"rgba(255,255,255,0.6)",minWidth:44,minHeight:44},children:e.jsx(ur,{})}),e.jsx(ce,{onClick:A=>K(A.currentTarget),"aria-label":f("メニュー","Menu"),sx:{color:"#fff",minWidth:44,minHeight:44},children:e.jsx(hr,{})}),e.jsxs(fr,{anchorEl:O,open:!!O,onClose:()=>K(null),PaperProps:{sx:{minWidth:200}},children:[e.jsxs(ye,{onClick:()=>{E(),K(null)},children:[e.jsx(ft,{children:r?e.jsx(Nt,{fontSize:"small"}):e.jsx(Bt,{fontSize:"small"})}),e.jsx(oe,{children:r?f("ライトモード","Light mode"):f("ダークモード","Dark mode")})]}),e.jsxs(ye,{onClick:()=>{j(),K(null)},children:[e.jsx(ft,{children:e.jsx(At,{fontSize:"small",sx:{color:m?"#FF9900":void 0}})}),e.jsx(oe,{children:m?f("らくらくモード OFF","Easy mode OFF"):f("らくらくモード ON","Easy mode ON")})]}),e.jsxs(ye,{onClick:()=>{K(null),t("/kafka-exam/settings")},children:[e.jsx(ft,{children:e.jsx(bn,{fontSize:"small"})}),e.jsx(oe,{children:f("設定","Settings")})]})]})]}),e.jsxs(i,{sx:{px:{xs:2,md:4,lg:6},pt:{xs:1.5,md:2},pb:.5,maxWidth:{md:1100},mx:{md:"auto"},width:"100%"},children:[e.jsx(He,{variant:"determinate",value:H,sx:{height:{xs:8,md:10},borderRadius:4,bgcolor:r?"#333":"#F2F3F3","& .MuiLinearProgress-bar":{backgroundColor:"#1D8102"}}}),e.jsxs(a,{sx:{display:"block",textAlign:"center",mt:.5,color:ke,fontSize:{xs:"0.75rem",md:"0.9rem"}},children:[h==="en"?"Progress":"進捗",": ",L,"/",_]})]}),e.jsxs(i,{sx:{px:{xs:2,md:4,lg:6},py:{xs:2,md:3},flex:1,overflowY:"auto",maxWidth:{md:1100},mx:{md:"auto"},width:"100%"},children:[e.jsx(Be,{children:e.jsx(wt,{text:x.question,sx:{color:we,whiteSpace:"pre-line",mb:{xs:3,md:4},fontSize:{xs:"1rem",md:"1.2rem",lg:"1.3rem"},lineHeight:{xs:1.7,md:1.8},fontWeight:500}})}),e.jsx(i,{sx:{display:"flex",flexDirection:"column",gap:{xs:1.5,md:2}},children:x.options.map((A,V)=>e.jsxs(J,{onClick:()=>W(V),sx:{display:"flex",alignItems:"center",bgcolor:m&&b[V]?r?"#2a2a2a":"#e0e0e0":r?"#1e1e1e":"#fff",border:b[V]?`2px solid ${Jt}`:`2px solid ${Et}`,borderRadius:2,p:{xs:1.5,md:2.25},minHeight:52,cursor:"pointer",transition:"all 0.2s"}
1,elevation:0,children:[e.jsx(Qe,{checked:b[V],onChange:()=>W(V),onClick:ie=>ie.stopPropagation(),sx:{mr:{xs:1,md:1.5},p:.5,color:r?"#fff":void 0}}),e.jsx(Be,{children:e.jsxs(a,{sx:{color:ke,fontSize:{xs:"0.95rem",md:"1.1rem",lg:"1.15rem"},lineHeight:1.6},children:[e.jsxs(i,{component:"span",sx:{fontWeight:700,mr:.5},children:[String.fromCharCode(65+V),"."]}),A]})})]},V))})]}),!m&&e.jsx(i,{sx:{p:2,flexShrink:0},children:e.jsx(v,{variant:"contained",fullWidth:!0,onClick:p,disabled:!b.some(Boolean),sx:{height:48,bgcolor:"#FF9900",color:"#232F3E",fontSize:"1.1rem",borderRadius:2,"&:hover":{bgcolor:"#EC7211"}},children:h==="en"?"Submit":"回答"})}),e.jsxs(Ie,{open:R==="correct",onClose:q,PaperProps:{sx:{bgcolor:r?"#1e1e1e":void 0,minWidth:{xs:"85vw",sm:380}}},children:[e.jsxs(Se,{sx:{textAlign:"center",pt:3,pb:1,px:3},children:[e.jsx(qt,{sx:{fontSize:72,color:"#1D8102",mb:1}}),e.jsx(a,{variant:"h5",sx:{color:we,fontWeight:700},children:h==="en"?"Correct":"正解"})]}),e.jsxs(Ce,{sx:{justifyContent:"center",pb:3,px:3,gap:1.5,flexWrap:"wrap"},children:[e.jsx(v,{variant:"contained",size:"large",sx:{bgcolor:"#FF9900",color:"#232F3E",fontWeight:700,minWidth:132,py:1.25,"&:hover":{bgcolor:"#EC7211"}},onClick:be,children:h==="en"?"Next":"次へ"}),e.jsx(v,{variant:"outlined",size:"large",sx:{fontWeight:700,minWidth:132,py:1.25,color:we,borderColor:r?"rgba(255,255,255,0.5)":"rgba(0,0,0,0.5)"},onClick:De,children:h==="en"?"Explanation":"解説"})]})]}),e.jsxs(Ie,{open:R==="incorrect",onClose:q,PaperProps:{sx:{bgcolor:r?"#1e1e1e":void 0,minWidth:{xs:"85vw",sm:420},maxWidth:560}},children:[e.jsxs(Se,{sx:{pt:3,pb:1,px:3},children:[e.jsxs(i,{sx:{textAlign:"center"},children:[e.jsx(jn,{sx:{fontSize:72,color:"#D13212",mb:1}}),e.jsx(a,{variant:"h5",sx:{color:we,fontWeight:700},children:h==="en"?"Incorrect":"不正解"})]}),e.jsxs(i,{sx:{mt:2},children:[e.jsx(a,{variant:"subtitle2",sx:{mb:.75,color:r?"#bbb":"#555",fontWeight:700},children:h==="en"?"Correct answer(s)":"正解"}),F.correctAnswers.map(A=>{const V=x.options[A]??"",ie=/^[A-Z][\.\)]/.test(V.trim()),Y=String.fromCharCode(65+A);return e.jsx(i,{sx:{py:.75,px:1.25,mb:.5,borderRadius:1,bgcolor:r?"rgba(29, 129, 2, 0.18)":"#e8f5e9",border:"1px solid #1D8102"},children:e.jsxs(a,{variant:"body2",sx:{color:r?"#a5d6a7":"#1D8102",whiteSpace:"pre-wrap",wordBreak:"break-word",lineHeight:1.5},children:[ie?V:`${Y}. ${V}`," ✓"]})},A)})]})]}),e.jsxs(Ce,{sx:{justifyContent:"center",pb:3,px:3,gap:1.5,flexWrap:"wrap"},children:[e.jsx(v,{variant:"contained",size:"large",sx:{bgcolor:"#FF9900",color:"#232F3E",fontWeight:700,minWidth:132,py:1.25,"&:hover":{bgcolor:"#EC7211"}},onClick:be,children:h==="en"?"Next":"次へ"}),e.jsx(v,{variant:"outlined",size:"large",sx:{fontWeight:700,minWidth:132,py:1.25,color:we,borderColor:r?"rgba(255,255,255,0.5)":"rgba(0,0,0,0.5)"},onClick:De,children:h==="en"?"Explanation":"解説"})]})]}),e.jsx(Xe,{open:k,onClose:()=>M(!1)})]})};function ys(){const o=ge(),[t,s]=l.useState(0),[n,d]=l.useState(!1),{examType:r}=_e(),{darkMode:E}=Ke(),m=gt(r?()=>at(r):null,r),{isLoggedIn:j,isSubscribed:S}=Pe(),{siteLocale:u,studyMode:c}=de(),h=(p,q)=>u==="en"?q:p,[y,g]=l.useState(u==="en"||c==="en-question"?"en":"ja"),C=r?`${r}_mock_`:"",f=Number(localStorage.getItem(`${C}currentSet`)||"1"),M=(r?qe(r,f):{problems:[]}).problems,I=M.length,P=Number(localStorage.getItem(`${C}correctCount`)||0),b=I>0?Math.round(P/I*100):0,w=localStorage.getItem(`${C}answersDetail`)||"[]",R=JSON.parse(w),X=new Map(R.map(p=>[p.questionId,p])),O={};for(const p of R){const q=M.find(re=>re.id===p.questionId);if(!q)continue;const B=q.category;O[B]||(O[B]={correct:0,total:0}),O[B].total+=1,p.isCorrect&&(O[B].correct+=1)}const K=Object.entries(O).map(([p,q])=>({category:p,correct:q.correct,total:q.total})),[T,D]=l.useState(null),[N,ne]=l.useState(null),[U,G]=l.useState(null);l.useEffect(()=>{j&&r&&vn(r,"mock",Number(f)).then(p=>{D(p.correct),ne(p.rate),G(p.categories.map(q=>({category:q.name,correct:q.correct,total:q.total})))}).catch(()=>{})},[j,r,f]);const _=R.length>0?P:T??P,$=R.length>0?b:N??b,L=K.length>0?K:U??[];l.useEffect(()=>{if(!r){o("/kafka-exam/select");return}f&&m&&I>0&&R.length>0&&(localStorage.setItem(`mock_result_${r}_set${f}`,JSON.stringify({rate:$,correct:_,total:I})),Gr(r,I))},[r,o,f,$,_,I,R.length,m]);const H=Number(f)+1,F=r?In(r):0,x=H<=F,W=!S&&H>1,Q=()=>{var q;if(W){d(!0);return}D(null),ne(null),G(null),r&&nr(r,H);const p=r?((q=qe(r,H).problems[0])==null?void 0:q.id)??1:1;o(`/kafka-exam/mock-problem/${p}`,{replace:!0})};return r?m?e.jsxs(i,{className:E?"nl-dark-surface":void 0,sx:{display:"flex",flexDirection:"column",minHeight:"100vh",width:"100%"},children:[e.jsxs(i,{sx:{height:64,bgcolor:"#232F3E",display:"flex",alignItems:"center",px:1,flexShrink:0},children:[e.jsx(ce,{onClick:()=>o("/kafka-exam/mock"),"aria-label":h("一覧へ戻る","Back to list"),sx:{color:"#fff",minWidth:48,minHeight:48},children:e.jsx(Re,{})}),e.jsx(a,{variant:"h6",sx:{color:"#fff",flex:1,textAlign:"center"},children:u==="en"?`Mock Exam ${f} Results`:`模擬試験${f} 結果`}),e.jsx(i,{sx:{width:48}})]}),e.jsx(i,{sx:{display:"flex",justifyContent:"flex-end",px:2,pt:1.5},children:e.jsxs(i,{sx:{display:"flex",bgcolor:"#f0f0f0",borderRadius:1.5,overflow:"hidden"},children:[e.jsx(v,{onClick:()=>g("ja"),sx:{minWidth:56,height:36,fontWeight:700,fontSize:14,bgcolor:y==="ja"?"#232F3E":"transparent",color:y==="ja"?"#fff":"#666",borderRadius:0,"&:hover":{bgcolor:y==="ja"?"#232F3E":"#e0e0e0"}},children:"JA"}),e.jsx(v,{onClick:()=>g("en"),sx:{minWidth:56,height:36,fontWeight:700,fontSize:14,bgcolor:y==="en"?"#232F3E":"transparent",color:y==="en"?"#fff":"#666",borderRadius:0,"&:hover":{bgcolor:y==="en"?"#232F3E":"#e0e0e0"}},children:"EN"})]})}),e.jsxs(i,{sx:{flex:1,display:"flex",flexDirection:"column"},children:[e.jsxs(i,{sx:{display:"flex",alignItems:"center",borderBottom:"1px solid #e0e0e0"},children:[e.jsxs(kn,{value:t,onChange:(p,q)=>s(q),textColor:"primary",indicatorColor:"primary",sx:{flex:1},children:[e.jsx(Ye,{label:u==="en"?"Results":"試験結果"}),e.jsx(Ye,{label:u==="en"?"By Category":"カテゴリー別"})]}),e.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:.5,mr:1,flexShrink:0},children:[e.jsx(v,{onClick:()=>o("/kafka-exam/mock"),size:"small",sx:{color:"#232F3E",fontWeight:700,fontSize:"0.85rem",whiteSpace:"nowrap",minHeight:44,minWidth:56},children:u==="en"?"List":"一覧"}),x&&e.jsx(v,{onClick:Q,size:"small",sx:{color:W?"#555":"#232F3E",bgcolor:W?"#E8E8E8":"#FF9900",minHeight:44,px:1.5,"&:hover":{bgcolor:W?"#DDD":"#EC7211"},fontWeight:700,fontSize:"0.85rem",whiteSpace:"nowrap"},children:W?u==="en"?"Locked":"🔒 次へ ▶":u==="en"?"Next ▶":"次へ ▶"})]})]}),e.jsxs(i,{sx:{flex:1,overflowY:"auto",p:2},children:[t===0&&e.jsxs(e.Fragment,{children:[e.jsxs(J,{sx:{p:3,mb:2,textAlign:"center"},children:[e.jsxs(a,{variant:"h4",sx:{color:"#FF9900",fontWeight:"bold",mb:1},children:[$,"%"]}),e.jsx(He,{variant:"determinate",value:$,sx:{height:10,borderRadius:5,bgcolor:"#F2F3F3",mb:1,"& .MuiLinearProgress-bar":{backgroundColor:$>=70?"#1D8102":"#D13212"}}}),e.jsx(a,{variant:"body1",children:u==="en"?`${_} correct out of ${I}`:`${I}問中 ${_}問正解`})]}),$>=90&&e.jsxs(J,{sx:{p:2,mb:2,bgcolor:"#E8F5E9",border:"1px solid #4CAF50",borderRadius:2,textAlign:"center"}
1,elevation:0,children:[e.jsx(a,{sx:{fontSize:32,mb:.5},children:"🎉"}),e.jsx(a,{sx:{fontWeight:700,color:"#2E7D32",fontSize:16},children:u==="en"?"Excellent! Outstanding performance!":"素晴らしい成績です!"})]}),$>=70&&$<90&&e.jsx(J,{sx:{p:2,mb:2,bgcolor:"#FFF3E0",border:"1px solid #FF9800",borderRadius:2,textAlign:"center"},elevation:0,children:e.jsx(a,{sx:{fontWeight:700,color:"#E65100",fontSize:15},children:u==="en"?"Passed! Keep building on this momentum.":"合格圏内です。この調子で続けましょう。"})}),e.jsx(a,{variant:"body2",sx:{color:"#666",mb:3},children:u==="en"?$>=70?"You have reached the passing range. Keep studying.":"You need a bit more practice. Review the questions you missed.":$>=70?h("合格ラインに達しています。引き続き学習を続けましょう。","You are above the passing line. Keep going."):h("もう少し学習が必要です。間違えた問題を復習しましょう。","You need a little more study. Review the questions you missed.")}),e.jsx(a,{variant:"subtitle1",sx:{fontWeight:700,mb:1.5,color:"#232F3E"},children:u==="en"?"Question Review":"問題別 解答・解説"}),M.map((p,q)=>{const B=pt(p,y==="en"?"en":"ja",y==="en"?"en-question":"ja"),re=X.get(p.id),be=(re==null?void 0:re.isCorrect)??!1,De=!!re;return e.jsxs(jr,{sx:{mb:1},children:[e.jsx(yr,{expandIcon:e.jsx(Sr,{}),children:e.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:1,width:"100%"},children:[De?be?e.jsx(Me,{sx:{color:"#1D8102",fontSize:22}}):e.jsx(kr,{sx:{color:"#D13212",fontSize:22}}):e.jsx(Ne,{label:u==="en"?"Not answered":"未回答",size:"small",sx:{bgcolor:"#eee"}}),e.jsxs(a,{variant:"body2",sx:{fontWeight:600,flex:1},children:[u==="en"?"Q":"問",q+1,". ",B.question.slice(0,60),"…"]})]})}),e.jsxs(vr,{children:[e.jsx(a,{variant:"body2",sx:{whiteSpace:"pre-line",mb:2,color:"#333"},children:B.question}),e.jsx(i,{sx:{mb:2},children:B.options.map((Ue,we)=>{const ke=p.correctAnswers.includes(we);return e.jsx(i,{sx:{p:1,mb:.5,borderRadius:1,bgcolor:ke?"#e8f5e9":"transparent",border:ke?"1px solid #1D8102":"1px solid #eee"},children:e.jsxs(a,{variant:"body2",sx:{color:ke?"#1D8102":"#555"},children:[String.fromCharCode(65+we),". ",Ue," ",ke&&"✓"]})},we)})}),e.jsxs(J,{sx:{p:1.5,bgcolor:"#f9f9f9",borderLeft:"3px solid #232F3E"},elevation:0,children:[e.jsx(a,{variant:"caption",sx:{color:"#232F3E",fontWeight:600},children:u==="en"?"Explanation":"解説"}),e.jsx(a,{variant:"body2",sx:{color:"#333",whiteSpace:"pre-line",mt:.5},children:B.explanation})]})]})]},p.id)})]}),t===1&&e.jsxs(J,{sx:{p:2},children:[e.jsx(a,{variant:"h6",sx:{mb:1},children:u==="en"?"Accuracy by Category":"カテゴリー別正解率"}),e.jsx(Ee,{children:L.map((p,q)=>{const B=p.total?Math.round(p.correct/p.total*100):0;return e.jsxs(le,{sx:{flexDirection:"column",alignItems:"stretch"},children:[e.jsx(oe,{primary:p.category,secondary:`${p.correct}/${p.total} (${B}%)`}),e.jsx(He,{variant:"determinate",value:B,sx:{height:6,borderRadius:3,bgcolor:"#F2F3F3","& .MuiLinearProgress-bar":{backgroundColor:B>=70?"#1D8102":"#D13212"}}})]},q)})})]})]})]}),e.jsx(i,{sx:{p:2,display:"flex",justifyContent:"center",flexShrink:0},children:e.jsx(ce,{onClick:()=>o("/kafka-exam/mock"),sx:{bgcolor:"#232F3E",color:"white",width:48,height:48,"&:hover":{bgcolor:"#1B2631"}},title:u==="en"?"Go to mock exam list":"模擬試験一覧へ",children:e.jsx(yn,{})})}),e.jsx(Xe,{open:n,onClose:()=>d(!1)})]}):e.jsx(i,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"100vh"},children:e.jsx(a,{sx:{color:"#666"},children:h("読み込み中...","Loading...")})}):null}const tt=["ccdak","ccaak","ccsd"],ks=()=>{const o=ge(),{soundEnabled:t,toggleSound:s}=Kt(),{darkMode:n,toggleDarkMode:d}=Ke(),{easyMode:r,toggleEasyMode:E}=Ut(),{isLoggedIn:m}=Pe(),{siteLocale:j,studyMode:S,toggleEnglishQuestionMode:u}=de(),c=(H,F)=>j==="en"?F:H,[h,y]=l.useState(!1),[g,C]=l.useState(!1),[f,k]=l.useState(null),[M,I]=l.useState(!1),[P,b]=l.useState("feedback"),[w,R]=l.useState(""),[X,O]=l.useState(!1),[K,T]=l.useState(!1),[D,N]=l.useState(""),ne="https://nicheelab-api.fjyjfrtfzy.workers.dev",U=async()=>
1{if(w.trim().length<5){N(c("5文字以上で入力してください","Enter at least 5 characters"));return}O(!0),N("");try{const H=localStorage.getItem("exam_jwt_token");if(!(await fetch(`${ne}/api/reports`,{method:"POST",headers:{"Content-Type":"application/json",...H?{Authorization:`Bearer ${H}`}:{}},body:JSON.stringify({examType:"general",reportType:P,message:w.trim()})})).ok)throw new Error(c("送信に失敗しました","Failed to send"));T(!0)}catch{N(c("送信に失敗しました。時間をおいて再試行してください。","Failed to send. Please wait a moment and try again."))}finally{O(!1)}},G=()=>{I(!1),R(""),b("feedback"),N(""),T(!1)},_=H=>{k(H),y(!0)},$=async()=>{const H=Object.keys(localStorage);if(m)try{if(f==="practice")for(const F of tt)await tn(F,"practice").catch(()=>{});else if(f==="mock")for(const F of tt)await tn(F,"mock").catch(()=>{});else if(f==="all")for(const F of tt)await tn(F,"all").catch(()=>{})}catch{}(f==="practice"||f==="all")&&(tt.forEach(F=>{localStorage.removeItem(`${F}_answeredCount`),localStorage.removeItem(`${F}_correctCount`),localStorage.removeItem(`${F}_answersDetail`),localStorage.removeItem(`${F}_currentSet`),localStorage.removeItem(`${F}_wrong_answers`),localStorage.removeItem(`${F}_review_queue`),localStorage.removeItem(`${F}_review_index`),f==="all"&&localStorage.removeItem(`${F}_bookmarks`)}),H.forEach(F=>{tt.some(x=>F.startsWith(`ratio_${x}_`)||F.startsWith(`practice_result_${x}_`))&&localStorage.removeItem(F)})),(f==="mock"||f==="all")&&(tt.forEach(F=>{localStorage.removeItem(`${F}_mock_answeredCount`),localStorage.removeItem(`${F}_mock_correctCount`),localStorage.removeItem(`${F}_mock_answersDetail`),localStorage.removeItem(`${F}_mock_currentSet`),localStorage.removeItem(`${F}_mock_wrong_answers`),localStorage.removeItem(`${F}_mock_completed`)}),H.forEach(F=>{tt.some(x=>F.startsWith(`mock_ratio_${x}_`)||F.startsWith(`mock_result_${x}_`))&&localStorage.removeItem(F)})),y(!1),C(!0),setTimeout(()=>window.location.reload(),500)},L={practice:c("練習問題の学習データ","Practice question data"),mock:c("模擬試験の学習データ","Mock exam data"),all:c("すべての学習データ","All study data")};return e.jsxs(i,{sx:{display:"flex",flexDirection:"column",minHeight:"100vh",width:"100%"},children:[e.jsxs(i,{sx:{height:64,bgcolor:"#1B3139",display:"flex",alignItems:"center",px:1,flexShrink:0},children:[e.jsx(ce,{onClick:()=>o("/kafka-exam/menu"),children:e.jsx(Re,{sx:{color:"#fff"}})}),e.jsx(a,{variant:"h6",sx:{color:"#fff",flex:1,textAlign:"center"},children:c("設定","Settings")}),e.jsx(i,{sx:{width:48}})]}),e.jsxs(i,{sx:{flex:1,p:2},children:[e.jsx(a,{variant:"subtitle1",sx:{color:"#888",mb:1},children:c("表示・操作設定","Display and controls")}),e.jsxs(Ee,{children:[e.jsxs(le,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:1},children:[n?e.jsx(Bt,{sx:{color:"#1B3139"}}):e.jsx(Nt,{sx:{color:"#888"}}),e.jsx(oe,{primary:c("ダークモード","Dark mode"),secondary:n?"ON":"OFF"})]}),e.jsx(yt,{checked:n,onChange:d,color:"primary"})]}),e.jsx(Le,{}),e.jsxs(le,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:1},children:[r?e.jsx(At,{sx:{color:"#FF9900"}}):e.jsx(co,{sx:{color:"#888"}}),e.jsx(oe,{primary:c("らくらく回答モード","Easy answer mode"),secondary:r?c("ON — 選択するだけで自動回答","ON — choosing an option submits it automatically"):"OFF"})]}),e.jsx(yt,{checked:r,onChange:E,color:"warning"})]}),e.jsx(Le,{}),e.jsxs(le,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:1},children:[t?e.jsx(xo,{sx:{color:"#1B3139"}}):e.jsx(uo,{sx:{color:"#888"}}),e.jsx(oe,{primary:c("回答時の音声","Answer sound"),secondary:t?"ON":"OFF"})]}),e.jsx(yt,{checked:t,onChange:s,color:"primary"})]}),j==="ja"&&e.jsxs(e.Fragment,{children:[e.jsx(Le,{}),e.jsxs(le,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(At,{sx:{color:S==="en-question"?"#0073BB":"#888"}}),e.jsx(oe,{primary:c("問題文・選択肢を英語表示","Show questions and choices in English"),secondary:S==="en-question"?c("ON - 解説とUIは日本語のまま","ON - explanations and the UI stay in Japanese"):"OFF"})]}),e.jsx(yt,{checked:S==="en-question",onChange:u,color:"info"})]})]})]}),e.jsx(a,{variant:"subtitle1",sx:{color:"#888",mt:4,mb:1},children:c("学習データの管理","Manage study data")}),e.jsxs(Ee,{children:[e.jsxs(le,{sx:{cursor:"pointer","&:hover":{bgcolor:"#f5f5f5"}},onClick:()=>_("practice"),children:[e.jsx(Qt,{sx:{color:"#0073BB",mr:2}}),e.jsx(oe,{primary:c("練習問題データをリセット","Re
1set practice data"),secondary:c("正解率・回答履歴をクリアします","Clears your accuracy and answer history")})]}),e.jsx(Le,{}),e.jsxs(le,{sx:{cursor:"pointer","&:hover":{bgcolor:"#f5f5f5"}},onClick:()=>_("mock"),children:[e.jsx(Qt,{sx:{color:"#0073BB",mr:2}}),e.jsx(oe,{primary:c("模擬試験データをリセット","Reset mock exam data"),secondary:c("模擬試験の正解率・回答履歴をクリアします","Clears your mock exam accuracy and answer history")})]}),e.jsx(Le,{}),e.jsxs(le,{sx:{cursor:"pointer","&:hover":{bgcolor:"#f5f5f5"}},onClick:()=>_("all"),children:[e.jsx(Qt,{sx:{color:"#d32f2f",mr:2}}),e.jsx(oe,{primary:c("すべてのデータをリセット","Reset all data"),secondary:c("練習・模擬試験の全データをクリアします","Clears all practice and mock exam data"),primaryTypographyProps:{color:"#d32f2f"}})]})]}),e.jsx(a,{variant:"subtitle1",sx:{color:"#888",mt:4,mb:1},children:c("アプリ情報","About this app")}),e.jsxs(Ee,{children:[e.jsx(le,{children:e.jsx(oe,{primary:c("バージョン","Version"),secondary:"1.0.0"})}),e.jsx(Le,{}),e.jsx(le,{children:e.jsx(oe,{primary:c("対応試験","Supported exams"),secondary:"Confluent Certified Developer for Apache Kafka (CCDAK)"})})]}),e.jsxs(i,{sx:{mt:3},children:[e.jsx(a,{variant:"subtitle2",sx:{color:"#888",mb:1},children:c("フィードバック","Feedback")}),e.jsx(v,{variant:"outlined",startIcon:e.jsx(ho,{}),fullWidth:!0,onClick:()=>I(!0),sx:{mb:1,justifyContent:"flex-start",color:"#1B3139",borderColor:"#ccc"},children:c("フィードバックを送る","Send feedback")}),e.jsx(a,{variant:"caption",sx:{color:"#999"},children:c("問題の誤りは各問題の解説ページから「問題の誤りを報告」ボタンでも送信できます",`You can also report a mistake using the "Report an error" button on any question's explanation page.`)})]}),e.jsxs(i,{sx:{mt:2},children:[e.jsx(a,{variant:"subtitle2",sx:{color:"#888",mb:1},children:c("利用規約・ポリシー","Terms and Policies")}),e.jsx(bt,{color:"#0073BB",justifyContent:"flex-start"})]})]}),e.jsx(i,{sx:{p:2,display:"flex",justifyContent:"center",flexShrink:0},children:e.jsx(v,{variant:"outlined",onClick:()=>o("/kafka-exam/menu"),sx:{color:"#1B3139",borderColor:"#1B3139"},children:c("ホームへ戻る","Back to home")})}),e.jsxs(Ie,{open:h,onClose:()=>y(!1),children:[e.jsx(ot,{children:c("データリセット確認","Reset data?")}),e.jsx(Se,{children:e.jsx(fo,{children:c(`${f&&L[f]}をリセットします。この操作は取り消せません。`,`This will reset ${f&&L[f]}. This action cannot be undone.`)})}),e.jsxs(Ce,{children:[e.jsx(v,{onClick:()=>y(!1),children:c("キャンセル","Cancel")}),e.jsx(v,{onClick:$,color:"error",variant:"contained",children:c("リセット","Reset")})]})]}),e.jsx(xr,{open:g,autoHideDuration:3e3,onClose:()=>C(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},children:e.jsx(Oe,{severity:"success",onClose:()=>C(!1),children:c("データをリセットしました","Data reset")})}),e.jsx(Ie,{open:M,onClose:G,maxWidth:"sm",fullWidth:!0,children:K?e.jsxs(e.Fragment,{children:[e.jsxs(Se,{sx:{textAlign:"center",py:5},children:[e.jsx(Me,{sx:{fontSize:56,color:"#1D8102",mb:2}}),e.jsx(a,{variant:"h6",sx:{fontWeight:700,mb:1},children:c("送信しました","Sent")}),e.jsx(a,{variant:"body2",sx:{color:"#666"},children:c("ご意見ありがとうございます。","Thanks for your feedback.")})]}),e.jsx(Ce,{children:e.jsx(v,{onClick:G,children:c("閉じる","Close")})})]}):e.jsxs(e.Fragment,{children:[e.jsx(ot,{sx:{fontWeight:700},children:c("フィードバック","Feedback")}),e.jsxs(Se,{children:[e.jsxs(gr,{fullWidth:!0,sx:{mb:2,mt:1},children:[e.jsx(br,{children:c("種別","Type")}),e.jsxs(kt,{value:P,label:c("種別","Type"),onChange:H=>b(H.target.value),children:[e.jsx(ye,{value:"feedback",children:c("フィードバック","Feedback")}),e.jsx(ye,{value:"bug",children:c("不具合報告","Report a bug")}),e.jsx(ye,{value:"feature",children:c("機能リクエスト","Feature request")}),e.jsx(ye,{value:"other",children:c("その他","Other")})]})]}),e.jsx(Ae,{fullWidth:!0,multiline:!0,rows:4,label:c("詳細","Details"),value:w,onChange:H=>R(H.target.value),placeholder:c("お気軽にご記入ください","Feel free to write anything"),inputProps:{maxLength:1e3}}),D&&e.jsx(a,{color:"error",variant:"body2",sx:{mt:1},children:D}),e.jsx(i,{sx:{mt:1,textAlign:"right"},children:e.jsxs(a,{variant:"caption",sx:{color:"#999"},children:[w.length,"/1000"]})})]}),e.jsxs(Ce,{children:[e.jsx(v,{onClick:G,sx:{color:"#666"},children:c("キャンセル","Cancel")}),e.jsx(v,{onClick:U,variant:"contained",disabled:X,sx:{bgcolor:"#FF3621","&:hover":{bgcolor:"#E02E1B"}},children:X?c("送信中...","Sending..."):c("送信","Send")})]})]})})]})},Ss="https://nicheelab-api.fjyjfrtfzy.workers.dev";async function ct(o,t){const s=localStorage.getItem("exam_jwt_token");return(await fetch(`${Ss}${o}`,{...t,headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`,...t==null?void 0:t.headers}})).json()}function vs(){var F;const{siteLocale:o}=de(),t=(x,W)=>o==="en"?W:x,s=ge(),{user:n}=Pe(),[d,r]=l.useState(0),[E,m]=l.useState([]),[j,S]=l.useState([]),[u,c]=l.useState([]),[h,y]=l.useState([]),[g,C]=l.useState(null),[f,k]=l.useState("dea"),[M,I]=l.useState("practice"),[P,b]=l.useState(!1),[w,R]=l.useState(null),[X,O]=l.useState(!1),K=(n==null?void 0:n.role)==="admin",T=l.useCallback(async()=>{try{const{questions:x}=await wo(f,M);m(x)}catch{m([])}},[f,M]),D=l.useCallback(async()=>{try{const{users:x}=await Po();S(x)}catch{S([])}},[]),N=l.useCallback(async()=>{try{const x=await ct("/api/admin/reports");y(x.reports||[])}catch{y([])}},[]),ne=l.useCallback(async()=>{var x;try{const W=await ct("/api/admin/stats");C(W)}catch{C(null)}try{const W=await ct("/api/admin/settings");O(((x=W.settings)==null?void 0:x.maintenance_mode)==="true")}catch{}},[]),U=async()=>{const x=!X;await ct("/api/admin/settings",{method:"PUT",body:JSON.stringify({key:"maintenance_mode",value:String(x)})}),O(x)},G=l.useCallback(async()=>{try{const{categories:x}=await Do();c(x)}catch{c([])}},[]);l.useEffect(()=>{K&&(d===0&&ne(),d===1&&T(),d===2&&D(),d===3&&N())},[d,f,M,K,ne,T,D,N]),l.useEffect(()=>{K&&G()},[K,G]);const _=async x=>
1{confirm(t("この問題を削除しますか?","Delete this question?"))&&(await Io(x),T())},$=async x=>{confirm(t("このユーザーと関連データを全て削除しますか?","Delete this user and all related data?"))&&(await ct(`/api/admin/users/${x}`,{method:"DELETE"}),D())},L=async(x,W)=>{await ct(`/api/admin/reports/${x}`,{method:"PUT",body:JSON.stringify({status:W})}),N()},H=async()=>{w&&(w.id?await Eo(w.id,w):await Ao({...w,exam_type:f,question_set:M}),b(!1),R(null),T())};return K?e.jsxs(i,{sx:{minHeight:"100vh",bgcolor:"#F2F3F3"},children:[e.jsxs(i,{sx:{height:64,bgcolor:"#1B3139",display:"flex",alignItems:"center",px:2},children:[e.jsx(ce,{onClick:()=>s("/kafka-exam/menu"),children:e.jsx(Re,{sx:{color:"#fff"}})}),e.jsx(a,{variant:"h6",sx:{color:"#fff",ml:2},children:t("管理画面","Admin")})]}),e.jsxs(Fe,{maxWidth:"lg",sx:{py:3},children:[e.jsxs(kn,{value:d,onChange:(x,W)=>r(W),sx:{mb:3},variant:"scrollable",scrollButtons:"auto",children:[e.jsx(Ye,{label:t("ダッシュボード","Dashboard")}),e.jsx(Ye,{label:t("問題管理","Questions")}),e.jsx(Ye,{label:t("ユーザー管理","Users")}),e.jsx(Ye,{label:t("フィードバック","Feedback")})]}),d===0&&e.jsxs(e.Fragment,{children:[e.jsxs(J,{sx:{p:2,mb:3,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs(i,{children:[e.jsx(a,{sx:{fontWeight:700},children:t("メンテナンスモード","Maintenance mode")}),e.jsx(a,{variant:"caption",sx:{color:"#666"},children:t("ONにするとユーザーにメンテナンス画面が表示されます","When on, users see a maintenance screen")})]}),e.jsx(ht,{control:e.jsx(yt,{checked:X,onChange:U,color:"warning"}),label:X?"ON":"OFF"})]}),X&&e.jsx(Oe,{severity:"warning",sx:{mb:2},children:t("メンテナンスモードが有効です。ユーザーにメンテナンス画面が表示されています。","Maintenance mode is on. Users are seeing the maintenance screen.")})]}),d===0&&g&&e.jsxs(i,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr 1fr",md:"1fr 1fr 1fr 1fr"},gap:2,mb:3},children:[e.jsx(It,{children:e.jsxs(Pt,{sx:{textAlign:"center"},children:[e.jsx(mo,{sx:{fontSize:36,color:"#1B3139"}}),e.jsx(a,{variant:"h4",sx:{fontWeight:800,color:"#1B3139"},children:g.users}),e.jsx(a,{variant:"body2",sx:{color:"#666"},children:t("登録ユーザー","Registered users")})]})}),e.jsx(It,{children:e.jsxs(Pt,{sx:{textAlign:"center"},children:[e.jsx(gn,{sx:{fontSize:36,color:"#1D8102"}}),e.jsx(a,{variant:"h4",sx:{fontWeight:800,color:"#1D8102"},children:g.activeSubscriptions}),e.jsx(a,{variant:"body2",sx:{color:"#666"},children:t("有料会員","Paid members")})]})}),e.jsx(It,{children:e.jsxs(Pt,{sx:{textAlign:"center"},children:[e.jsx(pn,{sx:{fontSize:36,color:"#FF3621"}}),e.jsx(a,{variant:"h4",sx:{fontWeight:800,color:"#FF3621"},children:g.totalAnswers}),e.jsx(a,{variant:"body2",sx:{color:"#666"},children:t("総回答数","Total answers")})]})}),e.jsx(It,{children:e.jsxs(Pt,{sx:{textAlign:"center"},children:[e.jsx(pr,{sx:{fontSize:36,color:"#F59E0B"}}),e.jsx(a,{variant:"h4",sx:{fontWeight:800,color:"#F59E0B"},children:g.openReports}),e.jsx(a,{variant:"body2",sx:{color:"#666"},children:t("未対応報告","Open reports")})]})})]}),d===1&&e.jsxs(e.Fragment,{children:[e.jsxs(i,{sx:{display:"flex",gap:2,mb:2,alignItems:"center",flexWrap:"wrap"},children:[e.jsx(kt,{value:f,onChange:x=>k(x.target.value),size:"small",children:["dea","dep","daa","mla","mlp","spark","genai"].map(x=>e.jsx(ye,{value:x,children:x.toUpperCase()},x))}),e.jsxs(kt,{value:M,onChange:x=>I(x.target.value),size:"small",children:[e.jsx(ye,{value:"practice",children:t("練習問題","Practice questions")}),e.jsx(ye,{value:"mock",children:t("模擬試験","Mock exams")})]}),e.jsx(v,{startIcon:e.jsx(po,{}),variant:"contained",sx:{bgcolor:"#FF3621","&:hover":{bgcolor:"#E02E1B"}},onClick:()=>{var x;R({title:"",body:"",category_id:((x=u[0])==null?void 0:x.id)||1,difficulty:1,choices:[{text:"",is_correct:!1},{text:"",is_correct:!1},{text:"",is_correct:!1},{text:"",is_correct:!1}],explanation:""}),b(!0)},children:t("問題追加","Add question")})]}),e.jsx(J,{sx:{overflowX:"auto"},children:e.jsxs(Vt,{size:"small",children:[e.jsx(Xt,{children:e.jsxs(lt,{sx:{bgcolor:"#1B3139"},children:[e.jsx(ee,{sx:{color:"#fff"},children:"ID"}),e.jsx(ee,{sx:{color:"#fff"},children:t("タイトル","Title")}),e.jsx(ee,{sx:{color:"#fff"},children:t("カテゴリ","Category")}),e.jsx(ee,{sx:{color:"#fff"},children:t("難易度","Difficulty")}),e.jsx(ee,{sx:{color:"#fff"},children:t("操作","Actions")})]})}),e.jsx(Zt,{children:E.map(x=>e.jsxs(lt,{children:[e.jsx(ee,{children:x.id}),e.jsx(ee,{children:x.title}),e.jsx(ee,{children:x.category_name}),e.jsx(ee,{children:x.difficulty}),e.jsxs(ee,{children:[e.jsx(ce,{size:"small",onClick:()=>{R(x),b(!0)},children:e.jsx(go,{fontSize:"small"})}),e.jsx(ce,{size:"small",color:"error",onClick:()=>_(x.id),children:e.jsx(zn,{fontSize:"small"})})]})]},x.id))})]})})]}),d===2&&e.jsx(J,{sx:{overflowX:"auto"},children:e.jsxs(Vt,{size:"small",children:[e.jsx(Xt,{children:e.jsxs(lt,{sx:{bgcolor:"#1B3139"},children:[e.jsx(ee,{sx:{color:"#fff"},children:"ID"}),e.jsx(ee,{sx:{color:"#fff"},children:t("メール","Email")}),e.jsx(ee,{sx:{color:"#fff"},children:t("プラン","Plan")}),e.jsx(ee,{sx:{color:"#fff"},children:t("役割","Role")}),e.jsx(ee,{sx:{color:"#fff"},children:t("登録日","Joined")}),e.jsx(ee,{sx:{color:"#fff"},children:t("操作","Actions")})]})}),e.jsx(Zt,{children:j.map(x=>e.jsxs(lt,{children:[e.jsx(ee,{children:x.id}),e.jsx(ee,{children:x.email}),e.jsx(ee,{children:e.jsx(Ne,{label:x.plan==="active"?t("有料","Paid"):t("無料","Free"),size:"small",color:x.plan==="active"?"success":"default"})}),e.jsx(ee,{children:x.role}),e.jsx(ee,{children:new Date(x.created_at).toLocaleDateString("ja-JP")}),e.jsx(ee,{children:e.jsx(ce,{size:"small",color:"error",onClick:()=>$(x.id),title:t("ユーザー削除","Delete user"),children:e.jsx(zn,{fontSize:"small"})})})]},x.id))})]})}),d===3&&e.jsx(J,{sx:{overflowX:"auto"},children:e.jsxs(Vt,{size:"small",children:[e.jsx(Xt,{children:e.jsxs(lt,{sx:{bgcolor:"#1B3139"},children:[e.jsx(ee,{sx:{color:"#fff"},children:"ID"}),e.jsx(ee,{sx:{color:"#fff"},children:t("種別","Type")}),e.jsx(ee,{sx:{color:"#fff"},children:t("試験","Exam")}),e.jsx(ee,{sx:{color:"#fff"},children:t("内容","Details")}),e.jsx(ee,{sx:{color:"#fff"},children:t("ユーザー","User")}),e.jsx(ee,{sx:{color:"#fff"},children:t("ステータス","Status")}),e.jsx(ee,{sx:{color:"#fff"},children:t("日時","Date")}),e.jsx(ee,{sx:{color:"#fff"},children:t("操作","Actions")})]})}),e.jsx(Zt,{children:h.map(x=>e.jsxs(lt,{sx:{bgcolor:x.status==="open"?"#FFF8E1":void 0},children:[e.jsx(ee,{children:x.id}),e.jsx(ee,{children:e.jsx(Ne,{label:x.report_type,size:"small"})}),e.jsxs(ee,{children:[x.exam_type," #",x.set_number]}),e.jsx(ee,{sx:{maxWidth:300,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:x.message}),e.jsx(ee,{children:x.user_email||t("匿名","Anonymous")}),e.jsx(ee,{children:e.jsx(Ne,{label:x.status==="open"?t("未対応","Open"):x.status==="resolved"?t("解決済","Resolved"):x.status,size:"small",color:x.status==="open"?"warning":"success"})}),e.jsx(ee,{children:new Date(x.created_at).toLocaleDateString("ja-JP")}),e.jsx(ee,{children:x.status==="open"&&e.jsx(v,{size:"small",variant:"outlined",color:"success",onClick:()=>L(x.id,"resolved"),children:t("解決","Resolve")})})]},x.id))})]})})]}),e.jsxs(Ie,{open:P,onClose:()=>b(!1),maxWidth:"md",fullWidth:!0,children:[e.jsx(ot,{children:w!=null&&w.id?t("問題編集","E
1dit question"):t("問題追加","Add question")}),e.jsx(Se,{children:w&&e.jsxs(i,{sx:{display:"flex",flexDirection:"column",gap:2,mt:1},children:[e.jsx(Ae,{label:t("タイトル","Title"),value:w.title,onChange:x=>R({...w,title:x.target.value}),fullWidth:!0}),e.jsx(Ae,{label:t("問題文","Question"),value:w.body,onChange:x=>R({...w,body:x.target.value}),multiline:!0,rows:4,fullWidth:!0}),e.jsx(kt,{value:w.category_id,onChange:x=>R({...w,category_id:x.target.value}),size:"small",children:u.map(x=>e.jsxs(ye,{value:x.id,children:[x.name," (",x.exam_type,")"]},x.id))}),e.jsx(a,{variant:"subtitle2",children:t("選択肢","Options")}),(F=w.choices)==null?void 0:F.map((x,W)=>e.jsxs(i,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsx(Ae,{label:t(`選択肢 ${String.fromCharCode(65+W)}`,`Choice ${String.fromCharCode(65+W)}`),value:x.text,onChange:Q=>{const p=[...w.choices];p[W]={...p[W],text:Q.target.value},R({...w,choices:p})},fullWidth:!0,size:"small"}),e.jsx(v,{variant:x.is_correct?"contained":"outlined",size:"small",color:x.is_correct?"success":"inherit",onClick:()=>{const Q=[...w.choices];Q[W]={...Q[W],is_correct:!Q[W].is_correct},R({...w,choices:Q})},children:t("正解","Correct")})]},W)),e.jsx(Ae,{label:t("解説","Explanation"),value:w.explanation,onChange:x=>R({...w,explanation:x.target.value}),multiline:!0,rows:3,fullWidth:!0})]})}),e.jsxs(Ce,{children:[e.jsx(v,{onClick:()=>b(!1),children:t("キャンセル","Cancel")}),e.jsx(v,{variant:"contained",onClick:H,sx:{bgcolor:"#FF3621","&:hover":{bgcolor:"#E02E1B"}},children:t("保存","Save")})]})]})]}):e.jsxs(i,{sx:{p:4,textAlign:"center"},children:[e.jsx(a,{variant:"h5",color:"error",children:t("管理者権限が必要です","Admin access required")}),e.jsx(v,{onClick:()=>s("/kafka-exam/menu"),sx:{mt:2},children:t("ホームに戻る","Back to home")})]})}const Dt=Te,Cs="This English text is a reference translation. The Japanese version is the authoritative text; if the two differ, the Japanese version prevails.";function Pn({title:o,subtitle:t,children:s}){const{siteLocale:n}=de(),d=n==="en",r=ge();return e.jsxs(i,{sx:{minHeight:"100vh",bgcolor:Dt.lightGray},children:[e.jsx(i,{sx:{bgcolor:Dt.squidInk,color:"#fff",py:4,px:2},children:e.jsxs(Fe,{maxWidth:"md",children:[e.jsx(v,{startIcon:e.jsx(Re,{}),onClick:()=>r("/kafka-exam/"),sx:{color:"rgba(255,255,255,0.8)",mb:2},children:d?"Back to top":"トップへ戻る"}),e.jsx(a,{variant:"h4",sx:{fontWeight:800,mb:1,fontSize:{xs:"1.6rem",md:"2.1rem"}},children:o}),e.jsx(a,{sx:{color:"rgba(255,255,255,0.75)"},children:t}),d&&e.jsx(a,{sx:{mt:2,p:1.5,borderRadius:1,bgcolor:"rgba(255,255,255,0.12)",color:"rgba(255,255,255,0.9)",fontSize:"0.85rem",lineHeight:1.6},children:Cs})]})}),e.jsxs(Fe,{maxWidth:"md",sx:{py:4},children:[e.jsx(i,{sx:{display:"flex",flexDirection:"column",gap:3},children:s}),e.jsx(i,{sx:{mt:5,pt:3,borderTop:`1px solid ${Dt.borderGray}`},children:e.jsx(bt,{color:Dt.accentBlue,justifyContent:"flex-start"})})]})]})}const rt=Te;function Ge({title:o,children:t}){return e.jsxs(J,{elevation:0,sx:{p:3,borderRadius:2,border:`1px solid ${rt.borderGray}`},children:[e.jsx(a,{variant:"h6",sx:{fontWeight:700,color:rt.squidInk,mb:1.5},children:o}),t]})}function ws(){const{siteLocale:o}=de(),t=(s,n)=>o==="en"?n:s;return e.jsxs(Pn,{title:t("利用規約","Terms of Service"),subtitle:t("本サービスの利用条件、禁止事項、免責事項、課金条件を定める規約です。","Terms that set out the conditions of use, prohibited acts, disclaimers, and billing conditions of the Service."),children:[e.jsx(Ge,{title:t("1. サービス内容","1. Service description"),children:e.jsx(Ee,{dense:!0,disablePadding:!0,children:Bo.map(s=>e.jsx(le,{disableGutters:!0,children:e.jsx(oe,{primary:t(s.ja,s.en)})},s.ja))})}),e.jsx(Ge,{title:t("2. 料金と支払い","2. Fees and payment"),children:e.jsxs(a,{variant:"body2",sx:{color:rt.textSecondary,lineHeight:1.8},children:[t(`有料プランの料金は ${t(Z.priceDisplay.ja,Z.priceDisplay.en)} です。決済は ${t(Z.paymentMethods.ja,Z.paymentMethods.en)} により行われ、`,`The paid plan costs ${t(Z.priceDisplay.ja,Z.priceDisplay.en)}. Payment is made by ${t(Z.paymentMethods.ja,Z.paymentMethods.en)}, and`),t(`月額プランのサブスクリプションは自動更新されます(90日間の買い切りプランは自動更新されず、期間満了で終了します)。解約は ${t(Z.cancellationPolicy.ja,Z.cancellationPolicy.en)}`,`Monthly subscriptions renew automatically (the one-time 90-day plan does not renew and ends when the peri
1od expires). Cancellation follows ${t(Z.cancellationPolicy.ja,Z.cancellationPolicy.en)}`)]})}),e.jsx(Ge,{title:t("3. 禁止事項","3. Prohibited conduct"),children:e.jsx(Ee,{dense:!0,disablePadding:!0,children:Ho.map(s=>e.jsx(le,{disableGutters:!0,children:e.jsx(oe,{primary:t(s.ja,s.en)})},s.ja))})}),e.jsx(Ge,{title:t("4. 知的財産権・商標","4. Intellectual property rights and trademarks"),children:e.jsx(Ee,{dense:!0,disablePadding:!0,children:$r.map(s=>e.jsx(le,{disableGutters:!0,children:e.jsx(oe,{primary:t(s.ja,s.en)})},s.ja))})}),e.jsx(Ge,{title:t("5. 免責事項","5. Disclaimer"),children:e.jsxs(a,{variant:"body2",sx:{color:rt.textSecondary,lineHeight:1.8},children:[t("本サービスは学習支援を目的として提供されるものであり、資格試験の合格を保証するものではありません。","This service is provided as a study aid and does not guarantee that you will pass any certification exam."),t("最新性・正確性の確保に努めますが、その完全性を保証するものではなく、","We work to keep the content current and accurate, but we do not warrant its completeness,"),t("利用者は自己の責任で本サービスを利用するものとします。","and you use this service at your own risk.")]})}),e.jsx(Ge,{title:t("6. サービス変更・停止","6. Changes to and suspension of the service"),children:e.jsxs(a,{variant:"body2",sx:{color:rt.textSecondary,lineHeight:1.8},children:[t("運営者は、保守、障害対応、法令順守、サービス改善その他合理的な理由により、","For maintenance, incident response, legal compliance, service improvements, or other reasonable causes, the operator may"),t("本サービスの全部または一部を変更、停止、終了することがあります。","change, suspend, or discontinue all or part of this service.")]})}),e.jsx(Ge,{title:t("7. 返金・解約","7. Refunds and cancellation"),children:e.jsxs(a,{variant:"body2",sx:{color:rt.textSecondary,lineHeight:1.8},children:[t(Z.refundPolicy.ja,Z.refundPolicy.en)," ",t(Z.cancellationPolicy.ja,Z.cancellationPolicy.en)]})}),e.jsx(Ge,{title:t("8. 準拠法・管轄","8. Governing law and jurisdiction"),children:e.jsxs(a,{variant:"body2",sx:{color:rt.textSecondary,lineHeight:1.8},children:[t("本規約は日本法に準拠します。本サービスに関して紛争が生じた場合は、","These terms are governed by the laws of Japan. In the event of a dispute concerning this service,"),t("運営者の所在地を管轄する裁判所を第一審の専属的合意管轄裁判所とします。","the court with jurisdiction over the operator's location shall be the exclusive court of first instance.")]})})]})}const vt=Te;function dt({title:o,children:t}){return e.jsxs(J,{elevation:0,sx:{p:3,borderRadius:2,border:`1px solid ${vt.borderGray}`},children:[e.jsx(a,{variant:"h6",sx:{fontWeight:700,color:vt.squidInk,mb:1.5},children:o}),t]})}function As(){const{siteLocale:o}=de(),t=(s,n)=>o==="en"?n:s;return e.jsxs(Pn,{title:t("プライバシーポリシー","Privacy Policy"),subtitle:t("個人情報の取得項目、利用目的、第三者提供、管理方法を定めています。","Sets out the items of personal information collected, the purposes of use, provision to third parties, and management methods."),children:[mt.length>0&&e.jsx(Oe,{severity:"warning",children:t(`リリース前に以下の運営者情報を必ず確定してください: ${mt.map(s=>t(s.ja,s.en)).join("、")}`,`Finalize the following operator details before release: ${mt.map(s=>t(s.ja,s.en)).join("、")}`)}),e.jsx(dt,{title:t("1. 取得する情報","1. Information collected"),children:e.jsx(Ee,{dense:!0,disablePadding:!0,children:Ko.map(s=>e.jsx(le,{disableGutters:!0,children:e.jsx(oe,{primary:t(s.ja,s.en)})},s.ja))})}),e.jsx(dt,{title:t("2. 利用目的","2. Purposes of use"),children:e.jsx(Ee,{dense:!0,disablePadding:!0,children:Uo.map(s=>e.jsx(le,{disableGutters:!0,children:e.jsx(oe,{primary:t(s.ja,s.en)})},s.ja))})}),e.jsx(dt,{title:t("3. 第三者提供・外部サービス連携","3. Provision to third parties and integration with external services"),children:e.jsx(Ee,{dense:!0,disablePadding:!0,children:Go.map(s=>e.jsx(le,{disableGutters:!0,children:e.jsx(oe,{primary:s.name,secondary:t(s.purpose.ja,s.purpose.en)})},s.name))})}
1),e.jsx(dt,{title:t("4. 安全管理措置","4. Security control measures"),children:e.jsxs(a,{variant:"body2",sx:{color:vt.textSecondary,lineHeight:1.8},children:[t("パスワードはハッシュ化して保存し、クレジットカード情報は当サービスでは保持せず Stripe 側で管理します。","Passwords are stored hashed. We never hold credit card details; Stripe manages them."),t("API ではレート制限、署名検証、bot 対策、アクセス制御を実施し、必要最小限の権限で運用します。","Our APIs use rate limiting, signature verification, bot protection, and access control, and run with the minimum permissions required.")]})}),e.jsx(dt,{title:t("5. Cookie・ログの利用","5. Use of cookies and logs"),children:e.jsxs(a,{variant:"body2",sx:{color:vt.textSecondary,lineHeight:1.8},children:[t("本サービスでは、ログイン状態の維持、操作性向上、不正利用検知、利用状況分析のために Cookie や","We use cookies,"),t("ローカルストレージ、アクセスログを利用します。ブラウザ設定により Cookie を制限した場合、一部機能が","local storage, and access logs to keep you signed in, improve usability, detect abuse, and analyze usage. If you restrict cookies in your browser settings, some features"),t("正常に動作しないことがあります。","may not work correctly.")]})}),e.jsx(dt,{title:t("6. 開示・訂正・削除等の請求","6. Requests for disclosure, correction, deletion, etc."),children:e.jsxs(a,{variant:"body2",sx:{color:vt.textSecondary,lineHeight:1.8},children:[t(`保有個人データの開示、訂正、削除、利用停止等のご依頼は、${Z.contactEmail}`,`To request disclosure, correction, deletion, or suspension of use of your retained personal data, contact ${Z.contactEmail}`),t("までご連絡ください。本人確認のうえ、法令に従って対応します。",". We will verify your identity and respond as required by law.")]})})]})}const Ct=Te;function jt({title:o,children:t}){return e.jsxs(J,{elevation:0,sx:{p:3,borderRadius:2,border:`1px solid ${Ct.borderGray}`},children:[e.jsx(a,{variant:"h6",sx:{fontWeight:700,color:Ct.squidInk,mb:1.5},children:o}),t]})}function Es(){const{siteLocale:o}=de(),t=(s,n)=>o==="en"?n:s;return e.jsxs(Pn,{title:t("特定商取引法に基づく表記","Notation based on the Act on Specified Commercial Transactions (Tokutei Shotorihiki Ho)"),subtitle:t("事業者情報、販売価格、支払方法、提供時期、解約・返金条件を掲載しています。","This page sets out business operator information, sale prices, payment methods, timing of provision, and cancellation and refund conditions."),children:[mt.length>0&&e.jsx(Oe,{severity:"warning",children:t(`リリース前に以下の項目を実値へ差し替えてください: ${mt.map(s=>t(s.ja,s.en)).join("、")}`,`Replace these fields with real values before release: ${mt.map(s=>t(s.ja,s.en)).join("、")}`)}),e.jsx(jt,{title:t("1. 事業者情報","1. Business information"),children:e.jsxs(Ee,{dense:!0,disablePadding:!0,children:[e.jsx(le,{disableGutters:!0,children:e.jsx(oe,{primary:t("サービス名","Service name"),secondary:t(Z.serviceName.ja,Z.serviceName.en)})}),e.jsx(le,{disableGutters:!0,children:e.jsx(oe,{primary:t("事業者名","Business operator name"),secondary:t(Z.operatorName.ja,Z.operatorName.en)})}),e.jsx(le,{disableGutters:!0,children:e.jsx(oe,{primary:t("住所","Address"),secondary:t(Z.businessAddress.ja,Z.businessAddress.en)})}),e.jsx(le,{disableGutters:!0,children:e.jsx(oe,{primary:t("メールアドレス","Email address"),secondary:Z.contactEmail})}),e.jsx(le,{disableGutters:!0,children:e.jsx(oe,{primary:t("電話番号","Telephone number"),secondary:t(Z.phoneNumber.ja,Z.phoneNumber.en)})})]})}),e.jsx(jt,{title:t("2. 販売価格・支払方法","2. Sale price and payment method"),children:e.jsxs(Ee,{dense:!0,disablePadding:!0,children:[e.jsx(le,{disableGutters:!0,children:e.jsx(oe,{primary:t("販売価格","Sales price"),secondary:t(Z.priceDisplay.ja,Z.priceDisplay.en)})}),e.jsx(le,{disableGutters:!0,children:e.jsx(oe,{primary:t("支払方法","Payment method"),secondary:t(Z.paymentMethods.ja,Z.paymentMethods.en)})})]})}),e.jsx(jt,{title:t("3. サービス提供時期","3. Timing of service provision"),children:e.jsx(a,{variant:"body2",sx:{color:Ct.textSecondary,lineHeight:1.8},children:t(Z.serviceStartTiming.ja,Z.serviceStartTiming.en)})}),e.jsx(jt,{title:t("4. 解約・返金","4. Cancellation and refunds"),children:e.jsxs(a,{variant:"body2",sx:{color:Ct.textSecondary,lineHeight:1.8},children:[t(Z.cancellationPolicy.ja,Z.cancellationPolicy.en)," ",t(Z.refundPolicy.ja,Z.refundPolicy.en)]})}),e.jsxs(jt,{title:t("5. 著作権・権利侵害に関する連絡先","5. Contact for copyright and rights infringement matters"),children:[e.jsxs(a,{variant:"body2",sx:{color:Ct.textSecondary,lineHeight:1.8,mb:1.5},children:[t("権利侵害、DMCA 相当の申告、商標・著作権に関するお問い合わせは","For infringement claims, DMCA-equivalent notices, and trademark or copyright inquiries, contact"),` ${t(Z.abuseContactEmail.ja,Z.abuseContactEmail.en)} `,t("までご連絡ください。"," for assistance.")]}),e.jsx(Ee,{dense:!0,disablePadding:!0,children:$r.map(s=>e.jsx(le,{disableGutters:!0,children:e.jsx(oe,{primary:t(s.ja,s.en)})},s.ja))})]})]})}function Rs(){return e.jsx(Fo,{children:e.jsx($o,{children:e.jsx(Ro,{children:e.jsx(_o,{children:e.jsx(zo,{children:e.jsxs(Or,{children:[e.jsx(fe,{index:!0,element:e.jsx(Yo,{})}),e.jsx(fe,{path:"select",element:e.jsx(Qo,{})}),e.jsx(fe,{path:"login",element:e.jsx(Xo,{})}),e.jsx(fe,{path:"register",element:e.jsx(es,{})}),e.jsx(fe,{path:"forgot-password",element:e.jsx(ts,{})}),e.jsx(fe,{path:"terms",element:e.jsx(ws,{})}),e.jsx(fe,{path:"privacy",element:e.jsx(As,{})}),e.jsx(fe,{path:"legal",element:e.jsx(Es,{})}),e.jsx(fe,{path:"menu",element:e.jsx(os,{})}),e.jsx(fe,{path:"practice",element:e.jsx(an,{})}),e.jsx(fe,{path:"training-problem/:id",element:e.jsx(Yn,{})}),e.jsx(fe,{path:"training-problem/:id/explanation",element:e.jsx(Jn,{})}),e.jsx(fe,{path:"practice/result",element:e.jsx(ds,{})}),e.jsx(fe,{path:"mock",element:e.jsx(ps,{})}),e.jsx(fe,{path:"mock-problem/:id",element:e.jsx(js,{})}),e.jsx(fe,{path:"mock-problem/:id/explanation",element:e.jsx(Jn,{})}),e.jsx(fe,{path:"mock-exam/result",element:e.jsx(ys,{})}),e.jsx(fe,{path:"review",element:e.jsx(xs,{})}),e.jsx(fe,{path:"review-problem",element:e.jsx(fs,{})}),e.jsx(fe,{path:"settings",element:e.jsx(ks,{})}),e.jsx(fe,{path:"admin",element:e.jsx(vs,{})}),e.jsx(fe,{path:"questions",element:e.jsx(an,{})}),e.jsx(fe,{path:"questions/:id",element:e.jsx(Yn,{})}),e.jsx(fe,{path:"category/:name",element:e.jsx(an,{})})]})})})})})})}export{Rs 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.