全新popiart网站 react项目重构
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

2 lines
29 KiB

import{j as t}from"./markdown-vendor-DnN-_XEd.js";import{r as u,a as T,u as w}from"./data-vendor-DOiUz3Tw.js";import{g as H,s as K,f as ie,S as ce}from"./swiper-vendor-Bs-UmCJ7.js";/* empty css */import{u as de,c as ue,d as fe,o as pe,e as X,b as k,a as me,g as ge,R as xe,f as Z}from"./index-BKk2Zt4l.js";import{a as _e}from"./react-vendor-B8OyfHW2.js";import"./arco-vendor-Cm-ntj-q.js";function he({swiper:e,extendParams:n,on:r,emit:a,params:f}){e.autoplay={running:!1,paused:!1,timeLeft:0},n({autoplay:{enabled:!1,delay:3e3,waitForTransition:!0,disableOnInteraction:!1,stopOnLastSlide:!1,reverseDirection:!1,pauseOnMouseEnter:!1}});let p,g,_=f&&f.autoplay?f.autoplay.delay:3e3,l=f&&f.autoplay?f.autoplay.delay:3e3,s,m=new Date().getTime(),x,j,N,L,d,o;function E(b){!e||e.destroyed||!e.wrapperEl||b.target===e.wrapperEl&&(e.wrapperEl.removeEventListener("transitionend",E),!(o||b.detail&&b.detail.bySwiperTouchMove)&&R())}const I=()=>{if(e.destroyed||!e.autoplay.running)return;e.autoplay.paused?x=!0:x&&(l=s,x=!1);const b=e.autoplay.paused?s:m+l-new Date().getTime();e.autoplay.timeLeft=b,a("autoplayTimeLeft",b,b/_),g=requestAnimationFrame(()=>{I()})},h=()=>{let b;return e.virtual&&e.params.virtual.enabled?b=e.slides.find(P=>P.classList.contains("swiper-slide-active")):b=e.slides[e.activeIndex],b?parseInt(b.getAttribute("data-swiper-autoplay"),10):void 0},y=()=>{let b=e.params.autoplay.delay;const S=h();return!Number.isNaN(S)&&S>0&&(b=S),b},i=b=>{if(e.destroyed||!e.autoplay.running)return;cancelAnimationFrame(g),I();let S=b;typeof S>"u"&&(S=y(),_=S,l=S),s=S;const P=e.params.speed,V=()=>{!e||e.destroyed||(e.params.autoplay.reverseDirection?!e.isBeginning||e.params.loop||e.params.rewind?(e.slidePrev(P,!0,!0),a("autoplay")):e.params.autoplay.stopOnLastSlide||(e.slideTo(e.slides.length-1,P,!0,!0),a("autoplay")):!e.isEnd||e.params.loop||e.params.rewind?(e.slideNext(P,!0,!0),a("autoplay")):e.params.autoplay.stopOnLastSlide||(e.slideTo(0,P,!0,!0),a("autoplay")),e.params.cssMode&&(m=new Date().getTime(),requestAnimationFrame(()=>{i()})))};return S>0?(clearTimeout(p),p=setTimeout(()=>{V()},S)):requestAnimationFrame(()=>{V()}),S},v=()=>{m=new Date().getTime(),e.autoplay.running=!0,i(),a("autoplayStart")},C=()=>{e.autoplay.running=!1,clearTimeout(p),cancelAnimationFrame(g),a("autoplayStop")},c=(b,S)=>{if(e.destroyed||!e.autoplay.running)return;clearTimeout(p),b||(d=!0);const P=()=>{a("autoplayPause"),e.params.autoplay.waitForTransition?e.wrapperEl.addEventListener("transitionend",E):R()};if(e.autoplay.paused=!0,S){P();return}s=(s||e.params.autoplay.delay)-(new Date().getTime()-m),!(e.isEnd&&s<0&&!e.params.loop)&&(s<0&&(s=0),P())},R=()=>{e.isEnd&&s<0&&!e.params.loop||e.destroyed||!e.autoplay.running||(m=new Date().getTime(),d?(d=!1,i(s)):i(),e.autoplay.paused=!1,a("autoplayResume"))},D=()=>{if(e.destroyed||!e.autoplay.running)return;const b=H();b.visibilityState==="hidden"&&(d=!0,c(!0)),b.visibilityState==="visible"&&R()},O=b=>{b.pointerType==="mouse"&&(d=!0,o=!0,!(e.animating||e.autoplay.paused)&&c(!0))},M=b=>{b.pointerType==="mouse"&&(o=!1,e.autoplay.paused&&R())},U=()=>{e.params.autoplay.pauseOnMouseEnter&&(e.el.addEventListener("pointerenter",O),e.el.addEventListener("pointerleave",M))},z=()=>{e.el&&typeof e.el!="string"&&(e.el.removeEventListener("pointerenter",O),e.el.removeEventListener("pointerleave",M))},q=()=>{H().addEventListener("visibilitychange",D)},G=()=>{H().removeEventListener("visibilitychange",D)};r("init",()=>{e.params.autoplay.enabled&&(U(),q(),v())}),r("destroy",()=>{z(),G(),e.autoplay.running&&C()}),r("_freeModeStaticRelease",()=>{(N||d)&&R()}),r("_freeModeNoMomentumRelease",()=>{e.params.autoplay.disableOnInteraction?C():c(!0,!0)}),r("beforeTransitionStart",(b,S,P)=>{e.destroyed||!e.autoplay.running||(P||!e.params.autoplay.disableOnInteraction?c(!0,!0):C())}),r("sliderFirstMove",()=>{if(!(e.destroyed||!e.autoplay.running)){if(e.params.autoplay.disableOnInteraction){C();return}j=!0,N=!1,d=!1,L=setTimeout(()=>{d=!0,N=!0,c(!0)},200)}}),r("touchEnd",()=>{if(!(e.destroyed||!e.autoplay.running||!j)){if(clearTimeout(L),clearTimeout(p),e.params.autoplay.disableOnInteraction){N=!1,j=!1;return}N&&e.params.cssMode&&R(),N=!1,j=!1}}),r("slideChange",()=>{e.destroyed||!e.autoplay.running||e.autoplay.paused&&(s=y(),_=y())}),Object.assign(e.autoplay,{start:v,stop:C,pause:c,resume:R})}const ee=["eventsPrefix","injectStyles","injectStylesUrls","modules","init","_direction","oneWayMovement","swiperElementNodeName","touchEventsTarget","initialSlide","_speed","cssMode","updateOnWindowResize","resizeObserver","nested","focusableElements","_enabled","_width","_height","preventInteractionOnTransition","userAgent","url","_edgeSwipeDetection","_edgeSwipeThreshold","_freeMode","_autoHeight","setWrapperSize","virtualTranslate","_effect","breakpoints","breakpointsBase","_spaceBetween","_slidesPerView","maxBackfaceHiddenSlides","_grid","_slidesPerGroup","_slidesPerGroupSkip","_slidesPerGroupAuto","_centeredSlides","_centeredSlidesBounds","_slidesOffsetBefore","_slidesOffsetAfter","normalizeSlideIndex","_centerInsufficientSlides","_snapToSlideEdge","_watchOverflow","roundLengths","touchRatio","touchAngle","simulateTouch","_shortSwipes","_longSwipes","longSwipesRatio","longSwipesMs","_followFinger","allowTouchMove","_threshold","touchMoveStopPropagation","touchStartPreventDefault","touchStartForcePreventDefault","touchReleaseOnEdges","uniqueNavElements","_resistance","_resistanceRatio","_watchSlidesProgress","_grabCursor","preventClicks","preventClicksPropagation","_slideToClickedSlide","_loop","loopAdditionalSlides","loopAddBlankSlides","loopPreventsSliding","_rewind","_allowSlidePrev","_allowSlideNext","_swipeHandler","_noSwiping","noSwipingClass","noSwipingSelector","passiveListeners","containerModifierClass","slideClass","slideActiveClass","slideVisibleClass","slideFullyVisibleClass","slideNextClass","slidePrevClass","slideBlankClass","wrapperClass","lazyPreloaderClass","lazyPreloadPrevNext","runCallbacksOnInit","observer","observeParents","observeSlideChildren","a11y","_autoplay","_controller","coverflowEffect","cubeEffect","fadeEffect","flipEffect","creativeEffect","cardsEffect","hashNavigation","history","keyboard","mousewheel","_navigation","_pagination","parallax","_scrollbar","_thumbs","virtual","zoom","control"];function A(e){return typeof e=="object"&&e!==null&&e.constructor&&Object.prototype.toString.call(e).slice(8,-1)==="Object"&&!e.__swiper__}function B(e,n){const r=["__proto__","constructor","prototype"];Object.keys(n).filter(a=>r.indexOf(a)<0).forEach(a=>{typeof e[a]>"u"?e[a]=n[a]:A(n[a])&&A(e[a])&&Object.keys(n[a]).length>0?n[a].__swiper__?e[a]=n[a]:B(e[a],n[a]):e[a]=n[a]})}function te(e={}){return e.navigation&&typeof e.navigation.nextEl>"u"&&typeof e.navigation.prevEl>"u"}function ae(e={}){return e.pagination&&typeof e.pagination.el>"u"}function re(e={}){return e.scrollbar&&typeof e.scrollbar.el>"u"}function le(e=""){const n=e.split(" ").map(a=>a.trim()).filter(a=>!!a),r=[];return n.forEach(a=>{r.indexOf(a)<0&&r.push(a)}),r.join(" ")}function ve(e=""){return e?e.includes("swiper-wrapper")?e:`swiper-wrapper ${e}`:"swiper-wrapper"}function be({swiper:e,slides:n,passedParams:r,changedParams:a,nextEl:f,prevEl:p,scrollbarEl:g,paginationEl:_}){const l=a.filter(c=>c!=="children"&&c!=="direction"&&c!=="wrapperClass"),{params:s,pagination:m,navigation:x,scrollbar:j,virtual:N,thumbs:L}=e;let d,o,E,I,h,y,i,v;a.includes("thumbs")&&r.thumbs&&r.thumbs.swiper&&!r.thumbs.swiper.destroyed&&s.thumbs&&(!s.thumbs.swiper||s.thumbs.swiper.destroyed)&&(d=!0),a.includes("controller")&&r.controller&&r.controller.control&&s.controller&&!s.controller.control&&(o=!0),a.includes("pagination")&&r.pagination&&(r.pagination.el||_)&&(s.pagination||s.pagination===!1)&&m&&!m.el&&(E=!0),a.includes("scrollbar")&&r.scrollbar&&(r.scrollbar.el||g)&&(s.scrollbar||s.scrollbar===!1)&&j&&!j.el&&(I=!0),a.includes("navigation")&&r.navigation&&(r.navigation.prevEl||p)&&(r.navigation.nextEl||f)&&(s.navigation||s.navigation===!1)&&x&&!x.prevEl&&!x.nextEl&&(h=!0);const C=c=>{e[c]&&(e[c].destroy(),c==="navigation"?(e.isElement&&(e[c].prevEl.remove(),e[c].nextEl.remove()),s[c].prevEl=void 0,s[c].nextEl=void 0,e[c].prevEl=void 0,e[c].nextEl=void 0):(e.isElement&&e[c].el.remove(),s[c].el=void 0,e[c].el=void 0))};a.includes("loop")&&e.isElement&&(s.loop&&!r.loop?y=!0:!s.loop&&r.loop?i=!0:v=!0),l.forEach(c=>{if(A(s[c])&&A(r[c]))Object.assign(s[c],r[c]),(c==="navigation"||c==="pagination"||c==="scrollbar")&&"enabled"in r[c]&&!r[c].enabled&&C(c);else{const R=r[c];(R===!0||R===!1)&&(c==="navigation"||c==="pagination"||c==="scrollbar")?R===!1&&C(c):s[c]=r[c]}}),l.includes("controller")&&!o&&e.controller&&e.controller.control&&s.controller&&s.controller.control&&(e.controller.control=s.controller.control),a.includes("children")&&n&&N&&s.virtual.enabled?(N.slides=n,N.update(!0)):a.includes("virtual")&&N&&s.virtual.enabled&&(n&&(N.slides=n),N.update(!0)),a.includes("children")&&n&&s.loop&&(v=!0),d&&L.init()&&L.update(!0),o&&(e.controller.control=s.controller.control),E&&(e.isElement&&(!_||typeof _=="string")&&(_=document.createElement("div"),_.classList.add("swiper-pagination"),_.part.add("pagination"),e.el.appendChild(_)),_&&(s.pagination.el=_),m.init(),m.render(),m.update()),I&&(e.isElement&&(!g||typeof g=="string")&&(g=document.createElement("div"),g.classList.add("swiper-scrollbar"),g.part.add("scrollbar"),e.el.appendChild(g)),g&&(s.scrollbar.el=g),j.init(),j.updateSize(),j.setTranslate()),h&&(e.isElement&&((!f||typeof f=="string")&&(f=document.createElement("div"),f.classList.add("swiper-button-next"),K(f,e.navigation.arrowSvg),f.part.add("button-next"),e.el.appendChild(f)),(!p||typeof p=="string")&&(p=document.createElement("div"),p.classList.add("swiper-button-prev"),K(p,e.navigation.arrowSvg),p.part.add("button-prev"),e.el.appendChild(p))),f&&(s.navigation.nextEl=f),p&&(s.navigation.prevEl=p),x.init(),x.update()),a.includes("allowSlideNext")&&(e.allowSlideNext=r.allowSlideNext),a.includes("allowSlidePrev")&&(e.allowSlidePrev=r.allowSlidePrev),a.includes("direction")&&e.changeDirection(r.direction,!1),(y||v)&&e.loopDestroy(),(i||v)&&e.loopCreate(),e.update()}function Se(e={},n=!0){const r={on:{}},a={},f={};B(r,ie),r._emitClasses=!0,r.init=!1;const p={},g=ee.map(l=>l.replace(/_/,"")),_=Object.assign({},e);return Object.keys(_).forEach(l=>{typeof e[l]>"u"||(g.indexOf(l)>=0?A(e[l])?(r[l]={},f[l]={},B(r[l],e[l]),B(f[l],e[l])):(r[l]=e[l],f[l]=e[l]):l.search(/on[A-Z]/)===0&&typeof e[l]=="function"?n?a[`${l[2].toLowerCase()}${l.substr(3)}`]=e[l]:r.on[`${l[2].toLowerCase()}${l.substr(3)}`]=e[l]:p[l]=e[l])}),["navigation","pagination","scrollbar"].forEach(l=>{r[l]===!0&&(r[l]={}),r[l]===!1&&delete r[l]}),{params:r,passedParams:f,rest:p,events:a}}function ye({el:e,nextEl:n,prevEl:r,paginationEl:a,scrollbarEl:f,swiper:p},g){te(g)&&n&&r&&(p.params.navigation.nextEl=n,p.originalParams.navigation.nextEl=n,p.params.navigation.prevEl=r,p.originalParams.navigation.prevEl=r),ae(g)&&a&&(p.params.pagination.el=a,p.originalParams.pagination.el=a),re(g)&&f&&(p.params.scrollbar.el=f,p.originalParams.scrollbar.el=f),p.init(e)}function Ce(e,n,r,a,f){const p=[];if(!n)return p;const g=l=>{p.indexOf(l)<0&&p.push(l)};if(r&&a){const l=a.map(f),s=r.map(f);l.join("")!==s.join("")&&g("children"),a.length!==r.length&&g("children")}return ee.filter(l=>l[0]==="_").map(l=>l.replace(/_/,"")).forEach(l=>{if(l in e&&l in n)if(A(e[l])&&A(n[l])){const s=Object.keys(e[l]),m=Object.keys(n[l]);s.length!==m.length?g(l):(s.forEach(x=>{e[l][x]!==n[l][x]&&g(l)}),m.forEach(x=>{e[l][x]!==n[l][x]&&g(l)}))}else e[l]!==n[l]&&g(l)}),p}const Ne=e=>{!e||e.destroyed||!e.params.virtual||e.params.virtual&&!e.params.virtual.enabled||(e.updateSlides(),e.updateProgress(),e.updateSlidesClasses(),e.emit("_virtualUpdated"),e.parallax&&e.params.parallax&&e.params.parallax.enabled&&e.parallax.setTranslate())};function $(){return $=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},$.apply(this,arguments)}function ne(e){return e.type&&e.type.displayName&&e.type.displayName.includes("SwiperSlide")}function se(e){const n=[];return T.Children.toArray(e).forEach(r=>{ne(r)?n.push(r):r.props&&r.props.children&&se(r.props.children).forEach(a=>n.push(a))}),n}function je(e){const n=[],r={"container-start":[],"container-end":[],"wrapper-start":[],"wrapper-end":[]};return T.Children.toArray(e).forEach(a=>{if(ne(a))n.push(a);else if(a.props&&a.props.slot&&r[a.props.slot])r[a.props.slot].push(a);else if(a.props&&a.props.children){const f=se(a.props.children);f.length>0?f.forEach(p=>n.push(p)):r["container-end"].push(a)}else r["container-end"].push(a)}),{slides:n,slots:r}}function Pe(e,n,r){if(!r)return null;const a=m=>{let x=m;return m<0?x=n.length+m:x>=n.length&&(x=x-n.length),x},f=e.isHorizontal()?{[e.rtlTranslate?"right":"left"]:`${r.offset}px`}:{top:`${r.offset}px`},{from:p,to:g}=r,_=e.params.loop?-n.length:0,l=e.params.loop?n.length*2:n.length,s=[];for(let m=_;m<l;m+=1)m>=p&&m<=g&&s.push(n[a(m)]);return s.map((m,x)=>T.cloneElement(m,{swiper:e,style:f,key:m.props.virtualIndex||m.key||`slide-${x}`}))}function F(e,n){return typeof window>"u"?u.useEffect(e,n):u.useLayoutEffect(e,n)}const Y=u.createContext(null),Ee=u.createContext(null),oe=u.forwardRef(({className:e,tag:n="div",wrapperTag:r="div",children:a,onSwiper:f,...p}={},g)=>{let _=!1;const[l,s]=u.useState("swiper"),[m,x]=u.useState(null),[j,N]=u.useState(!1),L=u.useRef(!1),d=u.useRef(null),o=u.useRef(null),E=u.useRef(null),I=u.useRef(null),h=u.useRef(null),y=u.useRef(null),i=u.useRef(null),v=u.useRef(null),{params:C,passedParams:c,rest:R,events:D}=Se(p),{slides:O,slots:M}=je(a),U=()=>{N(!j)};Object.assign(C.on,{_containerClasses(S,P){s(P)}});const z=()=>{Object.assign(C.on,D),_=!0;const S={...C};if(delete S.wrapperClass,o.current=new ce(S),o.current.virtual&&o.current.params.virtual.enabled){o.current.virtual.slides=O;const P={cache:!1,slides:O,renderExternal:x,renderExternalUpdate:!1};B(o.current.params.virtual,P),B(o.current.originalParams.virtual,P)}};d.current||z(),o.current&&o.current.on("_beforeBreakpoint",U);const q=()=>{_||!D||!o.current||Object.keys(D).forEach(S=>{o.current.on(S,D[S])})},G=()=>{!D||!o.current||Object.keys(D).forEach(S=>{o.current.off(S,D[S])})};u.useEffect(()=>()=>{o.current&&o.current.off("_beforeBreakpoint",U)}),u.useEffect(()=>{!L.current&&o.current&&(o.current.emitSlidesClasses(),L.current=!0)}),F(()=>{if(g&&(g.current=d.current),!!d.current)return o.current.destroyed&&z(),ye({el:d.current,nextEl:h.current,prevEl:y.current,paginationEl:i.current,scrollbarEl:v.current,swiper:o.current},C),f&&!o.current.destroyed&&f(o.current),()=>{o.current&&!o.current.destroyed&&o.current.destroy(!0,!1)}},[]),F(()=>{q();const S=Ce(c,E.current,O,I.current,P=>P.key);return E.current=c,I.current=O,S.length&&o.current&&!o.current.destroyed&&be({swiper:o.current,slides:O,passedParams:c,changedParams:S,nextEl:h.current,prevEl:y.current,scrollbarEl:v.current,paginationEl:i.current}),()=>{G()}}),F(()=>{Ne(o.current)},[m]);function b(){return C.virtual?Pe(o.current,O,m):O.map((S,P)=>T.cloneElement(S,{swiper:o.current,swiperSlideIndex:P}))}return T.createElement(n,$({ref:d,className:le(`${l}${e?` ${e}`:""}`)},R),T.createElement(Ee.Provider,{value:o.current},M["container-start"],T.createElement(r,{className:ve(C.wrapperClass)},M["wrapper-start"],b(),M["wrapper-end"]),te(C)&&T.createElement(T.Fragment,null,T.createElement("div",{ref:y,className:"swiper-button-prev"}),T.createElement("div",{ref:h,className:"swiper-button-next"})),re(C)&&T.createElement("div",{ref:v,className:"swiper-scrollbar"}),ae(C)&&T.createElement("div",{ref:i,className:"swiper-pagination"}),M["container-end"]))});oe.displayName="Swiper";const W=u.forwardRef(({tag:e="div",children:n,className:r="",swiper:a,zoom:f,lazy:p,virtualIndex:g,swiperSlideIndex:_,...l}={},s)=>{const m=u.useRef(null),[x,j]=u.useState("swiper-slide"),[N,L]=u.useState(!1);function d(h,y,i){y===m.current&&j(i)}F(()=>{if(typeof _<"u"&&(m.current.swiperSlideIndex=_),s&&(s.current=m.current),!(!m.current||!a)){if(a.destroyed){x!=="swiper-slide"&&j("swiper-slide");return}return a.on("_slideClass",d),()=>{a&&a.off("_slideClass",d)}}}),F(()=>{a&&m.current&&!a.destroyed&&j(a.getSlideClasses(m.current))},[a]);const o={isActive:x.indexOf("swiper-slide-active")>=0,isVisible:x.indexOf("swiper-slide-visible")>=0,isPrev:x.indexOf("swiper-slide-prev")>=0,isNext:x.indexOf("swiper-slide-next")>=0},E=()=>typeof n=="function"?n(o):n,I=()=>{L(!0)};return T.createElement(e,$({ref:m,className:le(`${x}${r?` ${r}`:""}`),"data-swiper-slide-index":g,onLoad:I},l),f&&T.createElement(Y.Provider,{value:o},T.createElement("div",{className:"swiper-zoom-container","data-swiper-zoom":typeof f=="number"?f:void 0},E(),p&&!N&&T.createElement("div",{className:"swiper-lazy-preloader",ref:h=>{h&&(h.lazyPreloaderManaged=!0)}}))),!f&&T.createElement(Y.Provider,{value:o},E(),p&&!N&&T.createElement("div",{className:"swiper-lazy-preloader",ref:h=>{h&&(h.lazyPreloaderManaged=!0)}})))});W.displayName="SwiperSlide";const J=18;function Te(){const{t:e}=w(),n=de(i=>i.requestMakeSame),r=ue(i=>i.requestMakeSame),[a,f]=u.useState([]),[p,g]=u.useState(1),[_,l]=u.useState(!0),[s,m]=u.useState(!1),[x,j]=u.useState(!1),[N,L]=u.useState(null),d=u.useRef(!1),o=u.useRef(null),E=u.useCallback(async(i,v)=>{v?j(!0):m(!0),L(null);try{const c=(await fe({page:i,pageSize:J}))?.data?.list??[];f(R=>v?[...R,...c]:c),l(c.length>=J),g(i)}catch(C){const c=C instanceof Error?C.message:e("pages.explore.feed.loadFailed");L(c),v||f([]),l(!1)}finally{v?j(!1):m(!1)}},[e]);u.useEffect(()=>{d.current||(d.current=!0,E(1,!1))},[E]);const I=s||x;u.useEffect(()=>{if(!_||I)return;const i=o.current;if(i==null)return;const v=new IntersectionObserver(C=>{C.some(c=>c.isIntersecting)&&E(p+1,!0)},{root:null,rootMargin:"240px",threshold:0});return v.observe(i),()=>v.disconnect()},[_,I,p,E]);const h=u.useCallback(i=>{pe({assetId:i.id})},[]),y=u.useCallback(i=>{if(!(i.id==null||i.id==="")){if(i.type==4){r(i.id);return}n(i.id)}},[n,r]);return t.jsxs("div",{className:"explorePage__feedPanel",id:"explore-feed-panel-explore",role:"tabpanel","aria-labelledby":"explore-feed-tab-explore",children:[N!=null?t.jsx("p",{className:"explorePage__feedError",role:"alert",children:N}):null,s&&a.length===0?t.jsx("p",{className:"explorePage__feedLoading",children:e("common.loading")}):null,t.jsx("div",{className:"explorePage__feedGrid explorePage__feedGrid--masonry",children:a.map((i,v)=>({post:i,idx:v})).filter(({post:i})=>{const C=i.type===2?i.cover:i.images?.[0];return C!=null&&C!==""}).map(({post:i,idx:v})=>{const c=i.type===2?i.cover:i.images?.[0];return t.jsxs("article",{className:"explorePage__feedCard",onClick:()=>h(i),children:[t.jsx("div",{className:"explorePage__feedCardMedia",children:t.jsx("img",{src:c,alt:"",loading:"lazy",decoding:"async"})}),t.jsx("div",{className:"explorePage__feedCardGrad explorePage__feedCardGrad--tall","aria-hidden":!0}),t.jsxs("div",{className:"explorePage__feedCardBottom",children:[t.jsxs("div",{className:"explorePage__feedCardFooter explorePage__feedCardFooter--video",children:[t.jsxs("div",{className:"explorePage__feedCardUser",children:[t.jsx("div",{className:"explorePage__feedCardAvatar",children:i.userAvatar?t.jsx("img",{src:i.userAvatar,alt:""}):t.jsx("span",{className:"explorePage__feedCardAvatarPh","aria-hidden":!0})}),t.jsx("span",{className:"explorePage__feedCardName",children:i.userName})]}),t.jsxs("div",{className:"explorePage__feedCardStats",children:[t.jsxs("span",{className:"explorePage__feedCardStat",children:[t.jsx("img",{className:"explorePage__feedStatIcon",src:new URL("/assets/ic_look-B3mblBMS.png",import.meta.url).href,alt:""}),t.jsx("span",{className:"explorePage__feedCardStatNum",children:i.lookNum})]}),t.jsxs("span",{className:"explorePage__feedCardStat",children:[i.userLiked?t.jsx("img",{className:"explorePage__feedStatIcon",src:new URL("/assets/ic_like_active-C1GDW4GU.png",import.meta.url).href,alt:""}):t.jsx("img",{className:"explorePage__feedStatIcon",src:new URL("/assets/ic_like_white-DdFasbWY.png",import.meta.url).href,alt:""}),t.jsx("span",{className:"explorePage__feedCardStatNum",children:i.likeNum})]})]})]}),t.jsx("div",{className:"explorePage__feedCardCta",role:"presentation",onClick:R=>{R.stopPropagation(),R.preventDefault(),y(i)},children:e("pages.assetDetails.makeSame")})]})]},i.id??`p-${v}`)})}),_&&a.length>0?t.jsx("div",{className:"explorePage__feedSentinel",ref:o,"aria-hidden":!0}):null,x?t.jsx("p",{className:"explorePage__feedLoading explorePage__feedLoading--more",children:e("pages.explore.feed.loadingMore")}):null]})}const Q=50;function Le(){const{t:e}=w(),n=X(h=>h.requestTemplateSelect),[r,a]=u.useState([]),[f,p]=u.useState(1),[g,_]=u.useState(!0),[l,s]=u.useState(!1),[m,x]=u.useState(!1),[j,N]=u.useState(null),L=u.useRef(!1),d=u.useRef(null),o=u.useCallback(async(h,y)=>{y?x(!0):s(!0),N(null);try{const v=(await k({page:h,pageSize:Q}))?.data?.list??[];a(C=>y?[...C,...v]:v),_(v.length>=Q),p(h)}catch(i){const v=i instanceof Error?i.message:e("pages.explore.feed.loadFailed");N(v),y||a([]),_(!1)}finally{y?x(!1):s(!1)}},[e]);u.useEffect(()=>{L.current||(L.current=!0,o(1,!1))},[o]);const E=l||m,I=u.useCallback(h=>{const y=h?.id;y==null||y===""||n(y)},[n]);return u.useEffect(()=>{if(!g||E)return;const h=d.current;if(h==null)return;const y=new IntersectionObserver(i=>{i.some(v=>v.isIntersecting)&&o(f+1,!0)},{root:null,rootMargin:"240px",threshold:0});return y.observe(h),()=>y.disconnect()},[g,E,f,o]),t.jsxs("div",{className:"explorePage__feedPanel",id:"explore-feed-panel-template",role:"tabpanel","aria-labelledby":"explore-feed-tab-template",children:[j!=null?t.jsx("p",{className:"explorePage__feedError",role:"alert",children:j}):null,l&&r.length===0?t.jsx("p",{className:"explorePage__feedLoading",children:e("common.loading")}):null,t.jsx("div",{className:"explorePage__feedGrid",children:r.map(h=>t.jsxs("article",{className:"explorePage__tplCard",children:[t.jsx("div",{className:"explorePage__tplCardMedia",children:t.jsx("img",{src:h.coverUrl,alt:h.title,loading:"lazy",decoding:"async"})}),t.jsxs("div",{className:"explorePage__tplCardOverlay",children:[t.jsxs("div",{className:"explorePage__tplCardChip",children:[t.jsx("img",{className:"explorePage__tplCardChipIcon",src:new URL("/assets/ic_template_chip-CWZEuWV8.png",import.meta.url).href,alt:"",width:12,height:12}),t.jsx("p",{className:"explorePage__tplCardChipText",children:h.title})]}),t.jsx("div",{className:"explorePage__tplCardCtaRow",children:t.jsx("div",{className:"explorePage__tplCardCta",role:"button",tabIndex:0,onClick:()=>I(h),onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),I(h))},children:e("pages.create.inspiration.templateLibrary.useTemplate")})})]})]},h.id))}),g&&r.length>0?t.jsx("div",{className:"explorePage__feedSentinel",ref:d,"aria-hidden":!0}):null,m?t.jsx("p",{className:"explorePage__feedLoading explorePage__feedLoading--more",children:e("pages.explore.feed.loadingMore")}):null]})}function Fe(){const{t:e}=w(),n=X(d=>d.requestTemplateSelect),r=_e(),[a,f]=u.useState([]),[p,g]=u.useState([]),[_,l]=u.useState("explore"),[s,m]=u.useState("");u.useEffect(()=>{me({type:1,page:1,pageSize:9}).then(d=>{const o=d?.data?.list??d?.list??[];f(o.slice(0,9))}).catch(()=>{f([])})},[]),u.useEffect(()=>{k({page:1,pageSize:3}).then(d=>{g((d?.data?.list??[]).slice(0,3))}).catch(()=>{g([])})},[]),u.useEffect(()=>{ge().then(d=>{m(d?.systemConfig?.usageTutorialPageUrl??"")}).catch(()=>{m("")})},[]);const x=a.slice(0,4),j=a.slice(4,9),N=()=>{l("explore"),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.getElementById("explore-feed-panel-explore")?.scrollIntoView({behavior:"smooth",block:"start"})})})},L=()=>{l("template"),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.getElementById("explore-feed-panel-template")?.scrollIntoView({behavior:"smooth",block:"start"})})})};return t.jsxs("div",{className:"explorePage",children:[t.jsx("section",{className:"explorePage__hero",children:t.jsxs(oe,{className:"explorePage__heroSwiper",modules:[he],slidesPerView:1,loop:!0,autoplay:{delay:1e5,disableOnInteraction:!1},children:[t.jsx(W,{className:"explorePage__heroSlide",children:t.jsxs("div",{className:"heroSlideItem1",style:{backgroundImage:`url(${new URL("/assets/hero-image1-ClXGTvt6.png",import.meta.url).href})`},children:[t.jsx("img",{className:"heroSlideItem1Icon",src:new URL("/assets/heroTitleIcon1-BdR3tBJ1.png",import.meta.url).href,alt:""}),t.jsx("p",{className:"heroSlideItem1Desc",children:e("pages.explore.hero.banner1Desc")}),t.jsx("button",{className:"heroSlideItem1Btn",type:"button",onClick:()=>{s&&window.open(s,"_blank")},children:e("pages.explore.hero.watchTutorial")})]})}),t.jsx(W,{className:"explorePage__heroSlide",children:t.jsxs("div",{className:"heroSlideItem2",style:{backgroundImage:`url(${new URL("/assets/hero-image2-CcA4ltnY.png",import.meta.url).href})`},children:[t.jsx("img",{className:"heroSlideItem2Icon",src:new URL("/assets/heroTitleIcon2-DKffuqiJ.png",import.meta.url).href,alt:""}),t.jsx("p",{className:"heroSlideItem2Desc",children:e("pages.explore.hero.banner2Desc")}),t.jsxs("div",{className:"flex items-center gap-5",children:[t.jsxs("button",{className:"heroSlideItem2Btn",children:[t.jsx("img",{src:new URL("/assets/app-store-BlyKpUQK.png",import.meta.url).href,alt:""}),e("pages.explore.hero.appStoreDownload")]}),t.jsxs("button",{className:"heroSlideItem2Btn",children:[t.jsx("img",{src:new URL("/assets/google-play-CmY6ooQq.png",import.meta.url).href,alt:""}),e("pages.explore.hero.googlePlayDownload")]})]})]})})]})}),t.jsxs("section",{className:"explorePage__content",children:[t.jsxs("div",{className:"explorePage__leftColumn",children:[t.jsxs("div",{className:"explorePage__sectionHeader",children:[t.jsx("h2",{className:"explorePage__sectionTitle",children:e("pages.explore.sections.officialRoles")}),t.jsx("button",{className:"explorePage__moreBtn",type:"button",onClick:()=>r(xe.CHARACTERS),children:e("index.explore_more")})]}),t.jsxs("div",{className:"explorePage__officialTop",children:[t.jsx("article",{className:"explorePage__officialMainCard",children:t.jsx("img",{src:new URL("/assets/official-main-card-DSr-IU9t.png",import.meta.url).href,alt:"",draggable:"true"})}),t.jsx("div",{className:"explorePage__officialTopGrid",children:x.map((d,o)=>t.jsxs("article",{className:"explorePage__roleCard",onClick:()=>{Z({props:{characterDetailData:d}})},children:[t.jsx("img",{src:d.avatar,alt:""}),t.jsx("div",{className:"explorePage__roleTag",title:d.title,children:d.title})]},d?.id??`top-${o}`))})]}),t.jsx("div",{className:"explorePage__officialBottomGrid",children:j.map((d,o)=>t.jsxs("article",{className:"explorePage__roleCard",onClick:()=>{Z({props:{characterDetailData:d}})},children:[t.jsx("img",{src:d.avatar,alt:""}),t.jsx("div",{className:"explorePage__roleTag",title:d.title,children:d.title})]},d?.id??`bottom-${o}`))})]}),t.jsxs("div",{className:"explorePage__rightColumn",children:[t.jsxs("div",{className:"explorePage__bannerGrid",children:[t.jsxs("section",{className:"explorePage__bannerGroup",children:[t.jsx("h2",{className:"explorePage__sectionTitle",children:e("pages.explore.sections.diyRole")}),t.jsx("article",{className:"explorePage__bannerCard",children:t.jsx("img",{src:new URL("/assets/diy-role-card-BMuoz-kX.png",import.meta.url).href,alt:""})})]}),t.jsxs("section",{className:"explorePage__bannerGroup",children:[t.jsx("h2",{className:"explorePage__sectionTitle",children:e("pages.explore.sections.socialCases")}),t.jsx("article",{className:"explorePage__bannerCard",onClick:N,children:t.jsx("img",{src:new URL("/assets/social-media-card-B53CKpk9.png",import.meta.url).href,alt:""})})]})]}),t.jsxs("div",{className:"explorePage__sectionHeader explorePage__sectionHeader--templates",children:[t.jsx("h2",{className:"explorePage__sectionTitle",children:e("index.ai_template_section.title")}),t.jsx("button",{className:"explorePage__moreBtn",type:"button",onClick:L,children:e("index.explore_more")})]}),t.jsx("div",{className:"explorePage__templateList",children:p.map(d=>t.jsxs("article",{className:"explorePage__templateCard",children:[t.jsx("img",{className:"explorePage__templateThumb",src:d.coverUrl,alt:d.title}),t.jsxs("div",{className:"explorePage__templateBody",children:[t.jsx("h3",{className:"explorePage__templateTitle",children:d.title}),t.jsx("p",{className:"explorePage__templateDesc",title:d.desp,children:d.desp})]}),t.jsx("button",{className:"explorePage__templateAction",type:"button",onClick:()=>{n(d.id)},children:e("pages.explore.feed.makeNow")})]},d.id))})]})]}),t.jsxs("section",{className:"explorePage__feed","aria-label":e("pages.explore.feed.ariaSquare"),children:[t.jsxs("div",{className:"explorePage__feedTabs",role:"tablist",children:[t.jsx("button",{type:"button",role:"tab",id:"explore-feed-tab-explore","aria-selected":_==="explore","aria-controls":"explore-feed-panel-explore",className:`explorePage__feedTab ${_==="explore"?"explorePage__feedTab--active":""}`,onClick:()=>l("explore"),children:e("layout.nav.explore")}),t.jsx("button",{type:"button",role:"tab",id:"explore-feed-tab-template","aria-selected":_==="template","aria-controls":"explore-feed-panel-template",className:`explorePage__feedTab ${_==="template"?"explorePage__feedTab--active":""}`,onClick:()=>l("template"),children:e("pages.create.filters.template")})]}),t.jsxs("div",{className:"explorePage__feedTabPanels",children:[t.jsx("div",{className:"explorePage__feedTabPanel",hidden:_!=="explore",children:t.jsx(Te,{})}),t.jsx("div",{className:"explorePage__feedTabPanel",hidden:_!=="template",children:t.jsx(Le,{})})]})]})]})}export{Fe as default};
//# sourceMappingURL=index-CIkploC8.js.map