var e=Object.defineProperty,t=Object.defineProperties,l=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable,s=(t,l,a)=>l in t?e(t,l,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[l]=a,r=(e,t)=>{for(var l in t||(t={}))i.call(t,l)&&s(e,l,t[l]);if(a)for(var l of a(t))n.call(t,l)&&s(e,l,t[l]);return e};import{t as o,a as d,j as p,_ as c}from"./index-D4lLxThK.js";import{d as m,k as u,n as v,a0 as y,a3 as b,v as f,a7 as g,a8 as k,aa as h,a6 as j,ab as C,B as O,A as _,F as x,af as M,a1 as I,a5 as P}from"./vendor-DezibNX8.js";import{v as w}from"./antd-CKo75OZH.js";const L=m({name:"filterComponent",props:{item:{type:Object},dataList:{type:Array},driver__:{type:Boolean,default:!1},isCanvas:{type:Boolean,default:!1},deleteItem:{type:Number,default:-1},driverClass:{type:Object,default:{class1:"",class2:"",classList:{item1:"",item2:"",item3:""}}},style_:{type:Object,default:{}},ulStyle:{type:Object,default:{}},selectWidth:{type:String,default:"20rem"}},emits:["setprintModel"],setup(e,{emit:t}){let l=u(0),a=u(!1),i=d(),n=()=>{a.value=!1,document.removeEventListener("click",n)};return{selectIndex:l,openClick:a,store:i,setprintModel:(i,n)=>{e.deleteItem!=n&&-1!=i.img&&(a.value=!1,l=n,v().then(()=>{e.driver__.driver&&p.moveNext()}),t("setprintModel",i))},openPrintModel:()=>{document.addEventListener("click",n),a.value=!0,v().then(()=>{e.driver__.driver&&p.moveNext()})},fileUploadChange:t=>{let l=t.file;if("done"===l.status){let t=JSON.parse(l.xhr.response);0==t.errCode&&(l.type_="upload",e.dataList.forEach(e=>{-1==e.img&&(e.img=t.data.url,e.id=t.data.id)}))}else l.status},deleteFile:l=>{l.img=-1,t("setprintModel",e.dataList[0])}}},data:e=>({upload:{isPin:0,gender:"",level1Type:"Sketchboard",timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone},uploadUrl:"",type_:{type1:"generate",type2:"Sketchboard"},isTextarea:!1,isInputFocus:!1}),mounted(){this.uploadUrl=o(),this.upload.gender=this.store.state.Workspace.probjects.sex}}),S={class:"generalMenu_printModel"},E=["src"],F={style:{"text-align":"center"}},N={key:0},W={key:1},B={key:1},T={key:0},U={key:1},$=["onClick"],A=["src"],D={style:{"text-align":"center"}},G={key:0},Z={key:1},J={key:1},q={key:0},z={key:1};const H=c(L,[["render",function(e,a,i,n,s,o){var d,p,c;const m=w;return I(),y("div",S,[b("div",{onClick:a[0]||(a[0]=O((...t)=>e.openPrintModel&&e.openPrintModel(...t),["stop"])),class:j(e.driverClass.class1),style:C((u=r({},e.$props.style_),v={width:e.selectWidth},t(u,l(v))))},[e.isCanvas?(I(),g(m,{key:0},{content:k(()=>[b("img",{style:{width:"10rem",height:"10rem","object-fit":"contain"},src:e.item.img,alt:""},null,8,E),b("span",F,h(e.$t("Generate.referenceImage")),1)]),default:k(()=>{var t,l,a;return[(null==(t=e.item)?void 0:t.label)?(I(),y("span",N,h(null==(l=e.item)?void 0:l.label),1)):(I(),y("span",W,h(null==(a=e.item)?void 0:a.name),1))]}),_:1})):(I(),y("div",B,[(null==(d=e.item)?void 0:d.label)?(I(),y("span",T,h(null==(p=e.item)?void 0:p.label),1)):(I(),y("span",U,h(null==(c=e.item)?void 0:c.name),1))])),b("div",{class:j(["icon iconfont icon-xiala",{active:e.openClick}])},null,2)],6),f(b("ul",{class:j(e.driverClass.class2),style:C(r({width:e.selectWidth},e.ulStyle))},[b("div",null,[(I(!0),y(x,null,M(e.dataList,(t,l)=>{var a,i,n,s;return I(),y("li",{class:j([{active:e.deleteItem==l,hover:(null==(a=e.item)?void 0:a.label)&&(null==(i=e.item)?void 0:i.label)==(null==t?void 0:t.label)||(null==(n=e.item)?void 0:n.name)&&(null==(s=e.item)?void 0:s.name)==(null==t?void 0:t.name)},"printModel_item"]),onClick:a=>e.setprintModel(t,l)},[e.isCanvas?(I(),g(m,{key:0,placement:"right"},{content:k(()=>[-1!=t.img?(I(),y("img",{key:0,style:{width:"10rem",height:"10rem","object-fit":"contain"},src:e.item.img,alt:""},null,8,A)):P("",!0),b("span",D,h(e.$t("Generate.referenceImage")),1)]),default:k(()=>[(null==t?void 0:t.label)?(I(),y("span",G,h(null==t?void 0:t.label),1)):(I(),y("span",Z,h(null==t?void 0:t.name),1))]),_:2},1024)):(I(),y("div",J,[(null==t?void 0:t.label)?(I(),y("span",q,h(null==t?void 0:t.label),1)):(I(),y("span",z,h(null==t?void 0:t.name),1))]))],10,$)}),256))])],6),[[_,e.openClick]])]);var u,v}]]);export{H as g};
