var M=(s,E,n)=>new Promise((c,v)=>{var i=r=>{try{u(n.next(r))}catch(f){v(f)}},V=r=>{try{u(n.throw(r))}catch(f){v(f)}},u=r=>r.done?c(r.value):Promise.resolve(r.value).then(i,V);u((n=n.apply(s,E)).next())});import{r as O,a2 as j,aj as te,bI as H,a4 as le,a6 as I,bJ as se,al as X,bK as ue,bL as oe,bM as ne,d as ce,u as ie,bN as de,o as U,c as re,w as a,a as g,b as e,$ as k,n as C,t as p,e as t,l as S,ak as fe,V as Z,ad as q,ah as Q,ae as W,U as ee,j as z,a9 as me,aa as G,X as ae,S as be,h as _e,p as pe,m as Be,bO as ke,a8 as K,an as Ce,bP as Ee,_ as ve}from"./index.6c36cb53.js";import{M as ye}from"./index.a696a3d7.js";var T=(s=>(s[s.HOLD=0]="HOLD",s[s.CONVERT_TO_BLOCK=1]="CONVERT_TO_BLOCK",s[s.DELETE=2]="DELETE",s))(T||{});const De=()=>{const s=O(""),E=O([]);ne(()=>{E.value=H()});const n=j(!1,"Mx_CreateBlocksDialog_is_specify_on_screen_get_base_point"),c=te({x:0,y:0,z:0}),v=()=>M(void 0,null,function*(){const b=new le;b.clearLastInputPoint(),b.setMessage("\u6307\u5B9A\u63D2\u5165\u57FA\u70B9");const _=yield b.go();if(!_)return;const{x:B,y,z:m}=_;return c.x=I(B,3),c.y=I(y,3),c.z=I(m,3),_}),i=j(!1,"Mx_CreateBlocksDialog_is_specify_on_screen_select_object"),V=j(2,"Mx_CreateBlocksDialog_select_Object_operation_type"),u=O(!0),r=O(0);let f;const D=()=>M(void 0,null,function*(){if(f=new se,r.value=0,!(yield f.userSelect("\u9009\u62E9\u8981\u505A\u6210\u5757\u7684\u5BF9\u8C61")))return;const b=f.count();if(r.value=b,b===0){u.value=!0;return}return u.value=!1,f}),R=()=>{const _=X.getCurrentMxCAD().getDatabase().getBlockTable(),B=new ue;return B.name=s.value,_.add(B)},$=(b,_,B)=>{var N;(N=_.getMcDbBlockTableRecord())==null||N.getAllEntityId().forEach(x=>{var F;(F=x.getMcDbEntity())==null||F.erase()});let y=_.getMcDbBlockTableRecord();if(!y)return;b.forEach(x=>{const F=x.getMcDbEntity();if(!F)return;const h=F.clone();!y||y.appendAcDbEntity(h)}),y.origin=B;let m=new oe;return m.blockTableRecordId=_,m.position=B,m},P=O("");return{blockName:s,blockNames:E,getBlockNames:H,basePoint:c,getMouseClickGetBasePoint:v,isSpecifyOnScreenGetBasePoint:n,isNoSelectObject:u,isSpecifyOnScreenSelectObject:i,selectObjectOperationType:V,selectObject:D,createBlock:R,loadBlock:$,explainText:P,selectCount:r}},J=s=>(pe("data-v-c75d2835"),s=s(),Be(),s),ge={class:"px-3"},Ve={class:"f-flex justify-center align-center mt-2"},xe=J(()=>g("span",{class:""}," X:",-1)),Fe=J(()=>g("span",{class:""}," Y: ",-1)),Ae=J(()=>g("span",{class:""}," Z:",-1)),Me={class:"f-flex justify-center align-center mt-2"},Te={class:"d-flex flex-column"},we={key:0,class:"f-flex justify-center align-center mt-2"},Oe={key:1},Se=ce({__name:"index",setup(s){const{isShow:E,showDialog:n}=ie(!1,"Mx_Block",()=>{n(!0),B()}),{blockName:c,blockNames:v,basePoint:i,getMouseClickGetBasePoint:V,isSpecifyOnScreenGetBasePoint:u,isNoSelectObject:r,isSpecifyOnScreenSelectObject:f,selectObjectOperationType:D,selectObject:R,selectCount:$,createBlock:P,loadBlock:b,explainText:_}=De(),B=()=>{i.x=0,i.y=0,i.z=0,c.value="",m=void 0,r.value=!0,v.value=H()},y=()=>M(this,null,function*(){n(!1),yield V(),n(!0)});let m;const N=()=>M(this,null,function*(){n(!1),m=yield R(),n(!0)}),{t:x}=de(),h=[{name:"\u786E\u5B9A",fun:()=>M(this,null,function*(){const{open:d}=ke();let l=!1;const o=v.value.includes(c.value);if(c.value==="")return K().error("\u56FE\u5757\u540D\u4E0D\u80FD\u4E3A\u7A7A!");if(o)try{yield(()=>new Promise((A,w)=>{d({title:"\u662F\u5426\u66FF\u6362\u8BE5\u56FE\u5757",text:"\u5DF2\u5B9A\u4E49"+c.value+"\u7684\u56FE\u5757\uFF0C\u662F\u5426\u66FF\u6362?",define:()=>{l=!0,A()},cancel:()=>{l=!1,w()},defineTitle:x("\u662F"),cancelTitle:x("\u5426")})}))()}catch(A){return}let L;if(l?L=X.getCurrentMxCAD().getDatabase().getBlockTable().get(c.value):L=P(),u.value&&(n(!1),yield V()),f.value&&(n(!1),m=yield R()),!m||r.value)return K().error("\u6CA1\u6709\u4E3A\u5757"+c.value+"\u9009\u62E9\u5BF9\u8C61!");const Y=b(m,L,new Ce(i.x,i.y,i.z));if(!Y)return K().error("\u521B\u5EFA\u5757\u5931\u8D25!");D.value!==T.HOLD&&(m.forEach(A=>{const w=A.getMcDbEntity();!w||w.erase()}),Ee()),D.value===T.CONVERT_TO_BLOCK&&X.getCurrentMxCAD().drawEntity(Y),n(!1)}),primary:!0},{name:"\u5173\u95ED",fun:()=>{n(!1)}}];return(d,l)=>(U(),re(ye,{title:d.$t("\u521B\u5EFA\u5757"),modelValue:t(E),"onUpdate:modelValue":l[7]||(l[7]=o=>S(E)?E.value=o:null),"max-width":"400",footerBtnList:h},{default:a(()=>[g("div",ge,[e(fe,{class:"mt-2",modelValue:t(c),"onUpdate:modelValue":l[0]||(l[0]=o=>S(c)?c.value=o:null),items:t(v)},{prepend:a(()=>[e(k,{"key-name":"N"},{default:a(()=>[C(p(d.$t("\u540D\u79F0")),1)]),_:1})]),_:1},8,["modelValue","items"]),e(_e,{"align-stretch":""},{default:a(()=>[e(Z,{cols:6,"align-self":"stretch"},{default:a(()=>[e(q,{title:d.$t("\u57FA\u70B9"),class:"h-100"},{default:a(()=>[e(Q,{modelValue:t(u),"onUpdate:modelValue":l[1]||(l[1]=o=>S(u)?u.value=o:null)},{label:a(()=>[e(k,{"key-name":"S"},{default:a(()=>[C(p(d.$t("\u5728\u5C4F\u5E55\u4E0A\u6307\u5B9A")),1)]),_:1})]),_:1},8,["modelValue"]),g("div",Ve,[e(W,{disabled:t(u),onClick:y},null,8,["disabled"]),e(k,{class:ee(t(u)?"text-disabled":""),"key-name":"S"},{default:a(()=>[C(p(d.$t("\u62FE\u53D6\u70B9")),1)]),_:1},8,["class"])]),e(z,{class:"mt-3",modelValue:t(i).x,"onUpdate:modelValue":l[2]||(l[2]=o=>t(i).x=o),type:"number",disabled:t(u)},{prepend:a(()=>[xe]),_:1},8,["modelValue","disabled"]),e(z,{class:"mt-1",modelValue:t(i).y,"onUpdate:modelValue":l[3]||(l[3]=o=>t(i).y=o),type:"number",disabled:t(u)},{prepend:a(()=>[Fe]),_:1},8,["modelValue","disabled"]),e(z,{class:"mt-1",modelValue:t(i).z,"onUpdate:modelValue":l[4]||(l[4]=o=>t(i).z=o),type:"number",disabled:t(u)},{prepend:a(()=>[Ae]),_:1},8,["modelValue","disabled"])]),_:1},8,["title"])]),_:1}),e(Z,{cols:6,"align-self":"stretch"},{default:a(()=>[e(q,{title:d.$t("\u5BF9\u8C61"),class:"h-100"},{default:a(()=>[e(Q,{modelValue:t(f),"onUpdate:modelValue":l[5]||(l[5]=o=>S(f)?f.value=o:null)},{label:a(()=>[e(k,{class:"","key-name":"S"},{default:a(()=>[C(p(d.$t("\u5728\u5C4F\u5E55\u4E0A\u6307\u5B9A")),1)]),_:1})]),_:1},8,["modelValue"]),g("div",Me,[e(W,{disabled:t(f),onClick:N},null,8,["disabled"]),e(k,{class:ee(t(f)?"text-disabled":""),"key-name":"I"},{default:a(()=>[C(p(d.$t("\u9009\u62E9\u5BF9\u8C61")),1)]),_:1},8,["class"])]),e(me,{column:"",class:"mt-2",modelValue:t(D),"onUpdate:modelValue":l[6]||(l[6]=o=>S(D)?D.value=o:null)},{default:a(()=>[g("div",Te,[e(G,{value:t(T).HOLD,class:"mt-1"},{label:a(()=>[e(k,{class:"","key-name":"R"},{default:a(()=>[C(p(d.$t("\u4FDD\u7559")),1)]),_:1})]),_:1},8,["value"]),e(G,{value:t(T).CONVERT_TO_BLOCK,class:"mt-1"},{label:a(()=>[e(k,{class:"","key-name":"C"},{default:a(()=>[C(p(d.$t("\u8F6C\u6362\u4E3A\u5757")),1)]),_:1})]),_:1},8,["value"]),e(G,{value:t(T).DELETE,class:"mt-1"},{label:a(()=>[e(k,{class:"","key-name":"D"},{default:a(()=>[C(p(d.$t("\u5220\u9664")),1)]),_:1})]),_:1},8,["value"])])]),_:1},8,["modelValue"]),t(r)?(U(),ae("div",we,[e(be,{icon:"jinggao"}),e(k,{class:"","key-name":"I"},{default:a(()=>[C(p(d.$t("\u672A\u9009\u5B9A\u5BF9\u8C61")),1)]),_:1})])):(U(),ae("div",Oe,p(d.$t("\u5DF2\u9009\u62E9\u5BF9\u8C61")+":"+t($)+d.$t("\u4E2A")),1))]),_:1},8,["title"])]),_:1})]),_:1})])]),_:1},8,["title","modelValue"]))}});const Pe=ve(Se,[["__scopeId","data-v-c75d2835"]]);export{Pe as default};