import{__awaiter as n,__generator as t}from"tslib";import i from"../../core/Instance";import r from"./Model/LineWithPoint";import e from"../../util/arcgis";import o from"shortid";import u from"./Data/pointMap";import*as s from"@msign/angularis";import{Cartesian2 as c,Cartesian3 as a,Color as f,ColorMaterialProperty as h,CallbackProperty as v}from"@msign/angularis";function d(n){for(var t=[],i=0;i<360;i++){var r=s.Math.t(i);t.push(new c(n*Math.cos(r),n*Math.sin(r)))}return t}var m=function(){function m(){}return m.i=function(n){var t=f.o(n.color)||s.s.u;return function(i,r){return m.h.get(n.id)?m.v:t}},m.m=function(r,o,u,c){return void 0===r&&(r=[]),void 0===o&&(o=1),void 0===u&&(u="meters"),void 0===c&&(c=10),n(this,void 0,void 0,(function(){var n,c,a,f,h,v,d,m,l;return t(this,(function(t){switch(t.label){case 0:return[4,i.l()];case 1:return n=t.p(),c=n.g,a=n.M,[4,e.C(["esri/geometry/geometryEngineAsync","esri/geometry/Polyline"])];case 2:return f=t.p(),h=f[0],v=f[1],d=r.map((function(n){return new v({G:[[n.N,n.P],[n.W,n.A]]})})),[4,h.D(d,d.map((function(n){return o})),u,!0)];case 3:return m=t.p(),console.log("生成缓冲区",m),l=m[0].I,c.R.L=new s.S({T:[],V:s.s.j,k:1}),l.forEach((function(n){var t;a.entities.add({q:{B:!0,F:s.J.H((t=[]).concat.apply(t,n)),K:s.s.U.O(.2),outline:!0,outlineColor:s.s.X}})})),[2]}}))}))},m.Y=function(i){return void 0===i&&(i=[]),n(this,void 0,void 0,(function(){var n;return t(this,(function(t){switch(t.label){case 0:return[4,e.C(["esri/geometry/geometryEngine","esri/Graphic"])];case 1:return n=t.p(),n[0],n[1],[2]}}))}))},m.Z=function(r){return n(this,void 0,void 0,(function(){var n;return t(this,(function(t){switch(t.label){case 0:return[4,i.l()];case 1:return n=t.p(),n.g,[2,n.M.entities.add({name:r.id,$:{_:s.J.H([r.N,r.P,r.nn,r.W,r.A,r.tn]),K:s.s.in({alpha:1})}})]}}))}))},m.rn=function(r){return n(this,void 0,void 0,(function(){var n,e,o,u,a,f,l,p;return t(this,(function(t){switch(t.label){case 0:return[4,i.l()];case 1:return n=t.p(),n.g,e=n.M,o=r.en,u=o.split("*").map((function(n){return Number.parseFloat(n)})),a=u[0],f=u[1],l=Number.parseFloat(o),p=a&&f?[new c(-(w=a/1e3)/2,-(g=f/1e3)/2),new c(w/2,-g/2),new c(w/2,g/2),new c(-w/2,g/2)]:d(l?l/1e3:.1),[2,e.entities.add({id:r.id,on:{_:s.J.H([r.N,r.P,r.nn,r.W,r.A,r.tn]),shape:p,K:new h(new v(m.i(r),!1))}})]}var w,g}))}))},m.un=function(r){return n(this,void 0,void 0,(function(){var n;return t(this,(function(t){switch(t.label){case 0:return[4,i.l()];case 1:return n=t.p(),n.g,[2,n.M.entities.add({name:r.id,position:s.J.H([r.sn,r.cn,r.an]),fn:{color:s.s.j,hn:5,vn:s.mn.dn}})]}}))}))},m.ln=function(r){return n(this,void 0,void 0,(function(){var n,e,c,f,h,v;return t(this,(function(t){switch(t.label){case 0:return[4,i.l()];case 1:return n=t.p(),n.g,e=n.M,c=a.pn(r.sn,r.cn,r.an),f=s.Math.t(135),0,0,h=new s.wn(f,0,0),v=s.yn.gn(c,h),o(),u[r.Mn]?[2,r.Mn&&e.entities.add({id:r.id,position:c,orientation:v,bn:{uri:u[r.Mn],scale:1}})]:[2,r.Mn&&e.entities.add({id:r.id,position:c,orientation:v,xn:{dimensions:new s.J(1,1,1),K:s.s.u.O(.1),outline:!0,outlineColor:s.s.Cn.O(.5)}})]}}))}))},m.En=function(e){return n(this,void 0,void 0,(function(){var n,o,u,s,c,a;return t(this,(function(t){switch(t.label){case 0:return[4,i.l()];case 1:return n=t.p(),n.g,o=n.M,u=r.Gn(e),s=[],c=u.Nn,s.push.apply(s,c.map(this.Z.bind(this))),a=u.Pn,s.push.apply(s,a.map(this.un.bind(this))),s&&s[0]&&o.Wn(s[0]),[2]}}))}))},m.zn=function(e){return n(this,void 0,void 0,(function(){var n,o,u,s,c;return t(this,(function(t){switch(t.label){case 0:return[4,i.l()];case 1:return n=t.p(),n.g,n.M,o=r.Gn(e),u=[],s=o.Nn,u.push.apply(u,s.map(this.rn.bind(this))),c=o.Pn,u.push.apply(u,c.map(this.ln.bind(this))),[2,u]}}))}))},m.An=function(i){return n(this,void 0,void 0,(function(){return t(this,(function(n){return i?m.h.delete(i):m.h.clear(),[2]}))}))},m.Dn=function(i){return n(this,void 0,void 0,(function(){return t(this,(function(n){return m.h.set(i,!0),[2]}))}))},m.h=new Map,m.v=f.Cn.clone(),m}();export default m;