1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[31899],{18537:(e,r,t)=>{t.d(r,{W:()=>f});var a=t(42956),s=t(68040),o=t(24904),n=t(64129),l=t(40724),i=t(4260),c=t(90507),d=t(65094),m=t(15303),u=t(86459),x=t(14972),h=t(75609);function f(e){let{errorType:r,originalImage:t,onRetry:f,onTryAnother:p,credits:g,errorMessage:b}=e,j=(0,u.c3)("KirkifyGenerator.error"),v=(0,u.c3)("KirkifyGenerator.detection"),y=(0,u.c3)("KirkifyGenerator.actions"),w=(0,u.c3)("KirkifyGenerator.credits"),N=(0,h.useRouter)(),k={noFaceDetected:v("noFaceDetected"),multipleFaces:v("multipleFaces"),imageTooSmall:v("imageTooSmall"),processingTimeout:v("processingTimeout"),serverError:v("serverError"),unauthorized:j("unauthorized"),insufficient_credits:j("insufficientCredits"),processing_failed:b||"Failed to process. Please try again."},C="unauthorized"===r,S="insufficient_credits"===r;return(0,a.jsxs)("div",{className:"space-y-8",children:[(0,a.jsxs)("div",{className:"text-center space-y-2",children:[(0,a.jsx)("div",{className:"flex items-center justify-center",children:(0,a.jsx)("div",{className:"w-16 h-16 rounded-full bg-red-500/10 flex items-center justify-center",children:(0,a.jsx)(n.A,{className:"w-8 h-8 text-red-400"})})}),(0,a.jsx)("h2",{className:"text-2xl font-bold",children:j("title")}),(0,a.jsx)("p",{className:"text-lg text-red-400 font-medium",children:k[r]})]}),(0,a.jsx)("div",{className:"relative aspect-video rounded-lg overflow-hidden border border-border/30 bg-background/50",children:(0,a.jsx)(x.default,{src:t,alt:"Failed image",fill:!0,className:"object-contain"})}),!C&&!S&&(0,a.jsxs)(a.Fragment,{children:[b&&(0,a.jsx)("div",{className:"p-4 rounded-lg border border-red-500/20 bg-red-500/5",children:(0,a.jsx)("p",{className:"text-sm text-red-400",children:b})}),(0,a.jsxs)("div",{className:"space-y-4 p-6 rounded-lg border border-red-500/20 bg-red-500/5",children:[(0,a.jsx)("p",{className:"font-medium",children:j("pleaseEnsure")}),(0,a.jsxs)("ul",{className:"space-y-2",children:[(0,a.jsxs)("li",{className:"flex items-start gap-3 text-sm",children:[(0,a.jsx)("span",{className:"text-red-400 mt-1",children:"â¢"}),(0,a.jsx)("span",{className:"text-muted-foreground",children:j("tips.clearFace")})]}),(0,a.jsxs)("li",{className:"flex items-start gap-3 text-sm",children:[(0,a.jsx)("span",{className:"text-red-400 mt-1",children:"â¢"}),(0,a.jsx)("span",{className:"text-muted-foreground",children:j("tips.goodLighting")})]}),(0,a.jsxs)("li",{className:"flex items-start gap-3 text-sm",children:[(0,a.jsx)("span",{className:"text-red-400 mt-1",children:"â¢"}),(0,a.jsx)("span",{className:"text-muted-foreground",children:j("tips.noObstructions")})]})]})]}),(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2 p-4 rounded-lg border border-green-500/20 bg-green-500/5",children:[(0,a.jsx)(l.A,{className:"w-5 h-5 text-green-400"}),(0,a.jsx)("p",{className:"text-sm text-green-400 font-medium",children:j("noCharge")})]}),(0,a.jsx)("p",{className:"text-sm text-center text-muted-foreground",children:w("balance",{count:g})})]}),S&&(0,a.jsxs)("div",{className:"space-y-4 p-6 rounded-lg border border-yellow-500/20 bg-yellow-500/5",children:[(0,a.jsx)("p",{className:"font-medium text-yellow-400",children:j("needCredits")}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:j("currentBalance",{count:g})}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:j("requiredCredits",{count:2})})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-3",children:[C&&(0,a.jsxs)(s.$,{size:"lg",onClick:()=>N.push(o.BV.Login),className:"bg-primary hover:bg-primary/90 text-primary-foreground font-bold",children:[(0,a.jsx)(i.A,{className:"w-5 h-5 mr-2"}),j("loginNow")]}),S&&(0,a.jsxs)(s.$,{size:"lg",onClick:()=>N.push(o.BV.SettingsCredits),className:"bg-primary hover:bg-primary/90 text-primary-foreground font-bold",children:[(0,a.jsx)(c.A,{className:"w-5 h-5 mr-2"}),j("buyCredits")]}),!C&&!S&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(s.$,{size:"lg",onClick:f,className:"bg-primary hover:bg-primary/90 text-primary-foreground font-bold",children:[(0,a.jsx)(d.A,{className:"w-5 h-5 mr-2"}),y("retry")]}),(0,a.jsxs)(s.$,{size:"lg",variant:"outline",onClick:p,className:"border-primary/30 hover:border-primary/60 text-primary",children:[(0,a.jsx)(m.A,{className:"w-5 h-5 mr-2"}),y("tryAnother")]})]})]})]})}},23983:(e,r,t)=>{t.d(r,{b:()=>k});var a=t(42956),s=t(41002),o=t(24987),n=t(87390),l=t(68040),i=t(98514),c=t(36037),d=t(55138),m=t(48930),u=t(86546),x=t(98154),h=t(65094),f=t(86459),p=t(37632),g=t(80717),b=t(84128),j=t(80311),v=t(14745),y=t(35232);function w(e){let{open:r,onOpenChange:t,credits:s}=e,o=(0,f.c3)("KirkifyGenerator.freeUserUpgrade"),[n,l]=(0,p.useState)(!1);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(j.Lt,{open:r,onOpenChange:t,children:(0,a.jsxs)(j.EO,{className:"max-w-md",children:[(0,a.jsxs)(j.wd,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,a.jsx)("div",{className:"p-2 rounded-full bg-gradient-to-r from-orange-500 to-amber-500",children:(0,a.jsx)(v.A,{className:"w-6 h-6 text-white"})}),(0,a.jsx)(j.r7,{className:"text-xl",children:o("title")})]}),(0,a.jsx)(j.$v,{asChild:!0,children:(0,a.jsxs)("div",{className:"space-y-3 text-left",children:[(0,a.jsx)("p",{className:"text-base",children:o("description",{count:s})}),(0,a.jsx)("div",{className:"rounded-lg border border-primary/30 bg-primary/5 p-3",children:(0,a.jsx)("p",{className:"text-sm font-medium text-primary",children:o("benefits")})})]})})]}),(0,a.jsxs)(j.ck,{className:"flex-col sm:flex-row gap-2",children:[(0,a.jsx)(j.Zr,{className:"m-0 border-border/50 text-muted-foreground hover:bg-secondary",children:o("continueFree")}),(0,a.jsxs)(j.Rx,{onClick:()=>{t(!1),l(!0)},className:"m-0 bg-gradient-to-r from-orange-500 to-amber-500 hover:from-orange-600 hover:to-amber-600 text-white font-semibold",children:[(0,a.jsx)(y.A,{className:"w-4 h-4 mr-2"}),o("upgrade")]})]})]})}),(0,a.jsx)(b.e,{open:n,onOpenChange:l})]})}var N=t(40407);function k(e){let{originalImage:r,resultImage:t,processingTime:b,onKirkifyAnother:j,credits:v,generationId:y,isVideo:k=!1,contentType:C}=e,S=(0,f.c3)("KirkifyGenerator.result"),F=(0,f.c3)("KirkifyGenerator.actions"),A=(0,f.c3)("KirkifyGenerator.credits"),[R,z]=(0,p.useState)(!1),[I,U]=(0,p.useState)(!1),[G,L]=(0,p.useState)(),[
1K,$]=(0,p.useState)(!1),[E,T]=(0,p.useState)(!0);(0,p.useEffect)(()=>{y&&(async()=>{let e=await (0,s.C)(y);e.success&&e.inGallery&&(U(!0),L(e.galleryId))})()},[y]),(0,p.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/queue-status");if(e.ok){let r=await e.json();T(r.isPaidUser),r.isPaidUser||1!==r.generationCount||setTimeout(()=>{z(!0)},1e3)}}catch(e){console.error("Failed to check user status:",e)}})()},[]);let q=async()=>{try{let e="/api/download-image?url=".concat(encodeURIComponent(t)),r=document.createElement("a");r.href=e,document.body.appendChild(r),r.click(),document.body.removeChild(r)}catch(e){console.error("Download failed:",e),g.o.error("Failed to download image")}},_=async()=>{if(!y)return void g.o.error("Cannot modify gallery: missing generation ID");$(!0);try{if(I){if(!G)return void g.o.error("Cannot remove: missing gallery ID");let e=await (0,o.t)(G);e.success?(U(!1),L(void 0),g.o.success("Removed from gallery!")):g.o.error(e.error||"Failed to remove from gallery")}else{let e=await (0,n.f)(y);e.success?(U(!0),L(e.galleryId),g.o.success("Added to gallery!")):g.o.error(e.error||"Failed to add to gallery")}}catch(e){console.error("Gallery toggle error:",e),g.o.error("Something went wrong")}finally{$(!1)}};return(0,a.jsxs)("div",{className:"space-y-8",children:[(0,a.jsx)("div",{className:"text-center space-y-2",children:(0,a.jsxs)("h2",{className:"text-2xl font-bold flex items-center justify-center gap-2",children:[(0,a.jsx)(c.A,{className:"w-6 h-6 text-yellow-400"}),S("title")]})}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-center text-muted-foreground",children:S("before")}),(0,a.jsx)("div",{className:"relative rounded-lg overflow-hidden border border-border/50 bg-background/50 ".concat(k?"aspect-video":"aspect-square"),children:k?(0,a.jsx)("video",{src:r,controls:!0,preload:"metadata",className:"w-full h-full object-contain",children:(0,a.jsx)("track",{kind:"captions"})}):(0,a.jsx)("img",{src:(0,i.Y)(r)||r,alt:"Before",className:"w-full h-full object-contain"})})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-center text-primary",children:S("after")}),(0,a.jsxs)("div",{className:"relative rounded-lg overflow-hidden border border-primary/50 bg-background/50 ".concat(k?"aspect-video":"aspect-square"),children:[k?(0,a.jsx)("video",{src:t,controls:!0,preload:"metadata",className:"w-full h-full object-contain",children:(0,a.jsx)("track",{kind:"captions"})}):(0,a.jsx)("img",{src:(0,i.Y)(t)||t,alt:"After",className:"w-full h-full object-contain"}),(0,a.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-primary/10 to-transparent pointer-events-none"})]})]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-3",children:[(0,a.jsxs)(l.$,{size:"lg",onClick:q,className:"bg-primary hover:bg-primary/90 text-primary-foreground font-bold",children:[(0,a.jsx)(d.A,{className:"w-5 h-5 mr-2"}),F("download")]}),(0,a.jsxs)(l.$,{size:"lg",variant:"outline",onClick:()=>{let e=y?"".concat("https://kirkify.io","/result/").concat(y):window.location.href;navigator.share?navigator.share({title:"Check out my Kirkified image!",text:"I just kirkified my image with AI!",url:e}):(navigator.clipboard.writeText(e),g.o.success("Link copied to clipboard!"))},className:"border-primary/30 hover:border-primary/60 text-primary",children:[(0,a.jsx)(m.A,{className:"w-5 h-5 mr-2"}),F("share")]}),(0,a.jsx)(l.$,{size:"lg",variant:I?"secondary":"outline",onClick:_,disabled:K||!y,className:I?"border-purple-500/30 bg-purple-50 dark:bg-purple-950 text-purple-600 dark:text-purple-400 hover:bg-purple-100 dark:hover:bg-purple-900":"border-purple-500/30 hover:border-purple-500/60 text-purple-600 dark:text-purple-400",children:I?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u.A,{className:"w-5 h-5 mr-2"}),F("removeFromGallery")]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x.A,{className:"w-5 h-5 mr-2"}),F("addToGallery")]})}),(0,a.jsxs)(l.$,{size:"lg",variant:"outline",onClick:j,className:"border-border/50 hover:border-border/80",children:[(0,a.jsx)(h.A,{className:"w-5 h-5 mr-2"}),F("kirkifyAnother")]})]}),(0,a.jsxs)("div",{className:"flex items-center justify-center gap-6 text-sm text-muted-foreground border-t border-border/30 pt-6",children:[b>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{children:S("processingTime",{time:b.toFixed(1)})}),(0,a.jsx)("span",{children:"â¢"})]}),(0,a.jsx)("span",{children:A("remaining",{count:v})})]}),(0,a.jsx)(N.X,{credits:v}),(0,a.jsxs)("div",{className:"text-center space-y-3",children:[(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:S("shareOn")}),(0,a.jsxs)("div",{className:"flex items-center justify-center gap-3 flex-wrap",children:[(0,a.jsx)(l.$,{size:"sm",variant:"outline",className:"border-border/30 hover:border-border/60",onClick:()=>{let e=y?"".concat("https://kirkify.io","/result/").concat(y):window.location.href;window.open("https://twitter.com/intent/tweet?text=Check out my Kirkified image!&url=".concat(encodeURIComponent(e)),"_blank")},children:"Twitter"}),(0,a.jsx)(l.$,{size:"sm",variant:"outline",className:"border-border/30 hover:border-border/60",onClick:()=>{let e=y?"".concat("https://kirkify.io","/result/").concat(y):window.location.href;window.open("https://www.facebook.com/sharer/sharer.php?u=".concat(encodeURIComponent(e)),"_blank")},children:"Facebook"}),(0,a.jsx)(l.$,{size:"sm",variant:"outline",className:"border-border/30 hover:border-border/60",onClick:()=>{let e=y?"".concat("https://kirkify.io","/result/").concat(y):window.location.href,r=encodeURIComponent("Check out my Kirkified image!");window.open("https://reddit.com/submit?url=".concat(encodeURIComponent(e),"&title=").concat(r),"_blank")},children:"Reddit"}),(0,a.jsx)(l.$,{size:"sm",variant:"outline",className:"border-border/30 hover:border-border/60",onClick:()=>{let e=y?"".concat("https://kirkify.io","/result/").concat(y):window.location.href,r="https://pinterest.com/pin/create/button/?description=".concat(encodeURIComponent("Check out this amazing Kirkified image created with AI!"),"&url=").concat(encodeURIComponent(e));window.open("https://www.pinterest.com/pin/create/button/?url=".concat(r),"_blank")},children:"Pinterest"}),(0,a.jsx)(l.$,{size:"sm",variant:"outline",className:"border-border/30 hover:border-border/60",onClick:()=>{let e=y?"".concat("https://kirkify.io","/result/").concat(y):window.location.href;navigator.clipboard.writeText(e),g.o.success("Link copied to clipboard!")},children:"Copy Link"})]})]}),(0,a.jsx)(w,{open:R,onOpenChange:z,credits:v})]})}},24987:(e,r,t)=>{t.d(r,{t:()=>s});
1var a=t(98667);let s=(0,a.createServerReference)("4087369744fa390884c8c3549b0c05346a19215d93",a.callServer,void 0,a.findSourceMapURL,"removeFromGallery")},40407:(e,r,t)=>{t.d(r,{X:()=>m});var a=t(42956),s=t(84128),o=t(68040),n=t(64129),l=t(95577),i=t(35232),c=t(86459),d=t(37632);function m(e){let{credits:r,requiredCredits:t=2}=e,m=(0,c.c3)("KirkifyGenerator.lowCredits"),[u,x]=(0,d.useState)(!1),h=r<t,f=r<2*t;if(!(r<3*t))return null;let p=h?"critical":f?"warning":"early",g=h?n.A:l.A;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"rounded-lg border-2 p-4 ".concat(h?"border-red-500/50":f?"border-orange-500/50":"border-yellow-500/50"," ").concat(h?"bg-gradient-to-r from-red-500/20 to-orange-500/20":f?"bg-gradient-to-r from-orange-500/10 to-amber-500/10":"bg-gradient-to-r from-yellow-500/10 to-amber-500/10"," ").concat(h?"animate-pulse":""),children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)(g,{className:"w-5 h-5 flex-shrink-0 mt-0.5 ".concat(h?"text-red-500":f?"text-orange-500":"text-yellow-600 dark:text-yellow-500")}),(0,a.jsxs)("div",{className:"flex-1 space-y-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-semibold ".concat(h?"text-red-500":f?"text-orange-500":"text-yellow-600 dark:text-yellow-500"),children:m("".concat(p,".title"))}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:m("".concat(p,".description"),{count:r})}),h&&(0,a.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400 mt-2 font-medium",children:m("critical.urgency",{required:t})})]}),(0,a.jsxs)(o.$,{onClick:()=>x(!0),className:"w-full ".concat(h?"bg-gradient-to-r from-red-500 to-orange-500 hover:from-red-600 hover:to-orange-600":f?"bg-gradient-to-r from-orange-500 to-amber-500 hover:from-orange-600 hover:to-amber-600":"bg-gradient-to-r from-yellow-500 to-amber-500 hover:from-yellow-600 hover:to-amber-600"," text-white font-semibold shadow-md"),children:[(0,a.jsx)(i.A,{className:"w-4 h-4 mr-2"}),m("recharge")]})]})]})}),(0,a.jsx)(s.e,{open:u,onOpenChange:x})]})}},41002:(e,r,t)=>{t.d(r,{C:()=>s});var a=t(98667);let s=(0,a.createServerReference)("4060d313fec34844a83c3d3a726f3b047d21156d08",a.callServer,void 0,a.findSourceMapURL,"checkInGallery")},80311:(e,r,t)=>{t.d(r,{$v:()=>f,EO:()=>m,Lt:()=>l,Rx:()=>p,Zr:()=>g,ck:()=>x,r7:()=>h,tv:()=>i,wd:()=>u});var a=t(42956);t(37632);var s=t(36535),o=t(92551),n=t(68040);function l(e){let{...r}=e;return(0,a.jsx)(s.bL,{"data-slot":"alert-dialog",...r})}function i(e){let{...r}=e;return(0,a.jsx)(s.l9,{"data-slot":"alert-dialog-trigger",...r})}function c(e){let{...r}=e;return(0,a.jsx)(s.ZL,{"data-slot":"alert-dialog-portal",...r})}function d(e){let{className:r,...t}=e;return(0,a.jsx)(s.hJ,{"data-slot":"alert-dialog-overlay",className:(0,o.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",r),...t})}function m(e){let{className:r,...t}=e;return(0,a.jsxs)(c,{children:[(0,a.jsx)(d,{}),(0,a.jsx)(s.UC,{"data-slot":"alert-dialog-content",className:(0,o.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",r),...t})]})}function u(e){let{className:r,...t}=e;return(0,a.jsx)("div",{"data-slot":"alert-dialog-header",className:(0,o.cn)("flex flex-col gap-2 text-center sm:text-left",r),...t})}function x(e){let{className:r,...t}=e;return(0,a.jsx)("div",{"data-slot":"alert-dialog-footer",className:(0,o.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",r),...t})}function h(e){let{className:r,...t}=e;return(0,a.jsx)(s.hE,{"data-slot":"alert-dialog-title",className:(0,o.cn)("text-lg font-semibold",r),...t})}function f(e){let{className:r,...t}=e;return(0,a.jsx)(s.VY,{"data-slot":"alert-dialog-description",className:(0,o.cn)("text-muted-foreground text-sm",r),...t})}function p(e){let{className:r,...t}=e;return(0,a.jsx)(s.rc,{className:(0,o.cn)((0,n.r)(),r),...t})}function g(e){let{className:r,...t}=e;return(0,a.jsx)(s.ZD,{className:(0,o.cn)((0,n.r)({variant:"outline"}),r),...t})}},82307:(e,r,t)=>{t.d(r,{a:()=>o});var a=t(42956),s=t(37632);function o(e){let{className:r=""}=e,t=(0,s.useRef)(null);return(0,s.useEffect)(()=>{t.current&&t.current.play().catch(e=>
1{console.warn("Video autoplay failed:",e)})},[]),(0,a.jsx)("div",{className:"absolute inset-0 overflow-hidden ".concat(r),children:(0,a.jsxs)("video",{ref:t,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,className:"absolute inset-0 w-full h-full object-cover opacity-20",poster:"/images/kirkify/hero-speed-laughing.gif",children:[(0,a.jsx)("source",{src:"/images/kirkify/hero-speed-laughing.webm",type:"video/webm"}),(0,a.jsx)("source",{src:"/images/kirkify/hero-speed-laughing.mp4",type:"video/mp4"}),(0,a.jsx)("div",{className:"absolute inset-0 w-full h-full opacity-20",style:{backgroundImage:"url(/images/kirkify/hero-speed-laughing.gif)",backgroundSize:"cover",backgroundPosition:"center"}})]})})}},84128:(e,r,t)=>{t.d(r,{e:()=>l});var a=t(42956),s=t(71720),o=t(86459),n=t(75481);function l(e){let{open:r,onOpenChange:t}=e,l=(0,o.c3)("PricingPage");return(0,a.jsx)(s.lG,{open:r,onOpenChange:t,children:(0,a.jsxs)(s.Cf,{className:"!w-[1200px] !max-w-[95vw] max-h-[90vh] overflow-y-auto p-4 sm:p-6",children:[(0,a.jsxs)(s.c7,{children:[(0,a.jsx)(s.L3,{className:"text-2xl sm:text-3xl font-bold text-center",children:l("title")}),(0,a.jsx)(s.rr,{className:"text-center text-sm sm:text-base",children:l("description")})]}),(0,a.jsx)("div",{className:"mt-4 sm:mt-6",children:(0,a.jsx)(n.PricingTable,{})})]})})}},87390:(e,r,t)=>{t.d(r,{f:()=>s});var a=t(98667);let s=(0,a.createServerReference)("40a0aa7d7c1a393b3919cabc84a588c10b47f240fb",a.callServer,void 0,a.findSourceMapURL,"addToGallery")},98514:(e,r,t)=>{t.d(r,{Y:()=>a});function a(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return null;let{watermark:t=!1}=r;if(e.startsWith("/api/image-proxy"))return t&&!e.includes("watermark=1")?e+(e.includes("?")?"&":"?")+"watermark=1":e;if(e.startsWith("/")||e.startsWith("data:")||e.startsWith("blob:"))return e;if(e.startsWith("https://")&&(e.includes(".r2.dev")||e.includes("pub-")||e.includes(".cloudflare"))){let r="/api/image-proxy?url=".concat(encodeURIComponent(e));return t?"".concat(r,"&watermark=1"):r}return e}},99847:(e,r,t)=>{t.d(r,{pC:()=>i,JB:()=>c,G4:()=>d,A7:()=>m});var a=t(98667);let s=(0,a.createServerReference)("7f2898468b27125a22adb4684bd53e90f96be3c588",a.callServer,void 0,a.findSourceMapURL,"getCreditBalanceAction"),o=(0,a.createServerReference)("7f96f4cd9c83c1cc38324a29de6899681bff5176a9",a.callServer,void 0,a.findSourceMapURL,"getCreditStatsAction"),n=(0,a.createServerReference)("7f08d4811a288228195d2a9d9bf974c741174adbc0",a.callServer,void 0,a.findSourceMapURL,"getCreditTransactionsAction");var l=t(35353);let i={all:["credits"],balance:()=>[...i.all,"balance"],stats:()=>[...i.all,"stats"],transactions:()=>[...i.all,"transactions"],transactionsList:e=>[...i.transactions(),e]};function c(){return(0,l.I)({queryKey:i.balance(),queryFn:async()=>{var e,r;let t=await s();if(!(null==t||null==(e=t.data)?void 0:e.success))throw Error((null==t||null==(r=t.data)?void 0:r.error)||"Failed to fetch credit balance");return t.data.credits||0}})}function d(){return(0,l.I)({queryKey:i.stats(),queryFn:async()=>{var e,r;let t=await o();if(!(null==t||null==(e=t.data)?void 0:e.success))throw Error((null==t||null==(r=t.data)?void 0:r.error)||"Failed to fetch credit stats");return t.data.data}})}function m(e,r,t,a){return(0,l.I)({queryKey:i.transactionsList({pageIndex:e,pageSize:r,search:t,sorting:a}),queryFn:async()=>{var s,o,l,i;let c=await n({pageIndex:e,pageSize:r,search:t,sorting:a});if(!(null==c||null==(s=c.data)?void 0:s.success))throw Error((null==c||null==(i=c.data)?void 0:i.error)||"Failed to fetch credit transactions");return{items:(null==(o=c.data.data)?void 0:o.items)||[],total:(null==(l=c.data.data)?void 0:l.total)||0}}})}}}]);
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.