1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,382983,e=>{"use strict";e.s(["BATCH_MAX_IMAGE_BYTES",0,0xa00000,"BATCH_MAX_ITEMS",0,50,"BATCH_MAX_TEXT_LENGTH",0,1e3,"BATCH_STATES",0,["queued","dispatching","processing","confirming","persisting","succeeded","failed","cancelled"]])},113515,116511,e=>{"use strict";var t=e.i(186971),r=e.i(892494),a=e.i(636680),i=e.i(394673),l=e.i(462297),n=e.i(550573),s=e.i(653668),o=e.i(675088),d=e.i(779342),c=e.i(511398),m=e.i(122913),u=e.i(960568),p=e.i(788250),h=e.i(68736),g=e.i(277170);let x={groups:[{name:"monthly",is_featured:!0},{name:"yearly"},{name:"one-time"}],plans:[{product_id:"free",product_name:"Free",group:"free",interval:"one-time",amount:0,currency:"USD",price:"$0",unit:"",credits:0,valid_days:30,is_free:!0,limits:{image_to_image:10,text_to_image:20,downloads:"unlimited",concurrent_tasks:g.MAX_CONCURRENT_COLORING_TASKS,private_generation:!1,support:"none"}},{product_id:"starter-monthly",product_name:"Starter Monthly",plan_name:"Starter",group:"monthly",interval:"month",amount:999,currency:"USD",price:"$9.99",unit:"/ month",credits:200,valid_days:30,limits:{image_to_image:100,text_to_image:200,downloads:"unlimited",concurrent_tasks:g.MAX_CONCURRENT_COLORING_TASKS,private_generation:!0,support:"email"}},{product_id:"standard-monthly",product_name:"Standard Monthly",plan_name:"Standard",group:"monthly",interval:"month",amount:1999,currency:"USD",price:"$19.99",unit:"/ month",credits:500,valid_days:30,is_featured:!0,label:"popular",limits:{image_to_image:250,text_to_image:500,downloads:"unlimited",concurrent_tasks:g.MAX_CONCURRENT_COLORING_TASKS,private_generation:!0,support:"email"}},{product_id:"premium-monthly",product_name:"Premium Monthly",plan_name:"Premium",group:"monthly",interval:"month",amount:3999,currency:"USD",price:"$39.99",unit:"/ month",credits:1500,valid_days:30,limits:{image_to_image:750,text_to_image:1500,downloads:"unlimited",concurrent_tasks:g.MAX_CONCURRENT_COLORING_TASKS,private_generation:!0,support:"email_24x7"}},{product_id:"starter-yearly",product_name:"Starter Yearly",plan_name:"Starter",group:"yearly",interval:"year",amount:7788,currency:"USD",original_price:"$9.99",price:"$6.49",unit:"/ month",monthly_equivalent_price:"$6.49",yearly_total_price:"$77.88/year",discount_percent:35,credits:200,valid_days:30,limits:{image_to_image:100,text_to_image:200,downloads:"unlimited",concurrent_tasks:g.MAX_CONCURRENT_COLORING_TASKS,private_generation:!0,support:"email"}},{product_id:"standard-yearly",product_name:"Standard Yearly",plan_name:"Standard",group:"yearly",interval:"year",amount:14388,currency:"USD",original_price:"$19.99",price:"$11.99",unit:"/ month",monthly_equivalent_price:"$11.99",yearly_total_price:"$143.88/year",discount_percent:40,credits:500,valid_days:30,is_featured:!0,label:"popular",limits:{image_to_image:250,text_to_image:500,downloads:"unlimited",concurrent_tasks:g.MAX_CONCURRENT_COLORING_TASKS,private_generation:!0,support:"email"}},{product_id:"premium-yearly",product_name:"Premium Yearly",plan_name:"Premium",group:"yearly",interval:"year",amount:26388,currency:"USD",original_price:"$39.99",price:"$21.99",unit:"/ month",monthly_equivalent_price:"$21.99",yearly_total_price:"$263.88/year",discount_percent:45,credits:1500,valid_days:30,limits:{image_to_image:750,text_to_image:1500,downloads:"unlimited",concurrent_tasks:g.MAX_CONCURRENT_COLORING_TASKS,private_generation:!0,support:"email_24x7"}},{product_id:"starter-onetime",product_name:"Starter One-time",group:"one-time",interval:"one-time",amount:1399,currency:"USD",price:"$13.99",unit:"",credits:200,valid_days:365,limits:{private_generation:!0}},{product_id:"standard-onetime",product_name:"Standard One-time",group:"one-time",interval:"one-time",amount:2399,currency:"USD",price:"$23.99",unit:"",credits:500,valid_days:365,is_featured:!0,label:"popular",limits:{private_generation:!0}},{product_id:"premium-onetime",product_name:"Premium One-time",group:"one-time",interval:"one-time",amount:4399,currency:"USD",price:"$43.99",unit:"",credits:1500,valid_days:365,limits:{private_generation:!0}}]};var y=e.i(382983);let f=/\{(\w+)\}/g,_=[/private/i,/privat/i,/priv[ée]/i,/privada/i,/privado/i,/prywat/i,/gizli/i,/riservata/i,/ãã©ã¤ãã¼ã/,/éå
¬é/,/ë¹ê³µê°/,/ç§å¯/,/é±ç§/,/é ç§/];function b(e){return e.trim().replace(/\s+/g," ").toLowerCase()}let v={de:{credits:"Credits",month:"Monat",year:"Jahr",billedMonthly:"Monatliche Abrechnung. Jederzeit kündbar.",billedYearly:"Jährliche Abrechnung.",oneTime:"Einmaliger Kauf. Credits sind ab Kauf 1 Jahr gültig."},en:{credits:"credits",month:"month",year:"year",billedMonthly:"Billed monthly. Cancel anytime.",billedYearly:"Billed yearly.",oneTime:"One-time purchase. Credits are valid for 1 year after purchase."},es:{credits:"créditos",month:"mes",year:"año",billedMonthly:"Facturación mensual. Cancela cuando quieras.",billedYearly:"Facturación anual.",oneTime:"Compra única. Los créditos son válidos durante 1 año desde la compra."},fr:{credits:"crédits",month:"mois",year:"an",billedMonthly:"Facturation mensuelle. Annulation à tout moment.",billedYearly:"Facturation annuelle.",oneTime:"Achat unique. Les crédits sont valables 1 an après l'achat."},it:{credits:"crediti",month:"mese",year:"anno",billedMonthly:"Fatturazione mensile. Annulla quando vuoi.",billedYearly:"Fatturazione annuale.",oneTime:"Acquisto una tantum. I crediti sono validi per 1 anno dall'acquisto."},ja:{credits:"ã¯ã¬ã¸ãã",month:"æ",year:"å¹´",billedMonthly:"æé¡è«æ±ãã
1ã¤ã§ããã£ã³ã»ã«å¯è½ã",billedYearly:"å¹´é¡è«æ±ã",oneTime:"ä¸åº¦ããã®è³¼å
¥ãã¯ã¬ã¸ããã¯è³¼å
¥å¾1å¹´éæå¹ã§ãã"},ko:{credits:"í¬ë ë§",month:"ì",year:"ë
",billedMonthly:"ìë³ ê²°ì . ì¸ì ë ì§ ì·¨ì ê°ë¥.",billedYearly:"ì°ê° ê²°ì .",oneTime:"ì¼íì± êµ¬ë§¤. í¬ë ë§ì 구매 í 1ë
ê° ì í¨í©ëë¤."},nl:{credits:"credits",month:"maand",year:"jaar",billedMonthly:"Maandelijkse facturering. Altijd opzegbaar.",billedYearly:"Jaarlijkse facturering.",oneTime:"Eenmalige aankoop. Credits zijn 1 jaar geldig na aankoop."},pl:{credits:"kredytów",month:"miesiÄ
c",year:"rok",billedMonthly:"Rozliczenie miesiÄczne. Anuluj w dowolnym momencie.",billedYearly:"Rozliczenie roczne.",oneTime:"Zakup jednorazowy. Kredyty sÄ
ważne przez 1 rok od zakupu."},pt:{credits:"créditos",month:"mês",year:"ano",billedMonthly:"Faturamento mensal. Cancele quando quiser.",billedYearly:"Faturamento anual.",oneTime:"Compra única. Os créditos são válidos por 1 ano após a compra."},tr:{credits:"kredi",month:"ay",year:"yıl",billedMonthly:"Aylık faturalandırma. İstediÄiniz zaman iptal edin.",billedYearly:"Yıllık faturalandırma.",oneTime:"Tek seferlik satın alma. Krediler satın alma tarihinden itibaren 1 yıl geçerlidir."},zh:{credits:"积å",month:"æ",year:"å¹´",billedMonthly:"ææè®¡è´¹ï¼å¯éæ¶åæ¶ã",billedYearly:"æå¹´è®¡è´¹ã",oneTime:"䏿¬¡æ§è´ä¹°ï¼ç§¯åè´ä¹°å 1 å¹´å
ææã"},"zh-hant":{credits:"黿¸",month:"æ",year:"å¹´",billedMonthly:"ææè¨è²»ï¼å¯é¨æåæ¶ã",billedYearly:"æå¹´è¨è²»ã",oneTime:"䏿¬¡æ§è³¼è²·ï¼é»æ¸è³¼è²·å¾ 1 å¹´å
§ææã"}};function C(e){let t=e.toLowerCase();return t.startsWith("zh-hant")||t.startsWith("zh-tw")||t.startsWith("zh-hk")?v["zh-hant"]:t.startsWith("zh")?v.zh:v[t.split("-")[0]]||v.en}function w(e,t){return"month"!==e.interval&&"year"!==e.interval?"":`/ ${C(t).month}`}var k=e.i(526683);let N=["monthly","yearly","one-time"],j={zh:{monthly:"æä»",yearly:"å¹´ä»","one-time":"䏿¬¡æ§"},en:{monthly:"Monthly",yearly:"Yearly","one-time":"Pay once"}};function A({open:e,onOpenChange:v,locale:A}){let T,S=(0,o.useTranslations)("pages.pricing"),{user:M,setIsShowSignModal:E,configs:F}=(0,u.useAppContext)(),O={title:(T=A.startsWith("zh"))?"å级è·åæ´å¤ç§¯å":"Upgrade to get more credits",featuresTitle:T?"å级以è·å¾æ´å¤åè½ï¼":"Upgrade to unlock more features!",popular:T?"æ¨è":"Most popular",credits:T?"积å":"credits",checkout:T?"ç«å³è·å积å":"Get Credits Now",processing:T?"å¤çä¸...":"Processing...",noPlans:T?"ææ å¯è´ä¹°å¥é¤ã":"No paid plans available."},[R,z]=(0,r.useState)("yearly"),[D,U]=(0,r.useState)(""),[I,$]=(0,r.useState)(!1),[L,B]=(0,r.useState)(null),P=(0,r.useMemo)(()=>(function(e,t={}){let r=e.privateGenerationFeature?e.privateGenerationFeature:Object.values(e.items||{}).flatMap(e=>e.features||[]).find(e=>_.some(t=>t.test(e)))||"Private generation",a=e.commercialUseFeature??"Commercial use included",i=e.personalUseFeature??"Personal and non-commercial use only",l=x.groups.map(t=>{let r=e.groups?.[t.name];return{name:t.name,title:r?.title||t.name,label:r?.label,is_featured:t.is_featured}}),n=x.plans.map(l=>{let n=e.items?.[l.product_id];return{product_id:l.product_id,product_name:l.product_name,plan_name:l.plan_name,group:"free"===l.group?"monthly":l.group,interval:l.interval,amount:l.amount,currency:l.currency,price:l.price,original_price:l.original_price,unit:l.unit,monthly_equivalent_price:l.monthly_equivalent_price,yearly_total_price:l.yearly_total_price,discount_percent:l.discount_percent,credits:l.credits,valid_days:l.valid_days,limits:l.limits,is_featured:l.is_featured,is_free:l.is_free,label:n?.title&&l.label?l.label:void 0,title:n?.title,description:n?.description,features_title:n?.features_title,features:function(e,t,r,a="Private generation",i,l={}){let n;if(!e)return[];let s=(n=l.creditsByResolution??g.COLORING_CREDITS_BY_RESOLUTION,{signupCredits:l.signupCredits&&l.signupCredits>0?String(l.signupCredits):void 0,guestTrialCredits:l.guestTrialCredits&&l.guestTrialCredits>0?String(l.guestTrialCredits):void 0,weeklyCheckinCredits:void 0===l.weeklyCheckinCredits?void 0:String(l.weeklyCheckinCredits),maxConcurrent:String(l.maxConcurrentTasks??g.MAX_CONCURRENT_COLORING_TASKS),batchMax:String(l.batchMaxItems??y.BATCH_MAX_ITEMS),pages1k:String(Math.floor(t.credits/n["1K"])),pages4k:String(Math.floor(t.credits/n["4K"]))}),o=t.limits?.text_to_image==="unlimited"?"Unlimited":String(Math.floor(t.credits/g.CREDITS_TEXT_TO_COLORING)),d=t.limits?.image_to_image==="unlimited"?"Unlimited":String(Math.floor(t.credits/g.CREDITS_IMAGE_TO_COLORING)),c=e.flatMap(e=>{let r,a,i=(r=!1,a=e.replace(f,(e,t)=>{if(!(t in s))return e;let a=s[t];return void 0===a?(r=!0,e):a}),r?null:a);return null===i?[]:i.replace("{credits}",String(t.credits)).replace("{textToImage}",o).replace("{imageToImage}",d).replace("{downloads}",t.limits?.downloads==="unlimited"?"Unlimited":String(t.limits?.downloads||0)).replace("{concurrentTasks}",String(t.limits?.concurrent_tasks||1))}),m=c;if(t.is_free||(m=[c[0],r||"Powerful AI Coloring Book Generator",...c.slice(1)]),t.limits?.private_generation){let e=b(a);m.some(t=>b(t)===e)||(m=[...m,a])}if(i){let e=b(i);m.some(t=>b(t)===e)||(m=[...m,i])}return m}(n?.features,l,e.aiColoringBookFeature,r,l.is_free?i:a,t),tip:n?.tip,button:n?.button}});
1return{id:e.id||"pricing",title:e.title,description:e.description,buttons:e.buttons,groups:l,items:n}})(S.raw("page.sections.pricing")),[S]),G=(0,r.useMemo)(()=>(P.items||[]).filter(e=>!e.is_free&&e.group===R),[R,P.items]),q=(0,r.useMemo)(()=>new Map((P.groups||[]).map(e=>[e.name,e])),[P.groups]),Y=G.find(e=>e.product_id===D)||G.find(e=>e.is_featured)||G[0]||null,K=async e=>{try{if(!M)return void E(!0);$(!0),B(e.product_id);let t=await fetch("/api/payment/checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({product_id:e.product_id,currency:e.currency,locale:A||"en",payment_provider:"stripe",metadata:{affonso_referral:(0,p.getCookie)("affonso_referral")||"",promotekit_referral:window.promotekit_referral||(0,p.getCookie)("promotekit_referral")||""}})});if(401===t.status)return void E(!0);if(!t.ok)throw Error(`request failed with status ${t.status}`);let{code:r,message:a,data:i}=await t.json();if(0!==r)throw Error(a);if(!i?.checkoutUrl)throw Error("checkout url not found");let l=()=>{window.location.href=i.checkoutUrl};(0,h.trackConfiguredGoogleAdsConversion)({configs:F,labelKey:"beginCheckoutLabel",value:Number((e.amount/100).toFixed(2)),currency:e.currency,dataLayerEvent:h.GOOGLE_ADS_DATA_LAYER_EVENTS.beginCheckout,metadata:{product_id:e.product_id,payment_provider:"stripe",source:"credits_upgrade_dialog"},onComplete:l})||l()}catch(e){d.toast.error(e?.message||"checkout failed"),$(!1),B(null)}};return(0,t.jsx)(m.Dialog,{open:e,onOpenChange:v,children:(0,t.jsxs)(m.DialogContent,{showCloseButton:!1,className:"max-h-[92vh] overflow-y-auto p-0 sm:max-w-5xl",children:[(0,t.jsx)(m.DialogTitle,{className:"sr-only",children:O.title}),(0,t.jsxs)("div",{className:"grid overflow-hidden rounded-lg md:grid-cols-[0.42fr_0.58fr]",style:{background:"#FBF7EF",color:"#1B1611"},children:[(0,t.jsxs)("aside",{className:"border-b p-6 md:border-r md:border-b-0 md:p-8",style:{borderColor:"#EADFC8",background:"#F6EFE0"},children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("span",{className:"grid h-11 w-11 place-items-center rounded-[14px] text-white",style:{background:"#E27A3F"},children:(0,t.jsx)(i.Coins,{className:"h-6 w-6"})}),(0,t.jsx)("span",{className:"text-2xl font-black",children:"MyColoring.AI"})]}),(0,t.jsx)("h2",{className:"mt-9 text-2xl leading-tight font-black tracking-normal",children:O.featuresTitle}),Y?(0,t.jsx)("div",{className:"mt-4 inline-flex rounded-full border bg-white px-3 py-1 text-xs font-black",style:{borderColor:"#EADFC8",color:"#A24F1E"},children:Y.title||Y.plan_name||Y.product_name}):null,(0,t.jsx)("div",{className:"mt-5 grid grid-cols-1 gap-3",children:(Y?.features||[]).map(e=>(0,t.jsxs)("div",{className:"flex items-start gap-3 text-sm",children:[(0,t.jsx)(a.Check,{className:"h-4 w-4 shrink-0 text-[#E27A3F]"}),(0,t.jsx)("span",{className:"leading-5 font-semibold",children:e})]},e))})]}),(0,t.jsxs)("div",{className:"relative p-5 sm:p-8",children:[(0,t.jsx)("button",{type:"button","aria-label":"Close",onClick:()=>v(!1),className:"absolute top-4 right-4 grid h-10 w-10 cursor-pointer place-items-center rounded-full border bg-white",style:{borderColor:"#EADFC8",color:"#7A6D58"},children:(0,t.jsx)(s.X,{className:"h-5 w-5"})}),(0,t.jsx)(m.DialogHeader,{className:"pr-12",children:(0,t.jsx)("h1",{className:"text-3xl leading-tight font-black tracking-normal sm:text-4xl",children:O.title})}),(0,t.jsx)("div",{className:"mt-7 grid grid-cols-3 rounded-[16px] border p-1",style:{background:"#F6EFE0",borderColor:"#EADFC8"},children:N.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>{z(e),U("")},className:(0,k.cn)("min-h-11 cursor-pointer rounded-[12px] px-2 text-sm font-black transition",R===e&&"bg-white shadow-sm"),style:{color:R===e?"#1B1611":"#7A6D58"},children:q.get(e)?.title||j[A.startsWith("zh")?"zh":"en"][e]},e))}),(0,t.jsx)("div",{className:"mt-6 space-y-3",children:G.length?G.map(e=>{let r,i,l=Y?.product_id===e.product_id;return(0,t.jsxs)("button",{type:"button",onClick:()=>U(e.product_id),className:"relative flex min-h-24 w-full cursor-pointer items-center gap-4 roun
1ded-[16px] border bg-white p-4 text-left transition hover:-translate-y-0.5",style:{borderColor:l?"#E27A3F":"#EADFC8",boxShadow:l?"0 0 0 3px rgba(226,122,63,.16)":void 0},children:[e.is_featured?(0,t.jsx)("span",{className:"absolute -top-3 right-4 rounded-full px-3 py-1 text-xs font-black text-white",style:{background:"#E27A3F"},children:O.popular}):null,(0,t.jsx)("span",{className:"grid h-8 w-8 shrink-0 place-items-center rounded-full border",style:{borderColor:l?"#E27A3F":"#CDBF9F",color:l?"#E27A3F":"#A89B83"},children:l?(0,t.jsx)(a.Check,{className:"h-4 w-4"}):null}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"block text-xl font-black",children:e.title||e.plan_name||e.product_name}),(0,t.jsx)("span",{className:"mt-1 block text-sm font-semibold text-[#7A6D58]",children:(r=C(A),i=e.credits||0,"month"===e.interval||"year"===e.interval?`${i} ${r.credits} / ${r.month}`:`${i} ${r.credits}`)})]}),(0,t.jsxs)("span",{className:"text-right",children:[(0,t.jsxs)("span",{className:"block text-2xl font-black",children:[e.price,w(e,A)?(0,t.jsx)("span",{className:"text-sm text-[#7A6D58]",children:w(e,A)}):null]}),(0,t.jsx)("span",{className:"mt-1 block text-xs font-semibold text-[#7A6D58]",children:function(e,t){let r=C(t);if("month"===e.interval)return r.billedMonthly;if("year"===e.interval){let a,i;return`${a=C(t),i=(e.yearly_total_price||"").replace(/\s*\/\s*year\s*$/i,"")||e.price,`${i}/${a.year}`} ${r.billedYearly}`}return r.oneTime}(e,A)})]})]},e.product_id)}):(0,t.jsx)("p",{className:"rounded-[16px] border bg-white p-5 text-sm text-[#7A6D58]",children:O.noPlans})}),(0,t.jsx)("div",{className:"sticky bottom-0 z-20 -mx-5 mt-6 border-t border-[#EADFC8] bg-[#FBF7EF]/95 p-5 backdrop-blur sm:static sm:mx-0 sm:border-0 sm:bg-transparent sm:p-0",children:(0,t.jsxs)(c.Button,{className:"min-h-12 w-full rounded-[14px] text-base font-black",style:{background:"#E27A3F",color:"#fff"},disabled:!Y||I,onClick:()=>Y&&K(Y),children:[I&&Y?.product_id===L?(0,t.jsx)(l.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(n.Sparkles,{className:"mr-2 h-4 w-4"}),I?O.processing:O.checkout]})})]})]})]})})}e.s(["CreditsUpgradeDialog",()=>A],113515);var T=e.i(309401),S=e.i(623099);function M(){let e,t,a,i=(0,T.c)(7),l=(0,S.useLocale)(),[n,s]=(0,r.useState)(!1),[o,d]=(0,r.useState)(0),[c,m]=(0,r.useState)(0);i[0]===Symbol.for("react.memo_cache_sentinel")?(e=function(e,t){d(Math.max(0,e)),m(Math.max(0,void 0===t?0:t)),s(!0)},i[0]=e):e=i[0];let u=e;i[1]===Symbol.for("react.memo_cache_sentinel")?(t=function(e,t){if(!/insufficient credits/i.test(e||""))return!1;let r=function(e){if(!e||!/insufficient credits/i.test(e))return null;let t=e.match(/Insufficient credits,?\s*(\d+)\s*<\s*(\d+)/i);if(t)return{remainingCredits:Number(t[1]),requiredCredits:Number(t[2])};let r=e.match(/Required:\s*(\d+),\s*Available:\s*(\d+)/i);return r?{requiredCredits:Number(r[1]),remainingCredits:Number(r[2])}:null}(e);return u(r?.requiredCredits??t?.requiredCredits??0,r?.remainingCredits??t?.remainingCredits??0),!0},i[1]=t):t=i[1];let p=t;return i[2]!==l||i[3]!==n||i[4]!==c||i[5]!==o?(a={open:n,locale:l,requiredCredits:o,remainingCredits:c,setOpen:s,openDialog:u,openFromMessage:p},i[2]=l,i[3]=n,i[4]=c,i[5]=o,i[6]=a):a=i[6],a}e.s(["useCreditsUpgrade",()=>M],116511)},576076,e=>{"use strict";let t=(0,e.i(889522).default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);e.s(["RefreshCw",()=>t],576076)},525449,e=>{"use strict";let t=(0,e.i(889522).default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["TriangleAlert",()=>t],525449)},619485,e=>{"use strict";let t=(0,e.i(889522).default)("file-archive",[["path",{d:"M10 12v-1",key:"v7bkov"}],["path",{d:"M10 18v-2",key:"1cjy8d"}],["path",{d:"M10 7V6",key:"dljcrl"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v16a2 2 0 0 0 .274 1.01",key:"gkbcor"}],["circle",{cx:"10",cy:"20",r:"2",key:"1xzdoj"}]]);e.s(["FileArchive",()=>t],619485)},866875,e=>{"use strict";var t=e.i(186971),r=e.i(309401),a=e.i(892494),i=e.i(675933),l=e.i(576858),n=e.i(570172),s=e.i(866273),o=e.i(910776),d=e.i(619485),c=e.i(169543),m=e.i(462297),u=e.i(576076),p=e.i(525449),h=e.i(653668),g=e.i(122913),x=e.i(526683);let y="#F6EFE0",f="#1B1611",_="#3A3024",b="#6F624E",v="#EADFC8",C="#E27A3F",w="#A24F1E";function k({book:e,open:r,onOpenChange:u,labels:k,onRetryPage:j,retryingPageId:A,onDownloadPdf:T,downloadingPdf:S,onDownloadPngZi
1p:M,downloadingPngZip:E}){let[F,O]=(0,a.useState)(null),R=(0,a.useMemo)(()=>e?.pages??[],[e?.pages]),z=Math.max(0,R.findIndex(e=>e.id===F)),D=R[z]??R[0],U=R.some(e=>"completed"===e.status&&e.imageUrl),I=!!(T&&k.downloadPdf),$=!!(M&&k.downloadPngZip),L=(0,a.useMemo)(()=>{let e=0;return R.map(t=>"cover"===t.pageType?k.cover:(e+=1,k.page(e)))},[k,R]);function B(e){if(!R.length)return;let t=(z+e+R.length)%R.length;O(R[t]?.id??null)}return(0,a.useEffect)(()=>{O(e?.pages[0]?.id??null)},[e?.id,e?.pages]),(0,t.jsx)(g.Dialog,{open:r,onOpenChange:u,children:(0,t.jsx)(g.DialogContent,{showCloseButton:!1,className:"h-[calc(100dvh-16px)] w-[calc(100vw-16px)] !max-w-none overflow-x-hidden overflow-y-auto rounded-2xl border !p-0 shadow-[0_30px_120px_-48px_rgba(27,22,17,.65)] sm:h-[calc(100dvh-40px)] sm:w-[calc(100vw-40px)] lg:h-[min(92dvh,860px)] lg:w-[min(1180px,calc(100vw-48px))] lg:overflow-hidden",style:{borderColor:v},children:e?(0,t.jsxs)("div",{className:"flex min-h-full min-w-0 flex-col lg:grid lg:h-full lg:min-h-0 lg:grid-cols-[minmax(0,1fr)_340px] lg:overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex min-h-0 min-w-0 shrink-0 flex-col border-b lg:h-full lg:shrink lg:border-r lg:border-b-0",style:{background:"#FBF7EF",borderColor:v},children:[(0,t.jsxs)("div",{className:"relative flex h-[min(56dvh,520px)] min-h-[320px] min-w-0 items-center justify-center overflow-hidden px-3 py-4 sm:px-5 sm:py-6 lg:min-h-0 lg:flex-1",children:[D?.status==="completed"&&D.imageUrl?(0,t.jsx)("div",{className:"relative h-full w-full max-w-full overflow-hidden rounded-xl border bg-white shadow-[0_22px_80px_-54px_rgba(27,22,17,.7)]",style:{borderColor:v},children:(0,t.jsx)("div",{className:"relative h-full w-full",children:(0,t.jsx)(i.default,{src:D.imageUrl,alt:D.title,fill:!0,sizes:"(max-width: 1024px) 92vw, 760px",className:"object-contain"})})}):D?.status==="failed"?(0,t.jsx)(N,{page:D,labels:k,onRetryPage:j,retrying:A===D.id}):D?(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3 text-center",children:[(0,t.jsx)(m.Loader2,{className:"h-10 w-10 animate-spin",style:{color:C}}),(0,t.jsx)("p",{className:"font-bold",style:{color:b},children:D.title})]}):(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3 text-center",children:[(0,t.jsx)(c.ImageIcon,{className:"h-10 w-10",style:{color:b}}),(0,t.jsx)("p",{className:"font-bold",style:{color:b},children:k.empty})]}),R.length>1?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",onClick:()=>B(-1),className:"absolute top-1/2 left-3 flex h-11 w-11 -translate-y-1/2 items-center justify-center rounded-full border bg-white/95 shadow-sm transition hover:-translate-x-0.5 sm:left-5",style:{borderColor:v,color:f},"aria-label":k.previousPage,children:(0,t.jsx)(n.ChevronLeft,{className:"h-6 w-6"})}),(0,t.jsx)("button",{type:"button",onClick:()=>B(1),className:"absolute top-1/2 right-3 flex h-11 w-11 -translate-y-1/2 items-center justify-center rounded-full border bg-white/95 shadow-sm transition hover:translate-x-0.5 sm:right-5",style:{borderColor:v,color:f},"aria-label":k.nextPage,children:(0,t.jsx)(s.ChevronRight,{className:"h-6 w-6"})})]}):null]}),R.length?(0,t.jsxs)("div",{className:"min-w-0 border-t px-3 py-3 sm:px-4 lg:shrink-0",style:{borderColor:v},children:[(0,t.jsx)("p",{className:"mb-2 text-xs font-black tracking-[0.14em] uppercase",style:{color:w},children:k.thumbnails}),(0,t.jsx)("div",{className:"flex gap-2 overflow-x-auto pb-1",children:R.map((e,r)=>(0,t.jsxs)("button",{type:"button",onClick:()=>O(e.id),className:(0,x.cn)("w-[4.5rem] shrink-0 overflow-hidden rounded-lg border bg-white p-1 text-left transition sm:w-[5.5rem] lg:w-24",D?.id===e.id?"ring-2 ring-offset-2":"opacity-70 hover:opacity-100"),style:{borderColor:v,"--tw-ring-color":C},children:[(0,t.jsx)("div",{className:"relative aspect-[3/4] overflow-hidden rounded-md",children:"completed"===e.status&&e.imageUrl?(0,t.jsx)(i.default,{src:e.imageUrl,alt:"",fill:!0,loading:"eager",sizes:"96px",className:"object-contain"}):"failed"===e.status?(0,t.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-1 bg-red-50 text-red-700",children:[(0,t.jsx)(p.TriangleAlert,{className:"h-5 w-5"}),(0,t.jsx)("span",{className:"text-[10px] font-black",children:k.failed})]}):(0,t.jsx)("div",{className:"flex h-full items-center justify-center",style:{background:y},children:(0,t.jsx)(m.Loader2,{className:"h-5 w-5 animate-spin",style:{color:C}})})}),(0,t.jsx)("span",{className:"mt-1 block truncate px-0.5 text-[11px] font-black",style:{color:_},children:L[r]})]},e.id))})]}):null]}),(0,t.jsxs)("aside",{className:"min-h-0 min-w-0 shrink-0 overflow-y-auto bg-white p-5 sm:p-6 lg:h-full lg:shrink",children:[(0,t.jsxs)(g.DialogHeader,{className:"flex-row items-start justify-between gap-4 space-y-0 text-left",children:[(0,t.jsx)(g.DialogTitle,{className:"min-w-0 text-2xl leading-tight font-black tracking-normal break-words sm:text-3xl lg:text-[2rem]",children:e.title}),(0,t.jsx)(g.DialogClose,{asChild:!0,children:(0,t.jsx)("button",{type:"button",className:"inline-flex size-9 shrink-0 items-center justify-center rounded-full border transition-[background-color,transform] duration-150 hover:-translate-y-0.5 active:translate-y-
1px",style:{background:y,borderColor:v,color:_},"aria-label":k.close,children:(0,t.jsx)(h.X,{className:"size-4"})})})]}),I||$?(0,t.jsxs)("div",{className:"mt-5 flex flex-wrap gap-2",children:[I?(0,t.jsxs)("button",{type:"button",disabled:S||!U,onClick:T,className:"inline-flex min-h-10 items-center justify-center gap-2 rounded-[12px] px-4 text-sm font-bold text-white shadow-md transition-[filter,transform,box-shadow] duration-150 hover:-translate-y-0.5 hover:shadow-lg active:translate-y-px disabled:cursor-not-allowed disabled:opacity-60",style:{background:`linear-gradient(180deg, ${C} 0%, #C9622A 100%)`},children:[S?(0,t.jsx)(m.Loader2,{className:"size-4 animate-spin"}):(0,t.jsx)(o.Download,{className:"size-4"}),S&&k.downloadingPdf||k.downloadPdf]}):null,$?(0,t.jsxs)("button",{type:"button",disabled:E||!U,onClick:M,className:"inline-flex min-h-10 items-center justify-center gap-2 rounded-[12px] border px-4 text-sm font-bold transition-[background-color,transform] duration-150 hover:-translate-y-0.5 active:translate-y-px disabled:cursor-not-allowed disabled:opacity-60",style:{background:y,borderColor:v,color:_},children:[E?(0,t.jsx)(m.Loader2,{className:"size-4 animate-spin"}):(0,t.jsx)(d.FileArchive,{className:"size-4"}),E&&k.downloadingPngZip||k.downloadPngZip]}):null]}):null,(0,t.jsxs)("div",{className:"mt-5",children:[(0,t.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-full px-3 py-1 text-xs font-black",style:{background:y,color:w},children:[(0,t.jsx)(l.BookOpen,{className:"h-4 w-4"}),D?L[z]:k.empty]}),D?(0,t.jsx)("h3",{className:"mt-3 text-lg font-black tracking-normal sm:text-xl",children:D.title}):null]}),(0,t.jsx)("div",{className:"mt-6 grid grid-cols-1 gap-3 sm:grid-cols-2",children:e.meta.map(e=>(0,t.jsxs)("div",{className:"rounded-xl border bg-white p-3",style:{borderColor:v},children:[(0,t.jsx)("p",{className:"text-xs font-bold",style:{color:b},children:e.label}),(0,t.jsx)("p",{className:"mt-1 text-base leading-tight font-black",style:{color:f},children:e.value})]},`${e.label}-${e.value}`))}),e.statusText?(0,t.jsx)("p",{className:"mt-4 rounded-xl px-4 py-3 text-sm font-bold",style:{background:y,color:_},children:e.statusText}):null]})]}):null})})}function N(e){let a,i,l,n,s,o,d,c=(0,r.c)(17),{page:h,labels:g,onRetryPage:x,retrying:y}=e;c[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"#FFFFFF",borderColor:v,color:f},c[0]=a):a=c[0],c[1]===Symbol.for("react.memo_cache_sentinel")?(i=(0,t.jsx)("div",{className:"flex size-12 items-center justify-center rounded-full bg-red-50 text-red-700",children:(0,t.jsx)(p.TriangleAlert,{className:"size-6"})}),c[1]=i):i=c[1],c[2]!==g.failed?(l=(0,t.jsx)("h3",{className:"mt-4 text-xl font-black tracking-normal",children:g.failed}),c[2]=g.failed,c[3]=l):l=c[3],c[4]===Symbol.for("react.memo_cache_sentinel")?(n={color:b},c[4]=n):n=c[4];let _=h.error||g.failedDescription;return c[5]!==_?(s=(0,t.jsx)("p",{className:"mt-2 max-w-md text-sm leading-6",style:n,children:_}),c[5]=_,c[6]=s):s=c[6],c[7]!==g.retry||c[8]!==g.retrying||c[9]!==x||c[10]!==h||c[11]!==y?(o=x?(0,t.jsxs)("button",{type:"button",disabled:y,onClick:()=>x(h),className:"mt-5 inline-flex min-h-11 items-center justify-center gap-2 rounded-[12px] px-4 text-sm font-bold text-white shadow-md transition-[filter,transform,box-shadow] duration-150 hover:-translate-y-0.5 hover:shadow-lg active:translate-y-px disabled:cursor-not-allowed disabled:opacity-70",style:{background:`linear-gradient(180deg, ${C} 0%, #C9622A 100%)`},children:[y?(0,t.jsx)(m.Loader2,{className:"size-4 animate-spin"}):(0,t.jsx)(u.RefreshCw,{className:"size-4"}),y?g.retrying:g.retry]}):null,c[7]=g.retry,c[8]=g.retrying,c[9]=x,c[10]=h,c[11]=y,c[12]=o):o=c[12],c[13]!==l||c[14]!==s||c[15]!==o?(d=(0,t.jsxs)("div",{className:"flex min-h-[260px] w-full max-w-xl flex-col items-center justify-center rounded-xl border p-6 text-center shadow-[0_22px_80px_-54px_rgba(27,22,17,.7)]",style:a,children:[i,l,s,o]}),c[13]=l,c[14]=s,c[15]=o,c[16]=d):d=c[16],d}e.s(["BookPreviewDialog",()=>k])},752634,e=>{"use strict";let t=["planned","queued","generating","completed","failed"],r=["completed","partially_completed","failed"];function a(e){return r.includes(e||"")}function i(e){return t.includes(e)}e.s(["AI_COLORING_BOOK_CHARACTER_CREDIT_COST",0,2,"AI_COLORING_BOOK_PAGE_CREDIT_COST",0,2,"isKnownPageStatus",()=>i,"isTerminalBookStatus",()=>a],752634)}]);
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.