PageSourceSearch

http://chupian.cloud/_next/static/chunks/app/templates/%5Bcategory%5D/page-422d71cc3f9a4161.js

js chupian.cloud collected 2026-10-02 01:20:51 UTC 16,928 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[473],{704:function(e,t,r){Promise.resolve().then(r.bind(r,9207))},9207:function(e,t,r){"use strict";r.d(t,{default:function(){return w}});var i=r(5626),n=r(4087),a=r(6418),o=r(6097),s=r(9008),l=r(3096),c=r(8434),u=r(2204),d=r(7077);function m(e,t){let r=233280*Math.sin(9301*e+49297*t);return r-Math.floor(r)}let h=Date.parse("2026-01-01T00:00:00Z");function f(e){let t=function(e){let t=2166136261;for(let r=0;r<e.length;r++)t=Math.imul(t^e.charCodeAt(r),16777619)>>>0;return t>>>0}(e.id),r=Math.floor(360*m(t,7)),i=e.community?Math.max(120,Math.floor(9e3*m(t,1))+200):Math.max(80,Math.floor(4500*m(t,1))+120),n="number"==typeof e.likes?e.likes:Math.max(8,Math.floor(i*(.06+.08*m(t,2)))),a="number"==typeof e.favorites?e.favorites:Math.max(3,Math.floor(i*(.02+.04*m(t,3)))),o="number"==typeof e.extractCount&&e.extractCount>0?Math.max(i,30*e.extractCount):i;return{views:o,likes:n,favorites:a,ageDays:r,heat:Math.log10(Math.max(1,o+3*n+8*a))-.012*r}}function p(e){let t=Number(e);return Number.isFinite(t)?Math.max(4,Math.min(10,Math.round(t))):5}var g=r(7603),v=r(9687);let y={female:{zh:"女性风格",en:"Feminine"},male:{zh:"男性风格",en:"Masculine"},binary:{zh:"二次元 / 漫画风",en:"Anime / Illustration"},realistic:{zh:"高级氛围感",en:"Cinematic"}},x=["poster","seaside","forest","beach","ocean","newspaper","car","海边","海岸","森林","风景","景物","码头","草地","海报"];function b(e){let t="".concat(e.id," ").concat(e.title," ").concat(e.tag," ").concat(e.summary).toLowerCase();return!x.some(e=>t.includes(e.toLowerCase()))}function w(e){let{category:t}=e,{locale:r}=(0,g.Q)(),m=y[t],[v,x]=(0,n.useState)(null),[w,j]=(0,n.useState)(null),[N,S]=(0,n.useState)({}),[C,M]=(0,n.useState)([]),[A,T]=(0,n.useState)([]),[z,_]=(0,n.useState)([]),[L,E]=(0,n.useState)([]),[F,P]=(0,n.useState)([]),[R,I]=(0,n.useState)(1);(0,n.useEffect)(()=>{x(window.location.hostname||null)},[]),(0,n.useEffect)(()=>{let e=!1;return(0,c.My)({sort:"hot",limit:500}).then(t=>{e||j(t)}).catch(()=>{e||j([])}),()=>{e=!0}},[]),(0,n.useEffect)(()=>{let e=!1;return(0,c.TW)().then(t=>{e||S(t)}
1).catch(()=>{e||S({})}),()=>{e=!0}},[]),(0,n.useEffect)(()=>{let e=!1;return fetch("".concat((0,u.bR)(),"/api/site/home-featured")).then(e=>e.ok?e.json():null).then(t=>{if(e||!t)return;let r=Array.isArray(t.featured)?t.featured:Array.isArray(t.ids)?t.ids:[],i=Array.isArray(t.priority)?t.priority:[],n=Array.isArray(t.excluded)?t.excluded:[];M(r.map(String)),T(i.map(String)),_(n.map(String))}).catch(()=>{}),()=>{e=!0}},[]),(0,n.useEffect)(()=>{let e=!1;return(0,c.aX)().then(t=>{e||(E(t.likes),P(t.favorites))}),()=>{e=!0}},[]);let O=(0,n.useCallback)(e=>{var t;let r=N[e.id];return r?{...e,title:(null===(t=r.title)||void 0===t?void 0:t.trim())?r.title.trim():e.title,summary:null===r.tagline?"":"string"==typeof r.tagline&&r.tagline.trim()?r.tagline.trim():e.summary,mobileSummary:null===r.tagline?"":"string"==typeof r.tagline&&r.tagline.trim()?r.tagline.trim():e.mobileSummary,category:"female"===r.category||"male"===r.category||"binary"===r.category||"realistic"===r.category?r.category:e.category,cover:"string"==typeof r.coverImageUrl&&r.coverImageUrl.trim()?r.coverImageUrl.trim():e.cover}:e},[N]),Z=!!v&&("chupian.cloud"===v||v.endsWith(".chupian.cloud")),W=Z||"zh"===r,U=(0,n.useMemo)(()=>(function(e){let t=new Map;for(let r of e.apiItems){let i=function(e,t){var r;let i;if(!e.coverImageUrl)return null;let n=e.tag||("zh"===t?"精选风格":"Curated style"),a="zh"===t?"精选风格范本,可一键提取风格配方。":"Curated style preset \xb7 extract the recipe in one tap.",o=e.tagline&&(e.tagline.includes("{argument")||e.tagline.includes("{character")||e.tagline.includes("{name")),s="zh"===t?(i=e.tagline)&&/[\u4e00-\u9fff]/.test(i)&&!o&&e.tagline?e.tagline:a:e.tagline||a;return{id:e.id,kind:"api",category:"female"===(r=e.category)||"male"===r||"binary"===r||"realistic"===r?r:"realistic",cover:e.coverImageUrl,title:e.title,tag:n,summary:s,audience:e.tags.slice(0,3),priceCredits:p(e.priceCredits),originalPriceCredits:p(e.priceCredits),likes:e.likeCount,favorites:e.buyCount,views:Math.max(12*e.useCount,4*e.likeCount,1),createdAt:e.createdAt,sortOrder:1e6,authorLabel:null,hasLiked:!!e.hasLiked,hasFavorited:!!e.hasFavorited}}(r,e.locale);i&&t.set(i.id,i)}for(let r of e.staticItems){if(t.has(r.id))continue;let i=function(e,t,r){var i,n;if(!e.cover||"ready"!==e.availability)return null;let a=(0,d.p9)(e,t),o=f(e);return{id:e.id,kind:"static",category:e.category,cover:function(e){let t=e||"",[r="",i]=t.split("?");if(!r.startsWith("/templates/")||r.startsWith("/templates/_wm"))return t;let n=r.replace(/^\/templates\//,"/templates/_wm_low/").replace(/\.(png|jpe?g|webp)$/i,".webp");return i?"".concat(n,"?").concat(i):n}(e.cover),title:a.title,tag:a.tag,summary:a.summary,audience:(0,d.X2)(e,t),priceCredits:p(null!==(i=e.priceCredits)&&void 0!==i?i:5),originalPriceCredits:p(null!==(n=e.priceCredits)&&void 0!==n?n:5),likes:o.likes,favorites:o.favorites,views:o.views,createdAt:h-864e5*f(e).ageDays,sortOrder:e.sortOrder,authorLabel:e.author?"@".concat(e.author):null}}(r,e.locale,e.domesticStaticPricing);i&&t.set(i.id,i)}return[...t.values()]})({locale:r,domesticStaticPricing:Z,staticItems:l.ro.filter(e=>"ready"===e.availability&&!!e.cover&&(!W||b(e))).filter(e=>{var t;return!(null===(t=N[e.id])||void 0===t?void 0:t.deleted)}).map(O),apiItems:(null!=w?w:[]).filter(e=>!W||b({id:e.id,title:e.title,tag:e.category||"",summary:e.tagline||e.tags.join(" ")}))}),[Z,r,W,w,N,O]),q=(0,n.useMemo)(()=>{var e;let r=(e=U.filter(e=>e.category===t&&!z.includes(e.id)),[...e].sort((e,t)=>{let r=6*e.favorites+3*e.likes,i=6*t.favorites+3*t.likes;return i!==r?i-r:t.createdAt-e.createdAt})),i=new Set(C),n=new Set(A),a=new Set(L),o=new Set(F),s=r.filter(e=>n.has(e.id)),l=r.filter(e=>!n.has(e.id)&&o.has(e.id));return[...s,...l,...r.filter(e=>!n.has(e.id)&&!o.has(e.id)&&a.has(e.id)),...r.filter(e=>!n.has(e.id)&&!o.has(e.id)&&!a.has(e.id)&&i.has(e.id)),...r.filter(e=>!n.has(e.id)&&!o.has(e.id)&&!a.has(e.id)&&!i.has(e.id))]},[U,t,z,C,A,L,F]),B=Math.max(1,Math.ceil(q.length/24)),D=Math.min(Math.max(1,R),B),H=q.slice((D-1)*24,24*D);return(0,i.jsx)("main",{className:"min-h-screen bg-[linear-gradient(180deg,#FFFDF9_0%,#FFF8F4_45%,#FFF0F0_100%)] text-stone-950",children:(0,i.jsxs)("div",{className:"mx-auto max-w-7xl px-4 pb-24 pt-6 sm:px-6 lg:px-8",children:[(0,i.jsxs)(a.default,{href:"/#templates",className:"inline-flex items-center gap-1.5 text-sm font-medium text-stone-600 hover:text-stone-900",children:[(0,i.jsx)(o.Z,{className:"h-4 w-4"}),"zh"===r?"返回首页":"Back to home"]}),(0,i.jsxs)("header",{className:"mt-4 mb-8",children:[(0,i.jsx)("h1",{className:"text-3xl font-semibold tracking-tight",children:"zh"===r?m.zh:m.en}),(0,i.jsx)("p",{className:"mt-2 text-sm text-stone-500",children:"zh"===r?"共 ".concat(q.length," 款,按钉子、收藏、点赞与热度排序。"):"".concat(q.length," looks, sorted by pins, favorites, like
1s and heat.")})]}),null===w?(0,i.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:Array.from({length:8}).map((e,t)=>(0,i.jsx)("div",{className:"relative aspect-[4/5] overflow-hidden rounded-2xl bg-stone-100",children:(0,i.jsx)("div",{className:"absolute inset-0 animate-pulse bg-gradient-to-br from-stone-100 via-stone-200/70 to-stone-100"})},"skeleton-".concat(t)))}):0===H.length?(0,i.jsx)("div",{className:"rounded-3xl border border-stone-200 bg-white py-20 text-center text-sm text-stone-500",children:"zh"===r?"暂无模板":"No templates"}):(0,i.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:H.map((e,t)=>(0,i.jsx)(k,{template:e,priority:t<4},e.id))}),B>1&&(0,i.jsxs)("div",{className:"mt-10 flex items-center justify-center gap-2",children:[(0,i.jsxs)("button",{type:"button",onClick:()=>{I(e=>Math.max(1,e-1)),window.scrollTo({top:0,behavior:"smooth"})},disabled:D<=1,className:"inline-flex items-center gap-1.5 rounded-full border border-stone-200 bg-white px-4 py-2 text-sm font-medium text-stone-700 hover:bg-stone-50 disabled:cursor-not-allowed disabled:opacity-40",children:[(0,i.jsx)(o.Z,{className:"h-4 w-4"}),"zh"===r?"上一页":"Prev"]}),(0,i.jsxs)("span",{className:"text-sm text-stone-600",children:[D," / ",B]}),(0,i.jsxs)("button",{type:"button",onClick:()=>{I(e=>Math.min(B,e+1)),window.scrollTo({top:0,behavior:"smooth"})},disabled:D>=B,className:"inline-flex items-center gap-1.5 rounded-full border border-stone-200 bg-white px-4 py-2 text-sm font-medium text-stone-700 hover:bg-stone-50 disabled:cursor-not-allowed disabled:opacity-40",children:["zh"===r?"下一页":"Next",(0,i.jsx)(s.Z,{className:"h-4 w-4"})]})]})]})})}function k(e){let{template:t,priority:r=!1}=e,{locale:n}=(0,g.Q)();return(0,i.jsxs)(a.default,{href:"/studio?template=".concat(t.id),onClick:()=>(0,v.p)("template_click",{template_id:t.id,category:t.category,price_credits:t.priceCredits}),className:"group overflow-hidden rounded-[20px] border border-stone-200 bg-white shadow-sm transition hover:shadow-lg",children:[(0,i.jsx)("div",{className:"relative overflow-hidden",children:(0,i.jsx)("img",{src:function(e){let[t="",r=""]=e.split("?",2);if(!t.startsWith("/uploads/"))return e;let i=t.lastIndexOf(".");if(i<=9)return e;let n="/uploads/_template_thumbs/".concat(t.slice(9,i),".webp");return r?"".concat(n,"?").concat(r):n}(t.cover),alt:t.title,width:560,height:700,className:"aspect-[4/5] w-full object-cover transition duration-500 group-hover:scale-[1.05]",loading:r?"eager":"lazy",fetchPriority:r?"high":"auto",decoding:"async",onError:e=>{let r=e.currentTarget;"1"!==r.dataset.originalCover&&(r.dataset.originalCover="1",r.src=t.cover)}})}),(0,i.jsxs)("div",{className:"space-y-2 p-4",children:[(0,i.jsx)("span",{className:"inline-flex rounded-full bg-rose-50 px-3 py-1 text-[11px] font-medium text-rose-500",children:t.tag}),(0,i.jsx)("h3",{className:"text-base font-semibold line-clamp-2",title:t.title,children:t.title}),(0,i.jsx)("p",{className:"text-xs leading-5 text-stone-500 line-clamp-2",title:t.summary,children:t.summary}),(0,i.jsxs)("div",{className:"flex items-center justify-between text-[11px] text-stone-500",children:[(0,i.jsxs)("span",{children:["zh"===n?"收藏":"Fav"," ",t.favorites," \xb7 ","zh"===n?"点赞":"Like"," ",t.likes]}),(0,i.jsx)("span",{className:"font-semibold text-rose-600",children:"zh"===n?"提取 ".concat(t.priceCredits," 积分"):"Extract ".concat(t.priceCredits," credits")})]})]})]})}},9687:function(e,t,r){"use strict";r.d(t,{AnalyticsTracker:function(){return u},p:function(){return c}});var i=r(4087),n=r(7228),a=r(2204),o=r(26);function s(){if("undefined"==typeof navigator)return"desktop";let e=navigator.userAgent.toLowerCase();return/ipad|tablet/.test(e)?"tablet":/iphone|android|mobile|micromessenger/.test(e)?"mobile":"desktop"}function l(e,t){let r=window.localStorage.getItem("promptlens_token")||"",i="".concat((0,a.bR)()).concat(e),n=JSON.stringify(t),o=!1,s=()=>{if(!o&&"/api/analytics/event"===e){o=!0;try{var r,i,n,s,l,c,u,d,m;let e=t.campaign&&"object"==typeof t.campaign?t.campaign:{},o=new URLSearchParams({e:String(null!==(r=t.event)&&void 0!==r?r:"").slice(0,64),path:String(null!==(i=t.path)&&void 0!==i?i:"/").slice(0,160),title:String(null!==(n=t.title)&&void 0!==n?n:"").slice(0,120),device:String(null!==(s=t.device)&&void 0!==s?s:"desktop").slice(0,16),us:String(null!==(l=e.utm_source)&&void 0!==l?l:"").slice(0,120),um:String(null!==(c=e.utm_medium)&&void 0!==c?c:"").slice(0,120),uc:String(null!==(u=e.utm_campaign)&&void 0!==u?u:"").slice(0,120),ut:String(null!==(d=e.utm_content)&&void 0!==d?d:"").slice(0,120),p:JSON.stringify(null!==(m=t.properties)&&void 0!==m?m:{}).slice(0,900)}),h="".concat(Date.now().toString(36),"-").concat(Math.random().toString(36).slice(2,10));new Image().src="".concat((0,a.bR)(),"/api/i/").concat(h,".gif?").concat(o.toString())}catch(e){}}};fetch(i,{method:"POST",keepalive:!0,headers:{"Content-Type":"application/json",...r?{Authorization:"Bearer ".concat(r)}:{}},body:n}).catch(()=>{try{let e=new XMLHttpRequest;e.open("POST",i,!0),e.setRequestHeader("Content-Type","application/json"),r&&e.setRequestHeader("Authorization","Bearer ".concat(r)),e.addEventListener("loadend",()=>{e.status||s()}),e.addEventListener("error",s),e.send(n)}catch(e){s()}})}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};l("/api/analytics/event",{event:e,path:window.location.pathname,title:document.title,referrer:document.referrer||null,device:s(),campaign:(0,o.h)(),properties:t})}function u(){let e=(0,n.usePathname)(),t=(0,i.useRef)("");return(0,i.useEffect)(()=>{let r="".concat(e).concat(window.location.search);if(t.current===r)return;t.current=r;let i={path:e,title:document.title,referrer:document.referrer||null,device:s(),campaign:(0,o.h)()};l("/api/analytics/visit",i),l("/api/analytics/event",{event:"page_view",...i,properties:{}})},[e]),null}},2512:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});var i=r(4087);let n=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),a=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter((e,t,r)=>!!e&&r.indexOf(e)===t).join(" ")};var o={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let s=(0,i.forwardRef)((e,t)=>{let{color:r="currentColor",size:n=24,strokeWidth:s=2,absoluteStrokeWidth:l,className:c="",children:u,iconNode:d,...m}=e;return(0,i.createElement)("svg",{ref:t,...o,width:n,height:n,stroke:r,strokeWidth:l?24*Number(s)/Number(n):s,className:a("lucide",c),...m},[...d.map(e=>{let[t,r]=e;return(0,i.createElement)(t,r)}),...Array.isArray(u)?u:[u]])}),l=(e,t)=>
1{let r=(0,i.forwardRef)((r,o)=>{let{className:l,...c}=r;return(0,i.createElement)(s,{ref:o,iconNode:t,className:a("lucide-".concat(n(e)),l),...c})});return r.displayName="".concat(e),r}},6097:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});let i=(0,r(2512).Z)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},9008:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});let i=(0,r(2512).Z)("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])},6418:function(e,t,r){"use strict";r.d(t,{default:function(){return n.a}});var i=r(3168),n=r.n(i)},7228:function(e,t,r){"use strict";var i=r(9701);r.o(i,"usePathname")&&r.d(t,{usePathname:function(){return i.usePathname}}),r.o(i,"useRouter")&&r.d(t,{useRouter:function(){return i.useRouter}}),r.o(i,"useSearchParams")&&r.d(t,{useSearchParams:function(){return i.useSearchParams}})},5717:function(e,t,r){"use strict";var i,n;e.exports=(null==(i=r.g.process)?void 0:i.env)&&"object"==typeof(null==(n=r.g.process)?void 0:n.env)?r.g.process:r(2913)},2913:function(e){!function(){var t={229:function(e){var t,r,i,n=e.exports={};function a(){throw Error("setTimeout has not been defined")}function o(){throw Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===a||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:a}catch(e){t=a}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var l=[],c=!1,u=-1;function d(){c&&i&&(c=!1,i.length?l=i.concat(l):u=-1,l.length&&m())}function m(){if(!c){var e=s(d);c=!0;for(var t=l.length;t;){for(i=l,l=[];++u<t;)i&&i[u].run();u=-1,t=l.length}i=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function f(){}n.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new h(e,t)),1!==l.length||c||s(m)},h.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=f,n.addListener=f,n.once=f,n.off=f,n.removeListener=f,n.removeAllListeners=f,n.emit=f,n.prependListener=f,n.prependOnceListener=f,n.listeners=function(e){return[]},n.binding=function(e){throw Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw Error("process.chdir is not supported")},n.umask=function(){return 0}}},r={};function i(e){var n=r[e];if(void 0!==n)return n.exports;var a=r[e]={exports:{}},o=!0;try{t[e](a,a.exports,i),o=!1}finally{o&&delete r[e]}return a.exports}i.ab="//";var n=i(229);e.exports=n}()}},function(e){e.O(0,[168,330,603,760,849,796,744],function(){return e(e.s=704)}),_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.