PageSourceSearch

https://fylia.ai/_next/static/chunks/77493.f2eb27e0bd174727.js

js fylia.ai collected 2026-10-05 12:03:27 UTC 40,030 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[74414,77493],{5514:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(46774).A)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},14433:(e,t,r)=>{"use strict";r.d(t,{Yq:()=>l,cK:()=>c,fU:()=>o,fz:()=>d,n$:()=>u});var s=r(74414),n=r.n(s),i=r(92425),a=r.n(i);function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"HH:mm";return n()(e).format(t)}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"YYYY-MM-DD";return n()(e).format(t)}function c(e){return 0!==e&&n()(e).isSame(n()(),"day")}function u(){let e=Date.now().toString(36),t=Math.random().toString(36).substring(2,10);return"".concat(e,"-").concat(t)}function d(e){let t=n().duration(e,"seconds"),r=String(t.minutes()).padStart(2,"0"),s=String(t.seconds()).padStart(2,"0");return"".concat(r,":").concat(s)}n().extend(a())},27909:(e,t,r)=>{"use strict";r.d(t,{Z:()=>l});var s=r(63616),n=r(85776),i=r(76616),a=r(19984),o=r(95991);function l(e){let{name:t="version",title:r,description:l,options:c,afterSelect:u}=e,d=(0,n.c)("ui.form-field");return(0,s.jsxs)(o.cm,{children:[(0,s.jsx)(o.go,{icon:(0,s.jsx)(a.D8,{}),title:r||d("version")}),l&&(0,s.jsx)(o._s,{children:l}),(0,s.jsx)(i.z,{name:t,options:c,afterSelect:u})]})}},34475:(e,t,r)=>{"use strict";r.d(t,{es:()=>s.es,yD:()=>n.y});var s=r(42724);r(77138);var n=r(46464);r(24350)},35317:(e,t,r)=>{"use strict";r.d(t,{I:()=>a});var s=r(63616),n=r(27980),i=r(76616);function a(e){let{options:t}=e,r=(0,n.useMemo)(()=>t.map(e=>({...e,leftIcon:"0:0"===e.value?null:(0,s.jsx)("div",{className:"rounded-[1px] border-2 border-text-color",style:{width:e.iconWidth,height:e.iconHeight}})})),[t]);return(0,s.jsx)(i.z,{name:"ratio",options:r})}},36963:(e,t,r)=>{"use strict";r.d(t,{u:()=>o});var s=r(63616),n=r(85776),i=r(19984),a=r(95991);function o(e){let{children:t}=e,r=(0,n.c)("ui.form-field");return(0,s.jsxs)(a.cm,{children:[(0,s.jsx)(a.go,{icon:(0,s.jsx)(i.wB,{}),title:r("more_options")}),(0,s.jsx)("div",{"data-field":"more-options",className:'relative grid w-full grid-cols-2 gap-4 after:absolute after:inset-y-0 after:left-1/2 after:w-px after:-translate-x-1/2 after:rounded-full after:bg-light-gray-2 after:content-[""]',children:t})]})}},43336:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var s=r(63616),n=r(19256),i=r(57933),a=r(34475),o=r(70792),l=r(82713);function c(e){let{formType:t,children:r,className:c,wrapperClassName:u,onConfirmUrl:d}=e;return(0,s.jsx)(i.Ay,{imageFormType:t,children:(0,s.jsxs)("div",{className:(0,n.cn)("flex w-full flex-col gap-3 bg-[var(--c-bg)] p-3 lg:h-[856px] lg:flex-row lg:items-stretch lg:rounded-[36px] lg:p-5",c),children:[r,(0,s.jsxs)("div",{className:(0,n.cn)("flex h-full flex-col gap-3 lg:w-[calc(100%-350px)]","image-dialog"===t&&"hidden lg:flex",u),children:[(0,s.jsx)(a.es,{onConfirmUrl:d}),(0,s.jsx)(l.A,{}),(0,s.jsx)(o.A,{})]})]})})}},52120:(e,t,r)=>{"use strict";r.d(t,{Q:()=>E});var s=r(63616),n=r(27980),i=r(58620),a=r(85776),o=r(44743),l=r(41129),c=r(40225),u=r(71844),d=r(99348),m=r(37655),h=r(67676),f=r(14098),p=r(65493),g=r(6862),x=r(3569),v=r(66996),y=r(1455),b=r(32476),j=r(39189),w=r(78622),$=r(57933),N=r(28895),k=r(72424),S=r(73444),M=r(44885),A=r(10170),C=r(54867),T=r(51461),D=r(45167),I=r(8784),z=r(76616),O=r(95372),_=r(36963),H=r(65836),R=r(70693),V=r(35317),Y=r(52354),P=r(27909);let L=c.z.object({isPublic:c.z.boolean(),isTranslate:c.z.boolean(),prompt:c.z.string().optional(),disbaleModel:c.z.boolean(),ratio:c.z.string().optional(),model:c.z.string(),imageUrlList:c.z.array(c.z.string()).default([]),resolution:c.z.string().optional(),version:c.z.string().optional()});function U(){let{control:e}=(0,o.xW)(),[t]=(0,o.FH)({control:e,name:["model"]});return"gpt-image-2"===t?(0,s.jsx)(P.Z,{options:u.jy}):null}function F(){let e=(0,a.c)("ui.image-form"),t=(0,n.useMemo)(()=>({name:e("auto_ratio"),value:"0:0",iconWidth:"0px",iconHeight:"0px"}),[e]),{control:r}=(0,o.xW)(),[i]=(0,o.FH)({control:r,name:["model"]});return(0,s.jsxs)(_.u,{children:["nano-banana-ai"===i&&(0,s.jsx)(V.I,{options:[t,...u.cu]}),"nano-banana-pro"===i&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(V.I,{options:[t,...u.cu]}),(0,s.jsx)(z.z,{name:"resolution",options:u.vP})]}),"nano-banana-2"===i&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(V.I,{options:[t,...u.Hr]}),(0,s.jsx)(z.z,{name:"resolution",options:u.iq})]}),"gpt-image-2"===i&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(V.I,{options:u.ky}),(0,s.jsx)(z.z,{name:"resolution",options:u.vb})]}),["flux-kontext-pro","flux-kontext-max","flux-1-schnell","flux-1-pro","flux-1-1-pro","flux-1-1-pro-ultra"].includes(i)&&(0,s.jsx)(V.I,{options:u.bT}),"flux-2"===i&&(0,s.jsx)(V.I,{options:[t,...u.eq.filter(e=>"0:0"!==e.value)]}),"seedream-4-0"===i&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(V.I,{options:u.a4}),(0,s.jsx)(z.z,{name:"resolution",options:u.TA})]}),"seedream-4-5"===i&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(V.I,{options:u.dA}),(0,s.jsx)(z.z,{name:"resolution",options:u.YD})]}),"seedream-5-0"===i&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(V.I,{options:u.nP}),(0,s.jsx)(z.z,{name:"resolution",options:u.kh})]})]})}function E(e){var t;let{slotNode:r,formTitle:c,defaultFormValues:z}=e,_=(0,$.gZ)(),{translateTag:V,translateDescription:P}=(0,N.B0)(),E=(0,a.c)("ui.image-form"),W=(0,I.A)(e=>e.userInfo),B=(0,I.A)(e=>e.auth),q=(0,f.o)(),Z=(0,T.A)(e=>e.setOpen),G=(0,D.A)(e=>e.setOpen),J=(0,C.A)(e=>e.updateImageObj),{updateUserInfoWithDelay:Q}=(0,p.A)(),X=(0,A.A)(e=>e.shareImageObj),K=(0,A.A)(e=>e.setShareImageObj),ee=!!(null==W?void 0:W.isValidity),{appendFirstItem:et,updateFirstItem:er,removeFirstItem:es}=(0,M.HA)({filter:_,shouldFetch:!!W}),en=(0,x.mN)(z),ei=(0,o.mN)({resolver:(0,i.u)(L),defaultValues:en}),{handleSubmit:ea,control:eo,getValues:el,setValue:ec,formState:eu}=ei,{isSubmitting:ed}
1=eu,[em,eh,ef,ep]=(0,o.FH)({control:eo,name:["model","imageUrlList","resolution","version"]}),eg=(0,u.Lx)(em,(null==eh?void 0:eh.length)||0,ef||"",ep||""),ex=async e=>{if((0,d.o)("nano-banana-ai-submit"),!W||B&&B.expire_date<new Date().getTime())return void Z(!0);if(!ee&&eg&&(null==eg?void 0:eg.isPaid)||eg&&W.credits<(null==eg?void 0:eg.credit))return void G(!0);if(!e.prompt)return void l.o.error(E("noPromptInput"));if("image-to-image"===_&&0===e.imageUrlList.length)return void l.o.error(E("noImageInput"));try{let t="0:0"===e.ratio,[r,s]=((null==e?void 0:e.ratio)||"1:1").split(":").map(Number);et({id:-1,sourceImageUrl:"",platformType:0,platformName:"",modelId:0,prompt:"",outputPrompt:"",costCredits:50,categoryId:0,title:"",size:0,mimeType:"",tags:"",url:"",ratio:"".concat(0===r?1:r,"x").concat(0===s?1:s),resolution:"".concat(0===r?1:r,"x").concat(0===s?1:s),thumbnailUrl:"",createTime:0,modelName:"",nickName:"",categoryName:"",createBy:0,negativePrompt:"",params:{},updateBy:0,updateTime:new Date,isPublic:+!!e.isPublic,credits:null==eg?void 0:eg.credit,modelInfo:"",platformModel:"",urls:[],mediaCollections:[],dataResolution:"",status:"pending"});let n={imageType:"all"===_||"local-history"===_||"image-dialog"===_?void 0:_,prompt:e.prompt,outputPrompt:e.prompt,platformType:eg.platformType,modelName:eg.value,isPublic:+!!e.isPublic,imageUrlList:e.imageUrlList.length>0?e.imageUrlList:void 0,width:t?1:r,height:t?1:s,ratio:t?"1:1":e.ratio,supportRatio:!t};("seedream-4-0"===e.model||"seedream-4-5"===e.model||"seedream-5-0"===e.model||"gpt-image-2"===e.model||"nano-banana-pro"===e.model||"nano-banana-2"===e.model)&&(n={...n,resolution:e.resolution});let i=await (0,k.JX)(n),{code:a,msg:o,data:c}=i;if((null==i?void 0:i.code)===401)return void Z(!0);if(200!==a||(null==c?void 0:c.status)==="failed"||!(null==c?void 0:c.key))throw Error(o);let{code:u,msg:d,data:f}=await (0,m.__)({taskFunction:k.RF,params:i.data.key,intervalTime:1500,totalTimeLimit:3e5});if(200!==u||(null==f?void 0:f.status)==="failed"||!(null==f?void 0:f.imageResponseVo))throw Error((null==f?void 0:f.message)||d);if(er({id:f.imageResponseVo.id,url:f.imageResponseVo.url,resolution:f.imageResponseVo.resolution,prompt:e.prompt,outputPrompt:f.imageResponseVo.outputPrompt,costCredits:f.imageResponseVo.costCredits,platformType:f.imageResponseVo.platformType,platformName:f.imageResponseVo.platformName,modelId:f.imageResponseVo.modelId,modelName:f.imageResponseVo.modelName,nickName:f.imageResponseVo.nickName,categoryId:f.imageResponseVo.categoryId,categoryName:f.imageResponseVo.categoryName,createBy:f.imageResponseVo.createBy,createTime:f.imageResponseVo.createTime,mimeType:f.imageResponseVo.mimeType,tags:f.imageResponseVo.tags,thumbnailUrl:f.imageResponseVo.thumbnailUrl,title:f.imageResponseVo.title,updateBy:f.imageResponseVo.updateBy,updateTime:f.imageResponseVo.updateTime,isPublic:+!!e.isPublic,mediaCollections:f.imageResponseVo.mediaCollections||[]}),(0,h.E)(3e3),l.o.success(d),"image-dialog"===_){let[t,r]=f.imageResponseVo.resolution.split("x");J({id:f.imageResponseVo.id.toString(),src:f.imageResponseVo.url,name:f.imageResponseVo.url.split("/").pop(),resolution:"".concat(t,":").concat(r),prompt:e.prompt,credit:eg.credit,type:"display-one"}),(0,S.Tk)()}}catch(e){if((null==e?void 0:e.message)==="401")return void Z(!0);es(),l.o.error(e)}finally{Q()}},ev=(0,n.useCallback)(e=>{u.jG.includes(e)||(0,n.startTransition)(()=>{ec("model","nano-banana-pro")})},[ec]);return(0,n.useEffect)(()=>{if(X&&0===X.touchCount&&"image-to-image"===X.type){let e=el("imageUrlList")||[],t=e.includes(X.src)?e:[...e,X.src];(0,n.startTransition)(()=>{ec("imageUrlList",t)}),ev(em)}return()=>{X&&X.touchCount>0&&K(null)}},[X,em,el,ec,K,ev]),(0,s.jsx)(g.lV,{...ei,children:(0,s.jsx)(b._H,{styleVersion:"image-dialog"===_?"image-dialog":"v3",className:"image-dialog"===_?"!rounded-b-xl":"",children:(0,s.jsxs)(b.Yb,{onSubmit:ea(ex),children:[(0,s.jsx)(w.p,{}),r,(0,s.jsxs)(b.zw,{children:[(0,s.jsxs)(b.sf,{className:"gap-2",children:[(0,s.jsx)(b.zE,{title:c}),(0,s.jsx)(Y.O,{name:"model",mediaType:"image",options:Object.entries(u.xC).filter(e=>{let[t]=e;return q||!u.uX.includes(t)}).filter(e=>{let[t]=e;return"image-to-image"!==_||u.jG.includes(t)}).map(e=>{var t;let[r,s]=e;return{...s,name:s.name,description:P(r),value:r,icon:(0,N.kW)(r),infoTags:null==(t=s.imageInfoTags)?void 0:t.map(e=>({name:V(e),value:e,styleVersion:(0,N.x1)(e)}))}}),afterSelect:e=>{switch(e){case"seedream-4-0":(0,n.startTransition)(()=>{ec("resolution","1k"),ec("ratio","1:1")});break;case"seedream-4-5":case"seedream-5-0":(0,n.startTransition)(()=>{ec("resolution","2k"),ec("ratio","1:1")});break;case"gpt-image-2":(0,n.startTransition)(()=>{ec("version","low"),ec("resolution","1k"),ec("ratio","1:1")});break;case"nano-banana-pro":case"nano-banana-2":(0,n.startTransition)(()=>{ec("resolution","2k"),ec("ratio","1:1")});break;case"flux-2":(0,n.startTransition)(()=>{ec("version","pro"),ec("ratio","1:1")});break;default:(0,n.startTransition)(()=>{ei.setValue("ratio","1:1")})}}}),(0,s.jsx)(U,{}),(0,s.jsx)(O.H,{maxImages:null!=(t=null==eg?void 0:eg.maxImages)?t:5,afterSetImage:()=>{ev(em)},fieldTitle:"image-to-image"===_?E("upload_images_required"):void 0}),(0,s.jsx)(H.T,{}),(0,s.jsx)(F,{})]}),(0,s.jsxs)(b.IN,{children:[(0,s.jsx)(R._,{}),(0,s.jsx)(j.A,{disabled:ed,children:ed?(0,s.jsx)(v.A,{className:"size-4"}
1):(0,s.jsxs)(s.Fragment,{children:[E("generate"),(0,s.jsx)(y.A,{}),null==eg?void 0:eg.credit]})})]})]})]})})})}},53667:(e,t,r)=>{"use strict";r.d(t,{q:()=>s});let s=e=>Array.from({length:e},(e,t)=>t+1)},60242:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(46774).A)("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"}]])},63373:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>$});var s=r(63616),n=r(27980),i=r(60242),a=r(69327),o=r(85776),l=r(41129),c=r(66935),u=r(43336),d=r(52120),m=r(2467),h=r(54867),f=r(19256);function p(e){let{value:t,onChange:r,options:n,className:i}=e;return(0,s.jsx)("div",{className:(0,f.cn)("flex h-[45px] w-fit gap-1 rounded-xl bg-light-gray p-1",i),children:n.map(e=>{let n=t===e.value;return(0,s.jsx)("button",{type:"button",className:"h-full",onClick:()=>r(e.value),children:(0,s.jsx)("div",{className:(0,f.cn)("flex items-center justify-center rounded-lg px-5 py-2",n&&"bg-light-gray-1"),children:(0,s.jsx)("div",{className:(0,f.cn)("text-sm text-gray-color",n&&"text-white"),children:e.name})})},e.value)})})}var g=r(68964),x=r(53667),v=r(70613),y=r(73444);function b(){return(0,s.jsx)("div",{className:"grid w-full animate-pulse grid-cols-2 gap-2 lg:grid-cols-5",children:(0,x.q)(25).map(e=>(0,s.jsx)("div",{className:"h-52 rounded bg-main-gray lg:h-72"},e))})}function j(e){let{image:t,handleConfirm:r}=e;return(0,s.jsx)("div",{className:"w-full overflow-hidden rounded",children:(0,s.jsx)("img",{src:t.url,alt:t.title,className:"w-full cursor-pointer transition-all duration-200 hover:scale-105",loading:"lazy",decoding:"async",fetchPriority:"high",onClick:()=>r(t.url)})})}function w(e){let{onConfirm:t}=e,[r,i]=(0,n.useState)(1),{data:a,isLoading:o,total:l}=(0,y.Ay)({pageNum:r,pageSize:25}),c=async e=>{t(e)};return(0,s.jsxs)("div",{className:"relative flex h-full w-full flex-col items-center justify-center gap-3 px-8 py-3",children:[o&&(0,s.jsx)(b,{}),(0,s.jsx)("div",{className:"no-scrollbar h-full w-full overflow-y-auto",children:!o&&a&&a.length>0&&(0,s.jsx)(g.a,{items:a,config:{columns:[2,5],gap:[8,8],media:[768,1148]},render:e=>(0,s.jsx)(j,{image:e,handleConfirm:c},e.id)})}),(0,s.jsx)(v.A,{currentPage:r,pageSize:25,onChange:i,total:l||0,className:"mt-auto justify-center px-3 lg:px-0"})]})}function $(e){let{open:t,setOpen:r,onConfirm:f}=e,g=(0,o.c)("ui.image-dialog-form"),x=(0,h.A)(e=>e.imageObj),[v,y]=(0,n.useState)("create"),b=e=>{f(e),(0,n.startTransition)(()=>{r(!1)})};return(0,s.jsx)(c.lG,{open:t,onOpenChange:r,children:(0,s.jsx)(c.Cf,{onInteractOutside:e=>{e.preventDefault()},onSubmit:e=>{e.stopPropagation()},closeBtnClassName:"hidden",overlayClassName:"bg-black/60",className:"flex h-dvh w-dvw !rounded-none border-none bg-background-color p-0 shadow-[0px_0px_20px_0px_rgba(255,255,255,0.1)] lg:max-h-[723px] lg:min-w-[1322px] lg:!rounded-2xl",children:(0,s.jsxs)("div",{className:"flex size-full flex-col overflow-y-auto",children:[(0,s.jsxs)("div",{className:"flex w-full items-center justify-between border-b border-light-gray p-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(p,{value:v,onChange:e=>y(e),options:[{name:g("create"),value:"create"},{name:g("history"),value:"history"}]}),(0,s.jsx)(m.A,{tips:g("warning"),icon:(0,s.jsx)(i.A,{className:"size-4 cursor-help"})})]}),(0,s.jsx)("button",{type:"button",className:"flex size-5 items-center justify-center rounded hover:bg-white/10",onClick:()=>{if("loading"===x)return void l.o.warning(g("warning"));r(!1)},children:(0,s.jsx)(a.A,{className:"size-4 rounded-full text-[#D9D9D9]"})})]}),(0,s.jsxs)("div",{className:"w-full flex-1 overflow-hidden",children:["create"===v&&(0,s.jsx)(u.A,{formType:"image-dialog",className:"gap-2 rounded-none bg-background-color p-0 lg:h-full lg:p-0",wrapperClassName:"lg:w-[calc(100%-368px)]",onConfirmUrl:b,children:(0,s.jsx)(d.Q,{formTitle:g("title")})}),"history"===v&&(0,s.jsx)(w,{onConfirm:b})]})]})})})}},68964:(e,t,r)=>{"use strict";r.d(t,{a:()=>i});var s=r(27980);function n(e){return Array.isArray(e)?e:[e]}function i({items:e=[],render:t,config:r,...i}){let{columns:o,gap:l}
1=function(e,t,r){let[n,i]=(0,s.useState)({columns:0,gap:1});return(0,s.useEffect)(()=>{if(!e)return void i({columns:t[0],gap:r[0]});let s=e.map(e=>window.matchMedia(`(min-width: ${e}px)`)),n=()=>{let e=0;s.forEach(t=>{t.matches&&e++});let n=Math.min(s.length-1,Math.max(0,e));i({columns:t[n],gap:r[n]})};for(let e of(n(),s))e.addEventListener("change",n);return()=>{for(let e of s)e.removeEventListener("change",n)}},[n.columns,n.gap]),n}(r.media,n(r.columns),n(r.gap));if(!o)return null;let c=function(e=[],t=3){let r=Array.from({length:t},()=>[]);for(let s=0;s<t;s++)for(let t=0;t<e.length;t+=1)e[t][s]&&r[s].push(e[t][s]);return r}(function(e=[],t=3){let r=[];for(let s=0;s<e.length;s+=t){let n=e.slice(s,s+t);r.push(n)}return r}(e,o),o);return s.createElement("div",{...i,style:{display:"grid",alignItems:"start",gridColumnGap:l,gridTemplateColumns:`repeat(${o}, minmax(0, 1fr))`}},c.map((e,r)=>s.createElement(a,{gap:l,key:r},e.map((e,r)=>t(e,r)))))}function a({children:e,gap:t}){return s.createElement("div",{style:{display:"grid",rowGap:t,gridTemplateColumns:"minmax(0, 1fr)"}},e)}},70613:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var s=r(63616),n=r(5514),i=r(60935),a=r(36713),o=r(19256);function l(e){let{className:t,children:r}=e;return(0,s.jsx)("button",{type:"button",className:(0,o.cn)("size-8 rounded-lg bg-main-black p-px hover:cursor-pointer hover:text-white",t),children:(0,s.jsx)("span",{className:"flex-xy-center size-full flex-1 rounded-lg bg-dark-gray",children:r})})}function c(e){let{currentPage:t,pageSize:r,onChange:c,total:u,className:d}=e;return(0,s.jsx)(a.A,{className:(0,o.cn)("[&>li]:flex-xy-center flex gap-3 text-xs text-white",d),pageSize:r,current:t,onChange:c,total:u,showLessItems:!0,itemRender:(e,r,a)=>(function(e){let{page:t,type:r,element:a,currentPage:o}=e;return"page"===r?(0,s.jsx)(l,{className:t===o?"bg-white":"",children:t}):"prev"===r?(0,s.jsx)(l,{children:(0,s.jsx)(n.A,{className:"h-4 w-4"})}):"next"===r?(0,s.jsx)(l,{children:(0,s.jsx)(i.A,{className:"h-4 w-4"})}):"jump-prev"===r||"jump-next"===r?(0,s.jsx)("div",{children:"..."}):a})({page:e,type:r,element:a,currentPage:t}),locale:{next_page:"next",prev_page:"prev"},prevIcon:(0,s.jsx)(n.A,{className:"h-4 w-4"}),nextIcon:(0,s.jsx)(i.A,{className:"h-4 w-4"})})}},70792:(e,t,r)=>{"use strict";r.d(t,{A:()=>f});var s=r(63616),n=r(27980),i=r(85776),a=r(71844),o=r(53667),l=r(3356),c=r(73444),u=r(54867),d=r(76403),m=r(57933);function h(e){let{imgSrc:t,resolution:r,onClick:n}=e;return(0,s.jsxs)("div",{className:"group relative flex h-[130px] shrink-0 items-center justify-center overflow-hidden rounded-lg bg-[var(--c-light-light-gray2)] hover:cursor-pointer",onClick:n,children:[(0,s.jsx)("img",{src:t,alt:"imgSrc",fetchPriority:"low",loading:"lazy",className:"h-full bg-contain transition-all duration-200 group-hover:scale-110"}),(0,s.jsx)("div",{className:"absolute bottom-0.5 left-0.5 flex h-[25px] items-center justify-center rounded-6 border border-white bg-[#80808080] p-2.5 text-sm text-white backdrop-blur",children:r})]})}function f(){let e=(0,i.c)("ui.image-form.display"),t=(0,m.gZ)(),r=(0,u.A)(e=>e.updateImageObj),f=(0,u.A)(e=>e.setLayerImageObj),[p]=(0,n.useState)(1),{data:g,isLoading:x}=(0,c.Ay)({pageNum:p,pageSize:30,filter:t}),v=!!g&&g.length>0;return(0,s.jsxs)(d.A,{children:[!x&&!v&&(0,s.jsx)("div",{className:"bg flex size-[130px] shrink-0 items-center justify-center rounded-lg bg-white/10 px-3 py-2 text-center text-sm",children:e("noImage")}),x&&(0,s.jsx)("div",{className:"flex shrink-0 flex-nowrap gap-2 overflow-x-auto",children:(0,o.q)(8).map(e=>(0,s.jsx)("div",{className:"flex size-[130px] animate-pulse items-center justify-center rounded-lg bg-white/10"},e))}),!x&&v&&g.map(e=>(0,s.jsx)(h,{imgSrc:e.thumbnailUrl,resolution:(0,l.zi)(e.resolution,a.GX),onClick:()=>(e=>{let s=e.resolution.split("x").join(":");switch(t){case"new-year-cover":r({id:e.id.toString(),src:e.url,name:e.url.split("/").pop(),resolution:s,prompt:e.prompt,createTime:e.createTime,type:"new-year-cover",isPublic:e.isPublic,mediaCollections:e.mediaCollections,credit:e.credits});break;case"flux-fill":case"nano-banana-inpaint":f(null),(0,n.startTransition)(()=>{r({id:e.id.toString(),src:e.url,originalImg:e.sourceImageUrl,name:e.url.split("/").pop(),resolution:s,prompt:e.prompt,createTime:e.createTime,type:"compare-two",isPublic:e.isPublic,mediaCollections:e.mediaCollections,credit:e.credits})});break;default:r({id:e.id.toString(),src:e.url,name:e.url.split("/").pop(),resolution:s,prompt:e.prompt,createTime:e.createTime,type:"display-one",isPublic:e.isPublic,mediaCollections:e.mediaCollections,credit:e.credits})}})(e)},e.id))]})}},74414:function(e){e.exports=function(){"use strict";var e="millisecond",t="second",r="minute",s="hour",n="week",i="month",a="quarter",o="year",l="date",c="Invalid Date",u=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,d=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}
1|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m=function(e,t,r){var s=String(e);return!s||s.length>=t?e:""+Array(t+1-s.length).join(r)+e},h="en",f={};f[h]={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],r=e%100;return"["+e+(t[(r-20)%10]||t[r]||t[0])+"]"}};var p="$isDayjsObject",g=function(e){return e instanceof b||!(!e||!e[p])},x=function e(t,r,s){var n;if(!t)return h;if("string"==typeof t){var i=t.toLowerCase();f[i]&&(n=i),r&&(f[i]=r,n=i);var a=t.split("-");if(!n&&a.length>1)return e(a[0])}else{var o=t.name;f[o]=t,n=o}return!s&&n&&(h=n),n||!s&&h},v=function(e,t){if(g(e))return e.clone();var r="object"==typeof t?t:{};return r.date=e,r.args=arguments,new b(r)},y={s:m,z:function(e){var t=-e.utcOffset(),r=Math.abs(t);return(t<=0?"+":"-")+m(Math.floor(r/60),2,"0")+":"+m(r%60,2,"0")},m:function e(t,r){if(t.date()<r.date())return-e(r,t);var s=12*(r.year()-t.year())+(r.month()-t.month()),n=t.clone().add(s,i),a=r-n<0,o=t.clone().add(s+(a?-1:1),i);return+(-(s+(r-n)/(a?n-o:o-n))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(c){return({M:i,y:o,w:n,d:"day",D:l,h:s,m:r,s:t,ms:e,Q:a})[c]||String(c||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}};y.l=x,y.i=g,y.w=function(e,t){return v(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var b=function(){function m(e){this.$L=x(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[p]=!0}var h=m.prototype;return h.parse=function(e){this.$d=function(e){var t=e.date,r=e.utc;if(null===t)return new Date(NaN);if(y.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var s=t.match(u);if(s){var n=s[2]-1||0,i=(s[7]||"0").substring(0,3);return r?new Date(Date.UTC(s[1],n,s[3]||1,s[4]||0,s[5]||0,s[6]||0,i)):new Date(s[1],n,s[3]||1,s[4]||0,s[5]||0,s[6]||0,i)}}return new Date(t)}(e),this.init()},h.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},h.$utils=function(){return y},h.isValid=function(){return this.$d.toString()!==c},h.isSame=function(e,t){var r=v(e);return this.startOf(t)<=r&&r<=this.endOf(t)},h.isAfter=function(e,t){return v(e)<this.startOf(t)},h.isBefore=function(e,t){return this.endOf(t)<v(e)},h.$g=function(e,t,r){return y.u(e)?this[t]:this.set(r,e)},h.unix=function(){return Math.floor(this.valueOf()/1e3)},h.valueOf=function(){return this.$d.getTime()},h.startOf=function(e,a){var c=this,u=!!y.u(a)||a,d=y.p(e),m=function(e,t){var r=y.w(c.$u?Date.UTC(c.$y,t,e):new Date(c.$y,t,e),c);return u?r:r.endOf("day")},h=function(e,t){return y.w(c.toDate()[e].apply(c.toDate("s"),(u?[0,0,0,0]:[23,59,59,999]).slice(t)),c)},f=this.$W,p=this.$M,g=this.$D,x="set"+(this.$u?"UTC":"");switch(d){case o:return u?m(1,0):m(31,11);case i:return u?m(1,p):m(0,p+1);case n:var v=this.$locale().weekStart||0,b=(f<v?f+7:f)-v;return m(u?g-b:g+(6-b),p);case"day":case l:return h(x+"Hours",0);case s:return h(x+"Minutes",1);case r:return h(x+"Seconds",2);case t:return h(x+"Milliseconds",3);default:return this.clone()}},h.endOf=function(e){return this.startOf(e,!1)},h.$set=function(n,a){var c,u=y.p(n),d="set"+(this.$u?"UTC":""),m=((c={}).day=d+"Date",c[l]=d+"Date",c[i]=d+"Month",c[o]=d+"FullYear",c[s]=d+"Hours",c[r]=d+"Minutes",c[t]=d+"Seconds",c[e]=d+"Milliseconds",c)[u],h="day"===u?this.$D+(a-this.$W):a;if(u===i||u===o){var f=this.clone().set(l,1);f.$d[m](h),f.init(),this.$d=f.set(l,Math.min(this.$D,f.daysInMonth())).$d}else m&&this.$d[m](h);return this.init(),this},h.set=function(e,t){return this.clone().$set(e,t)},h.get=function(e){return this[y.p(e)]()},h.add=function(e,a){var l,c=this;e=Number(e);var u=y.p(a),d=function(t){var r=v(c);return y.w(r.date(r.date()+Math.round(t*e)),c)};if(u===i)return this.set(i,this.$M+e);if(u===o)return this.set(o,this.$y+e);if("day"===u)return d(1);if(u===n)return d(7);var m=((l={})[r]=6e4,l[s]=36e5,l[t]=1e3,l)[u]||1,h=this.$d.getTime()+e*m;return y.w(h,this)},h.subtract=function(e,t){return this.add(-1*e,t)},h.format=function(e){var t=this,r=this.$locale();if(!this.isValid())return r.invalidDate||c;var s=e||"YYYY-MM-DDTHH:mm:ssZ",n=y.z(this),i=this.$H,a=this.$m,o=this.$M,l=r.weekdays,u=r.months,m=r.meridiem,h=function(e,r,n,i){return e&&(e[r]||e(t,s))||n[r].slice(0,i)},f=function(e){return y.s(i%12||12,e,"0")},p=m||function(e,t,r){var s=e<12?"AM":"PM";return r?s.toLowerCase():s};return s.replace(d,function(e,s){return s||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return y.s(t.$y,4,"0");case"M":return o+1;case"MM":return y.s(o+1,2,"0");case"MMM":return h(r.monthsShort,o,u,3);case"MMMM":return h(u,o);case"D":return t.$D;case"DD":return y.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return h(r.weekdaysMin,t.$W,l,2);case"ddd":return h(r.weekdaysShort,t.$W,l,3);case"dddd":return l[t.$W];case"H":return String(i);case"HH":return y.s(i,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return p(i,a,!0);case"A":return p(i,a,!1);case"m":return String(a);case"mm":return y.s(a,2,"0");case"s":return String(t.$s);case"ss":return y.s(t.$s,2,"0");case"SSS":return y.s(t.$ms,3,"0");case"Z":return n}return null}(e)||n.replace(":","")})},h.utcOffset=function(){return-(15*Math.round(this.$d.getTimezoneOffset()/15))},h.diff=function(e,l,c){var u,d=this,m=y.p(l),h=v(e),f=(h.utcOffset()-this.utcOffset())*6e4,p=this-h,g=function(){return y.m(d,h)};switch(m){case o:u=g()/12;break;
1case i:u=g();break;case a:u=g()/3;break;case n:u=(p-f)/6048e5;break;case"day":u=(p-f)/864e5;break;case s:u=p/36e5;break;case r:u=p/6e4;break;case t:u=p/1e3;break;default:u=p}return c?u:y.a(u)},h.daysInMonth=function(){return this.endOf(i).$D},h.$locale=function(){return f[this.$L]},h.locale=function(e,t){if(!e)return this.$L;var r=this.clone(),s=x(e,t,!0);return s&&(r.$L=s),r},h.clone=function(){return y.w(this.$d,this)},h.toDate=function(){return new Date(this.valueOf())},h.toJSON=function(){return this.isValid()?this.toISOString():null},h.toISOString=function(){return this.$d.toISOString()},h.toString=function(){return this.$d.toUTCString()},m}(),j=b.prototype;return v.prototype=j,[["$ms",e],["$s",t],["$m",r],["$H",s],["$W","day"],["$M",i],["$y",o],["$D",l]].forEach(function(e){j[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),v.extend=function(e,t){return e.$i||(e(t,b,v),e.$i=!0),v},v.locale=x,v.isDayjs=g,v.unix=function(e){return v(1e3*e)},v.en=f[h],v.Ls=f,v.p={},v}()},76403:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var s=r(63616),n=r(27980),i=r(5514),a=r(60935),o=r(19256);function l(e){let{children:t,className:r}
1=e,l=(0,n.useRef)(null),[c,u]=(0,n.useState)(!1),[d,m]=(0,n.useState)(!1),h=()=>{if(l.current){let{scrollLeft:e,scrollWidth:t,clientWidth:r}=l.current;u(e>0),m(e<t-r)}},f=e=>{if(l.current){let t=l.current.clientWidth/2;"left"===e?l.current.scrollBy({left:-t,behavior:"smooth"}):l.current.scrollBy({left:t,behavior:"smooth"})}};return(0,n.useEffect)(()=>{h();let e=()=>h(),t=()=>h(),r=l.current;return r&&(r.addEventListener("scroll",e),window.addEventListener("resize",t)),()=>{r&&r.removeEventListener("scroll",e),window.removeEventListener("resize",t)}},[]),(0,s.jsx)("div",{className:"w-full max-w-full lg:w-dvw",children:(0,s.jsxs)("div",{className:(0,o.cn)("flex h-[154px] w-full items-center rounded-2xl bg-[var(--c-bg)]",r),children:[(0,s.jsx)("button",{type:"button",onClick:()=>f("left"),disabled:!c,className:(0,o.cn)("flex h-full w-8 shrink-0 items-center justify-center rounded-l-2xl transition-opacity",c?"opacity-100 hover:bg-[var(--c-secondary)]":"cursor-not-allowed opacity-70"),"aria-label":"Scroll left",children:(0,s.jsx)(i.A,{className:"h-5 w-5 text-gray-600"})}),(0,s.jsx)("div",{ref:l,className:(0,o.cn)("scrollbar-hide flex-1 overflow-x-auto overflow-y-hidden scroll-smooth px-2"),style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:(0,s.jsx)("div",{className:"flex gap-2",children:t})}),(0,s.jsx)("button",{type:"button",onClick:()=>f("right"),disabled:!d,className:(0,o.cn)("flex h-full w-8 shrink-0 items-center justify-center rounded-r-2xl transition-opacity",d?"opacity-100 hover:bg-[var(--c-secondary)]":"cursor-not-allowed opacity-70"),"aria-label":"Scroll right",children:(0,s.jsx)(a.A,{className:"h-5 w-5 text-gray-600"})})]})})}},82713:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var s=r(63616),n=r(60935),i=r(85776),a=r(6294),o=r(8784);function l(){let e=(0,i.c)("ui.image-form.display"),t=(0,o.A)(e=>e.userInfo);return(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,s.jsx)("div",{children:e("history")}),t&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"h-4 w-px rounded-full bg-[var(--c-text)]"}),(0,s.jsx)(a.N_,{href:"/profile/image-creations",children:(0,s.jsxs)("div",{className:"flex items-center gap-0.5 hover:text-main-color hover:underline",children:[e("check-all"),(0,s.jsx)(n.A,{className:"size-4"})]})})]})]})}},92425:function(e){e.exports=function(){"use strict";var e,t,r=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,s=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,n={years:31536e6,months:2628e6,days:864e5,hours:36e5,minutes:6e4,seconds:1e3,milliseconds:1,weeks:6048e5},i=function(e){return e instanceof d},a=function(e,t,r){return new d(e,r,t.$l)},o=function(e){return t.p(e)+"s"},l=function(e){return e<0},c=function(e){return l(e)?Math.ceil(e):Math.floor(e)},u=function(e,t){return e?l(e)?{negative:!0,format:""+Math.abs(e)+t}:{negative:!1,format:""+e+t}:{negative:!1,format:""}},d=function(){function l(e,t,r){var i=this;if(this.$d={},this.$l=r,void 0===e&&(this.$ms=0,this.parseFromMilliseconds()),t)return a(e*n[o(t)],this);if("number"==typeof e)return this.$ms=e,this.parseFromMilliseconds(),this;if("object"==typeof e)return Object.keys(e).forEach(function(t){i.$d[o(t)]=e[t]}),this.calMilliseconds(),this;if("string"==typeof e){var l=e.match(s);if(l){var c=l.slice(2).map(function(e){return null!=e?Number(e):0});return this.$d.years=c[0],this.$d.months=c[1],this.$d.weeks=c[2],this.$d.days=c[3],this.$d.hours=c[4],this.$d.minutes=c[5],this.$d.seconds=c[6],this.calMilliseconds(),this}}return this}var d=l.prototype;return d.calMilliseconds=function(){var e=this;this.$ms=Object.keys(this.$d).reduce(function(t,r){return t+(e.$d[r]||0)*n[r]},0)},d.parseFromMilliseconds=function(){var e=this.$ms;this.$d.years=c(e/31536e6),e%=31536e6,this.$d.months=c(e/2628e6),e%=2628e6,this.$d.days=c(e/864e5),e%=864e5,this.$d.hours=c(e/36e5),e%=36e5,this.$d.minutes=c(e/6e4),e%=6e4,this.$d.seconds=c(e/1e3),e%=1e3,this.$d.milliseconds=e},d.toISOString=function(){var e=u(this.$d.years,"Y"),t=u(this.$d.months,"M"),r=+this.$d.days||0;this.$d.weeks&&(r+=7*this.$d.weeks);var s=u(r,"D"),n=u(this.$d.hours,"H"),i=u(this.$d.minutes,"M"),a=this.$d.seconds||0;this.$d.milliseconds&&(a+=this.$d.milliseconds/1e3,a=Math.round(1e3*a)/1e3);var o=u(a,"S"),l=e.negative||t.negative||s.negative||n.negative||i.negative||o.negative,c=n.format||i.format||o.format?"T":"",d=(l?"-":"")+"P"+e.format+t.format+s.format+c+n.format+i.format+o.format;return"P"===d||"-P"===d?"P0D":d},d.toJSON=function(){return this.toISOString()},d.format=function(e){var s={Y:this.$d.years,YY:t.s(this.$d.years,2,"0"),YYYY:t.s(this.$d.years,4,"0"),M:this.$d.months,MM:t.s(this.$d.months,2,"0"),D:this.$d.days,DD:t.s(this.$d.days,2,"0"),H:this.$d.hours,HH:t.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:t.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:t.s(this.$d.seconds,2,"0"),SSS:t.s(this.$d.milliseconds,3,"0")};return(e||"YYYY-MM-DDTHH:mm:ss").replace(r,function(e,t){return t||String(s[e])})},d.as=function(e){return this.$ms/n[o(e)]},d.get=function(e){var t=this.$ms,r=o(e);return"milliseconds"===r?t%=1e3:t="weeks"===r?c(t/n[r]):this.$d[r],t||0},d.add=function(e,t,r){var s;return s=t?e*n[o(t)]:i(e)?e.$ms:a(e,this).$ms,a(this.$ms+s*(r?-1:1),this)},d.subtract=function(e,t){return this.add(e,t,!0)},d.locale=function(e){var t=this.clone();return t.$l=e,t},d.clone=function(){return a(this.$ms,this)},d.humanize=function(t){return e().add(this.$ms,"ms").locale(this.$l).fromNow(!t)},d.valueOf=function(){return this.asMilliseconds()},d.milliseconds=function(){return this.get("milliseconds")},d.asMilliseconds=function(){return this.as("milliseconds")},d.seconds=function(){return this.get("seconds")},d.asSeconds=function(){return this.as("seconds")},d.minutes=function(){return this.get("minutes")},d.asMinutes=function(){return this.as("minutes")},d.hours=function(){return this.get("hours")},d.asHours=function(){return this.as("hours")},d.days=function(){return this.get("days")},d.asDays=function(){return this.as("days")},d.weeks=function(){return this.get("weeks")},d.asWeeks=function(){return this.as("weeks")},d.months=function(){return this.get("months")},d.asMonths=function(){return this.as("months")},d.years=function(){return this.get("years")},d.asYears=function(){return this.as("years")},l}(),m=function(e,t,r){return e.add(t.years()*r,"y").add(t.months()*r,"M").add(t.days()*r,"d").add(t.hours()*r,"h").add(t.minutes()*r,"m").add(t.seconds()*r,"s").add(t.milliseconds()*r,"ms")};return function(r,s,n){e=n,t=n().$utils(),n.duration=function(e,t){return a(e,{$l:n.locale()},t)},n.isDuration=i;var o=s.prototype.add,l=s.prototype.subtract;s.prototype.add=function(e,t){return i(e)?m(this,e,1):o.bind(this)(e,t)},s.prototype.subtract=function(e,t){return i(e)?m(this,e,-1):l.bind(this)(e,t)}}}()},95372:(e,t,r)=>{"use strict";r.d(t,{H:()=>k});var s=r(63616),n=r(85776),i=r(27980),a=r(15808),o=r(8820),l=r(47848),c=r(41097),u=r(73503),d=r(881),m=r(9623),h=r(44743),f=r(41129),p=r(19256),g=r(38607),x=r(36636),v=r(6862),y=r(60253);let b=(0,a.default)(()=>Promise.all([r.e(9962),r.e(36297),r.e(14357)]).then(r.bind(r,14357)).then(e=>
1e.ImageCuttingDialog),{loadableGenerated:{webpack:()=>[14357]},ssr:!1}),j={"image/jpeg":[".jpg",".jpeg"],"image/png":[".png"],"image/webp":[".webp"],"image/heic":[".heic"],"image/heif":[".heif"]},w=(0,i.forwardRef)((e,t)=>{let{name:r,afterSetImage:a,onImageAdded:w,onDelete:$,maxImages:N=5,acceptedImageTypes:k=j,ratioLimit:S,enableCutting:M=!0}=e,A=(0,n.c)("ui.form-field.image-upload"),C=(0,h.xW)(),{setValue:T,getValues:D,control:I}=C,z=(0,h.FH)({control:I,name:r}),O=Array.isArray(z)?z:[],_=(0,i.useRef)(null),[H,R]=(0,i.useState)([]),[V,Y]=(0,i.useState)(null),P=(0,x.O)(),{uploadFile:L}=(0,y.useEagerUpload)(),U=(0,i.useCallback)(e=>{T(r,e,{shouldDirty:!0,shouldTouch:!0})},[r,T]),F=(0,i.useCallback)(()=>{let e=D(r);return Array.isArray(e)?e:[]},[D,r]),E=(0,i.useCallback)(e=>{U([...F(),e])},[F,U]),W=(0,i.useCallback)(e=>{E(e),null==w||w(e),null==a||a()},[E,w,a]),B=(0,i.useCallback)(async e=>{let t=(0,d.Ak)();R(e=>[...e,{id:t}]);try{let t=await L(e);t&&(E(t),null==w||w(t),null==a||a())}finally{R(e=>e.filter(e=>e.id!==t))}},[L,E,w,a]),q=(0,i.useCallback)(e=>{U(F().filter((t,r)=>r!==e)),null==$||$()},[F,U,$]),Z=(0,i.useCallback)(async e=>{if(e.length>1)return void f.o.error(A("single-file-error"));let t=e[0];if(t){if(S&&S.length>0){let e=await (0,g.Uc)(t);if(e<S[0]||e>S[1])return void f.o.error("".concat(A("ratio-limit"),": ").concat(S[0]," - ").concat(S[1]))}if(!(N-F().length-H.length<=0)){if(M)return void Y(t);B(t)}}},[M,S,N,H.length,B,A,F]),G=(0,i.useCallback)(e=>{if(!e.length)return;if(e.some(e=>e.errors.some(e=>"too-many-files"===e.code)))return void f.o.error(A("single-file-error"));let t=Object.keys(k).join(", ").replaceAll("image/","");f.o.error("".concat(A("support"),": ").concat(t))},[k,A]),{getRootProps:J,getInputProps:Q,isDragActive:X,open:K,inputRef:ee}=(0,m.VB)({onDrop:Z,onDropRejected:G,accept:k,maxFiles:1,multiple:!1,disabled:O.length>=N||H.length>0||!!V}),et=(0,i.useCallback)(()=>{U([]),ee.current&&(ee.current.value=""),_.current&&(_.current.value="")},[U,ee]),er=(0,i.useCallback)(()=>{switch(P){case"safari":case"firefox":var e;null==(e=_.current)||e.click();break;default:K()}},[K,P,_]);(0,i.useImperativeHandle)(t,()=>({addImageUrl:W,removeImage:q,removeAllImages:et}));let es=O.length+H.length,en=H.length>0,ei=(0,i.useCallback)(()=>{ee.current&&(ee.current.value=""),_.current&&(_.current.value="")},[ee]),ea=(0,i.useCallback)(()=>{Y(null),ei()},[ei]),eo=(0,i.useCallback)(async e=>{Y(null),ei(),await B(e)},[ei,B]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex h-[106px] w-full flex-col gap-2.5 bg-transparent",children:[(0,s.jsx)("div",{...J(),className:(0,p.cn)("relative h-full w-full rounded-xl border border-dashed border-light-gray-2 hover:border-white",X&&"border-collapse border-white",O.length>=N||en||V?"cursor-not-allowed opacity-50":"[&_[data-upload]]:cursor-pointer",es>0&&"absolute h-0 w-0 overflow-hidden opacity-0"),children:(0,s.jsx)(v.zB,{control:C.control,name:r,render:()=>(0,s.jsxs)(v.eI,{className:"flex h-full w-full flex-col space-y-0",children:[(0,s.jsxs)(v.lR,{className:"flex h-full w-full flex-col items-center justify-center gap-1 text-gray-color",children:[(0,s.jsx)(o.A,{className:"size-5"}),(0,s.jsx)("div",{"data-upload":!0,className:"text-sm whitespace-pre-line",children:X?A("drop"):"".concat(A("support"),": ").concat(Object.keys(k).join(", ").replaceAll("image/",""))})]}),(0,s.jsx)(v.MJ,{children:(0,s.jsx)("input",{...Q(),ref:"safari"===P||"firefox"===P?_:void 0})})]})})}),es>0&&(0,s.jsxs)("div",{className:"flex h-full flex-col gap-2 rounded-xl border border-dashed border-light-gray-2 p-2",children:[(0,s.jsxs)("div",{className:"no-scrollbar flex h-full min-h-0 w-full items-center gap-1 overflow-auto",children:[O.map((e,t)=>(0,s.jsxs)("div",{className:"bg-color-medium-gray group relative flex h-[56px] shrink-0 items-center justify-center overflow-hidden rounded",children:[(0,s.jsx)("img",{src:e,alt:"Upload ".concat(t+1),className:"block h-full w-auto max-w-none rounded-inherit object-cover"}),(0,s.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),e.preventDefault(),q(t)},className:"absolute inset-0 z-10 hidden items-center justify-center rounded-inherit bg-black/40 group-hover:flex",children:(0,s.jsx)(l.A,{className:"size-5 text-white"})})]},e)),H.map(e=>(0,s.jsx)("div",{className:"relative flex size-[56px] shrink-0 items-center justify-center rounded bg-white/20",children:(0,s.jsx)(c.A,{className:"size-6 animate-spin text-white"})},e.id))]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[O.length<N&&(0,s.jsxs)("button",{type:"button",onClick:er,className:"flex items-center gap-1 text-sm text-gray-color hover:text-white",disabled:en||!!V,children:[(0,s.jsx)(u.A,{className:"size-4"}),(0,s.jsx)("span",{children:A("add")}),O.length>0?"(".concat(O.length,"/").concat(N,")"):""]}),O.length>0&&(0,s.jsxs)("button",{type:"button",onClick:et,className:"flex items-center gap-1 text-sm text-gray-color hover:text-white",children:[(0,s.jsx)(l.A,{className:"size-4"}),(0,s.jsx)("span",{children:A("clear")})]})]})]})]}),M&&V&&(0,s.jsx)(b,{file:V,open:!0,onCancel:ea,onConfirm:eo})]})});w.displayName="ImageListUploadField";var $=r(19984),N=r(95991);function k(e){let{name:t="imageUrlList",maxImages:r,fieldTitle:i,acceptedImageTypes:a,ratioLimit:o,afterSetImage:l}=e,c=(0,n.c)("ui.form-field");return(0,s.jsxs)(N.cm,{children:[(0,s.jsx)(N.go,{icon:(0,s.jsx)($.xf,{}),title:i||c("upload_images_optional")}),(0,s.jsx)(w,{name:t,maxImages:r,acceptedImageTypes:a,ratioLimit:o,afterSetImage:l})]})}}}]);

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.