System.register(["./vue-legacy-a77002d8.js","./CustomForm.vue_vue_type_style_index_0_lang-legacy-9fd46059.js","./loading2.vue_vue_type_style_index_0_lang-legacy-46f03ae0.js","./resetbutton.vue_vue_type_style_index_0_lang-legacy-e72cc57a.js","./form-legacy-2adc72b2.js","./Task-legacy-da35db10.js","./tool-legacy-3f4f95f0.js","./index-legacy-02a74204.js","./index-legacy-b3c74255.js","./index-legacy-4c8f9698.js","./withInstall-legacy-a4ca9144.js","./useGlobalIcon-legacy-7d8ca2a4.js","./useVModel-legacy-71bf3ab2.js","./index-legacy-e38592e5.js","./dialog-legacy-771f8f43.js","./index-legacy-0aff25a3.js","./v4-legacy-ad483dde.js","./index.vue_vue_type_style_index_0_lang-legacy-19b5295d.js","./ScrollLoad.vue_vue_type_script_setup_true_lang-legacy-a9d41414.js"],(function(l,e){"use strict";var a,t,s,n,i,u,c,o,r,d,v,g,_,y,m,f,p,x,j,b,h,w,k,I,F,L,z,C,E;return{setters:[l=>{a=l.f,t=l.k,s=l.V,n=l.h,i=l.z,u=l.v,c=l.i,o=l.L,r=l.D,d=l.E,v=l.x,g=l.Q,_=l.w,y=l.F,m=l.A,f=l.o},l=>{p=l._},l=>{x=l._},l=>{j=l._},l=>{b=l._,h=l.a,w=l.F},l=>{l.b,k=l.g,I=l.c,F=l.d,L=l.e,z=l.f},l=>{C=l.V},l=>{E=l.a},null,null,null,null,null,null,null,null,null,null,null],execute:function(){const e=a({props:{list:Object,status:String},setup(l,e){const a=()=>{const{status:e}=l;return""==e?t(b,null,null):"loading"==e?t(h,null,null):t("div",{class:"load-success-box"},[t("div",{class:"result-img-box"},[l.list?l.list.map((l=>t("div",{class:"result-img"},[t("img",{class:"img",src:l,alt:""},null)]))):""]),t("div",{class:"download-img-box"},[t(j,null,{default:()=>[s("下载")]})])])};return()=>t("div",{class:"img-res-status"},[a()])}}),S={class:"custom-image-generation-box"},V={class:"generation-box-parent"},q={class:"interaction-form"},A={class:"confirm-box"},G=d("div",{class:"pay-num"},null,-1),B={class:"generate-result"},D=d("div",{class:"help"},null,-1);l("default",a({__name:"index",setup(l){const a=n(!1),b=m().query.id,h=n();let M=null;const O=n(0),Q=n(!1),T=n({}),H=i({list:[],callback_list:[],status:"",reset_num:1}),J=n();u((()=>Q.value),(l=>{l&&(async()=>{try{let l=await F();0==l.code&&(T.value=l.data)}catch(l){}})()}));const K=l=>{M=window.setInterval((()=>{(async l=>{try{let e=await z({key:l});0==e.code&&e.data.image&&(H.status="success",e.data.image.length>H.callback_list.length&&(H.callback_list=e.data.image),4!=e.data.image.length&&e.data.image.length!=O.value||N())}catch(e){}})(l)}),2e3)},N=()=>{M&&(window.clearInterval(M),clearInterval(M),M=null)},P=()=>{H.list.forEach((l=>{l.lists.forEach((l=>{l.value&&(l.value="")}))})),H.status="",H.callback_list=[]},R=()=>{if(M)return void E("请等待上一个任务完成");let l={};for(let e=0;e<H.list.length;e++){let a=H.list[e];for(let e=0;e<a.lists.length;e++){let t=a.lists[e],s=C(t.rules,t.value,t.name);if(s)return void E(s);if("radio_group_size"==t.type&&""==t.value){let e=t.options.find((l=>"custom"==l.type));if(e){if(!e.value1||!e.value2)return void E("自定义图片尺寸未填写完整");l[t.name]=e.value1+"x"+e.value2}}t.value&&("number"==t.name?l[t.name]=parseFloat(t.value+""):l[t.name]=t.value)}}(async l=>{try{let e=await L({scenario_id:J.value,parameters:l});0==e.code&&(O.value=l.number,K(e.data.uuid),H.status="loading")}catch(e){}})(l)};return c((async()=>{b?await(async()=>{try{a.value=!0;let l=await k(b,"id");if(0==l.code){J.value=l.data.id;let e=l.data.form;if(!e.length)return void E("表单未配置");{e.push(I);const l=w(e);e=l.list,l.al_config&&(Q.value=!0)}H.list=e}a.value=!1}catch(l){a.value=!1}})():E("禁止访问")})),o((()=>{N()})),(l,n)=>(f(),r("div",S,[d("div",V,[v(d("div",{class:"generation-box",ref_key:"GenerationBox",ref:h},[d("div",q,[t(p,{formList:H.list,config:T.value},null,8,["formList","config"]),d("div",A,[G,t(j,{onClick:P,width:"20%"},{default:_((()=>[s("重置")])),_:1}),t(j,{onClick:R,width:"50%",bold:""},{default:_((()=>[s("生成图片")])),_:1})])]),d("div",B,[t(y(e),{status:H.status,list:H.callback_list},null,8,["status","list"])])],512),[[g,!a.value]])]),D,v(t(x,null,null,512),[[g,a.value]])]))}}))}}}));
