PageSourceSearch

https://shuraba-app.web.app/assets/DonatePage-DCS2LsON.js

js shuraba-app.web.app collected 2026-10-03 12:37:13 UTC 13,516 bytes, 1 lines download raw bytes

1import{ah as T,r as d,a9 as c,j as e,Z as P,L as u,bC as _,Y as $,cW as D,ao as O,aN as M,cX as L}from"./index-DUpygkxg.js";import{P as h,a as g}from"./PublicFooter-DwTwHaFk.js";import{f as b}from"./formatters-QZX43yAa.js";import{u as R}from"./useEmbedMode-92wb7Dgi.js";import{H as U}from"./heart-Ci4mEWdb.js";import{S as B}from"./sparkles-BnDh6Tmo.js";import{T as F}from"./tree-pine-Cck8_HDH.js";import{C as H}from"./credit-card-BOVuKcP8.js";import{C as q}from"./chevron-right-DTgMSD5b.js";import"./firebase-eOymXQZD.js";import"./map-pin-ymTilxsA.js";const X=[{icon:B,title:"子どもの自然体験",desc:"火おこし・川遊び・炭焼きなど、五感を使った体験プログラムの運営費"},{icon:F,title:"里山整備・生態系再生",desc:"竹林整備・広葉樹植樹・ビオトープ造成・河川保全の道具・材料費"},{icon:$,title:"ボランティア・運営",desc:"活動を支えるスタッフの旅費・保険・通信費等の運営費"}],S="mie_donation_last_submit";function te(){const[p]=T(),C=p.get("success")==="true",k=p.get("canceled")==="true",r=R(),[f,E]=d.useState(3e3),[x,j]=d.useState(!1),[N,A]=d.useState(""),[t,o]=d.useState({donorName:"",donorEmail:"",address:"",comment:"",isAnonymous:!1}),[y,v]=d.useState(!1),[w,a]=d.useState(null);d.useEffect(()=>{window.scrollTo(0,0),document.title=`寄付する | ${c.nameShort}`},[]);const l=x?Number(N.replace(/,/g,""))||0:f,I=async s=>{s.preventDefault(),a(null);const i=t.donorName.trim(),m=t.donorEmail.trim();if(!i||!m){a("お名前とメールアドレスは必須です");return}if(i.length>100){a("名前は100文字以内で入力してください");return}if(!/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(m)||m.length>254){a("有効なメールアドレスを入力してください");return}if(!Number.isFinite(l)||l<100||l>1e6){a("金額は100円以上1,000,000円以下で指定してください");return}if(t.address&&t.address.length>200){a("住所は200文字以内で入力してください");return}if(t.comment&&t.comment.length>1e3){a("コメントは1000文字以内で入力してください");return}try{const n=Number(localStorage.getItem(S)||"0");if(n&&Date.now()-n<20*1e3){a("連続送信はできません。しばらく待ってから再度お試しください。");return}}catch{}v(!0);try{const{url:n}=await L({donorName:i,donorEmail:m,amount:Math.floor(l),address:t.address.trim()||void 0,comment:t.comment.trim()||void 0,isAnonymous:t.isAnonymous});try{localStorage.setItem(S,String(Date.now()))}catch{}window.location.href=n}catch(n){a(n instanceof Error?n.message:"決済ページの作成に失敗しました"),v(!1)}};return C?e.jsxs("div",{className:r?"bg-transparent":"min-h-screen bg-white",children:[!r&&e.jsx(h,{}),e.jsx("div",{className:`max-w-2xl mx-auto px-4 ${r?"py-6":"py-20"}`,children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-sm border border-gray-100 p-8 md:p-12 text-center",children:[e.jsx("div",{className:"w-16 h-16 bg-emerald-100 rounded-full flex items-center justify-center mx-auto mb-6",children:e.jsx(P,{className:"w-8 h-8 text-emerald-600"})}),e.jsx("h1",{className:"text-2xl md:text-3xl font-bold text-gray-900 mb-3",children:"ご寄付ありがとうございます"}),e.jsxs("p",{className:"text-gray-600 mb-6 leading-relaxed",children:["お支払いが完了しました。",e.jsx("br",{}),"いただいた寄付は、",c.vision.tagline,"ために大切に使わせていただきます。",e.jsx("br",{}),"後日、お礼のメールをお送りいたします。"]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-center",children:[e.jsx(u,{to:"/home",className:"px-5 py-2.5 rounded-xl bg-emerald-600 text-white text-sm font-medium hover:bg-emerald-500",children:"ホームへ戻る"}),e.jsx(u,{to:"/transparency",className:"px-5 py-2.5 rounded-xl border border-gray-200 text-sm font-medium hover:bg-gray-50",children:"財務状況を見る"})]})]})}),!r&&e.jsx(g,{})]}):k?e.jsxs("div",{className:r?"bg-transparent":"min-h-screen bg-white",children:[!r&&e.jsx(h,{}),e.jsx("div",{className:`max-w-2xl mx-auto px-4 ${r?"py-6":"py-20"}`,children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-sm border border-gray-100 p-8 md:p-12 text-center",children:[e.jsx("div",{className:"w-16 h-16 bg-amber-100 rounded-full flex items-center justify-center mx-auto mb-6",children:e.jsx(_,{className:"w-8 h-8 text-amber-600"})}),e.jsx("h1",{className:"text-2xl md:text-3xl font-bold text-gray-900 mb-3",children:"お支払いがキャンセルされました"}),e.jsx("p",{className:"text-gray-600 mb-6",children:"もう一度お試しいただくか、銀行振込でもご支援いただけます。"}),e.jsx(u,{to:"/donate",className:"inline-block px-5 py-2.5 rounded-xl bg-emerald-600 text-white text-sm font-medium hover:bg-emerald-500",children:"寄付ページに戻る"})]})}),!r&&e.jsx(g,{})]}):e.jsxs("div",{className:r?"bg-transparent":"min-h-screen bg-white",children:[!r&&e.jsx(h,{}),!r&&e.jsxs("section",{className:"relative overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-emerald-50 via-white to-rose-50"}),e.jsxs("div",{className:"relative max-w-4xl mx-auto px-4 py-16 md:py-20 text-center animate-page-enter",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full bg-white/70 border border-emerald-100 text-xs text-emerald-700 font-medium mb-5 shadow-sm",children:[e.jsx(U,{className:"w-3.5 h-3.5"}),"活動を応援する"]}),e.jsxs("h1",{className:"text-3xl md:text-5xl font-bold text-gray-900 mb-5 leading-tight",children:["あなたの寄付が、",e.jsx("br",{}),e.jsx("span",{className:"bg-gradient-to-r from-emerald-600 to-teal-600 bg-clip-text text-transparent",children:"里山の未来をつくります。"})]}),e.jsx("p",{className:"text-base md:text-lg text-gray-600 max-w-2xl mx-auto leading-relaxed",children:"ノンビリムラでの自然体験・里山整備・子どもの学びの場を、 継続的に運営していくために。ご支援をお願いいたします。"})]})]}),!r&&e.jsx("section",{className:"py-12 bg-white",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-4",children:[e.jsx("h2",{className:"text-lg font-bold text-gray-900 mb-6 text-center",children:"寄付の使い道"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:X.map((s,i)=>{const m=s.icon;return e.jsxs("div",{className:"p-5 rounded-2xl border border-gray-100 bg-gradient-to-br from-white to-gray-50 animate-card-up",style:{"--delay":`${i*80}ms`},children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-emerald-100 flex items-center justify-center mb-3",children:e.jsx(m,{className:"w-5 h-5 text-emerald-700"})}),e.jsx("h3",{className:"font-semibold text-gray-900 mb-1 text-sm",children:s.title}),e.jsx("p",{className:"text-xs text-gray-600 leading-relaxed",children:s.desc})]},s.title)})})]})}),e.jsx("section",{className:r?"py-4":"py-12 bg-gradient-to-b from-white to-emerald-50/30",children:e.jsxs("div",{className:"max-w-3xl mx-auto px-4",children:[e.jsxs("form",{onSubmit:I,className:"bg-white rounded-2xl shadow-sm border border-gray-100 p-6 md:p-10",children:[e.jsx("h2",{className:"text-xl md:text-2xl font-bold text-gray-900 mb-6",children:"寄付フォーム"}),e.jsxs("div",{className:"mb-8",children:[e.jsx("label",{className:"block text-sm font-semibold text-gray-700 mb-3",children:"寄付金額"}
1),e.jsx("div",{className:"grid grid-cols-3 md:grid-cols-5 gap-2",children:D.map(s=>e.jsx("button",{type:"button",onClick:()=>{E(s),j(!1)},className:`px-3 py-3 rounded-xl border-2 text-sm font-semibold transition-all ${!x&&f===s?"border-emerald-500 bg-emerald-50 text-emerald-700 ring-1 ring-emerald-200":"border-gray-200 bg-white text-gray-700 hover:border-gray-300"}`,children:b(s)},s))}),e.jsxs("div",{className:"mt-3 flex items-center gap-3",children:[e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:x,onChange:s=>j(s.target.checked),className:"w-4 h-4 rounded text-emerald-600 focus:ring-emerald-500"}),e.jsx("span",{className:"text-sm text-gray-700",children:"自由な金額を指定"})]}),x&&e.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[e.jsx("span",{className:"text-sm text-gray-500",children:"Â¥"}),e.jsx("input",{type:"text",inputMode:"numeric",placeholder:"例: 2000",value:N,onChange:s=>A(s.target.value.replace(/[^\d]/g,"")),className:"flex-1 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500 outline-none"})]})]}),e.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"※100円以上 1,000,000円以下"})]}),e.jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["お名前 ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{required:!0,className:"w-full border border-gray-300 rounded-lg px-3 py-2.5 text-sm focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500 outline-none",placeholder:"山田 太郎",value:t.donorName,onChange:s=>o({...t,donorName:s.target.value})})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["メールアドレス ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{required:!0,type:"email",className:"w-full border border-gray-300 rounded-lg px-3 py-2.5 text-sm focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500 outline-none",placeholder:"[email protected]",value:t.donorEmail,onChange:s=>o({...t,donorEmail:s.target.value})})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"住所(任意)"}),e.jsx("input",{className:"w-full border border-gray-300 rounded-lg px-3 py-2.5 text-sm focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500 outline-none",placeholder:"福岡県福岡市...",value:t.address,onChange:s=>o({...t,address:s.target.value})}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"税控除証明書等を郵送する場合にご記入ください"})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"応援コメント(任意)"}),e.jsx("textarea",{rows:3,maxLength:1e3,className:"w-full border border-gray-300 rounded-lg px-3 py-2.5 text-sm focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500 outline-none resize-none",placeholder:"応援メッセージをお聞かせください",value:t.comment,onChange:s=>o({...t,comment:s.target.value})})]}),e.jsx("div",{className:"md:col-span-2",children:e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:t.isAnonymous,onChange:s=>o({...t,isAnonymous:s.target.checked}),className:"w-4 h-4 rounded text-emerald-600 focus:ring-emerald-500"}),e.jsx("span",{className:"text-sm text-gray-700",children:"匿名の寄付として扱う(公開時にお名前を伏せます)"})]})})]}),e.jsxs("div",{className:"mb-6 p-4 rounded-xl bg-emerald-50/50 border border-emerald-100 flex gap-3",children:[e.jsx(O,{className:"w-5 h-5 text-emerald-600 flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-xs text-emerald-800 leading-relaxed",children:[e.jsx("p",{className:"font-semibold mb-1",children:"税控除について"}),e.jsxs("p",{children:["NPO法人への寄付は、一定の要件を満たす場合に寄附金控除(所得税)の対象となります。 証明書が必要な方は、寄付後に ",e.jsx("span",{className:"font-medium",children:"事務局"})," までお問い合わせください。"]})]})]}),e.jsx("div",{className:"mb-6 p-4 rounded-xl bg-gray-50 border border-gray-100",children:e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-sm text-gray-600",children:"寄付金額"}),e.jsx("span",{className:"text-2xl font-bold text-gray-900",children:b(l)})]})}),w&&e.jsx("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-lg text-sm text-red-700",children:w}),e.jsxs("button",{type:"submit",disabled:y||l<100,className:"w-full flex items-center justify-center gap-2 px-6 py-3.5 bg-emerald-600 hover:bg-emerald-500 text-white font-semibold rounded-xl transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[e.jsx(H,{className:"w-5 h-5"}),y?"決済ページを準備中...":`${b(l)} を寄付する`]}),e.jsx("div",{className:"mt-6 pt-6 border-t border-gray-100",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(M,{className:"w-4 h-4 text-gray-400 mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"text-xs text-gray-600 leading-relaxed",children:[e.jsx("span",{className:"font-semibold text-gray-700",children:"銀行振込でのご支援も可能です"}),e.jsx("br",{}),c.bankInfo.bankName," / ",c.bankInfo.accountType," / 口座名義: ",c.bankInfo.accountHolder,e.jsx("br",{}),"お振込後、","事務局","までご連絡ください。"]})]})})]}),e.jsx("div",{className:"mt-6 text-center",children:e.jsxs(u,{to:"/trans
1parency",className:"inline-flex items-center gap-1 text-sm text-emerald-700 hover:text-emerald-600 font-medium",children:["いただいた寄付の使い道を確認する",e.jsx(q,{className:"w-4 h-4"})]})})]})}),e.jsx(g,{})]})}export{te 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.