PageSourceSearch

https://vapps-res.media.io/mediaai/_nuxt/index-CXyhQi-M.js

js media.io collected 2026-09-24 08:53:36 UTC 14,463 bytes, 1 lines download raw bytes

1import{av as ye,i as ne,by as be,a1 as ae,aw as ke,t as Y,bh as Te,_ as se,b as X,c5 as we,c3 as Ce,bf as xe,d as Ie,k as Se,bb as Ee,a5 as fe,W as $e,dI as Le,aB as le,aL as Re,R as Pe,E as Ne,eQ as Oe,eR as Ae,eS as Be}from"./BuQWImh-.js";import{d as W,y as m,z as i,F as de,C as _e,L as U,E as V,r as u,c as q,w as j,o as re,x as Me,N as pe,D as a,ad as B,A as C,J as L,B as M,G as ee,_ as te,M as ce,f as z,a1 as De,a as qe,O as ue,b as ze,R as Fe}from"./chunk-vue-TRwxe8i9.js";import{g as He,i as Je,p as je}from"./effectTemplate-BSfpveH1.js";import{T as Ue}from"./TabComp-C95vNFkj.js";import{T as Ve}from"./TopBanner-Bm8by0y2.js";import{s as We}from"./chunk-pinia-DfnRCC0j.js";import{u as Ge}from"./chunk-i18n-CEBPY5W3.js";import"./chunk-alioss-Co3x7qJ6.js";import"./chunk-fabric-NyCWrAO1.js";const Ke={class:"inline-flex items-center gap-2 p-1 rounded-[100px] bg-[--color-foreground-normalcy-color-quaternary]"},Qe=["onClick"],Xe=W({__name:"CategoryTab",props:{tags:{},currentTag:{}},emits:["update:currentTag","change"],setup(D,{emit:T}){const t=T,o=g=>{t("update:currentTag",g.value),t("change",g.value),ye.trackHookClick({function_button_key:g.value,function_button_type:"setting"})};return(g,y)=>(i(),m("div",Ke,[(i(!0),m(de,null,_e(g.tags,d=>(i(),m("div",{key:d.value,class:U(["px-4 py-2 rounded-[100px] text-[14px] leading-[16px] font-[500] text-[--color-text-dynamic-white-tertiary] cursor-pointer",[g.currentTag===d.value?"bg-[--color-brand-solid-primary] text-[--color-text-static-white-primary]":""]]),onClick:O=>o(d)},V(d.name),11,Qe))),128))]))}}),Ye=Object.assign(Xe,{__name:"AiEffectsCategoryTab"}),Ze=["effect-id"],et=["src"],tt=["autoplay","loop","src"],at={key:1,class:"use-this-template"},nt={class:"btn"},st={class:"name"},rt={key:0,class:"hot"},ot={class:"effect-fullscreen-container"},it=W({__name:"EffectItem",props:{effect:{},autoPlay:{type:Boolean},currentTag:{},index:{},trackInfo:{},categoryId:{},isSearchResult:{type:Boolean}},emits:["play"],setup(D,{emit:T}){const t=D,o=T,g=()=>typeof window<"u",y=ne(),d=u(!1),O=u(!1),_=u(),R=u(!1),h=u(0),A=q(()=>JSON.parse(t.effect?.action_config)),P=u(),b=u(!1);let f=null;const I=()=>{d.value=!0,R.value=!0,_.value?.play().catch(()=>{})},l=()=>{d.value=!1,_.value?.pause(),_.value&&(_.value.currentTime=0)},c=()=>{t.effect.name,o("play",t.effect.uni_fun_code)},{isFullscreenOpen:k,fullscreenSrc:p,playerRef:x,openFullscreen:F}=be(),v=n=>{const S=JSON.parse(t.effect?.extra_data||"{}");Y("miai_creation_interface_click",{pworkflow:"core_process",button:"effect_thumbnail_fullscreen",miai_unit_code:t.effect?.uni_fun_code||"",miai_unit_name:t.effect?.name||"",template_origin_entity:S?.distrib_info?.distrib_id?"crc":"mi",explore_template_id:t.effect?.crc_id||t.effect?.uni_fun_code||""},!0,!1,!1),F(n)},N=()=>{h.value=performance.now()},w=()=>{if(O.value=!0,h.value){const n=Number((performance.now()-h.value).toFixed(2));Te(n),h.value=0}},Z=q(()=>JSON.parse(t.effect?.extra_data)?.gaussian_blur);j(()=>t.autoPlay,n=>{n?I():l()});const K=()=>{if(b.value||(b.value=!0,!t.effect?.uni_fun_code))return;const n=JSON.parse(t.effect?.extra_data);Y("miai_template_cover_expose",{search_context:t.isSearchResult?"ai_effect":t.trackInfo?.template_search_algorithm_id?"explore":"",expose_position:t.index?t.index+1:1,miai_unit_code:t.effect.uni_fun_code||"",miai_unit_name:t.effect.name||"",thumbnail_url:t.effect.thumbnail||"",module:t.isSearchResult?"effect_search_result_feed":"effectspage",module_slug:`effectspage_${t.effect.media}_${t.categoryId}`,...t.trackInfo||{},template_origin_entity:n?.distrib_info?.distrib_id?"crc":"mi",cap_id:n?.distrib_info?.grain_id||"",explore_template_id:t.effect?.crc_id||t.effect?.uni_fun_code||""})},Q=()=>{!g()||!P.value||f||(f=new IntersectionObserver(n=>{n.forEach(S=>{S.isIntersecting&&S.intersectionRatio>=.99&&!b.value&&K()})},{threshold:.99,rootMargin:"0px"}),f.observe(P.value))},H=()=>{f&&(f.disconnect(),f=null)};return re(()=>{setTimeout(()=>{P.value&&Q()},100)}),Me(()=>{H()}),(n,S)=>(i(),m("div",{ref_key:"itemRef",ref:P,class:U(["effect-item",{"effect-image-item":n.currentTag==="image","effect-video-item":n.currentTag!=="image"}]),"effect-id":("effect"in n?n.effect:a(B)).uni_fun_code,style:pe({"--bg-thumbnail":`url(${("effect"in n?n.effect:a(B)).thumbnail})`}),onMouseenter:I,onMouseleave:l},[C("div",{class:U(["thumbnail",{"thumbnail-contain":a(Z)}])},[ee(C("img",{src:("effect"in n?n.effect:a(B)).thumbnail,alt:"",loading:"lazy"},null,8,et),[[te,!a(O)||!a(d)]]),a(R)?ee((i(),m("video",{ref_key:"videoRef",ref:_,ke
1y:n.autoPlay?"true":"false",class:"video",muted:"",playsinline:"","webkit-playsinline":"","x5-playsinline":"true","x5-video-player-type":"h5",disablePictureInPicture:"",autoplay:n.autoPlay||a(d),loop:n.autoPlay||a(d),src:("effect"in n?n.effect:a(B)).preview,onCanplay:w,onLoadstart:N},null,40,tt)),[[te,(n.autoPlay||a(O))&&a(d)]]):L("",!0),a(d)&&!a(y)?(i(),m("div",at,[C("div",nt,V(n.currentTag==="video"?n.$t("ai_video_generator.useTemplate"):n.$t("ai_video_generator.goCreate")),1)])):L("",!0),a(d)&&!a(y)&&("effect"in n?n.effect:a(B)).preview?(i(),m("div",{key:2,class:"fullscreen-btn",onClick:S[0]||(S[0]=ce(oe=>v(("effect"in n?n.effect:a(B)).preview),["stop"]))},[z(a(ae),{name:"ai-image-extend/zoom_in",width:"16",height:"16"})])):L("",!0)],2),S[1]||(S[1]=C("div",{class:"name-box"},null,-1)),C("div",st,V(("effect"in n?n.effect:a(B)).name),1),a(A)?.is_hot?(i(),m("div",rt,"HOT")):L("",!0),a(y)&&("effect"in n?n.effect:a(B)).preview?(i(),m("div",{key:1,class:"absolute bottom-[36px] right-[8px]",onClick:ce(c,["stop"])},[z(a(ae),{name:"player",width:"32",height:"32"})])):L("",!0),(i(),M(De,{to:"body"},[ee(C("div",ot,[a(p)?(i(),M(a(ke),{key:0,ref_key:"playerRef",ref:x,class:"effect-fullscreen-player",src:a(p),aspect:"fluid",autoplay:!0,muted:!0},null,8,["src"])):L("",!0)],512),[[te,a(k)]])]))],46,Ze))}}),lt=Object.assign(se(it,[["__scopeId","data-v-39a7dd58"]]),{__name:"EffectsEffectItem"}),ct={class:"tpl-tab-list"},ut={key:1,class:"empty-text"},ft={key:2,class:"w-full flex items-center gap-3"},dt={class:"text-end"},_t={key:3,class:"h-8"},pt=W({__name:"TplTabList",props:{tabs:{},currentTag:{},categoryId:{}},emits:["selectedEffect","search-active-change"],setup(D,{emit:T}){const t=X(),o=u({}),g=T,y=ne(),d=u(),O=u(),_=u(null),R=u(null),h=u([]),A=u([]),P=u(0),b=u(0),f=u(""),I=u(!1),l=u({tpls:[],total:0,loading:!1});let c=null,k=null,p=0;const x=D,F=(e,s)=>{g("selectedEffect",e,o.value,s,v.value,f.value)},v=q(()=>f.value.trim().length>0),N=q(()=>v.value?l.value:o.value),w=q(()=>N.value?.tpls??[]),Z=q(()=>v.value?`search-${o.value?.id}-${f.value}`:o.value?.id);j([()=>x.tabs,()=>x.categoryId],()=>{const e=x.tabs?.find(s=>String(s.id)===String(x.categoryId));e?o.value=e:[o.value]=x.tabs},{immediate:!0});const K=async()=>{const e=N.value;if(!e)return;const s=e?.tpls?.length??0;if(s>0&&s>=e?.total||e?.loading)return;const r=He();e.loading=!0;const E=o.value.id,$=f.value.trim(),G=++p;try{const J=await Ie({page_size:r,page:Math.ceil(s/r)+1,fun_module:"effect",fun_category:$?"":o.value.id,media:ve($),keyword:$||void 0});if(o.value.id!==E||$&&(G!==p||$!==f.value.trim()))return;e.tpls=e.tpls.concat(J?.list??[]),e.total=J?.paginate?.total||J?.list?.length||0}finally{o.value.id===E&&(!$||G===p)&&(e.loading=!1)}},Q=()=>{w.value.length>0||K()},H=()=>{b.value=0,h.value=[],_.value=null},n=()=>{f.value="",I.value=!1,l.value={tpls:[],total:0,loading:!1},O.value?.close(),H(),g("search-active-change",!1),t.searchInfo={scene:"",search_term:""}},S=e=>{f.value=e?.trim()??"",l.value={tpls:[],total:f.value?1:0,loading:!1},H(),Q(),f.value?t.searchInfo={scene:"ai_effect",search_term:f.value}:t.searchInfo={scene:"",search_term:""},Y("miai_search_result_expose",{search_context:"ai_effect",search_term:f.value,result_count:w.value.length||0})},oe=e=>{I.value=e,y.value&&(v.value?g("search-active-change",!0):g("search-active-change",e))},ve=e=>x.currentTag;j(()=>o.value?.title,(e,s)=>{e!==s&&e&&(v.value&&(l.value={tpls:[],total:1,loading:!1}),H(),Q())},{immediate:!0}),j(()=>x.currentTag,()=>{f.value="",I.value=!1,l.value={tpls:[],total:0,loading:!1},g("search-active-change",!1),H()});const me=()=>{b.value>=w.value.length||(b.value+=1)},ge=(e,s)=>{let r=s;if(e[r]){const E=e[r],{top:$}=E?E.getBoundingClientRect():{top:0},G=s%2===0?2:1;$<60?r+=G:$>window.innerHeight-120&&(r-=G);const J=e[r]?.getAttribute("effect-id");_.value===J?_.value=e[r>0?r-1:r+1]?.getAttribute("effect-id"):_.value=J}},ie=we(()=>{ge(h.value,P.value)},500);j(()=>b.value,()=>{!c||!y.value||b.value===w.value.length&&(A.value=d.value?.children??[],Array.from(A.value).forEach(e=>{c?.observe(e)}))}),j(()=>h.value,(e,s)=>{if(!e.length)return;let r=Math.floor(Math.random()*e.length);(!s||s.length===0||e[0]===s[0]&&e[e.length-1]===s[s.length-1])&&(r=P.value),P.value=r,ie()},{immediate:!0,deep:!0});const he=async e=>{e[0]?.isIntersecting&&await K()};return re(()=>{c=new IntersectionObserver(e=>{const s=h.value.slice();e.forEach(r=>{if(r.isIntersecting&&r.intersectionRatio>=.9)s.includes(r.target)||s.push(r.target);else{const E=s.indexOf(r.target);E>-1&&s.splice(E,1)}}),h.value=s},{root:null,threshold:1}),k=new IntersectionObserver(he,{root:null,rootMargin:"0px",threshold:.1}),R.value&&k.observe(R.value),t.searchInfo={scene:"",search_term:""}}),qe(()=>{ie.cancel(),c?.disconnect(),c=null,k?.disconnect(),k=null}),(e,s)=>(i(),m("div",ct,[C("div",{class:U(["tpl-tab-head",{"tpl-tab-head--search":v.value||a(y)&&I.value}])},[v.value||a(y)&&I.value?(i(),m("button",{key:0,class:"back-btn",onClick:n},[z(a(ae),{class:"text-[--color-text-dynamic-white-tertiary] flex items-center justify-center inner-icon cursor-pointer hover:text-[--color-text-dynamic-white-primary]",name:"arrow_left",width:"24",height:"24"})])):L("",!0),o.value&&!v.value&&!(a(y)&&I.value)?(i(),M(Ue,{key:1,modelValue:o.value,"onUpdate:modelValue":[s[0]||(s[0]=r=>o.value=r),s[1]||(s[1]=r=>a(t).effectCurrentCategoryId=String(r.id))],tabs:e.tabs,"current-tag":e.currentTag,"hide-arrow":a(y),class:"tpl-tabs shrink-0",onUpdateSelectedEffect:F},null,8,["modelValue","tabs","current-tag","hide-arrow"])):L("",!0),o.value?(i(),M(Ce,{ref_key:"searchBoxRef",ref:O,key:e.currentTag,"in-search":v.value,onSearch:S,onToggleExpand:oe},null,8,["in-search"])):L("",!0)],2),C("div",{ref_key:"listWrapRef",ref:d,class:U(["tpl-list",{"image-tap-list":e.currentTag==="image"&&!v.value,"tpl-list--search":v.value}])},[(i(!0),m(de,null,_e(w.value,(r,E)=>(i(),M(lt,{key:`${r.uni_fun_code??r.value}${Z.value}`,ref_for:!0,ref:()=>me(),effect:r,index:Number(E),"category-id":o.value.id,"current-tag":e.currentTag,"auto-play":_.value===r.uni_fun_code,"is-search-result":v.value,onPlay:$=>_.value=r.uni_fun_code,onClick:$=>F(r,E)},null,8,["effect","index","category-id","current-tag","auto-play","is-search-result","onPlay","onClick"]))),128)),C("div",{ref_key:"LoadingArea",ref:R,class:"loading-area pt-4 pb-8"},[N.value?.loading||w.value.length===0&&N.value?.total!==0?(i(),M(a(xe),{key:0})):v.value&&w.value.length===0?(i(),m("div",ut,V(e.$t("ai_video_generator.search_empty")),1)):N.value&&w.value.length>=N.value.total&&w.value.length>(a(y)?8:20)?(i(),m("div",ft,[s[2]||(s[2]=C("div",{class:"end-guideline"},null,-1)),C("span",dt,V(e.$t("ai_video_generator.allDataTips")),1),s[3]||(s[3]=C("div",{class:"end-guideline"},null,-1))])):(i(),m("div",_t))],512)],2)]))}}),vt=Object.assign(se(pt,[["__scopeId","data-v-83d62a13"]]),{__name:"AiEffectsTplTabList"}),mt={class:"effect-resource"},gt={class:"effect-resource-area md:flex md:flex-col md:items-start"},ht=W({__name:"EffectList",async setup(D){let T,t;const{$i18n:o}=Se(),g=Ee(),{t:y}=Ge(),d=ne(),{query:O}=fe(),_=X(),R=u(!1),{effectCurrentTab:h}=We(_),A=u([{name:y("ai_effect.tag_video"),value:"video"},{name:y("ai_effect.tag_image"),value:"image"}]),P=q(()=>h.value==="video"?X().effectTemplateCategories:X().imageCategories),b=u("");async function f(){const{tag:l,category:c}=O.value;if(l&&(A.value.find(p=>p.value===l)?_.effectCurrentTab=l:_.effectCurrentTab=A.value[0]?.value),!c&&_.effectCurrentCategoryId&&(b.value=_.effectCurrentCategoryId),c){if(!isNaN(Number(c))){const k=await Le({value:"",extra:{category:Number(c),tag:l}}).catch(p=>{p.data||JSON.stringify(p)});b.value=JSON.parse(k?.category_info)?.name;return}b.value=c}}const I=(l,c,k,p,x)=>
1{_.effectCurrentCategoryId=String(c.id);const F=g.resolve({name:le.EffectCreate+"___"+o.locale.value,query:{categories:c.id,uni_fun_code:l?.uni_fun_code}}),v=JSON.parse(l?.extra_data||"{}")?.distrib_info,N=v?.distrib_id,w=v?.grain_id;Y("miai_creation_entry_trigger",{pworkflow:"core_process",trigger_type:"click",entry_type:p?"effect_search_result_feed":"effectspage",module:p?"effect_search_result_feed":"effectspage",...p?{search_context:"ai_effect",search_term:x||""}:{},miai_unit_name:l?.name,miai_unit_code:l?.uni_fun_code,pfunction_display:"template",pfunction_type:"ai_effect",pfunction:Re[Pe.aiEffects],landing_url:window.location.origin+F.href,template_origin_entity:N?"crc":"mi",thumbnail_url:l?.thumbnail||"",explore_template_id:l?.uni_fun_code,expose_position:k?k+1:1,module_slug:`effectspage_${l?.media}_${c.id}`,cap_id:w||"",button:"go_create"},!1,!1),Ne({name:`${le.EffectCreate}`,query:{categories:c.id,uni_fun_code:l?.uni_fun_code}}),window.scrollTo(0,0)};return f(),[T,t]=ue(()=>Je()),await T,t(),[T,t]=ue(()=>je({media:h.value,categoryId:b.value})),await T,t(),(l,c)=>{const k=$e;return i(),m("div",mt,[C("div",gt,[R.value?L("",!0):(i(),m("p",{key:0,class:U(["effect-title",a(d)?"opacity-0":""]),style:pe({marginBottom:a(d)?"10px":"16px"})},V(l.$t("ai_effect.aiEffect")),7)),a(d)&&!R.value?(i(),M(Ve,{key:1})):L("",!0),z(Ye,{"current-tag":a(h),"onUpdate:currentTag":c[0]||(c[0]=p=>ze(h)?h.value=p:null),class:"mb-4",tags:A.value},null,8,["current-tag","tags"]),z(k,null,{default:Fe(()=>[z(vt,{class:"md:!flex-auto md:!h-1",tabs:a(P),"current-tag":a(h),"category-id":b.value,onSelectedEffect:I,onSearchActiveChange:c[1]||(c[1]=p=>R.value=p)},null,8,["tabs","current-tag","category-id"])]),_:1})])])}}}),yt=Object.assign(se(ht,[["__scopeId","data-v-ee3ca243"]]),{__name:"AiEffectsEffectList"}),bt={class:"ai-effect-home w-full"},kt=W({__name:"AiEffectList",setup(D){const{query:T}=fe();re(()=>{t(),Oe({puser_source_tag:Ae()})});const t=()=>{const{sourceTag:o}=T.value;o!=null&&Be(o)};return(o,g)=>(i(),m("div",bt,[z(yt)]))}}),Tt=Object.assign(kt,{__name:"EffectsAiEffectList"}),Pt=W({__name:"index",setup(D){return(T,t)=>(i(),M(Tt))}});export{Pt as default};

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.