PageSourceSearch

https://12sell.ai/assets/Index-DCduAU0V.js

js 12sell.ai collected 2026-09-24 13:54:27 UTC 10,785 bytes, 1 lines download raw bytes

1import{d as me,a1 as ve,bw as he,c as P,r as v,L as S,o as fe,h as p,e as r,f as l,l as c,t as i,w as _,F,k as j,b as N,j as Z,g as K,v as Q,n as ge,b9 as _e,a5 as ye,cD as Ce,a6 as D,ac as Ue,ad as Le,cs as be,ct as $e,a9 as Te,cE as Ie,af as ke,cr as Y,ck as we,_ as Pe}from"./index-BaXy3GUs.js";import{_ as H}from"./icon-delete-CXr7vRo4.js";import{_ as J}from"./icon-upload-lg-Bt3EYjHp.js";import{C as Se,_ as Ne}from"./CreditPopover-IXXRaCvn.js";import{U as X}from"./UploadAsset-DE49WCIR.js";import{U as x}from"./icon-video-square-BY7f-ExR.js";import{u as De}from"./store-Cx8QGw11.js";import{F as ee}from"./icon-selected-BX-iKTkj.js";import{_ as Ve}from"./index-BADqoAWm.js";import{_ as Ee}from"./index-Bi57jXeH.js";import"./icon-asset-mCevQ63w.js";import"./AssetPage-DUO1nNcG.js";import"./AssetPreview-DXa5qOJg.js";import"./icon-download-CAl-FVSi.js";import"./VideoPlayer-TWW4-ZS0.js";import"./icon-play-sm-DMEmiFtT.js";/* empty css                                                                    */import"./process-CVZH8yVK.js";import"./index-CcwSDTtb.js";import"./CheckOutlined-D_U_ot1v.js";import"./index-Boj9u1c6.js";import"./responsiveObserve-DrJt6nJg.js";import"./_baseSlice-DT2HgEmb.js";import"./icon-upload-Bfa1SE27.js";import"./index-DhGKjD6Q.js";import"./type-C4Ylz5dD.js";const Re="/assets/top-cloth-example-ERhjFnsz.png",Fe="/assets/dress-example-BEPKuU7D.png",je="/assets/wrong-cloth-1-nmRhQNDy.png",Ae="/assets/wrong-cloth-2-CZADfZfb.png",Be={class:"ai-model-container"},Me={class:"ai-model-content"},Ge={class:"cloth-container"},We={class:"cloth-header"},qe={class:"cloth-upload-container"},Oe={key:0,class:"multiple-upload"},ze={key:0,class:"uploaded-item"},Ze=["src"],Ke={class:"image-wrapper"},Qe=["onClick"],Ye={class:"upload-btn-container"},He={class:"upload-btn-content"},Je={key:1,class:"single-upload"},Xe={class:"upload-item"},xe={key:0,class:"uploaded-item"},et=["src"],tt={class:"image-wrapper"},lt={class:"upload-btn-container"},ot={class:"upload-btn-content"},st={class:"cloth-template-container"},at={class:"cloth-template-list"},it=["onClick"],nt=["src"],rt={class:"guideline-container"},ut={class:"guideline-content"},ct={class:"sub-title"},dt={class:"rule-container"},pt={class:"icon-correct"},mt={class:"icon-wrong"},vt={class:"guideline-btn"},ht={class:"model-container"},ft={class:"model-list"},gt=["onClick"],_t=["src"],yt={class:"ai-model-footer"},Ct=me({__name:"Index",props:{editingProject:{}},setup(te){const le=te,{t:y}=ve(),V=we(),A=De(),{projectList:oe}=he(A),L=P(()=>oe.value),b=v([]),m=v(void 0),u=v("single"),n=v({url:"",path:"",source:"",isLoading:!1}),d=v([{url:"",path:"",source:"",isLoading:!1},{url:"",path:"",source:"",isLoading:!1}]),h=v({fileUrl:"",smallFileUrl:"",filePath:"",personType:""}),$=v([]),T=v(!1),I=v(!1),C=v(0),B=P(()=>{const e=$.value.filter(t=>!t.types.includes("dress"));if(u.value==="multiple")return e.filter(t=>t.types.length>1);switch(m.value){case"top":return e.filter(t=>t.types.includes("top"));case"bottom":return e.filter(t=>t.types.includes("bottom"));case"dress":return $.value.filter(t=>t.types.length>1).slice(0,-1);case"two-piece":return e.filter(t=>t.types.length>1);default:return $.value.slice(0,-1)}}),se=P(()=>{const e=b.value.filter(a=>a.clothType==="top"),t=b.value.filter(a=>a.clothType==="bottom"),o=b.value.filter(a=>a.clothType==="one-piece");return u.value==="multiple"?[e[0],t[0],t[1]].filter(Boolean):[e[0],t[0],o[0]].filter(Boolean)}),ae=P(()=>!h.value.fileUrl||(u.value==="multiple"?!d.value.every(e=>e.url):!n.value.url)),E=e=>{h.value={...h.value,fileUrl:e.metadata.humanImage,filePath:e.metadata.humanImagePath},e.metadata.clothInfos.length>1?(e.metadata.clothInfos.forEach((t,o)=>{d.value[o].url=t.fileUrl,d.value[o].path=t.filePath,d.value[o].source=t.source}),m.value="two-piece",u.value="multiple"):(n.value.url=e.metadata.clothInfos[0].fileUrl,n.value.path=e.metadata.clothInfos[0].filePath,n.value.source=e.metadata.clothInfos[0].source,m.value=e.metadata.clothInfos[0].clothType,u.value="single")};S(B,e=>{e.findIndex(o=>o.filePath===h.value.filePath)===-1&&(h.value={fileUrl:"",smallFileUrl:"",filePath:"",personType:""})}),S(()=>V.query.projectId,e=>{if(!e)return;I.value=!1;const t=L.value.find(o=>o.resourceId===e);t&&(E(t),I.value=!0)},{immediate:!0}),S([()=>le.editingProject,L],([e,t])=>
1{if(!e)return;const o=t.find(a=>a.resourceId===e.projectId);o&&E(o)},{immediate:!0,deep:!0}),S(L,()=>{if(V.query.projectId&&!I.value){const e=L.value.find(t=>t.resourceId===V.query.projectId);e&&(E(e),I.value=!0)}});const M=(e,t)=>{U(!0,t)},R=e=>u.value==="multiple"&&e!==void 0?d.value[e]:n.value,U=(e,t)=>{const o=R(t);o.isLoading=e},G=(e,t)=>{const o=R(t);o.url=e.fileUrl,o.path=e.filePath,o.isLoading=!1},k=async(e,t)=>{try{if(U(!0,t),u.value==="multiple"){const{isClothValid:o}=await O(e.fileUrl,t===0?"top":"bottom");if(!o){U(!1,t);return}m.value="two-piece"}else{const{isClothValid:o,types:a,clothNum:w}=await O(e.fileUrl,m.value);if(!o){U(!1,t);return}w&&w>1?m.value="two-piece":m.value=a[0]}G(e,t)}catch{G(e,t)}},W=(e,t)=>{U(!1,t)},q=e=>{const t=R(e);t.url="",t.path="",m.value=void 0},O=async(e,t)=>{const o=await Ce(e);if(!o)return{isClothValid:!0};if(!o.clothNum)return D.error(y("generation.noClothDetected")),{isClothValid:!1};if(t){if(o.clothNum>1)return D.error(y("generation.multipleClothDetected")),{isClothValid:!1};if(!o.types.includes(t))return D.error(y("generation.invalidClothType")),{isClothValid:!1}}if(o.clothNum>1&&!(o.clothNum===2&&o.types.includes("top")&&o.types.includes("bottom"))){const a=o.types.includes("dress")?y("generation.multipleClothWithDress"):y("generation.multipleSimilarClothDetected");return D.error(a),{isClothValid:!1}}return{isClothValid:!0,types:o.types,clothNum:o.clothNum}},ie=e=>{if(u.value==="multiple"){const t=e.clothType==="top"?0:1;d.value[t].url=e.fileUrl,d.value[t].path=e.filePath,d.value[t].source="template"}else n.value.url=e.fileUrl,n.value.path=e.filePath,n.value.source="template",m.value=e.clothType},ne=e=>{h.value=e},re=async()=>{if(T.value)return;T.value=!0;const e=u.value==="multiple"?d.value.map(o=>o.url):[n.value.url],t=u.value==="multiple"?d.value.map((o,a)=>({fileUrl:o.url,filePath:o.path,clothType:a===0?"top":"bottom",source:o.source})):[{fileUrl:n.value.url,filePath:n.value.path,clothType:m.value||"",source:n.value.source}];A.addNewAIModelProject({humanImage:h.value.fileUrl,humanImagePath:h.value.filePath,cloths:e,clothInfos:t},o=>{T.value=!1})},ue=async()=>{const e=await Ue();$.value=e},ce=async()=>{const e=await Le();b.value=e},de=async()=>{const e=await be($e.IMAGE_TRYON);C.value=e.price};return fe(()=>{ue(),ce(),de()}),(e,t)=>{const o=Ve,a=Te("inline-svg"),w=Ee,z=ye,pe=_e;return r(),p("div",Be,[l("div",Me,[l("div",Ge,[l("div",We,[l("div",null,i(e.$t("generation.clothType")),1),c(o,{value:u.value,"onUpdate:value":t[0]||(t[0]=s=>u.value=s),block:"",options:[{value:"single",label:e.$t("generation.single")},{value:"multiple",label:e.$t("generation.multiple")}]},{label:_(({label:s})=>[l("div",null,i(s),1)]),_:1},8,["value","options"])]),l("div",qe,[u.value==="multiple"?(r(),p("div",Oe,[(r(!0),p(F,null,j(d.value,(s,f)=>(r(),p("div",{class:"upload-item",key:f},[s.url?(r(),p("div",ze,[l("img",{class:"image-preview",src:s.url},null,8,Ze),l("div",Ke,[l("img",{src:H,class:"remove-btn",onClick:g=>q(f)},null,8,Qe)])])):s.isLoading?(r(),N(ee,{key:1})):Z("",!0),K(l("div",Ye,[l("div",He,[t[3]||(t[3]=l("img",{src:J},null,-1)),l("span",null,i(e.$t(`generation.${f===0?"uploadTop":"uploadBottom"}`)),1)]),c(x,{type:"image",class:"upload-local",minSideLimit:512,maxSideLimit:4096,onUploadStart:g=>M(g,f),onUploadSuccess:g=>k(g,f),onUploadError:g=>W(g,f)},null,8,["onUploadStart","onUploadSuccess","onUploadError"]),c(X,{filter:"image",class:"upload-asset",onUpdate:({added:g})=>k(g[0],f),modelTitle:e.$t("assets.myAssets"),minSideLimit:512,maxSideLimit:4096},null,8,["onUpdate","modelTitle"])],512),[[Q,!s.url&&!s.isLoading]])]))),128))])):(r(),p("div",Je,[l("div",Xe,[n.value.url?(r(),p("div",xe,[l("img",{class:"image-preview",src:n.value.url},null,8,et),l("div",tt,[l("img",{src:H,class:"remove-btn",onClick:t[1]||(t[1]=s=>q())})])])):n.value.isLoading?(r(),N(ee,{key:1})):Z("",!0),K(l("div",lt,[l("div",ot,[t[4]||(t[4]=l("img",{src:J},null,-1)),l("span",null,i(e.$t("assets.upload")),1)]),c(x,{type:"image",class:"upload-local",minSideLimit:512,maxSideLimit:4096,onUploadStart:M,onUploadSuccess:k,onUploadError:W}),c(X,{filter:"image",class:"upload-asset",onUpdate:t[2]||(t[2]=({added:s})=>k(s[0])),modelTitle:e.$t("assets.myAssets"),minSideLimit:512,maxSideLimit:4096},null,8,["modelTitle"])],512),[[Q,!n.value.url&&!n.value.isLoading]])])]))]),l("div",st,[l("span",null,i(e.$t("generation.clothTemplate")),1),l("div",at,[(r(!0),p(F,null,j(se.value,s=>(r(),p("div",{class:"cloth-template",key:s.filePath,onClick:f=>ie(s)},[l("img",{src:s.fileUrl},null,8,nt)],8,it))),128))]),l("div",rt,[c(w,{placement:"right",overlayClassName:"guideline-tooltip"},{content:_(()=>[l("div",ut,[l("h3",null,i(e.$t("generation.guidelineTitle")),1),l("div",ct,i(e.$t("generation.guidelineRule")),1),l("div",dt,[l("div",null,[l("div",pt,[c(a,{src:Ie})]),t[5]||(t[5]=l("div",{class:"image-container"},[l("img",{src:Re}),l("img",{src:Fe})],-1)),l("ul",null,[l("li",null,i(e.$t("generation.guidelineRule1")),1),l("li",null,i(e.$t("generation.guidelineRule2")),1),l("li",null,i(e.$t("generation.guidelineRule3")),1)])]),l("div",null,[l("div",mt,[c(a,{src:ke})]),t[6]||(t[6]=l("div",{class:"image-container"},[l("img",{src:je}),l("img",{src:Ae})],-1)),l("ul",null,[l("li",null,i(e.$t("generation.guidelineWrong1")),1),l("li",null,i(e.$t("generation.guidelineWrong2")),1),l("li",null,i(e.$t("generation.guidelineWrong3")),1)])])])])]),default:_(()=>[l("div",vt,[c(a,{src:Ne}),l("span",null,i(e.$t("generation.guideline")),1)])]),_:1})])])]),l("div",ht,[l("div",null,i(e.$t("generation.selectModel")),1),l("div",ft,[(r(!0),p(F,null,j(B.value,s=>(r(),p("div",{class:ge(["model-item",h.value.filePath===s.filePath?"selected":""]),key:s.filePath,onClick:f=>ne(s)},[l("img",{src:s.smallFileUrl},null,8,_t)],10,gt))),128))])])]),l("div",yt,[c(Se,{list:[{name:e.$t("common.virtualTryOn"),content:C.value}],total:C.value},null,8,["list","total"]),ae.value?(r(),N(pe,{key:0,title:e.$t("generation.aiModelDisableTooltip"),placement:"top"},{default:_(()=>[c(z,{type:"primary",class:"render-btn",disabled:!0},{default:_(()=>[l("span",null,i(e.$t("common.generate")),1),c(a,{src:Y}),l("span",null,i(C.value),1)]),_:1})]),_:1},8,["title"])):(r(),N(z,{key:1,type:"primary",class:"render-btn",loading:T.value,onClick:re},{default:_(()=>[l("span",null,i(e.$t("common.generate")),1),c(a,{src:Y}),l("span",null,i(C.value),1)]),_:1},8,["loading"]))])])}}}),Kt=Pe(Ct,[["__scopeId","data-v-7bc1177f"]]);export{Kt 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.