import{_ as H}from"./app-9444f1fe.js";import{_ as K,b as A,r as y,h as X,o as ee,L as te,M as le,p as d,q as _,Q as r,O as I,P as M,B as n,N as i,V as u,y as J,t as p,U as w,Z as ae,am as oe,v as k}from"./framework-2d0bbdc3.js";import{M as ne,L as N}from"./utils-e9a9aa23.js";import{E as B,a as se,b as j}from"./index-9d5bf97d.js";import{O as re}from"./enum-81d8f3d7.js";import{d as D,E as ie,a as G,b as ue,c as de,e as pe,f as me}from"./options-72c30d09.js";import{c as ce}from"./listData-9dae369c.js";import{E as S}from"./index-93c4d27d.js";import"./index-2653f279.js";import"./index-df01d077.js";const fe={class:"context"},ye={class:"list"},_e={class:"right"},ve={key:1,class:"options"},ge={class:"set"},ke={__name:"index.html",setup(Ee){let x=A([]),v=A([]),c=y(""),f=y("gg"),g=y(ne.GEAR),E=y(N.DOM),C=y(null),m=null,T=!1,V=y(!0);const F=X(()=>{let l=v.filter(e=>e.form===f.value);return f.value==="model"&&(l=l.filter(e=>e.model===g.value)),l});q(),ee(()=>{H(()=>import("./loading-5117cee7.js"),["assets/loading-5117cee7.js","assets/utils-e9a9aa23.js"]).then(l=>{m=l.default(),V.value=!1,L()})});function L(){m.getLoadingId()||(m.loading(C.value,O()),E.value!==N.DOM&&setTimeout(m.close,(c.value||1)*1e3))}function Y(){m&&m.close()}function $(l,e){e.key==="model"&&(f.value="model",g.value=l.value),e.key==="type"&&(E.value=l.value),!T&&["bgColor","pointerEvents"].includes(e.key)&&(me({title:"提示",type:"warning",message:'部分公共options是用于初始化canvas,例如:"背景色"与"事件穿透",需要 重新加载 显示效果!'}),T=!0),m&&m.update(O())}function q(){for(let a=0;a<10;a++)x.push(Q());v=JSON.parse(JSON.stringify(D));let e=te().query.model;if(e){let a=ce.find(o=>o.model===e),t=v.find(o=>o.key==="model");if(t.value=e,g.value=e,a){let o=JSON.parse(JSON.stringify(a));v.filter(s=>s.form==="gg"||s.model===e).forEach(s=>{for(let[R,b]of Object.entries(o.options))h(s.type)&&s.key===R&&s.arrayAdd&&s.arrayItems&&b.length&&(s.arrayItems=[],b.forEach(Z=>{s.arrayItems.push(JSON.parse(JSON.stringify(s.arrayAdd,(z,U)=>{switch(z){case"key":return U+s.arrayItems.length;case"value":return Z;default:return U}})))})),s.key===R&&(s.value=b)})}}}function P(l){let e={},a=O();D&&a&&D.forEach(o=>{(!o.model&&a[o.key]&&a[o.key]!==o.value||l||o.model&&o.model===a.model&&(h(o.type)?a[o.key].join()!==o.value.join():a[o.key]!==o.value))&&(e[o.key]=a[o.key])});let t=document.createElement("input");t.value=JSON.stringify(e),document.body.appendChild(t),t.select(),document.execCommand("Copy"),t.remove(),j.success("复制成功!")}function O(){let l=v.filter(a=>a.model===g.value||a.form===re.GG),e={};return l.forEach(a=>{h(a.type)?e[a.key]=a.arrayItems.map(t=>t.value):e[a.key]=a.value}),e}function W(){let l=parseInt(c.value);(l<1||l>30)&&(j.warning("范围1-30秒"),c.value="")}function Q(){let l=new Date;return{id:parseInt(Math.random()*1e7),user:parseInt(Math.random()*1e7),value:parseInt(Math.random()*100),date:`${l.getFullYear()}${l.getMonth()-1}-${l.getDate()}`}}function h(l){return l&&l.includes("array_")}return(l,e)=>{const a=le("WebTypeInput");return d(),_("div",null,[r("div",fe,[r("div",{class:"left",ref_key:"leftRef",ref:C},[(d(!0),_(I,null,M(n(x),t=>(d(),w(n(de),{key:t.id},{default:u(()=>[r("div",ye,[r("span",null,[p(" id: "),r("b",null,k(t.id),1)]),r("span",null,[p(" user: "),r("b",null,k(t.user),1)]),r("span",null,[p(" value: "),r("b",null,k(t.value),1)]),r("span",null,[p(" date: "),r("b",null,k(t.date),1)])])]),_:2},1024))),128))],512),r("div",_e,[i(n(se),{modelValue:n(f),"onUpdate:modelValue":e[0]||(e[0]=t=>J(f)?f.value=t:f=t),class:"demo-tabs"},{default:u(()=>[i(n(B),{label:"Public",name:"gg"}),i(n(B),{label:"model",name:"model"})]),_:1},8,["modelValue"]),n(V)?(d(),_(I,{key:0},M(10,t=>i(n(pe),{rows:1,animated:""})),64)):(d(),_("div",ve,[(d(!0),_(I,null,M(n(F),t=>(d(),w(a,{label:"key",key:t.key,modelValue:t.value,"onUpdate:modelValue":o=>t.value=o,options:t,onUpdate:o=>$(o,t)},null,8,["modelValue","onUpdate:modelValue","options","onUpdate"]))),128))])),r("div",ge,[i(n(S),{type:"primary",onClick:L},{default:u(()=>[p("loading")]),_:1}),n(E)===n(N).DOM?(d(),w(n(S),{key:0,type:"danger",onClick:Y},{default:u(()=>[p("close")]),_:1})):ae((d(),_("input",{key:1,type:"number",placeholder:"1秒关闭",onInput:W,"onUpdate:modelValue":e[1]||(e[1]=t=>J(c)?c.value=t:c=t)},null,544)),[[oe,n(c)]]),i(n(ue),null,{dropdown:u(()=>[i(n(ie),null,{default:u(()=>[i(n(G),{onClick:e[2]||(e[2]=t=>P())},{default:u(()=>[p("Modified part")]),_:1}),i(n(G),{onClick:e[3]||(e[3]=t=>P("all"))},{default:u(()=>[p("All Configuration")]),_:1})]),_:1})]),default:u(()=>[i(n(S),{type:"success"},{default:u(()=>[p("replication")]),_:1})]),_:1})])])])])}}},Te=K(ke,[["__scopeId","data-v-3d48cc93"],["__file","index.html.vue"]]);export{Te as default};
