PageSourceSearch

https://xynergy.ai/_next/static/chunks/app/sponsor/page-5ea2b65156d44efe.js

js xynergy.ai collected 2026-10-05 16:01:20 UTC 43,520 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1255,7014],{866:(e,t,r)=>{"use strict";r.d(t,{p:()=>o});var s=r(85047),a=r(31615),i=r(34961);let o=a.forwardRef(({className:e,type:t,...r},a)=>(0,s.jsx)("input",{type:t,className:(0,i.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm font-normal shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...r}));o.displayName="Input"},2962:(e,t,r)=>{"use strict";r.d(t,{A0:()=>n,BF:()=>l,Gg:()=>d,Hj:()=>c,XI:()=>o,nA:()=>u,nd:()=>m});var s=r(85047),a=r(31615),i=r(34961);let o=a.forwardRef(({className:e,...t},r)=>(0,s.jsx)("div",{className:"relative w-full overflow-auto",children:(0,s.jsx)("table",{ref:r,className:(0,i.cn)("w-full caption-bottom text-sm",e),...t})}));o.displayName="Table";let n=a.forwardRef(({className:e,...t},r)=>(0,s.jsx)("thead",{ref:r,className:(0,i.cn)("[&_tr]:border-b",e),...t}));n.displayName="TableHeader";let l=a.forwardRef(({className:e,...t},r)=>(0,s.jsx)("tbody",{ref:r,className:(0,i.cn)("[&_tr:last-child]:border-0",e),...t}));l.displayName="TableBody";let d=a.forwardRef(({className:e,...t},r)=>(0,s.jsx)("tfoot",{ref:r,className:(0,i.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));d.displayName="TableFooter";let c=a.forwardRef(({className:e,...t},r)=>(0,s.jsx)("tr",{ref:r,className:(0,i.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));c.displayName="TableRow";let m=a.forwardRef(({className:e,...t},r)=>(0,s.jsx)("th",{ref:r,className:(0,i.cn)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));m.displayName="TableHead";let u=a.forwardRef(({className:e,...t},r)=>(0,s.jsx)("td",{ref:r,className:(0,i.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));u.displayName="TableCell",a.forwardRef(({className:e,...t},r)=>(0,s.jsx)("caption",{ref:r,className:(0,i.cn)("mt-4 text-sm text-muted-foreground",e),...t})).displayName="TableCaption"},4153:(e,t,r)=>{"use strict";let s;r.d(t,{Bm:()=>i,Wm:()=>o,_K:()=>a});let a={firebase:{apiKey:"AIzaSyB_r1_v5qmFmrnzJkpTZL3ryRWtSfDHD3E",authDomain:(s="finance-app-263bf",`${s}.firebaseapp.com`),projectId:"finance-app-263bf",storageBucket:"finance-app-263bf.firebasestorage.app",messagingSenderId:"307877483016",appId:"1:307877483016:web:9287c046d1c533e254f7bd",measurementId:"G-S5B380JDF7"},app:{url:"https://xynergy.ai",name:"鑫世紀理財",description:"專業的個人財務管理平台"},api:{baseUrl:r(32407).env.NEXT_PUBLIC_API_URL||"/api"},analytics:{googleAnalyticsId:"G-S5B380JDF7"},nodeEnv:"production",isDevelopment:!1,isProduction:!0},i={paymentDisabled:!1,minCustomAmount:200,presetAmounts:[200,600,800,1200],costBreakdown:{lastUpdated:"2026-05-30",updateCadence:"每月更新",items:[{id:"gcp",label:"GCP",description:"Firebase、App Hosting、Cloud Functions、Firestore",defaultBillingPeriod:"monthly"},{id:"cursor",label:"Cursor",description:"IDE 訂閱",defaultBillingPeriod:"monthly"},{id:"claude-code",label:"Claude Code",description:"AI 輔助開發",defaultBillingPeriod:"monthly"},{id:"gemini",label:"Gemini",description:"AI API 用量",defaultBillingPeriod:"monthly"},{id:"developer",label:"開發者",description:"人力成本分攤",defaultBillingPeriod:"monthly"},{id:"domain",label:"域名",description:"xynergy.ai 等",defaultBillingPeriod:"yearly"},{id:"payment",label:"金流",description:"ECPay 手續費(隨贊助收入變動)",defaultBillingPeriod:"monthly"}]}},o={globalEnabled:!1,aiAssistantV2:{enabled:!1,label:"AI 助理 2.0"},advancedReports:{enabled:!1,label:"進階報表 Beta"}}},6386:(e,t,r)=>{"use strict";r.d(t,{Xi:()=>d,av:()=>c,j7:()=>l,tU:()=>n});var s=r(85047),a=r(31615),i=r(27997),o=r(34961);let n=i.bL,l=a.forwardRef(({className:e,...t},r)=>{let n=a.useRef(null),{indicator:l,mounted:d}=function(e){let[t,r]=a.useState({left:0,width:0,top:0,height:0}),[s,i]=a.useState(!1),o=a.useCallback(()=>{let t=e.current;if(!t)return;let s=t.querySelector("[data-state=active]");s&&r({left:s.offsetLeft,width:s.offsetWidth,top:s.offsetTop,height:s.offsetHeight}),i(!0)},[e]);return a.useLayoutEffect(()=>{o();let t=e.current;if(!t)return;let r=new MutationObserver(o);r.observe(t,{subtree:!0,attributes:!0,attributeFilter:["data-state"]});let s=new ResizeObserver(o);return s.observe(t),()=>{r.disconnect(),s.disconnect()}},[e,o]),{indicator:t,mounted:s}}(n);return a.useEffect(()=>{let e=n.current;if(!e)return;let t=!1,r=!1,s=0,a=0,i=()=>e.scrollWidth>e.clientWidth+1,o=()=>{e.style.cursor=i()?"grab":""},l=i=>{if(!t)return;let o=i.clientX-s;!r&&Math.abs(o)>5&&(r=!0,e.style.cursor="grabbing",e.style.userSelect="none"),r&&(e.scrollLeft=a-o,i.preventDefault())},d=()=>
1{if(window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",d),r){let t=e=>{e.stopPropagation(),e.preventDefault()};e.addEventListener("click",t,{capture:!0,once:!0}),window.setTimeout(()=>e.removeEventListener("click",t,!0),0)}t=!1,r=!1,e.style.userSelect="",o()},c=o=>{0===o.button&&i()&&(t=!0,r=!1,s=o.clientX,a=e.scrollLeft,window.addEventListener("pointermove",l),window.addEventListener("pointerup",d))},m=t=>{i()&&0!==t.deltaY&&(e.scrollLeft+=t.deltaY,t.preventDefault())};o();let u=new ResizeObserver(o);return u.observe(e),e.addEventListener("pointerdown",c),e.addEventListener("wheel",m,{passive:!1}),()=>{u.disconnect(),e.removeEventListener("pointerdown",c),e.removeEventListener("wheel",m),window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",d)}},[n]),(0,s.jsxs)(i.B8,{ref:e=>{n.current=e,"function"==typeof r?r(e):r&&(r.current=e)},className:(0,o.cn)("relative inline-flex h-10 items-center justify-start rounded-md bg-transparent p-1 text-muted-foreground w-full overflow-x-auto scrollbar-hide",e),...t,children:[(0,s.jsx)("span",{"aria-hidden":!0,className:(0,o.cn)("absolute rounded-md bg-muted shadow-sm pointer-events-none",d&&"opacity-100 transition-[left,width,top,height] ease-in-out",!d&&"opacity-0"),style:{left:l.left,width:l.width,top:l.top,height:l.height,transitionDuration:d?"500ms":void 0}}),t.children]})});l.displayName=i.B8.displayName;let d=a.forwardRef(({className:e,...t},r)=>(0,s.jsx)(i.l9,{ref:r,className:(0,o.cn)("relative z-[1] inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=inactive]:hover:text-foreground/80 data-[state=active]:text-foreground","data-[state=inactive]:hover:bg-muted/30 data-[state=inactive]:hover:rounded-md",e),...t}));d.displayName=i.l9.displayName;let c=a.forwardRef(({className:e,...t},r)=>(0,s.jsx)(i.UC,{ref:r,className:(0,o.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));c.displayName=i.UC.displayName},6524:(e,t,r)=>{"use strict";r.d(t,{$m:()=>c,As:()=>d,nD:()=>l,ub:()=>m});var s=r(85047),a=r(31615),i=r(40212),o=r(26345),n=r(34961);let l=i.bL,d=a.forwardRef(({className:e,...t},r)=>(0,s.jsx)(i.q7,{ref:r,className:(0,n.cn)("border-b",e),...t}));d.displayName="AccordionItem";let c=a.forwardRef(({className:e,children:t,...r},a)=>(0,s.jsx)(i.Y9,{className:"flex",children:(0,s.jsxs)(i.l9,{ref:a,className:(0,n.cn)("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...r,children:[t,(0,s.jsx)(o.A,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));c.displayName=i.l9.displayName;let m=a.forwardRef(({className:e,children:t,...r},a)=>(0,s.jsx)(i.UC,{ref:a,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...r,children:(0,s.jsx)("div",{className:(0,n.cn)("pb-4 pt-0",e),children:t})}));m.displayName=i.UC.displayName},8180:(e,t,r)=>{"use strict";r.d(t,{dE:()=>V,L4:()=>Y,tp:()=>E,yO:()=>H,Pl:()=>v,nh:()=>k,nH:()=>C});var s=r(85047),a=r(31615),i=r(26052),o=r.n(i),n=r(21410),l=r(866),d=r(96968),c=r(62557),m=r(6386),u=r(82520),p=r(11787),f=r(41178),h=r(73521),x=r(46377),g=r(4153),b=r(83298),y=r(34961);let j=g.Bm.presetAmounts;function v(){let{user:e}=(0,h.A)(),t=(0,x.useRouter)(),{toast:r}=(0,f.dj)(),{loading:i,createSponsorship:y}=(0,b.i)(),[j,v]=(0,a.useState)("onetime"),[w,_]=(0,a.useState)(600),[L,T]=(0,a.useState)(""),[A,k]=(0,a.useState)(!1),[C,B]=(0,a.useState)(!1),[S,E]=(0,a.useState)(""),[F,I]=(0,a.useState)(""),R=g.Bm.paymentDisabled,O=g.Bm.minCustomAmount,$=()=>{if(A){let e=parseInt(L,10);return Number.isFinite(e)?e:0}return w},Y=async()=>{if(R)return;if(!e)return void t.push(`/auth?redirect=${encodeURIComponent("/sponsor")}`);let s=$();if(s<O)return void r({variant:"destructive",title:"金額不足",description:`最低贊助金額為 NT$${O}`});if(C&&!S.trim())return void r({variant:"destructive",title:"請填寫顯示名稱",description:"選擇顯示於贊助牆時需填寫名稱"});try{await y({type:j,amount:s,displayOnWall:C,displayName:S.trim()||void 0,message:F.trim()||void 0})}catch(e){r({variant:"destructive",title:"贊助失敗",description:e instanceof Error?e.message:"請稍後再試"})}};return(0,s.jsxs)(u.Zp,{id:"sponsor-panel",className:"border-primary/20 shadow-lg",children:[(0,s.jsxs)(u.aR,{children:[(0,s.jsx)(u.ZB,{children:"支持我們"}),(0,s.jsx)(u.BT,{children:"選擇一次性或每月贊助,幫助平台持續運營。所有個人功能已免費開放,贊助純為支持營運。"})]}),(0,s.jsxs)(u.Wu,{className:"space-y-6",children:[(0,s.jsxs)(m.tU,{value:j,onValueChange:e=>v(e),children:[(0,s.jsxs)(m.j7,{className:"grid w-full grid-cols-2",children:[(0,s.jsx)(m.Xi,{value:"onetime",children:"一次性"}),(0,s.jsx)(m.Xi,{value:"monthly",children:"每月"})]}),(0,s.jsx)(m.av,{value:"onetime",className:"mt-4 space-y-4",children:(0,s.jsx)(N,{selectedAmount:w,setSelectedAmount:_,customAmount:L,setCustomAmount:T,useCustom:A,setUseCustom:k,minAmount:O})}),(0,s.jsx)(m.av,{value:"monthly",className:"mt-4 space-y-4",children:(0,s.jsx)(N,{selectedAmount:w,setSelectedAmount:_,customAmount:L,setCustomAmount:T,useCustom:A,setUseCustom:k,minAmount:O})})]}),(0,s.jsxs)("div",{className:"space-y-3 rounded-lg border p-4 bg-muted/30",children:[(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)(c.S,{id:"displayOnWall",checked:C,onCheckedChange:e=>B(!0===e)}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)(d.J,{htmlFor:"displayOnWall",className:"cursor-pointer",children:"願意顯示於贊助牆(可選)"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"勾選後可填寫公開顯示名稱與留言"})]})]}),C&&(0,s.jsxs)("div",{className:"space-y-3 pt-2",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(d.J,{htmlFor:"displayName",children:"顯示名稱"}),(0,s.jsx)(l.p,{id:"displayName",value:S,onChange:e=>E(e.target.value),placeholder:"您希望公開顯示的名稱",maxLength:50})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(d.J,{htmlFor:"message",children:"留言(
1選填)"}),(0,s.jsx)(l.p,{id:"message",value:F,onChange:e=>I(e.target.value),placeholder:"給團隊的一句話",maxLength:200})]})]})]}),R?(0,s.jsxs)("div",{className:"rounded-lg border border-dashed border-yellow-500/50 bg-yellow-500/5 p-4 text-center",children:[(0,s.jsx)("p",{className:"font-medium text-yellow-700 dark:text-yellow-400",children:"贊助功能即將開放"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"我們正在準備金流整合,敬請期待"})]}):(0,s.jsxs)(n.$,{className:"w-full",size:"lg",onClick:Y,disabled:i,children:[i&&(0,s.jsx)(p.A,{className:"mr-2 h-4 w-4 animate-spin"}),e?`前往付款 NT$${$().toLocaleString()}`:"登入後贊助"]}),!e&&!R&&(0,s.jsxs)("p",{className:"text-center text-sm text-muted-foreground",children:["尚未登入?"," ",(0,s.jsx)(o(),{href:`/auth?redirect=${encodeURIComponent("/sponsor")}`,className:"text-primary underline",children:"立即登入"})]})]})]})}function N({selectedAmount:e,setSelectedAmount:t,customAmount:r,setCustomAmount:a,useCustom:i,setUseCustom:o,minAmount:m}){return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2",children:j.map(r=>(0,s.jsxs)(n.$,{type:"button",variant:i||e!==r?"outline":"default",className:(0,y.cn)("h-12 text-base font-semibold"),onClick:()=>{o(!1),t(r)},children:["NT$",r]},r))}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(c.S,{id:"useCustom",checked:i,onCheckedChange:e=>o(!0===e)}),(0,s.jsxs)(d.J,{htmlFor:"useCustom",className:"shrink-0 cursor-pointer",children:["自訂金額(最低 NT$",m,")"]}),(0,s.jsx)(l.p,{type:"number",min:m,step:1,value:r,onChange:e=>{o(!0),a(e.target.value)},placeholder:String(m),className:"max-w-[140px]"})]})]})}var w=r(35617),_=r(9),L=r(51577),T=r(26364),A=r(18654);function k(){let{stats:e,loading:t}=function(){let[e,t]=(0,a.useState)(null),[r,s]=(0,a.useState)(!0);return(0,a.useEffect)(()=>{let e=!1;return(async()=>{try{let r=await fetch("/api/sponsor/stats");if(!r.ok)throw Error("fetch failed");let s=await r.json();e||t(s)}catch(r){(0,A.vV)("useSponsorStats failed:",r),e||t({totalAmount:0,sponsorCount:0,activeMonthlyCount:0})}finally{e||s(!1)}})(),()=>{e=!0}},[]),{stats:e,loading:r}}();if(t)return(0,s.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4 animate-pulse",children:[1,2,3].map(e=>(0,s.jsx)("div",{className:"h-24 rounded-xl bg-muted"},e))});let r=[{icon:_.A,label:"累計贊助",value:(0,w.C)(e?.totalAmount??0,{showSymbol:!0})},{icon:L.A,label:"贊助者",value:String(e?.sponsorCount??0)},{icon:T.A,label:"每月定期",value:String(e?.activeMonthlyCount??0)}];return(0,s.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:r.map(({icon:e,label:t,value:r})=>(0,s.jsxs)("div",{className:"rounded-xl border bg-card p-6 text-center shadow-sm",children:[(0,s.jsx)(e,{className:"mx-auto h-8 w-8 text-primary mb-2"}),(0,s.jsx)("p",{className:"text-2xl font-bold",children:r}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:t})]},t))})}function C(){let e=Array.from({length:8},(e,t)=>({id:`placeholder-${t}`,name:"贊助者"}));return(0,s.jsxs)("section",{className:"space-y-4",children:[(0,s.jsx)("h2",{className:"text-2xl font-bold text-center",children:"贊助牆"}),(0,s.jsx)("p",{className:"text-center text-muted-foreground text-sm",children:"感謝每一位支持我們的夥伴(完整贊助牆即將上線)"}),(0,s.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 max-h-[320px] overflow-y-auto",children:e.map(e=>(0,s.jsxs)("div",{className:"rounded-lg border border-dashed bg-muted/30 p-4 text-center text-sm text-muted-foreground",children:[(0,s.jsx)("div",{className:"w-10 h-10 rounded-full bg-primary/10 mx-auto mb-2"}),e.name]},e.id))})]})}var B=r(6524);let S=[{q:"贊助金額用在哪裡?",a:"我們公開每月營運成本表(GCP、AI 工具、域名、金流等),贊助收入用於支撐這些支出,使平台能持續免費提供個人理財功能。請見本頁「營運成本透明表」。"},{q:"贊助和訂閱有什麼不同?",a:"所有個人理財功能已免費開放。贊助是純粹支持平台營運,不會解鎖額外功能或權限。"},{q:"可以取消每月贊助嗎?",a:"可以。登入後前往「設定 → 贊助管理」,即可取消定期贊助。"},{q:"最低贊助金額是多少?",a:"一次性或每月贊助最低 NT$200,也可選擇 200 / 600 / 800 / 1200 等預設方案。"},{q:"贊助牆是什麼?",a:"若您勾選「願意顯示於贊助牆」,我們會在贊助頁公開您的顯示名稱與留言(可選)。"},{q:"付款安全嗎?",a:"付款由綠界 ECPay 處理,本平台不儲存您的信用卡資訊。"}];function E(){return(0,s.jsxs)("section",{className:"space-y-4",children:[(0,s.jsx)("h2",{className:"text-2xl font-bold text-center",children:"常見問題"}),(0,s.jsx)(B.nD,{type:"single",collapsible:!0,className:"w-full max-w-2xl mx-auto",children:S.map((e,t)=>(0,s.jsxs)(B.As,{value:`faq-${t}`,children:[(0,s.jsx)(B.$m,{children:e.q}),(0,s.jsx)(B.ub,{className:"text-muted-foreground",children:e.a})]},e.q))})]})}var F=r(2962),I=r(61414),R=r(54306),O=r(9234);function $(e){return null===e?"待填":(0,w.C)(e,{showSymbol:!0})}function Y(){var e;let{breakdown:t,loading:r}=function(){let[e,t]=(0,a.useState)(null),[r,s]=(0,a.useState)(!0);return(0,a.useEffect)(()=>{let e=!1;return(async()=>{try{let r=await fetch("/api/sponsor/cost-breakdown");if(!r.ok)throw Error("fetch failed");let s=await r.json();e||t(s)}catch(r){(0,A.vV)("useSponsorCostBreakdown failed:",r),e||t((0,O.sN)())}finally{e||s(!1)}})(),()=>{e=!0}},[]),{breakdown:e,loading:r}}();if(r||!t)return(0,s.jsx)("section",{id:"cost-breakdown",className:"scroll-mt-24 flex justify-center py-12",children:(0,s.jsx)(R.default,{})});let i=(e=t.items).some(e=>null===e.monthlyAmountTwd)?null:e.reduce((e,t)=>
1e+(t.monthlyAmountTwd??0),0);return(0,s.jsx)("section",{id:"cost-breakdown",className:"scroll-mt-24 space-y-4",children:(0,s.jsxs)(u.Zp,{className:"border-primary/15 shadow-sm",children:[(0,s.jsx)(u.aR,{className:"text-center sm:text-left",children:(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-3",children:[(0,s.jsx)("div",{className:"mx-auto sm:mx-0 flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10",children:(0,s.jsx)(I.A,{className:"h-5 w-5 text-primary","aria-hidden":!0})}),(0,s.jsxs)("div",{children:[(0,s.jsx)(u.ZB,{className:"text-2xl",children:"營運成本透明表"}),(0,s.jsxs)(u.BT,{className:"mt-1 max-w-2xl",children:["贊助收入用於支撐平台營運。以下為每月成本概估(年繳項目已換算月均),我們承諾",t.updateCadence,"並公開調整。"]})]})]})}),(0,s.jsxs)(u.Wu,{children:[(0,s.jsx)("div",{className:"rounded-lg border overflow-hidden",children:(0,s.jsxs)(F.XI,{children:[(0,s.jsx)(F.A0,{children:(0,s.jsxs)(F.Hj,{className:"bg-muted/40 hover:bg-muted/40",children:[(0,s.jsx)(F.nd,{className:"w-[120px] font-semibold",children:"項目"}),(0,s.jsx)(F.nd,{className:"font-semibold",children:"說明"}),(0,s.jsx)(F.nd,{className:"w-[140px] text-right font-semibold",children:"月均(NT$)"})]})}),(0,s.jsx)(F.BF,{children:t.items.map(e=>(0,s.jsxs)(F.Hj,{children:[(0,s.jsx)(F.nA,{className:"font-medium",children:e.label}),(0,s.jsx)(F.nA,{className:"text-muted-foreground",children:e.description}),(0,s.jsxs)(F.nA,{className:"text-right tabular-nums",children:[$(e.monthlyAmountTwd),"yearly"===e.billingPeriod&&null!==e.monthlyAmountTwd&&(0,s.jsxs)("p",{className:"text-xs text-muted-foreground font-normal",children:["年繳 ",$(e.amountTwd)," \xf7 12"]})]})]},e.id))}),(0,s.jsx)(F.Gg,{children:(0,s.jsxs)(F.Hj,{className:"bg-muted/30 hover:bg-muted/30",children:[(0,s.jsx)(F.nA,{colSpan:2,className:"font-semibold",children:"月合計"}),(0,s.jsx)(F.nA,{className:"text-right font-semibold tabular-nums",children:$(i)})]})})]})}),(0,s.jsxs)("p",{className:"mt-4 text-xs text-muted-foreground text-center sm:text-left",children:["最後更新:",t.lastUpdated.replace(/-/g,"/"),null===i?" \xb7 各項金額確認中":""]})]})]})})}var P=r(38187),D=r(32898),U=r(24571),W=r(76458),M=r(27703);let z={pending:"待付款",active:"進行中",completed:"已完成",cancelled:"已取消",failed:"失敗"};function H(){let{user:e}=(0,h.A)(),{toast:t}=(0,f.dj)(),{sponsorships:r,loading:i,refresh:l}=function(){let{user:e}=(0,h.A)(),[t,r]=(0,a.useState)([]),[s,i]=(0,a.useState)(!0),o=(0,a.useCallback)(async()=>{if(!e||!W.db){r([]),i(!1);return}i(!0);try{let t=(0,U.P)((0,U.rJ)(W.db,M.I.sponsorships),(0,U._M)("userId","==",e.uid)),s=(await (0,U.GG)(t)).docs.map(e=>({id:e.id,...e.data()})).sort((e,t)=>{let r=e.createdAt?.seconds??0;return(t.createdAt?.seconds??0)-r});r(s)}catch(e){(0,A.vV)("useUserSponsorships failed:",e),r([])}finally{i(!1)}},[e]);return(0,a.useEffect)(()=>{o()},[o]),{sponsorships:t,loading:s,refresh:o}}(),[d,c]=(0,a.useState)(null),m=async r=>{if(e){c(r);try{let s=await e.getIdToken(),a=await fetch("/api/sponsorship/cancel",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`},body:JSON.stringify({sponsorshipId:r})}),i=await a.json().catch(()=>({}));if(!a.ok)throw Error(i.error||"取消失敗");t({title:"已取消贊助"}),await l()}catch(e){t({variant:"destructive",title:"取消失敗",description:e instanceof Error?e.message:"請稍後再試"})}finally{c(null)}}};return i?(0,s.jsx)("div",{className:"flex justify-center py-12",children:(0,s.jsx)(p.A,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("h2",{className:"text-xl font-semibold flex items-center gap-2",children:[(0,s.jsx)(_.A,{className:"h-5 w-5 text-red-500"}),"贊助管理"]}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"查看您的贊助紀錄,或前往贊助頁支持我們"})]}),(0,s.jsx)(n.$,{asChild:!0,variant:"outline",children:(0,s.jsx)(o(),{href:"/sponsor",children:"前往贊助"})})]}),0===r.length?(0,s.jsx)(u.Zp,{children:(0,s.jsx)(u.Wu,{className:"py-10 text-center text-muted-foreground",children:"尚無贊助紀錄"})}):(0,s.jsx)("div",{className:"space-y-3",children:r.map(e=>(0,s.jsxs)(u.Zp,{children:[(0,s.jsxs)(u.aR,{className:"pb-2",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsxs)(u.ZB,{className:"text-base",children:["monthly"===e.type?"每月贊助":"一次性贊助"," ",(0,w.C)(e.amount,{showSymbol:!0})]}
1),(0,s.jsx)(P.E,{variant:"active"===e.status?"default":"secondary",children:z[e.status]??e.status})]}),(0,s.jsx)(u.BT,{children:e.merchantTradeNo?`訂單 ${e.merchantTradeNo.slice(0,12)}…`:""})]}),(0,s.jsxs)(u.Wu,{className:"space-y-3",children:["monthly"===e.type&&"active"===e.status&&e.renewalFailure&&(0,s.jsxs)("p",{className:"text-sm text-destructive",children:["最近一期扣款未成功(連續 ",e.renewalFailure.consecutiveFailures," 次)。若信用卡已更換或過期,請取消後重新設定每月贊助。"]}),"monthly"===e.type&&"active"===e.status&&(0,s.jsxs)(n.$,{variant:"outline",size:"sm",disabled:d===e.id,onClick:()=>m(e.id),children:[d===e.id?(0,s.jsx)(p.A,{className:"h-4 w-4 animate-spin mr-1"}):(0,s.jsx)(D.A,{className:"h-4 w-4 mr-1"}),"取消定期贊助"]})]})]},e.id))})]})}var G=r(25646);function V(){let{hasBetaAccess:e,loading:t}=function(){let{user:e}=(0,h.A)(),[t,r]=(0,a.useState)(!1),[s,i]=(0,a.useState)(!0);return(0,a.useEffect)(()=>{if(g.Wm.globalEnabled){r(!0),i(!1);return}if(!e||!W.db){r(!1),i(!1);return}let t=!1;return(async()=>{try{let s=(await (0,U.getDoc)((0,U.doc)(W.db,"users",e.uid))).data();t||r(s?.betaAccess===!0)}catch(e){(0,A.vV)("useBetaAccess failed:",e),t||r(!1)}finally{t||i(!1)}})(),()=>{t=!0}},[e]),{hasBetaAccess:t,loading:s}}();if(t)return null;let r=[g.Wm.aiAssistantV2,g.Wm.advancedReports].filter(e=>e.enabled);return(0,s.jsxs)(u.Zp,{className:"border-dashed",children:[(0,s.jsxs)(u.aR,{children:[(0,s.jsxs)(u.ZB,{className:"flex items-center gap-2 text-lg",children:[(0,s.jsx)(G.A,{className:"h-5 w-5"}),"Beta 功能",e&&(0,s.jsx)(P.E,{variant:"secondary",children:"已啟用"})]}),(0,s.jsx)(u.BT,{children:"搶先體驗實驗性功能。Beta 功能可能不穩定,隨時可能調整或移除。"})]}),(0,s.jsx)(u.Wu,{children:e?(0,s.jsxs)("ul",{className:"space-y-2 text-sm text-muted-foreground",children:[r.map(e=>(0,s.jsxs)("li",{children:["• ",e.label]},e.label)),0===r.length&&(0,s.jsx)("p",{children:"目前無開放中的 Beta 功能"})]}):(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Beta 功能尚未對您的帳號開放。贊助者可優先取得 Beta 資格(即將推出)。"})})]})}},9234:(e,t,r)=>{"use strict";r.d(t,{sN:()=>h,MV:()=>f});var s=r(4153),a=r(15418);let i=a.KC([a.p6(),a.Ik({seconds:a.ai(),nanoseconds:a.ai()}),a.bz()]),o=a.k5(["D","M","Y"]),n=a.k5(["onetime","monthly"]),l=a.k5(["pending","active","failed","cancelled","completed"]),d=a.Ik({displayOnWall:a.zM().default(!1),displayName:a.Yj().min(1).max(50).optional(),message:a.Yj().max(200).optional()});a.Ik({id:a.Yj(),amount:a.ai().int().positive(),name:a.Yj(),description:a.Yj().optional(),isActive:a.zM().default(!0),sortOrder:a.ai().int().nonnegative().default(0),periodType:o.default("M"),frequency:a.ai().int().positive().default(1),execTimes:a.ai().int().positive().default(99),createdAt:i.optional(),updatedAt:i.optional()}),a.Ik({userId:a.Yj(),type:n,tierId:a.Yj().optional(),amount:a.ai().nonnegative(),merchantTradeNo:a.Yj().min(1),status:l.default("pending"),sponsorProfile:d.optional(),periodType:o.optional(),frequency:a.ai().int().positive().optional(),execTimes:a.ai().int().positive().optional(),currentExecTimes:a.ai().int().nonnegative().default(0),nextPaymentDate:i.optional(),createdAt:i.optional(),updatedAt:i.optional(),cancelledAt:i.optional(),cancellationReason:a.Yj().optional(),renewalFailure:a.Ik({consecutiveFailures:a.ai().int().positive(),lastFailedAt:i.optional(),lastFailureMessage:a.Yj().nullable().optional()}).optional(),chargedAfterCancel:a.zM().optional()}),a.Ik({id:a.Yj(),sponsorshipId:a.Yj(),userId:a.Yj(),merchantTradeNo:a.Yj(),ecpayTradeNo:a.Yj().nullable().optional(),gwsr:a.Yj().nullable().optional(),amount:a.ai().nonnegative(),paymentDate:i,status:a.k5(["success","failed","pending","refunded"]),paymentType:a.Yj().optional(),amountMismatch:a.zM().optional(),chargedAfterCancel:a.zM().optional(),ecpayResponse:a.g1(a.Yj(),a.bz()).optional(),createdAt:i.optional()}),a.Ik({type:n,amount:a.ai().int().min(200),tierId:a.Yj().nullish(),displayOnWall:a.zM().default(!1),displayName:a.Yj().max(50).nullish(),message:a.Yj().max(200).nullish(),clientBackURL:a.Yj().url().nullish(),orderResultURL:a.Yj().url().nullish()}),a.Ik({sponsorshipId:a.Yj().min(1)}).passthrough();let c=a.k5(["monthly","yearly"]),m=a.Ik({id:a.Yj().min(1),label:a.Yj().min(1),description:a.Yj().min(1),billingPeriod:c,amountTwd:a.ai().int().nonnegative().nullable(),monthlyAmountTwd:a.ai().int().nonnegative().nullable()}),u=a.Ik({lastUpdated:a.Yj().regex(/^\d{4}-\d{2}-\d{2}$/),updateCadence:a.Yj().min(1),items:a.YO(m).min(1)}),p=a.Ik({id:a.Yj().min(1),amountTwd:a.ai().int().nonnegative().nullable().optional(),billingPeriod:c.optional(),monthlyAmountTwd:a.ai().int().nonnegative().nullable().optional()});function f(e,t){return null===e?null:"yearly"===t?Math.round(e/12):e}function h(){let{lastUpdated:e,updateCadence:t,items:r}=s.Bm.costBreakdown;return u.parse({lastUpdated:e,updateCadence:t,items:r.map(e=>{let t;return t=(void 0)??e.defaultBillingPeriod,{id:e.id,label:e.label,description:e.description,billingPeriod:t,amountTwd:null,monthlyAmountTwd:f(null,t)}})})}a.Ik({items:a.YO(p),lastUpdated:a.Yj().regex(/^\d{4}-\d{2}-\d{2}$/),updatedBy:a.Yj().optional()}),a.Ik({items:a.YO(a.Ik({id:a.Yj().min(1),amountTwd:a.ai().int().nonnegative().nullable(),billingPeriod:c})).min(1)}),r(27703)},30834:e=>{e.exports={svg:"LogoLoader_svg__K_m18",bgCircle:"LogoLoader_bgCircle__I9a0P",ringOuter:"LogoLoader_ringOuter__MOHXw",ringInner:"LogoLoader_ringInner__f3O_A",triTop:"LogoLoader_triTop__GNYgx",triBl:"LogoLoader_triBl__rI1Ka",triBr:"LogoLoader_triBr__uR9KW",orbit1:"LogoLoader_orbit1__fs26i",orbit2:"LogoLoader_orbit2__XhKZ2",orbit3:"LogoLoader_orbit3__e4hO3",orbitCounter:"LogoLoader_orbitCounter__vpKzS",triOutlineTop:"LogoLoader_triOutlineTop__mDP5N",triOutlineBl:"LogoLoader_triOutlineBl__iVjAO",triOutlineBr:"LogoLoader_triOutlineBr__v3z0a",comet:"LogoLoader_comet__mL9zX",cometThin:"LogoLoader_cometThin__WPzgT",orbit:"LogoLoader_orbit__NJhb0",bgShift:"LogoLoader_bgShift__b2JcU",rotCw:"LogoLoader_rotCw__eCgi_",rotCcw:"LogoLoader_rotCcw__G86Ks",triFlyTop:"LogoLoader_triFl
1yTop__dt_UM",triFlyBl:"LogoLoader_triFlyBl__BHPtH",triFlyBr:"LogoLoader_triFlyBr__6mkHr",orbitCw:"LogoLoader_orbitCw__SzhUp",orbitCcw:"LogoLoader_orbitCcw__EK7PG",outline:"LogoLoader_outline__9LjpJ",olBgIn:"LogoLoader_olBgIn__z4VpU",olRingOuter:"LogoLoader_olRingOuter__GGZ7h",olRingInner:"LogoLoader_olRingInner__xanAk",olTriStrokeTop:"LogoLoader_olTriStrokeTop__Rw8NR",olTriStrokeBl:"LogoLoader_olTriStrokeBl__VjX5L",olTriStrokeBr:"LogoLoader_olTriStrokeBr___wAAB",triFillTop:"LogoLoader_triFillTop__5VxIo",olTriFillTop:"LogoLoader_olTriFillTop__GD8CV",triFillBl:"LogoLoader_triFillBl__yQQYX",olTriFillBl:"LogoLoader_olTriFillBl__YAGZS",triFillBr:"LogoLoader_triFillBr__jIkwr",olTriFillBr:"LogoLoader_olTriFillBr__mpbgE",cometGroup:"LogoLoader_cometGroup__k9pBP",olCometIn:"LogoLoader_olCometIn__6KPhH",comet1:"LogoLoader_comet1__Uig7S",comet2:"LogoLoader_comet2__swgHT"}},35617:(e,t,r)=>{"use strict";r.d(t,{C:()=>s});let s=(e,t={})=>{let r="number"==typeof e&&Number.isFinite(e)?e:0,s=!0===t.showSymbol,a=t.currencySymbol??"NT$",i=t.locale??"zh-TW",o=r<0?"-":"",n=Math.abs(r),l=(e,t)=>{var r;let i=e>=100?0:e>=10?1:2,n=(r=e.toFixed(i)).includes(".")?r.replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,""):r;return`${o}${s?a:""}${n}${t}`};if(n>=1e8)return l(n/1e8,"億元");if(n>=1e4)return l(n/1e4,"萬元");let d="number"==typeof t.minimumFractionDigits?t.minimumFractionDigits:"number"==typeof t.maximumFractionDigits?t.maximumFractionDigits:0,c="number"==typeof t.maximumFractionDigits?t.maximumFractionDigits:d,m=n.toLocaleString(i,{minimumFractionDigits:d,maximumFractionDigits:c});return`${o}${s?a:""}${m}元`}},37014:(e,t,r)=>{"use strict";r.d(t,{callFn:()=>o,callPublicFn:()=>n});var s=r(71931),a=r(76458),i=r(19548);async function o(e,t){if(!a.functions)throw Error("Firebase Functions 未初始化");if(!a.auth)throw Error("Firebase Auth 未初始化");if(!a.auth.currentUser)throw Error("用戶未登入,請先登入後再使用此功能");try{if(!await a.auth.currentUser.getIdToken(!0))throw Error("無法取得認證 token")}catch(t){let e=t instanceof Error?t:Error(String(t));throw i.Cp(e,{level:"error",extra:{message:"刷新 ID Token 失敗",operation:"callFn.getIdToken"},tags:{source:"firebase.callFn"}}),Error("認證失敗,請重新登入")}if(!a.app)throw Error("Firebase App 未初始化");if(a.functions&&"app"in a.functions&&a.auth&&"app"in a.auth){let e=a.functions.app,t=a.auth.app;if(e!==t)throw i.Cp(Error("Firebase App mismatch"),{level:"error",extra:{message:"Firebase App 實例不一致",functionsAppName:e?.name,authAppName:t?.name,appName:a.app?.name},tags:{source:"firebase.callFn"}}),Error("Firebase App 實例不一致,請重新初始化")}let r=(0,s.httpsCallable)(a.functions,e);try{return await r(t)}catch(n){let r=n?.code||"",o=String(n?.message||"");if("unauthenticated"===r||"permission-denied"===r||o.includes("unauth")||o.includes("401")||o.includes("Unauthorized"))try{if(!a.auth.currentUser)throw Error("用戶已登出,請重新登入");await a.auth.currentUser.getIdToken(!0),await new Promise(e=>setTimeout(e,100));let r=(0,s.httpsCallable)(a.functions,e);return await r(t)}catch(t){throw i.Cp(t instanceof Error?t:Error(String(t)),{level:"error",extra:{message:`重試失敗: ${e}`,operation:"callFn.retry",code:t?.code},tags:{source:"firebase.callFn"}}),Error(t?.message||"認證失敗,請重新登入後再試")}throw n}}async function n(e,t){if(!a.functions)throw Error("Firebase Functions 未初始化");return(0,s.httpsCallable)(a.functions,e)(t)}},38187:(e,t,r)=>{"use strict";r.d(t,{E:()=>l});var s=r(85047),a=r(31615),i=r(63610),o=r(34961);let n=(0,i.F)("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}}),l=a.forwardRef(({className:e,variant:t,...r},a)=>(0,s.jsx)("div",{ref:a,className:(0,o.cn)(n({variant:t}),e),...r}));l.displayName="Badge"},41178:(e,t,r)=>{"use strict";r.d(t,{dj:()=>p});var s=r(31615),a=r(28979),i=r(8958);let o=0,n=new Map,l=e=>{if(n.has(e))return;let t=setTimeout(()=>{n.delete(e),m({type:"REMOVE_TOAST",toastId:e})},3e3);n.set(e,t)},d=[],c={toasts:[]};function m(e){c=((e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,1)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case"DISMISS_TOAST":{let{toastId:r}=t;
1return r?l(r):e.toasts.forEach(e=>{l(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===r||void 0===r?{...e,open:!1}:e)}}case"REMOVE_TOAST":if(void 0===t.toastId)return{...e,toasts:[]};return{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}})(c,e),d.forEach(e=>{e(c)})}function u({...e}){var t;let r,s=(o=(o+1)%Number.MAX_VALUE).toString(),n=()=>m({type:"DISMISS_TOAST",toastId:s});return t=e.variant,r=function(){try{let e=localStorage.getItem(i.RZ);if(e){let t=JSON.parse(e);return{enabled:t.enabled??i.wK.enabled,categories:{alerts:t.categories?.alerts??i.wK.categories.alerts,tasks:t.categories?.tasks??i.wK.categories.tasks},volume:t.volume??i.wK.volume}}}catch(e){}return i.wK}(),"destructive"===t&&a.jY.playSound("ERROR",r).catch(()=>{}),m({type:"ADD_TOAST",toast:{...e,id:s,open:!0,onOpenChange:e=>{e||n()}}}),{id:s,dismiss:n,update:e=>m({type:"UPDATE_TOAST",toast:{...e,id:s}})}}function p(){let[e,t]=s.useState(c);return s.useEffect(()=>(d.push(t),()=>{let e=d.indexOf(t);e>-1&&d.splice(e,1)}),[e]),{...e,toast:u,dismiss:e=>m({type:"DISMISS_TOAST",toastId:e})}}},49734:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>u});var s=r(85047),a=r(31615),i=r(90930),o=r(44251),n=r(38187),l=r(21410),d=r(8180),c=r(46711),m=r(9);function u(){return(0,a.useEffect)(()=>{(0,c.Ad)()},[]),(0,s.jsxs)("div",{className:"flex flex-col min-h-screen bg-background",children:[(0,s.jsx)(i.R,{}),(0,s.jsxs)("main",{className:"flex-1",children:[(0,s.jsx)("section",{className:"py-16 md:py-24 bg-gradient-to-b from-background via-primary/5 to-muted/20 border-b",children:(0,s.jsxs)("div",{className:"container max-w-4xl text-center flex flex-col items-center gap-6",children:[(0,s.jsxs)(n.E,{variant:"secondary",className:"text-base px-4 py-1",children:[(0,s.jsx)(m.A,{className:"inline h-4 w-4 mr-1 text-red-500"}),"支持鑫世紀理財"]}),(0,s.jsx)("h1",{className:"text-4xl md:text-5xl font-bold tracking-tight",children:"您的贊助,讓免費理財工具持續運營"}),(0,s.jsx)("p",{className:"text-lg text-muted-foreground max-w-2xl",children:"所有個人功能已免費開放。若您認同我們的理念,歡迎以一次性或每月贊助,支持伺服器、AI 與開發成本。"}),(0,s.jsx)(l.$,{size:"lg",asChild:!0,children:(0,s.jsx)("a",{href:"#sponsor-panel",children:"立即贊助"})})]})}),(0,s.jsxs)("section",{className:"container max-w-4xl py-12 space-y-16",children:[(0,s.jsx)(d.nh,{}),(0,s.jsx)(d.L4,{}),(0,s.jsx)(d.Pl,{}),(0,s.jsx)(d.nH,{}),(0,s.jsx)(d.tp,{})]})]}),(0,s.jsx)(o.r,{})]})}},54306:(e,t,r)=>{"use strict";r.d(t,{default:()=>m});var s=r(85047),a=r(31615),i=r(34961),o=r(30834),n=r.n(o);let l="0,-90 -39,-22.5 39,-22.5",d="-78,45 0,45 -39,-22.5",c="0,45 78,45 39,-22.5";function m({variant:e="orbit",size:t=96,text:r="",fullScreen:o=!1,className:u}){let p=(0,a.useId)().replace(/:/g,""),f=`xll-bg-${p}`,h=`xll-gold-${p}`,x=(0,s.jsxs)("svg",{className:(0,i.cn)(n().svg,n()[e]),viewBox:"-160 -160 320 320",width:t,height:t,role:"img","aria-label":"鑫世紀理財載入中",children:[(0,s.jsxs)("defs",{children:[(0,s.jsxs)("linearGradient",{id:f,x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[(0,s.jsx)("stop",{offset:"0%",stopColor:"#3B82F6"}),(0,s.jsx)("stop",{offset:"50%",stopColor:"#7C3AED"}),(0,s.jsx)("stop",{offset:"100%",stopColor:"#8B5CF6"})]}),(0,s.jsxs)("linearGradient",{id:h,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[(0,s.jsx)("stop",{offset:"0%",stopColor:"#FBBF24"}),(0,s.jsx)("stop",{offset:"100%",stopColor:"#EAB308"})]})]}),(0,s.jsx)("circle",{className:n().bgCircle,cx:"0",cy:"0",r:"148",fill:`url(#${f})`}),"orbit"===e?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("circle",{className:n().ringOuter,cx:"0",cy:"0",r:"110",fill:"none",stroke:`url(#${h})`,strokeWidth:"5"}),(0,s.jsx)("circle",{className:n().ringInner,cx:"0",cy:"0",r:"100",fill:"none",stroke:`url(#${h})`,strokeWidth:"2.5",opacity:"0.7"}),(0,s.jsx)("circle",{className:(0,i.cn)(n().comet,n().orbit1),cx:"0",cy:"0",r:"110",transform:"rotate(-90)"}),(0,s.jsx)("circle",{className:(0,i.cn)(n().comet,n().cometThin,n().orbit2),cx:"0",cy:"0",r:"110",transform:"rotate(-90)"}),(0,s.jsx)("circle",{className:(0,i.cn)(n().comet,n().cometThin,n().orbit3),cx:"0",cy:"0",r:"110",transform:"rotate(-90)"}),(0,s.jsx)("circle",{className:(0,i.cn)(n().comet,n().cometThin,n().orbitCounter),cx:"0",cy:"0",r:"100",transform:"rotate(-90)"}),(0,s.jsx)("polygon",{className:n().triTop,points:l,fill:`url(#${h})`}),(0,s.jsx)("polygon",{className:n().triBl,points:d,fill:`url(#${h})`}),(0,s.jsx)("polygon",{className:n().triBr,points:c,fill:`url(#${h})`})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("circle",{cx:"0",cy:"0",r:"148",fill:"none",stroke:"rgba(125,150,255,0.2)",strokeWidth:"1"}),(0,s.jsx)("circle",{className:n().ringOuter,cx:"0",cy:"0",r:"110",fill:"none",stroke:`url(#${h})`,strokeWidth:"5",strokeLinecap:"round"}),(0,s.jsx)("circle",{className:n().ringInner,cx:"0",cy:"0",r:"100",fill:"none",stroke:`url(#${h})`,strokeWidth:"2.5",strokeLinecap:"round",opacity:"0.7"}),(0,s.jsx)("polygon",{className:n().triOutlineTop,points:l,pathLength:100,fill:"none",stroke:"#FBBF24",strokeWidth:"2.5",strokeLinejoin:"round"}),(0,s.jsx)("polygon",{className:n().triOutlineBl,points:d,pathLength:100,fill:"none",stroke:"#FBBF24",strokeWidth:"2.5",strokeLinejoin:"round"}),(0,s.jsx)("polygon",{className:n().triOutlineBr,points:c,pathLength:100,fill:"none",stroke:"#FBBF24",strokeWidth:"2.5",strokeLinejoin:"round"}),(0,s.jsx)("polygon",{className:n().triFillTop,points:l,fill:`url(#${h})`}),(0,s.jsx)("polygon",{className:n().triFillBl,points:d,fill:`url(#${h})`}),(0,s.jsx)("polygon",{className:n().triFillBr,points:c,fill:`url(#${h})`}
1),(0,s.jsxs)("g",{className:n().cometGroup,children:[(0,s.jsx)("circle",{className:(0,i.cn)(n().comet,n().comet1),cx:"0",cy:"0",r:"110",transform:"rotate(-90)"}),(0,s.jsx)("circle",{className:(0,i.cn)(n().comet,n().cometThin,n().comet2),cx:"0",cy:"0",r:"100",transform:"rotate(-90)"})]})]})]}),g=(0,s.jsxs)("div",{className:(0,i.cn)("flex flex-col items-center justify-center gap-4 text-center",u),children:[(0,s.jsx)("div",{style:{width:t,height:t},children:x}),r?(0,s.jsx)("p",{className:"text-muted-foreground text-sm",children:r}):null]});return o?(0,s.jsx)("div",{className:"flex min-h-screen items-center justify-center bg-background",children:g}):g}},61598:(e,t,r)=>{Promise.resolve().then(r.bind(r,49734))},62557:(e,t,r)=>{"use strict";r.d(t,{S:()=>l});var s=r(85047),a=r(31615),i=r(2817),o=r(68341),n=r(34961);let l=a.forwardRef(({className:e,...t},r)=>(0,s.jsx)(i.bL,{ref:r,className:(0,n.cn)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:(0,s.jsx)(i.C1,{className:(0,n.cn)("flex items-center justify-center text-current"),children:(0,s.jsx)(o.A,{className:"h-4 w-4"})})}));l.displayName=i.bL.displayName},82520:(e,t,r)=>{"use strict";r.d(t,{BT:()=>d,Wu:()=>c,ZB:()=>l,Zp:()=>o,aR:()=>n,wL:()=>m});var s=r(85047),a=r(31615),i=r(34961);let o=a.forwardRef(({className:e,...t},r)=>(0,s.jsx)("div",{ref:r,className:(0,i.cn)("rounded-xl border bg-card text-card-foreground shadow",e),...t}));o.displayName="Card";let n=a.forwardRef(({className:e,...t},r)=>(0,s.jsx)("div",{ref:r,className:(0,i.cn)("flex flex-col space-y-1.5 p-6",e),...t}));n.displayName="CardHeader";let l=a.forwardRef(({className:e,...t},r)=>(0,s.jsx)("h3",{ref:r,className:(0,i.cn)("font-semibold leading-none tracking-tight",e),...t}));l.displayName="CardTitle";let d=a.forwardRef(({className:e,...t},r)=>(0,s.jsx)("p",{ref:r,className:(0,i.cn)("text-sm text-muted-foreground",e),...t}));d.displayName="CardDescription";let c=a.forwardRef(({className:e,...t},r)=>(0,s.jsx)("div",{ref:r,className:(0,i.cn)("p-6 pt-0",e),...t}));c.displayName="CardContent";let m=a.forwardRef(({className:e,...t},r)=>(0,s.jsx)("div",{ref:r,className:(0,i.cn)("flex items-center p-6 pt-0",e),...t}));m.displayName="CardFooter"},83298:(e,t,r)=>{"use strict";r.d(t,{i:()=>d});var s=r(31615),a=r(87777),i=r(37014),o=r(73521),n=r(18654),l=r(46711);function d(){let{user:e}=(0,o.A)(),[t,r]=(0,s.useState)(!1);return{loading:t,createSponsorship:(0,s.useCallback)(async t=>{if(!e)throw Error("請先登入");r(!0);try{(0,l.a1)(t.type,t.amount);let e=window.location.origin,r=t.clientBackURL??"/sponsor",s=t.orderResultURL??"/payment/success?type=sponsorship",a={type:t.type,amount:t.amount,displayOnWall:t.displayOnWall,clientBackURL:r.startsWith("http")?r:`${e}${r}`,orderResultURL:s.startsWith("http")?s:`${e}${s}`};t.tierId&&(a.tierId=t.tierId),t.displayName&&(a.displayName=t.displayName),t.message&&(a.message=t.message);let o=(await (0,i.callFn)("createSponsorship",a)).data;if(o.success&&o.formHtml){let e=document.createElement("div");e.innerHTML=o.formHtml,document.body.appendChild(e);let t=e.querySelector("form");if(t)t.submit();else throw Error("無法取得付款表單")}else if(!o.success)throw Error(o.error||"建立贊助失敗")}catch(e){throw(0,n.vV)("createSponsorship failed:",e),function(e){if(e instanceof a.g){if("functions/not-found"===e.code)return Error("贊助服務尚未部署或無法使用,請稍後再試或聯絡客服。");if("functions/unauthenticated"===e.code)return Error("請先登入後再贊助。");if("functions/internal"===e.code)return Error("贊助服務暫時無法使用,請稍後再試。");if(e.message&&"internal"!==e.message)return Error(e.message)}return e instanceof Error?e:Error("建立贊助失敗,請稍後再試。")}(e)}finally{r(!1)}},[e]),cancelSponsorship:(0,s.useCallback)(async(e,t)=>{let r=await fetch("/api/sponsorship/cancel",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify({sponsorshipId:e})}),s=await r.json().catch(()=>({}));if(!r.ok)throw Error(s.error||"取消贊助失敗")},[]),trackSponsorSuccess:l.Hn}}},96968:(e,t,r)=>{"use strict";r.d(t,{J:()=>d});var s=r(85047),a=r(31615),i=r(97688),o=r(63610),n=r(34961);let l=(0,o.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),d=a.forwardRef(({className:e,...t},r)=>(0,s.jsx)(i.b,{ref:r,className:(0,n.cn)(l(),e),...t}));d.displayName=i.b.displayName}},e=>{e.O(0,[5338,6062,8721,2811,6277,274,9291,6052,7629,5418,7355,8133,8594,6821,6620,2931,5120,5360,4457,6162,4498,972,5035,3118,1936,7358],()=>e(e.s=61598)),_N_E=e.O()}]);

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.